Browse Source

Merge branches 'dev' and 'dev_issue_project' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_issue_project

dev_shibei_match
yinzuomei 5 years ago
parent
commit
c4f4afc239
  1. 6
      epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java
  3. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  4. 51
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationDefaultDTO.java
  5. 2
      epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml
  6. 2
      epmet-module/gov-access/gov-access-server/pom.xml
  7. 3
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/RoleController.java
  8. 33
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDefaultDao.java
  9. 41
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationDefaultEntity.java
  10. 6
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java
  11. 19
      epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml
  12. 90
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddRootAgencyFormDTO.java
  13. 2
      epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml
  14. 2
      epmet-module/gov-org/gov-org-server/pom.xml
  15. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  16. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
  17. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  18. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
  19. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  20. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  21. 2
      epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml
  22. 2
      epmet-module/oper-access/oper-access-server/pom.xml
  23. 9
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java
  24. 25
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerFormDTO.java
  25. 38
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerManagerFormDTO.java
  26. 17
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerDetailResultDTO.java
  27. 9
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java
  28. 12
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/ManagerDTO.java
  29. 13
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/RootAgencyDTO.java
  30. 2
      epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml
  31. 2
      epmet-module/oper-crm/oper-crm-server/pom.xml
  32. 67
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  33. 7
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java
  34. 13
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java
  35. 19
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  36. 42
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  37. 12
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
  38. 24
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  39. 18
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
  40. 168
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  41. 7
      epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml
  42. 2
      epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml
  43. 2
      epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml
  44. 2
      epmet-module/resi-partymember/resi-partymember-server/pom.xml
  45. 17
      epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java
  46. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/constant/UserWorkType.java
  47. 18
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerRoleFormDTO.java
  48. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java
  49. 86
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java
  50. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  51. 2
      epmet-user/epmet-user-server/pom.xml
  52. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java
  53. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java
  54. 41
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleTemplateDao.java
  55. 56
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleTemplateEntity.java
  56. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java
  57. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java
  58. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java
  59. 9
      epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml
  60. 27
      epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleTemplateDao.xml
  61. 3
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

6
epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java

@ -3,6 +3,7 @@ package com.epmet.commons.mybatis.aspect;
import com.epmet.commons.mybatis.annotation.DataFilter;
import com.epmet.commons.mybatis.feign.MybatisGovAccessFeignClient;
import com.epmet.commons.mybatis.dto.form.*;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.user.LoginUserUtil;
@ -39,6 +40,11 @@ public class DataFilterAspect {
@Before("@annotation(com.epmet.commons.mybatis.annotation.DataFilter)")
public void dataFilter(JoinPoint point) {
if (!AppClientConstant.APP_GOV.equals(loginUserUtil.getLoginUserApp())) {
// 只校验gov,否则放行
return;
}
// 从ThreadLocal中取所需权限
String requirePermission = ThreadLocalConstant.requirePermissionTl.get();
// 没有配置所需权限,不做操作,打印提示日志

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java

@ -70,7 +70,7 @@ public abstract class BaseRequestLogAspect {
long execTimeMillis = Duration.between(startTime, endTime).toMillis();
if (exception != null) {
log.info("<<<<<<<<异常响应<<<<<<<<:线程ID:{},执行时长:{}ms, 响应数据:{}, 异常信息:{}",
log.error("<<<<<<<<异常响应<<<<<<<<:线程ID:{},执行时长:{}ms, 响应数据:{}, 异常信息:{}",
id, execTimeMillis, result == null ? result : result.toString(), ExceptionUtils.getErrorStackTrace(exception));
} else {
log.info("<<<<<<<<正常响应<<<<<<<<:线程ID:{},执行时长:{}ms, 响应数据:{}",

7
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -48,7 +48,12 @@ public enum EpmetErrorCode {
PROJECT_IS_CLOSED(8601,"项目已结案"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数");
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),
OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"),
OPER_ADD_CUSTOMER_ROOT_AGENCY_EXISTS(8703, "添加客户根级组织失败,根级组织已存在"),
OPER_CUSTOMER_EXISTS(8704, "客户已存在"),
OPER_ADD_CUSTOMER_ERROR(8705, "新增客户失败"),
OPER_ADD_CUSTOMER_MANAGER_ERROR(8706, "新增客户管理员失败");
private int code;
private String msg;

51
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationDefaultDTO.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 角色默认的可操作功能列表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-21
*/
@Data
public class RoleOperationDefaultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String id;
/**
* 角色KEY
*/
private String roleKey;
/**
* 操作key
*/
private String operationKey;
}

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

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-access-server:
container_name: gov-access-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.11
image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.12
ports:
- "8099:8099"
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"
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">
<version>0.3.11</version>
<version>0.3.12</version>
<parent>
<artifactId>gov-access</artifactId>
<groupId>com.epmet</groupId>

3
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/RoleController.java

@ -3,6 +3,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.RoleOperationResultDTO;
import com.epmet.service.RoleOperationService;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -28,6 +29,4 @@ public class RoleController {
List<RoleOperationResultDTO> roleOperationResultDTOS = roleOperationService.listOperationsByRoleId(roleId);
return new Result<List<RoleOperationResultDTO>>().ok(roleOperationResultDTOS);
}
}

33
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDefaultDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.RoleOperationDefaultEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 角色默认的可操作功能列表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-21
*/
@Mapper
public interface RoleOperationDefaultDao extends BaseDao<RoleOperationDefaultEntity> {
}

41
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationDefaultEntity.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
public class RoleOperationDefaultEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 角色KEY
*/
private String roleKey;
/**
* 操作key
*/
private String operationKey;
}

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

@ -2,6 +2,7 @@ package com.epmet.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.epmet.bean.OpeScopeFilterResultBean;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.OpeScopeConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
@ -122,6 +123,11 @@ public class AccessServiceImpl implements AccessService {
@Override
public Boolean hasPermission(String operationKey, String userId, String app, String client) {
if (!AppClientConstant.APP_GOV.equals(app)) {
// 如果不是gov,那么不判断权限,放行
return true;
}
GovTokenDto userDetails = getUserDetails(app, client, userId);
if (userDetails == null) {
return false;

19
epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.RoleOperationDefaultDao">
<resultMap type="com.epmet.entity.RoleOperationDefaultEntity" id="roleOperationDefaultMap">
<result property="id" column="ID"/>
<result property="roleKey" column="ROLE_KEY"/>
<result property="operationKey" column="OPERATION_KEY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

90
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddRootAgencyFormDTO.java

@ -0,0 +1,90 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.form;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 添加组织-接口入参
*
* @author sun
*/
@Data
public class AddRootAgencyFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
//=====分组校验========
public interface AddRootAgencyGroup {}
/**
* 客户ID
*/
@NotBlank(message = "客户ID不能为空", groups = AddRootAgencyGroup.class)
private String customerId;
/**
* 机构组织名称
*/
@NotBlank(message = "组织名称不能为空" , groups = AddRootAgencyGroup.class)
@Length(max=50,message = "机构名称不能超过50个字" , groups = AddRootAgencyGroup.class)
private String agencyName;
/**
* 机关级别社区级community
* 街道:street,
* 区县级: district,
* 市级: city
* 省级:province 机关级别社区级community街道:street,区县级: district,市级: city省级:province
*/
@NotBlank(message = "机关级别不能为空" , groups = AddRootAgencyGroup.class)
@Length(max=30,message = "机关类别不能超过30个字" , groups = AddRootAgencyGroup.class)
private String level;
/**
* 地区编码
*/
@NotBlank(message = "地区编码不能为空", groups = AddRootAgencyGroup.class)
@Length(max=10,message = "地区编码不能超过10位", groups = AddRootAgencyGroup.class)
private String areaCode;
/**
* 省份
*/
@NotBlank(message = "省级机关名称不能为空", groups = AddRootAgencyGroup.class)
@Length(max=30,message = "省级机关名称不能超过30个字", groups = AddRootAgencyGroup.class)
private String province;
/**
* 城市
*/
@Length(max=30,message = "市级机关名称不能超过30个字", groups = AddRootAgencyGroup.class)
private String city;
/**
* 区县
*/
@Length(max=30,message = "区县级机关名称不能超过30个字", groups = AddRootAgencyGroup.class)
private String district;
}

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

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-org-server:
container_name: gov-org-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.47
image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.48
ports:
- "8092:8092"
network_mode: host # 使用现有网络

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

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
<version>0.3.47</version>
<version>0.3.48</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>gov-org</artifactId>

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

@ -38,6 +38,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.xml.validation.Validator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -81,6 +82,20 @@ public class AgencyController {
return agencyService.addAgency(formDTO);
}
/**
* 添加根级组织
* @param form
* @return
*/
@PostMapping("addrootagency")
public Result<Map<String, String>> addRootAgency(@RequestBody AddRootAgencyFormDTO form) {
ValidatorUtils.validateEntity(form, AddRootAgencyFormDTO.AddRootAgencyGroup.class);
String agencyId = agencyService.addRootAgency(form);
HashMap<String, String> resultMap = new HashMap<>();
resultMap.put("agencyId", agencyId);
return new Result<Map<String, String>>().ok(resultMap);
}
/**
* @param formDTO
* @return

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java

@ -87,9 +87,11 @@ public class StaffController {
*/
@PostMapping("addstaff")
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_CREATE)
public Result addStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitFromDTO fromDTO){
public Result addStaff(@RequestBody StaffSubmitFromDTO fromDTO){
fromDTO.setApp("gov");
fromDTO.setClient("wxmp");
ValidatorUtils.validateEntity(fromDTO);
return staffService.addStaff(tokenDto, fromDTO);
return staffService.addStaff(fromDTO);
}
/**

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -97,4 +97,6 @@ public interface AgencyService {
* @param customerId
*/
CustomerAgencyDTO getCustomerRootAgency(String customerId);
String addRootAgency(AddRootAgencyFormDTO form);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java

@ -56,7 +56,7 @@ public interface StaffService {
* @param fromDTO 参数
* @return Result
*/
Result addStaff(TokenDto tokenDto, StaffSubmitFromDTO fromDTO);
Result addStaff(StaffSubmitFromDTO fromDTO);
/**
* 人员编辑

19
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -254,4 +254,23 @@ public class AgencyServiceImpl implements AgencyService {
public CustomerAgencyDTO getCustomerRootAgency(String customerId) {
return customerAgencyDao.getCustomerRootAgency(customerId);
}
@Override
public String addRootAgency(AddRootAgencyFormDTO form) {
CustomerAgencyDTO rootAgencyExists = customerAgencyDao.getCustomerRootAgency(form.getCustomerId());
if (rootAgencyExists != null) {
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_ROOT_AGENCY_EXISTS.getCode());
}
CustomerAgencyEntity entity = ConvertUtils.sourceToTarget(form, CustomerAgencyEntity.class);
entity.setAllParentName("");
entity.setOrganizationName(form.getAgencyName());
entity.setPids("0");
entity.setPid("0");
entity.setTotalUser(0);
entity.setCustomerId(form.getCustomerId());
customerAgencyDao.insert(entity);
return entity.getId();
}
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -101,10 +101,10 @@ public class StaffServiceImpl implements StaffService {
@Override
@Transactional(rollbackFor = Exception.class)
public Result addStaff(TokenDto tokenDto, StaffSubmitFromDTO fromDTO) {
public Result addStaff(StaffSubmitFromDTO fromDTO) {
CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId());
fromDTO.setApp(tokenDto.getApp());
fromDTO.setClient(tokenDto.getClient());
//fromDTO.setApp(tokenDto.getApp());
//fromDTO.setClient(tokenDto.getClient());
fromDTO.setCustomerId(customerAgencyEntity.getCustomerId());
Result<CustomerStaffDTO> result = epmetUserFeignClient.addStaff(fromDTO);

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

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-access-server:
container_name: oper-access-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.8
image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.9
ports:
- "8093:8093"
network_mode: host # 使用现有网络

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

@ -3,7 +3,7 @@
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">
<version>0.3.8</version>
<version>0.3.9</version>
<parent>
<artifactId>oper-access</artifactId>
<groupId>com.epmet</groupId>

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

@ -74,9 +74,14 @@ public class CustomerDTO implements Serializable {
private String customerPassword;
/**
* 客户组织级别0.省级1市级2.区县级3.乡镇街道级 字典表keyorganizationlevel
* 客户组织级别机关级别
* 社区级community
* 街道:street,
* 区县级: district,
* 市级: city
* 省级:province 机关级别社区级community街道:street,区县级: district,市级: city省级:province
*/
private Integer organizationLevel;
private String organizationLevel;
/**
* 删除标识0.未删除 1.已删除

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

@ -2,6 +2,7 @@ package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
@ -12,9 +13,31 @@ import java.util.List;
*/
@Data
public class CustomerFormDTO implements Serializable {
public interface AddCustomerGroup {
}
public interface GetCustomerDetailGroup {
}
/**
* 客户id集合
* */
*/
private List<String> customerIdList;
/**
* 客户名称
*/
@NotBlank(message = "客户名称不能为空", groups = {AddCustomerGroup.class})
private String customerName;
/**
* 组织级别
*/
@NotBlank(message = "客户的组织级别", groups = {AddCustomerGroup.class})
private String organizationLevel;
@NotBlank(message = "客户ID", groups = {GetCustomerDetailGroup.class})
private String customerId;
}

38
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerManagerFormDTO.java

@ -0,0 +1,38 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* {
* "customerId": "100824",
* "realName": "XF9wxEFMfi",
* "gender": "Vxa8GNrMfb",
* "mobile": "54RyjPWtwh",
* "agencyId": "101259"
* }
*/
@Data
public class CustomerManagerFormDTO {
public interface AddManagerGroup {}
@NotBlank(message = "客户ID不能为空", groups = { AddManagerGroup.class })
private String customerId;
@NotBlank(message = "管理员名字不能为空", groups = { AddManagerGroup.class })
private String realName;
@NotNull(message = "管理员性别不能为空", groups = { AddManagerGroup.class })
private Integer gender;
@NotBlank(message = "管理员手机号不能为空", groups = { AddManagerGroup.class })
private String mobile;
// 根据customerId查询rootAgency即可获得
//@NotBlank(message = "管理员所属组织ID不能为空", groups = { AddManagerGroup.class })
//private String agencyId;
}

17
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerDetailResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class CustomerDetailResultDTO {
private RootAgencyDTO rootAgencyDTO;
private CustomerInfoDTO customerInfoDTO;
private List<ManagerDTO> managers = new ArrayList<>();
}

9
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java

@ -0,0 +1,9 @@
package com.epmet.dto.result;
import lombok.Data;
@Data
public class CustomerInfoDTO {
private String customerName;
private String organizationLevel;
}

12
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/ManagerDTO.java

@ -0,0 +1,12 @@
package com.epmet.dto.result;
import lombok.Data;
@Data
public class ManagerDTO {
private String realName;
private String gender;
private String mobile;
}

13
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/RootAgencyDTO.java

@ -0,0 +1,13 @@
package com.epmet.dto.result;
import lombok.Data;
@Data
public class RootAgencyDTO {
private String agencyName;
private String level;
private String areaCode;
private String province;
private String city;
private String district;
}

2
epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-crm-server:
container_name: oper-crm-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.10
image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.11
ports:
- "8090:8090"
network_mode: host # 使用现有网络

2
epmet-module/oper-crm/oper-crm-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
<version>0.3.10</version>
<version>0.3.11</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>oper-crm</artifactId>

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

@ -17,6 +17,8 @@
package com.epmet.controller;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
@ -26,16 +28,23 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.form.AddRootAgencyFormDTO;
import com.epmet.dto.form.CustomerFormDTO;
import com.epmet.dto.form.CustomerManagerFormDTO;
import com.epmet.dto.result.CustomerDetailResultDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.excel.CustomerExcel;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.service.CustomerService;
import org.apache.ibatis.mapping.ResultMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.xml.validation.Validator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -54,6 +63,9 @@ public class CustomerController {
@Autowired
private CustomerService customerService;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@GetMapping("page")
public Result<PageData<CustomerDTO>> page(@RequestParam Map<String, Object> params) {
PageData<CustomerDTO> page = customerService.page(params);
@ -156,4 +168,59 @@ public class CustomerController {
public Result<List<CustomerDTO>> queryCustomerList(@RequestBody CustomerFormDTO formDTO) {
return customerService.queryCustomerList(formDTO);
}
/**
* 添加客户
* @param form
* @return
*/
@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());
Map<String, String> resultmap = new HashMap<>();
resultmap.put("customerId", customerId);
return new Result<Map<String, String>>().ok(resultmap);
}
/**
* 添加客户根级组织
* @param form
* @return
*/
@PostMapping("addrootagency")
public Result<Map<String, String>> addRootAgency(@RequestBody AddRootAgencyFormDTO form) {
Result<Map<String, String>> result = govOrgFeignClient.addRootAgency(form);
if (!result.success()) {
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR.getCode(),
EpmetErrorCode.OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR.getMsg().concat(",错误信息:").concat(result.getMsg()));
}
return result;
}
/**
*
* 添加管理员
* @param form
* @return
*/
@PostMapping("addmanager")
public Result addManager(@RequestBody CustomerManagerFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerManagerFormDTO.AddManagerGroup.class);
customerService.addManager(form);
return new Result();
}
/**
*
* 客户详情
* @param form
* @return
*/
@PostMapping("detail")
public Result getCustomerDetail(@RequestBody CustomerFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFormDTO.GetCustomerDetailGroup.class);
CustomerDetailResultDTO customerDetailResultDto = customerService.getcustomerDetail(form.getCustomerId());
return new Result().ok(customerDetailResultDto);
}
}

7
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java

@ -51,4 +51,11 @@ public interface CustomerDao extends BaseDao<CustomerEntity> {
* @Date 2020/4/24 9:21
**/
List<CustomerDTO> selectListByIds(@Param("customerIdList") List<String> customerIdList);
/**
* 根据名字查询客户
* @param customerName
* @return
*/
CustomerDTO selectByCustomerName(@Param("customerName") String customerName);
}

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

@ -73,9 +73,14 @@ public class CustomerEntity extends BaseEpmetEntity {
*/
private String customerPassword;
/**
* 客户组织级别0.省级1市级2.区县级3.乡镇街道级 字典表keyorganizationlevel
*/
private Integer organizationLevel;
/**
* 客户组织级别机关级别
* 社区级community
* 街道:street,
* 区县级: district,
* 市级: city
* 省级:province 机关级别社区级community街道:street,区县级: district,市级: city省级:province
*/
private String organizationLevel;
}

19
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -2,10 +2,13 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.CustomerRoleFormDTO;
import com.epmet.dto.form.StaffRoleFormDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.feign.fallback.EpmetUserFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -32,4 +35,20 @@ public interface EpmetUserFeignClient {
*/
@PostMapping("/epmetuser/staffrole/staffsinroleoforgs")
Result<Map<String, List<GovStaffRoleResultDTO>>> getStaffsInRoleOfOrgs(@RequestBody StaffRoleFormDTO staffRoleFormDTO);
/**
* 为客户初始化政府端工作人员角色
* @param customerId
* @return
*/
@PostMapping("/epmetuser/staffrole/initrolesforcustomer/{customerId}")
Result initGovStaffRolesForCustomer(@PathVariable String customerId);
/**
* 根据客户ID和角色key查询角色信息
* @param form
* @return
*/
@PostMapping("/epmetuser/staffrole/roleofcustomer")
Result<GovStaffRoleDTO> getRoleOfCustomer(@RequestBody CustomerRoleFormDTO form);
}

42
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -1,10 +1,20 @@
package com.epmet.feign;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.AddAgencyFormDTO;
import com.epmet.dto.form.AddRootAgencyFormDTO;
import com.epmet.dto.form.StaffSubmitFromDTO;
import com.epmet.dto.result.AddAgencyResultDTO;
import com.epmet.feign.fallback.GovOrgFeignClientFallBack;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -15,6 +25,14 @@ import java.util.Map;
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class)
public interface GovOrgFeignClient {
/**
* 查询客户根级组织
* @param customerId
* @return
*/
@PostMapping("/gov/org/agency/customerrootagency/{customerId}")
Result<CustomerAgencyDTO> getCustomerRootAgency(@PathVariable String customerId);
/**
* 批量查询客户根级组织
* @param customerIds
@ -23,4 +41,28 @@ public interface GovOrgFeignClient {
@PostMapping("/gov/org/agency/customerrootagencybatch")
Result<Map<String, CustomerAgencyDTO>> getCustomerRootAgencyBatch(List<String> customerIds);
/**
* 添加组织
* @param formDTO
* @return
*/
@PostMapping("/gov/org/agency/addagency")
Result<AddAgencyResultDTO> addAgency(@RequestBody AddAgencyFormDTO formDTO);
/**
* 添加根级组织
* @param form
* @return
*/
@PostMapping("/gov/org/agency/addrootagency")
Result<Map<String, String>> addRootAgency(@RequestBody AddRootAgencyFormDTO form);
/**
* 人员添加
*
* @param fromDTO 参数
* @return Result
*/
@PostMapping("/gov/org/staff/addstaff")
Result addStaff(@RequestBody StaffSubmitFromDTO fromDTO);
}

12
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java

@ -3,6 +3,8 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.CustomerRoleFormDTO;
import com.epmet.dto.form.StaffRoleFormDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.feign.EpmetUserFeignClient;
@ -22,4 +24,14 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
public Result<Map<String, List<GovStaffRoleResultDTO>>> getStaffsInRoleOfOrgs(StaffRoleFormDTO staffRoleFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffsInRoleOfOrgs", staffRoleFormDTO);
}
@Override
public Result initGovStaffRolesForCustomer(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "initGovStaffRolesForCustomer", customerId);
}
@Override
public Result<GovStaffRoleDTO> getRoleOfCustomer(CustomerRoleFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRoleOfCustomer", form);
}
}

24
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -4,6 +4,10 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.AddAgencyFormDTO;
import com.epmet.dto.form.AddRootAgencyFormDTO;
import com.epmet.dto.form.StaffSubmitFromDTO;
import com.epmet.dto.result.AddAgencyResultDTO;
import com.epmet.feign.GovOrgFeignClient;
import org.springframework.stereotype.Component;
@ -13,8 +17,28 @@ import java.util.Map;
@Component
public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
@Override
public Result<CustomerAgencyDTO> getCustomerRootAgency(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerRootAgency", customerId);
}
@Override
public Result<Map<String, CustomerAgencyDTO>> getCustomerRootAgencyBatch(List<String> customerIds) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerRootAgencyBatch", customerIds);
}
@Override
public Result<AddAgencyResultDTO> addAgency(AddAgencyFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "addAgency", formDTO);
}
@Override
public Result<Map<String, String>> addRootAgency(AddRootAgencyFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "addRootAgency", form);
}
@Override
public Result addStaff(StaffSubmitFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "addStaff", fromDTO);
}
}

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

@ -22,6 +22,8 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.form.CustomerFormDTO;
import com.epmet.dto.form.CustomerManagerFormDTO;
import com.epmet.dto.result.CustomerDetailResultDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.entity.CustomerEntity;
@ -130,4 +132,20 @@ public interface CustomerService extends BaseService<CustomerEntity> {
* @Date 2020/4/24 9:13
**/
Result<List<CustomerDTO>> queryCustomerList(CustomerFormDTO formDTO);
/**
* 新增客户
* @param customerName
* @param organizationLevel
* @return
*/
String addCustomer(String customerName, String organizationLevel);
/**
* 添加管理员
* @param form
*/
void addManager(CustomerManagerFormDTO form);
CustomerDetailResultDTO getcustomerDetail(String customerId);
}

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

@ -20,17 +20,20 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.RoleKeyConstants;
import com.epmet.constant.UserWorkType;
import com.epmet.dao.CustomerDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.form.CustomerFormDTO;
import com.epmet.dto.form.StaffRoleFormDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerEntity;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovOrgFeignClient;
@ -197,4 +200,161 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
return new Result<List<CustomerDTO>>().ok(customerDTOList);
}
@Override
@Transactional
public String addCustomer(String customerName, String organizationLevel) {
// 校验
CustomerDTO customerExists = baseDao.selectByCustomerName(customerName);
if (customerExists != null) {
throw new RenException(EpmetErrorCode.OPER_CUSTOMER_EXISTS.getCode());
}
// 1. 本地新增客户信息
CustomerEntity customerEntity = new CustomerEntity();
customerEntity.setCustomerName(customerName);
customerEntity.setTitle("");
customerEntity.setOrganizationNumber("");
customerEntity.setOrganizationImg("");
customerEntity.setValidityTime(getValidityTime());
customerEntity.setOrganizationLevel(organizationLevel);
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()));
}
return customerEntity.getId();
}
@Override
public void addManager(CustomerManagerFormDTO form) {
// 查询客户具有指定RoleKey的角色信息
CustomerRoleFormDTO customerRoleForm = new CustomerRoleFormDTO();
customerRoleForm.setCustomerId(form.getCustomerId());
customerRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_MANAGER);
Result<GovStaffRoleDTO> getRoleResult = epmetUserFeignClient.getRoleOfCustomer(customerRoleForm);
if (!getRoleResult.success()) {
throw new RenException("查询客户具有指定RoleKey的角色信息失败:".concat(getRoleResult.toString()));
}
if (getRoleResult.getData() == null) {
throw new RenException("未查询到客户具有指定RoleKey的角色信息:".concat(getRoleResult.toString()));
}
// 查询客户根级组织
Result<CustomerAgencyDTO> customerRootAgencyResult = govOrgFeignClient.getCustomerRootAgency(form.getCustomerId());
if (!customerRootAgencyResult.success()) {
throw new RenException("查询客户根级组织失败:".concat(getRoleResult.toString()));
}
if (customerRootAgencyResult.getData() == null) {
throw new RenException("没有查询到客户根级组织,无法设置管理员:".concat(getRoleResult.toString()));
}
StaffSubmitFromDTO staffSubmitFrom = new StaffSubmitFromDTO();
staffSubmitFrom.setCustomerId(form.getCustomerId());
staffSubmitFrom.setAgencyId(customerRootAgencyResult.getData().getId());
staffSubmitFrom.setGender(form.getGender());
staffSubmitFrom.setMobile(form.getMobile());
staffSubmitFrom.setName(form.getRealName());
staffSubmitFrom.setWorkType(UserWorkType.FULL_TIME);
staffSubmitFrom.setRoles(Arrays.asList(getRoleResult.getData().getId()));
Result result = govOrgFeignClient.addStaff(staffSubmitFrom);
if (!result.success()) {
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_MANAGER_ERROR.getCode());
}
}
@Override
public CustomerDetailResultDTO getcustomerDetail(String customerId) {
// 客户信息
CustomerEntity customer = baseDao.selectById(customerId);
CustomerInfoDTO customerInfo = ConvertUtils.sourceToTarget(customer, CustomerInfoDTO.class);
if (customerInfo == null) {
return new CustomerDetailResultDTO();
}
// 根级组织
Result<CustomerAgencyDTO> customerRootAgencyRst = govOrgFeignClient.getCustomerRootAgency(customerId);
if (!customerRootAgencyRst.success()) {
throw new RenException("查询客户详情:查询客户根级组织失败:".concat(customerRootAgencyRst.toString()));
}
CustomerAgencyDTO customerRootAgency = customerRootAgencyRst.getData();
// 管理员
List<GovStaffRoleResultDTO> managers = new ArrayList<>();
if (customerRootAgency != null) {
StaffRoleFormDTO staffsInRoleForm = new StaffRoleFormDTO();
staffsInRoleForm.setOrgId(customerRootAgency.getId());
staffsInRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_MANAGER);
Result<List<GovStaffRoleResultDTO>> managersResult = epmetUserFeignClient.getStaffsInRole(staffsInRoleForm);
if (!managersResult.success()) {
throw new RenException("查询客户详情:查询客户管理员失败:".concat(managersResult.toString()));
}
managers = managersResult.getData();
}
return constructCustomerDetail(customerInfo, customerRootAgency, managers);
}
/**
* 构造客户详情dto
* @param customerInfo
* @param customerRootAgency
* @param managers
* @return
*/
public CustomerDetailResultDTO constructCustomerDetail(CustomerInfoDTO customerInfo,
CustomerAgencyDTO customerRootAgency,
List<GovStaffRoleResultDTO> managers) {
CustomerDetailResultDTO customerDetail = new CustomerDetailResultDTO();
// 构造管理员
if (!CollectionUtils.isEmpty(managers)) {
for (GovStaffRoleResultDTO manager : managers) {
ManagerDTO managerDTO = new ManagerDTO();
managerDTO.setRealName(manager.getRealName());
managerDTO.setMobile(manager.getMobile());
managerDTO.setGender(manager.getGender());
customerDetail.getManagers().add(managerDTO);
}
}
// 客户信息
customerDetail.setCustomerInfoDTO(customerInfo);
// 根级组织
if (customerRootAgency != null) {
RootAgencyDTO rootAgencyDTO = new RootAgencyDTO();
rootAgencyDTO.setAgencyName(customerRootAgency.getOrganizationName());
rootAgencyDTO.setAreaCode(customerRootAgency.getAreaCode());
rootAgencyDTO.setCity(customerRootAgency.getCity());
rootAgencyDTO.setDistrict(customerRootAgency.getDistrict());
rootAgencyDTO.setLevel(customerRootAgency.getLevel());
rootAgencyDTO.setProvince(customerRootAgency.getProvince());
customerDetail.setRootAgencyDTO(rootAgencyDTO);
}
return customerDetail;
}
/**
* 获取客户的有效时长
* @return
*/
private Date getValidityTime() {
int life = 3600 * 1000 * 24 * 365 * 10;
return new Date(new Date().getTime() + Long.valueOf(life));
}
}

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

@ -48,4 +48,11 @@
#{customerId}
</foreach>
</select>
<!--根据名字查询客户-->
<select id="selectByCustomerName" resultType="com.epmet.dto.CustomerDTO">
SELECT *
FROM customer
WHERE CUSTOMER_NAME = #{customerName}
</select>
</mapper>

2
epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-partymember-server:
container_name: resi-partymember-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.30
image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.31
ports:
- "8096:8096"
network_mode: host # 使用现有网络

2
epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-partymember-server:
container_name: resi-partymember-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.30
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.31
ports:
- "8096:8096"
network_mode: host # 使用现有网络

2
epmet-module/resi-partymember/resi-partymember-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
<version>0.3.30</version>
<version>0.3.31</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>resi-partymember</artifactId>

17
epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java

@ -0,0 +1,17 @@
package com.epmet.constant;
/**
* 角色key常量
*/
public class RoleKeyConstants {
public static final String ROLE_KEY_MANAGER = "manager";
public static final String ROLE_KEY_PARTY_PRINCIPALS = "party_principals";
public static final String ROLE_KEY_GRID_MANAGER = "grid_manager";
public static final String ROLE_KEY_AGENCY_LEADER = "agency_leader";
public static final String ROLE_KEY_GRID_PARTY_DIRECTOR = "grid_party_director";
public static final String ROLE_KEY_DEPT_LEADER = "dept_leader";
public static final String ROLE_KEY_STAFF = "staff";
public static final String ROLE_KEY_GRID_MEMBER = "grid_member";
}

8
epmet-user/epmet-user-client/src/main/java/com/epmet/constant/UserWorkType.java

@ -0,0 +1,8 @@
package com.epmet.constant;
public class UserWorkType {
public static final String FULL_TIME="fulltime";
public static final String PART_TIME="parttime";
}

18
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerRoleFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class CustomerRoleFormDTO {
public interface GetRoleByCustomerAndKey{}
@NotBlank(message = "客户ID不能为空", groups = { GetRoleByCustomerAndKey.class })
private String customerId;
@NotBlank(message = "角色Key不能为空", groups = { GetRoleByCustomerAndKey.class })
private String roleKey;
}

8
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java

@ -53,4 +53,12 @@ public class GovStaffRoleResultDTO implements Serializable {
* 角色名称
*/
private String roleName;
/**
* 姓名
*/
private String realName;
private String mobile;
private String gender;
}

86
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java

@ -0,0 +1,86 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 政府端角色模板表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-21
*/
@Data
public class GovStaffRoleTemplateDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 角色key
*/
private String roleKey;
/**
* 角色名称
*/
private String roleName;
/**
* 角色所属体系类型org,dept,grid
*/
private String orgType;
/**
*
*/
private Integer delFlag;
/**
*
*/
private Integer revision;
/**
*
*/
private String createdBy;
/**
*
*/
private Date createdTime;
/**
*
*/
private String updatedBy;
/**
*
*/
private Date updatedTime;
}

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.31
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.32
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
<version>0.3.31</version>
<version>0.3.32</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId>

30
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerRoleFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.form.StaffRoleFormDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
@ -13,12 +14,10 @@ import com.epmet.dto.result.StaffRolesResultDTO;
import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.service.GovStaffRoleService;
import com.epmet.service.StaffRoleService;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
@ -120,4 +119,27 @@ public class StaffRoleController {
public Result<List<String>> specificRolesStaffs(@RequestBody RolesUsersListFormDTO rolesUsersListFormDTO) {
return staffRoleService.getSpecificRolesStaffs(rolesUsersListFormDTO);
}
/**
* 为客户初始化政府端工作人员角色
* @param customerId
* @return
*/
@PostMapping("initrolesforcustomer/{customerId}")
public Result initGovStaffRolesForCustomer(@PathVariable String customerId) {
govStaffRoleService.initGovStaffRolesForCustomer(customerId);
return new Result();
}
/**
* 根据客户ID和角色key查询角色信息
* @param form
* @return
*/
@PostMapping("roleofcustomer")
public Result<GovStaffRoleDTO> getRoleOfCustomer(@RequestBody CustomerRoleFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerRoleFormDTO.GetRoleByCustomerAndKey.class);
GovStaffRoleDTO role = govStaffRoleService.getRoleByCustomerIdAndRoleKey(form.getCustomerId(), form.getRoleKey());
return new Result<GovStaffRoleDTO>().ok(role);
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java

@ -48,4 +48,12 @@ public interface GovStaffRoleDao extends BaseDao<GovStaffRoleEntity> {
* @return
*/
List<GovStaffRoleDTO> selectGovStaffRoleList(GovStaffRoleDTO params);
/**
* 查询客户的指定roleKey的角色信息
* @param customerId
* @param roleKey
* @return
*/
GovStaffRoleDTO getRoleByCustomerIdAndRoleKey(@Param("customerId") String customerId, @Param("roleKey") String roleKey);
}

41
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleTemplateDao.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.GovStaffRoleTemplateDTO;
import com.epmet.entity.GovStaffRoleTemplateEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 政府端角色模板表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-21
*/
@Mapper
public interface GovStaffRoleTemplateDao extends BaseDao<GovStaffRoleTemplateEntity> {
/**
* 列出有效的角色字典
* @return
*/
List<GovStaffRoleTemplateDTO> listValidateRoles();
}

56
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleTemplateEntity.java

@ -0,0 +1,56 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 政府端角色模板表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("gov_staff_role_template")
public class GovStaffRoleTemplateEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 角色key
*/
private String roleKey;
/**
* 角色名称
*/
private String roleName;
/**
* 角色所属体系类型org,dept,grid
*/
private String orgType;
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.entity.GovStaffRoleEntity;
import java.util.List;
@ -106,4 +107,17 @@ public interface GovStaffRoleService extends BaseService<GovStaffRoleEntity> {
* @return
*/
List<GovStaffRoleDTO> getGovStaffRoleList(GovStaffRoleDTO dto);
/**
* 为客户初始化角色列表
* @param customerId
*/
void initGovStaffRolesForCustomer(String customerId);
/**
* 根据客户ID和角色key查询角色信息
* @param customerId
* @param roleKey
*/
GovStaffRoleDTO getRoleByCustomerIdAndRoleKey(String customerId, String roleKey);
}

25
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java

@ -24,7 +24,9 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.GovStaffRoleDao;
import com.epmet.dao.GovStaffRoleTemplateDao;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.result.GovStaffRoleTemplateDTO;
import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.redis.GovStaffRoleRedis;
import com.epmet.service.GovStaffRoleService;
@ -49,6 +51,12 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl<GovStaffRoleDao, Go
@Autowired
private GovStaffRoleRedis govStaffRoleRedis;
@Autowired
private GovStaffRoleTemplateDao govStaffRoleTemplateDao;
@Autowired
private GovStaffRoleDao govStaffRoleDao;
@Override
public PageData<GovStaffRoleDTO> page(Map<String, Object> params) {
IPage<GovStaffRoleEntity> page = baseDao.selectPage(
@ -115,4 +123,21 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl<GovStaffRoleDao, Go
public List<GovStaffRoleDTO> getGovStaffRoleList(GovStaffRoleDTO dto) {
return baseDao.selectGovStaffRoleList(dto);
}
@Override
@Transactional
public void initGovStaffRolesForCustomer(String customerId) {
List<GovStaffRoleTemplateDTO> validRoles = govStaffRoleTemplateDao.listValidateRoles();
for (GovStaffRoleTemplateDTO validRole : validRoles) {
GovStaffRoleEntity entity = ConvertUtils.sourceToTarget(validRole, GovStaffRoleEntity.class);
entity.setCustomerId(customerId);
entity.setId(null);
baseDao.insert(entity);
}
}
@Override
public GovStaffRoleDTO getRoleByCustomerIdAndRoleKey(String customerId, String roleKey) {
return govStaffRoleDao.getRoleByCustomerIdAndRoleKey(customerId, roleKey);
}
}

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -27,12 +27,15 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.GovStaffRoleTemplateDao;
import com.epmet.dao.StaffRoleDao;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.GovStaffRoleTemplateDTO;
import com.epmet.dto.result.StaffRolesResultDTO;
import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.entity.StaffRoleEntity;
import com.epmet.redis.StaffRoleRedis;
import com.epmet.service.StaffRoleService;
@ -58,6 +61,9 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
@Autowired
private StaffRoleRedis staffRoleRedis;
@Autowired
private GovStaffRoleTemplateDao govStaffRoleTemplateDao;
@Override
public PageData<StaffRoleDTO> page(Map<String, Object> params) {
IPage<StaffRoleEntity> page = baseDao.selectPage(

9
epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml

@ -41,4 +41,13 @@
AND ORG_TYPE = 'agency'
ORDER BY SORT ASC
</select>
<!--查询客户的指定roleKey的角色信息-->
<select id="getRoleByCustomerIdAndRoleKey" resultType="com.epmet.dto.GovStaffRoleDTO">
SELECT *
FROM gov_staff_role
WHERE CUSTOMER_ID = #{customerId}
AND ROLE_KEY = #{roleKey}
AND DEL_FLAG = '0'
</select>
</mapper>

27
epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleTemplateDao.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.GovStaffRoleTemplateDao">
<resultMap type="com.epmet.entity.GovStaffRoleTemplateEntity" id="govStaffRoleTemplateMap">
<result property="id" column="ID"/>
<result property="roleKey" column="ROLE_KEY"/>
<result property="roleName" column="ROLE_NAME"/>
<result property="orgType" column="ORG_TYPE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!--列出有效的角色字典-->
<select id="listValidateRoles" resultType="com.epmet.dto.result.GovStaffRoleTemplateDTO">
SELECT *
FROM gov_staff_role_template
WHERE DEL_FLAG = 0
</select>
</mapper>

3
epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

@ -27,10 +27,11 @@
<!--查询具有某角色的staff列表-->
<select id="listStaffIdsByRoleKeyAndOrgId" resultType="com.epmet.dto.result.GovStaffRoleResultDTO">
SELECT sr.STAFF_ID, sr.ROLE_ID, r.ROLE_NAME, r.ROLE_KEY
SELECT sr.STAFF_ID, sr.ROLE_ID, r.ROLE_NAME, r.ROLE_KEY, s.REAL_NAME, s.MOBILE, s.GENDER
FROM
staff_role sr
INNER JOIN gov_staff_role r ON ( sr.ROLE_ID = r.ID )
INNER JOIN customer_staff s ON (sr.STAFF_ID = s.USER_ID)
WHERE
r.ROLE_KEY = #{roleKey}
AND sr.ORG_ID = #{orgId}

Loading…
Cancel
Save