Browse Source

1.新增客户:增加logo字段

2.查询有效客户列表:增加logo字段返回
dev_shibei_match
wxz 5 years ago
parent
commit
2015ac4d0c
  1. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java
  2. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerFormDTO.java
  3. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/ValidCustomerResultDTO.java
  4. 2
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  5. 5
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java
  6. 3
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
  7. 31
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  8. 4
      epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

5
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java

@ -83,6 +83,11 @@ public class CustomerDTO implements Serializable {
*/
private String organizationLevel;
/**
* 客户logo
*/
private String logo;
/**
* 删除标识0.未删除 1.已删除
*/

5
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerFormDTO.java

@ -39,5 +39,10 @@ public class CustomerFormDTO implements Serializable {
@NotBlank(message = "客户ID", groups = {GetCustomerDetailGroup.class})
private String customerId;
/**
* 客户LOGO
*/
private String logo;
}

5
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/ValidCustomerResultDTO.java

@ -37,4 +37,9 @@ public class ValidCustomerResultDTO implements Serializable {
* 根级组织ID
*/
private String rootAgencyId;
/**
* 客户logo
*/
private String logo;
}

2
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java

@ -177,7 +177,7 @@ public class CustomerController {
@PostMapping("add")
public Result<Map<String, String>> addCustomer(@RequestBody CustomerFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFormDTO.AddCustomerGroup.class);
String customerId = customerService.addCustomer(form.getCustomerName(), form.getOrganizationLevel());
String customerId = customerService.addCustomer(form.getCustomerName(), form.getOrganizationLevel(), form.getLogo());
Map<String, String> resultmap = new HashMap<>();
resultmap.put("customerId", customerId);
return new Result<Map<String, String>>().ok(resultmap);

5
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java

@ -83,4 +83,9 @@ public class CustomerEntity extends BaseEpmetEntity {
*/
private String organizationLevel;
/**
* 客户logo
*/
private String logo;
}

3
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java

@ -137,9 +137,10 @@ public interface CustomerService extends BaseService<CustomerEntity> {
* 新增客户
* @param customerName
* @param organizationLevel
* @param logo logo
* @return
*/
String addCustomer(String customerName, String organizationLevel);
String addCustomer(String customerName, String organizationLevel, String logo);
/**
* 添加管理员

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

@ -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();
}

4
epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

@ -13,6 +13,7 @@
<result property="customerAdmin" column="CUSTOMER_ADMIN"/>
<result property="customerPassword" column="CUSTOMER_PASSWORD"/>
<result property="organizationLevel" column="ORGANIZATION_LEVEL"/>
<result property="logo" column="LOGO"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
@ -25,7 +26,8 @@
<select id="selectListValidCustomerResultDTO" resultType="com.epmet.dto.result.ValidCustomerResultDTO">
SELECT
c.id AS CUSTOMER_ID,
c.CUSTOMER_NAME
c.CUSTOMER_NAME,
c.LOGO AS logo
FROM
customer c
WHERE

Loading…
Cancel
Save