Browse Source

Merge branch 'dev_bugfix' into dev

master
sunyuchao 5 years ago
parent
commit
305fa038e6
  1. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java
  2. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  3. 9
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java

@ -33,10 +33,15 @@ public class AgencydetailFormDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 内部错误分组
* */
public interface AddUserInternalGroup{}
/** /**
* 机关组织Id * 机关组织Id
*/ */
@NotBlank(message = "机关组织ID不能为空") @NotBlank(message = "机关组织ID不能为空" , groups = {AgencydetailFormDTO.AddUserInternalGroup.class})
private String agencyId; private String agencyId;

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -132,7 +132,7 @@ public class AgencyController {
@PostMapping("agencydetail") @PostMapping("agencydetail")
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_AGENCY_TRACE) @RequirePermission(requirePermission = RequirePermissionEnum.ORG_AGENCY_TRACE)
public Result<AgencysResultDTO> agencyDetail(@LoginUser TokenDto tokenDTO, @RequestBody AgencydetailFormDTO formDTO) { public Result<AgencysResultDTO> agencyDetail(@LoginUser TokenDto tokenDTO, @RequestBody AgencydetailFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO, AgencydetailFormDTO.AddUserInternalGroup.class);
return agencyService.agencyDetail(formDTO); return agencyService.agencyDetail(formDTO);
} }

9
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -42,7 +43,6 @@ import com.epmet.feign.OperCustomizeFeignClient;
import com.epmet.redis.CustomerRedis; import com.epmet.redis.CustomerRedis;
import com.epmet.service.CustomerService; import com.epmet.service.CustomerService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -257,20 +257,24 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
customerRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_MANAGER); customerRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_MANAGER);
Result<GovStaffRoleDTO> getRoleResult = epmetUserFeignClient.getRoleOfCustomer(customerRoleForm); Result<GovStaffRoleDTO> getRoleResult = epmetUserFeignClient.getRoleOfCustomer(customerRoleForm);
if (!getRoleResult.success()) { if (!getRoleResult.success()) {
log.error("查询客户具有指定RoleKey的角色信息失败:".concat(getRoleResult.toString()));
throw new RenException("查询客户具有指定RoleKey的角色信息失败:".concat(getRoleResult.toString())); throw new RenException("查询客户具有指定RoleKey的角色信息失败:".concat(getRoleResult.toString()));
} }
if (getRoleResult.getData() == null) { if (getRoleResult.getData() == null) {
log.error("未查询到客户具有指定RoleKey的角色信息:".concat(getRoleResult.toString()));
throw new RenException("未查询到客户具有指定RoleKey的角色信息:".concat(getRoleResult.toString())); throw new RenException("未查询到客户具有指定RoleKey的角色信息:".concat(getRoleResult.toString()));
} }
// 查询客户根级组织 // 查询客户根级组织
Result<CustomerAgencyDTO> customerRootAgencyResult = govOrgFeignClient.getCustomerRootAgency(form.getCustomerId()); Result<CustomerAgencyDTO> customerRootAgencyResult = govOrgFeignClient.getCustomerRootAgency(form.getCustomerId());
if (!customerRootAgencyResult.success()) { if (!customerRootAgencyResult.success()) {
log.error("查询客户根级组织失败:".concat(getRoleResult.toString()));
throw new RenException("查询客户根级组织失败:".concat(getRoleResult.toString())); throw new RenException("查询客户根级组织失败:".concat(getRoleResult.toString()));
} }
if (customerRootAgencyResult.getData() == null) { if (customerRootAgencyResult.getData() == null) {
log.error("新增客户管理员失败,没有查询到客户根级组织,无法设置管理员:".concat(getRoleResult.toString()));
throw new RenException("没有查询到客户根级组织,无法设置管理员:".concat(getRoleResult.toString())); throw new RenException("没有查询到客户根级组织,无法设置管理员:".concat(getRoleResult.toString()));
} }
@ -284,7 +288,8 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
staffSubmitFrom.setRoles(Arrays.asList(getRoleResult.getData().getId())); staffSubmitFrom.setRoles(Arrays.asList(getRoleResult.getData().getId()));
Result result = govOrgFeignClient.addStaff(staffSubmitFrom); Result result = govOrgFeignClient.addStaff(staffSubmitFrom);
if (!result.success()) { if (!result.success()) {
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_MANAGER_ERROR.getCode()); log.error(String.format("新增客户管理员失败,调用gov-org-server服务异常%s", JSON.toJSONString(result)));
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_MANAGER_ERROR.getCode(),result.getMsg());
} }
} }

Loading…
Cancel
Save