|
|
@ -160,7 +160,7 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn |
|
|
|
//2.查询客户的根级组织对应的管理员角色列表,批量查询
|
|
|
|
StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); |
|
|
|
staffRoleFormDTO.setOrgIds(rootAgencyIds); |
|
|
|
staffRoleFormDTO.setRoleKey("manager");// TODO ,此处应该将所有的角色key放到EpmetUser的client中
|
|
|
|
staffRoleFormDTO.setRoleKey(RoleKeyConstants.ROLE_KEY_MANAGER);// TODO ,此处应该将所有的角色key放到EpmetUser的client中
|
|
|
|
Result<Map<String, List<GovStaffRoleResultDTO>>> managersResult = epmetUserFeignClient.getStaffsInRoleOfOrgs(staffRoleFormDTO); |
|
|
|
if (managersResult.success()) { |
|
|
|
Map<String, List<GovStaffRoleResultDTO>> rootAgencyManagerMap = managersResult.getData(); |
|
|
@ -207,7 +207,7 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public String addCustomer(String customerName, String organizationLevel) { |
|
|
|
public String addCustomer(String customerName, String organizationLevel, String logo) { |
|
|
|
|
|
|
|
// 校验
|
|
|
|
CustomerDTO customerExists = baseDao.selectByCustomerName(customerName); |
|
|
@ -223,24 +223,25 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn |
|
|
|
customerEntity.setOrganizationImg(""); |
|
|
|
customerEntity.setValidityTime(getValidityTime()); |
|
|
|
customerEntity.setOrganizationLevel(organizationLevel); |
|
|
|
customerEntity.setLogo(logo); |
|
|
|
int insert = baseDao.insert(customerEntity); |
|
|
|
if (insert == 0) { |
|
|
|
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_ERROR.getCode()); |
|
|
|
} |
|
|
|
|
|
|
|
// 2. 给客户初始化角色列表
|
|
|
|
Result initResult = epmetUserFeignClient.initGovStaffRolesForCustomer(customerEntity.getId()); |
|
|
|
if (!initResult.success()) { |
|
|
|
throw new RenException("客户新增:为客户初始化角色调用user服务失败:".concat(initResult.toString())); |
|
|
|
} |
|
|
|
|
|
|
|
//3. 给客户初始化 定制化首页
|
|
|
|
CustomerHomeDTO initHomeForm = new CustomerHomeDTO(); |
|
|
|
initHomeForm.setCustomerId(customerEntity.getId()); |
|
|
|
Result initHomeResult = operCustomizeFeignClient.init(initHomeForm); |
|
|
|
if (!initHomeResult.success()) { |
|
|
|
throw new RenException("初始化首页失败:".concat(initHomeResult.getInternalMsg())); |
|
|
|
} |
|
|
|
//// 2. 给客户初始化角色列表
|
|
|
|
//Result initResult = epmetUserFeignClient.initGovStaffRolesForCustomer(customerEntity.getId());
|
|
|
|
//if (!initResult.success()) {
|
|
|
|
// throw new RenException("客户新增:为客户初始化角色调用user服务失败:".concat(initResult.toString()));
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
////3. 给客户初始化 定制化首页
|
|
|
|
//CustomerHomeDTO initHomeForm = new CustomerHomeDTO();
|
|
|
|
//initHomeForm.setCustomerId(customerEntity.getId());
|
|
|
|
//Result initHomeResult = operCustomizeFeignClient.init(initHomeForm);
|
|
|
|
//if (!initHomeResult.success()) {
|
|
|
|
// throw new RenException("初始化首页失败:".concat(initHomeResult.getInternalMsg()));
|
|
|
|
//}
|
|
|
|
|
|
|
|
return customerEntity.getId(); |
|
|
|
} |
|
|
|