添加字段 userAreaName
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user