Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev_shibei_match
yinzuomei 5 years ago
parent
commit
89e0ebdcce
  1. 2
      epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml
  2. 2
      epmet-module/gov-access/gov-access-server/pom.xml
  3. 11
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java
  4. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java
  5. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerFormDTO.java
  6. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/ValidCustomerResultDTO.java
  7. 2
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  8. 5
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java
  9. 3
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
  10. 33
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  11. 7
      epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

2
epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
gov-access-server: gov-access-server:
container_name: gov-access-server-dev container_name: gov-access-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.18 image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.19
ports: ports:
- "8099:8099" - "8099:8099"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/gov-access/gov-access-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.18</version> <version>0.3.19</version>
<parent> <parent>
<artifactId>gov-access</artifactId> <artifactId>gov-access</artifactId>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>

11
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java

@ -497,11 +497,12 @@ public class AccessServiceImpl implements AccessService {
Set<String> filtedOps = new HashSet<>(); Set<String> filtedOps = new HashSet<>();
roleIdList.forEach(roleId -> { if (!CollectionUtils.isEmpty(roleIdList)) {
List<RoleOpeScopeResultDTO> opeAndScopeDTO = listAllRoleOperationScopesByRoleId(roleId); roleIdList.forEach(roleId -> {
filtedOps.addAll(filterOpesByScope(currOrgRelation, opeAndScopeDTO)); List<RoleOpeScopeResultDTO> opeAndScopeDTO = listAllRoleOperationScopesByRoleId(roleId);
}); filtedOps.addAll(filterOpesByScope(currOrgRelation, opeAndScopeDTO));
});
}
return filtedOps; return filtedOps;
} }

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; private String organizationLevel;
/**
* 客户logo
*/
private String logo;
/** /**
* 删除标识0.未删除 1.已删除 * 删除标识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}) @NotBlank(message = "客户ID", groups = {GetCustomerDetailGroup.class})
private String customerId; 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 * 根级组织ID
*/ */
private String rootAgencyId; 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") @PostMapping("add")
public Result<Map<String, String>> addCustomer(@RequestBody CustomerFormDTO form) { public Result<Map<String, String>> addCustomer(@RequestBody CustomerFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFormDTO.AddCustomerGroup.class); 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<>(); Map<String, String> resultmap = new HashMap<>();
resultmap.put("customerId", customerId); resultmap.put("customerId", customerId);
return new Result<Map<String, String>>().ok(resultmap); 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; 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 customerName
* @param organizationLevel * @param organizationLevel
* @param logo logo
* @return * @return
*/ */
String addCustomer(String customerName, String organizationLevel); String addCustomer(String customerName, String organizationLevel, String logo);
/** /**
* 添加管理员 * 添加管理员

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

@ -147,7 +147,7 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
validCustomers.stream().forEach(customer -> { validCustomers.stream().forEach(customer -> {
CustomerAgencyDTO rootAgency = rootAgencies.get(customer.getCustomerId()); CustomerAgencyDTO rootAgency = rootAgencies.get(customer.getCustomerId());
customer.setHasRootAgency(rootAgency == null ? false : true); customer.setHasRootAgency(rootAgency == null ? false : true);
customer.setRootAgencyId(rootAgency == null ? null : rootAgency.getId()); customer.setRootAgencyId(rootAgency == null ? "" : rootAgency.getId());
if (rootAgency != null) { if (rootAgency != null) {
rootAgencyIds.add(rootAgency.getId()); rootAgencyIds.add(rootAgency.getId());
} }
@ -160,7 +160,7 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
//2.查询客户的根级组织对应的管理员角色列表,批量查询 //2.查询客户的根级组织对应的管理员角色列表,批量查询
StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO();
staffRoleFormDTO.setOrgIds(rootAgencyIds); 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); Result<Map<String, List<GovStaffRoleResultDTO>>> managersResult = epmetUserFeignClient.getStaffsInRoleOfOrgs(staffRoleFormDTO);
if (managersResult.success()) { if (managersResult.success()) {
Map<String, List<GovStaffRoleResultDTO>> rootAgencyManagerMap = managersResult.getData(); Map<String, List<GovStaffRoleResultDTO>> rootAgencyManagerMap = managersResult.getData();
@ -207,7 +207,7 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
@Override @Override
@Transactional @Transactional
public String addCustomer(String customerName, String organizationLevel) { public String addCustomer(String customerName, String organizationLevel, String logo) {
// 校验 // 校验
CustomerDTO customerExists = baseDao.selectByCustomerName(customerName); CustomerDTO customerExists = baseDao.selectByCustomerName(customerName);
@ -223,24 +223,25 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
customerEntity.setOrganizationImg(""); customerEntity.setOrganizationImg("");
customerEntity.setValidityTime(getValidityTime()); customerEntity.setValidityTime(getValidityTime());
customerEntity.setOrganizationLevel(organizationLevel); customerEntity.setOrganizationLevel(organizationLevel);
customerEntity.setLogo(logo);
int insert = baseDao.insert(customerEntity); int insert = baseDao.insert(customerEntity);
if (insert == 0) { if (insert == 0) {
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_ERROR.getCode()); throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_ERROR.getCode());
} }
// 2. 给客户初始化角色列表 //// 2. 给客户初始化角色列表
Result initResult = epmetUserFeignClient.initGovStaffRolesForCustomer(customerEntity.getId()); //Result initResult = epmetUserFeignClient.initGovStaffRolesForCustomer(customerEntity.getId());
if (!initResult.success()) { //if (!initResult.success()) {
throw new RenException("客户新增:为客户初始化角色调用user服务失败:".concat(initResult.toString())); // throw new RenException("客户新增:为客户初始化角色调用user服务失败:".concat(initResult.toString()));
} //}
//
//3. 给客户初始化 定制化首页 ////3. 给客户初始化 定制化首页
CustomerHomeDTO initHomeForm = new CustomerHomeDTO(); //CustomerHomeDTO initHomeForm = new CustomerHomeDTO();
initHomeForm.setCustomerId(customerEntity.getId()); //initHomeForm.setCustomerId(customerEntity.getId());
Result initHomeResult = operCustomizeFeignClient.init(initHomeForm); //Result initHomeResult = operCustomizeFeignClient.init(initHomeForm);
if (!initHomeResult.success()) { //if (!initHomeResult.success()) {
throw new RenException("初始化首页失败:".concat(initHomeResult.getInternalMsg())); // throw new RenException("初始化首页失败:".concat(initHomeResult.getInternalMsg()));
} //}
return customerEntity.getId(); return customerEntity.getId();
} }

7
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="customerAdmin" column="CUSTOMER_ADMIN"/>
<result property="customerPassword" column="CUSTOMER_PASSWORD"/> <result property="customerPassword" column="CUSTOMER_PASSWORD"/>
<result property="organizationLevel" column="ORGANIZATION_LEVEL"/> <result property="organizationLevel" column="ORGANIZATION_LEVEL"/>
<result property="logo" column="LOGO"/>
<result property="delFlag" column="DEL_FLAG"/> <result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/> <result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/> <result property="createdBy" column="CREATED_BY"/>
@ -23,9 +24,9 @@
<!-- 运营端-获取有效客户列表 (未删除+有效期内的,按照客户名称排序 )--> <!-- 运营端-获取有效客户列表 (未删除+有效期内的,按照客户名称排序 )-->
<select id="selectListValidCustomerResultDTO" resultType="com.epmet.dto.result.ValidCustomerResultDTO"> <select id="selectListValidCustomerResultDTO" resultType="com.epmet.dto.result.ValidCustomerResultDTO">
SELECT SELECT c.id AS CUSTOMER_ID,
c.id AS CUSTOMER_ID, c.CUSTOMER_NAME,
c.CUSTOMER_NAME CASE WHEN c.LOGO IS NULL THEN '' ELSE c.LOGO END AS LOGO
FROM FROM
customer c customer c
WHERE WHERE

Loading…
Cancel
Save