添加字段 userAreaName

This commit is contained in:
秦鸿展
2026-05-28 15:49:33 +08:00
parent 54d943ea10
commit 88832114fa
3 changed files with 39 additions and 8 deletions
@@ -912,8 +912,9 @@ public class UserAPI extends BaseController {
try {
CustomerDO customerDO = new CustomerDO();
BeanUtils.copyProperties(customerDTO,customerDO);
userApplicationService.addCustomer(customerDO);
return AjaxResult.success();
UserPo userPo = userApplicationService.addCustomer(customerDO);
CustomerDTO result = toCustomerDTO(userPo);
return AjaxResult.success(result);
} catch (com.mhd.common.core.exception.ServiceException e) {
e.printStackTrace();
return AjaxResult.error(500, e.getMessage());
@@ -923,6 +924,29 @@ public class UserAPI extends BaseController {
}
}
@Log(title = "用户中台管理-查询", description = "根据用户ID查询货主/供应商/客户详情", businessType = BusinessType.INQUIRE)
@ApiOperation("根据用户ID查询货主、供应商、客户详情")
@GetMapping("/getCustomerInfo/{userId}")
public AjaxResult getCustomerInfo(@PathVariable("userId") Long userId) {
UserPo userPo = userApplicationService.selectByUserId(userId);
return AjaxResult.success(toCustomerDTO(userPo));
}
private CustomerDTO toCustomerDTO(UserPo userPo) {
if (userPo == null) {
return null;
}
CustomerDTO customerDTO = new CustomerDTO();
BeanUtils.copyProperties(userPo, customerDTO);
customerDTO.setUserMemberCode(userPo.getUserMemberCode());
customerDTO.setEmergencyContactPhone(userPo.getUserPhone());
customerDTO.setEmergencyContactName(userPo.getEmergencyContactName());
customerDTO.setUserAreaName(userPo.getUserAreaName());
customerDTO.setUserAreaCountyId(userPo.getUserAreaCountyId());
customerDTO.setUserAreaAddress(userPo.getUserAreaAddress());
return customerDTO;
}
@Log(title = "修改货主、供应商、客户", description ="修改货主、供应商、客户",businessType = BusinessType.UPDATE)
@ApiOperation("修改货主、供应商、客户")
@PostMapping("/updateCustomer")