From fa0410e63335bf63450b1f6343a8f12617454575 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 23 Apr 2020 18:25:42 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E7=BB=84=E7=BB=87-?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/StaffsInAgencyFromDTO.java | 28 ++++++++++ .../epmet/dto/result/StaffInfoResultDTO.java | 38 +++++++++++++ .../dto/result/StaffsInAgencyResultDTO.java | 27 ++++++++++ .../CustomerStaffAgencyController.java | 5 ++ .../com/epmet/controller/StaffController.java | 36 +++++++++++++ .../com/epmet/dao/CustomerStaffAgencyDao.java | 9 ++++ .../com/epmet/feign/EpmetUserFeignClient.java | 10 ++++ .../EpmetUserFeignClientFallBack.java | 7 +++ .../service/CustomerStaffAgencyService.java | 10 ++++ .../java/com/epmet/service/StaffService.java | 22 ++++++++ .../impl/CustomerStaffAgencyServiceImpl.java | 19 ++++++- .../epmet/service/impl/StaffServiceImpl.java | 54 +++++++++++++++++++ .../mapper/CustomerStaffAgencyDao.xml | 10 ++++ .../java/com/epmet/dto/CustomerStaffDTO.java | 5 ++ .../controller/CustomerStaffController.java | 12 +++++ .../java/com/epmet/dao/CustomerStaffDao.java | 19 ++++++- .../epmet/service/CustomerStaffService.java | 10 +++- .../impl/CustomerStaffServiceImpl.java | 9 +++- .../resources/mapper/CustomerStaffDao.xml | 27 ++++++++++ 19 files changed, 352 insertions(+), 5 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffsInAgencyFromDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInfoResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffsInAgencyResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffsInAgencyFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffsInAgencyFromDTO.java new file mode 100644 index 0000000000..dc0deddc9d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffsInAgencyFromDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/23 15:45 + */ +@Data +public class StaffsInAgencyFromDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户ID + */ + private String customerId; + /** + * 机关ID + */ + private String agencyId; + /** + * 用户ID + */ + private List staffList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInfoResultDTO.java new file mode 100644 index 0000000000..2859c1171a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInfoResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/23 16:08 + */ +@Data +public class StaffInfoResultDTO implements Serializable { + /** + * 用户ID + */ + private String staffId; + /** + * 用户姓名 + */ + private String staffName; + /** + * 头像 + */ + private String staffHeadPhoto; + /** + * 性别 + */ + private Integer gender; + /** + * 是否禁用(未禁用enable,已禁用disabled) + */ + private String enableFlag; + /** + * 权限名 + */ + private String roleName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffsInAgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffsInAgencyResultDTO.java new file mode 100644 index 0000000000..4c9352466b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffsInAgencyResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/23 15:58 + */ +@NoArgsConstructor +@Data +public class StaffsInAgencyResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 人员总数 + */ + private Integer staffCount; + /** + * 人员列表 + */ + private List staffList; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java index fa1976bf6d..3bfc887aec 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java @@ -26,7 +26,9 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.excel.CustomerStaffAgencyExcel; import com.epmet.service.CustomerStaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -104,4 +106,7 @@ public class CustomerStaffAgencyController { return customerStaffAgencyService.getLatestCustomer(userId); } + + + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java new file mode 100644 index 0000000000..7d57bb3a71 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -0,0 +1,36 @@ +package com.epmet.controller; + + + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffInfoResultDTO; +import com.epmet.dto.result.StaffsInAgencyResultDTO; +import com.epmet.service.StaffService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 组织结构-工作人员 + * @author zhaoqifeng + * @date 2020/4/23 17:59 + */ +@RestController +@RequestMapping("staff") +public class StaffController { + @Autowired + private StaffService staffService; + /** + * 组织首页-工作人员列表 + * @param fromDTO + * @return + */ + @PostMapping("staffsinagency") + public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + return staffService.getStaffInfoForHome(fromDTO); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 828c6cdd98..533c97b2a5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -22,6 +22,8 @@ import com.epmet.dto.CustomerStaffAgencyDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 人员-机关单位关系表 * @@ -37,5 +39,12 @@ public interface CustomerStaffAgencyDao extends BaseDao selectCustomerStaffAgencyList(String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 1774a21c15..217d37c0bb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -5,6 +5,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -33,4 +35,12 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/customerstaff/selectstaffgridlistbyuserid") Result> getStaffGridList(@RequestBody List customerStaffGridDTOS); + /** + * 组织首页-工作人员列表 + * @param fromDTO + * @return + */ + @PostMapping("/epmetuser/customerstaff/staffsinagency") + Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java index 05b26449b3..a4cf20b805 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -6,6 +6,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -25,4 +27,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result> getStaffGridList(List customerStaffGridDTOS) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS); } + + @Override + public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoForHome", fromDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java index 2aaee92578..c713dbde52 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; @@ -102,4 +103,13 @@ public interface CustomerStaffAgencyService extends BaseService getLatestCustomer(String userId); + + /** + * 获取组织下关联人员 + * @param fromDTO + * @return + */ + Result> getCustomerStaffAgencyList(StaffsInAgencyFromDTO fromDTO); + + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java new file mode 100644 index 0000000000..6d5b37c11f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -0,0 +1,22 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffsInAgencyResultDTO; + +/** + * 组织结构-工作人员 + * + * @author zhaoqifeng + * @date 2020/4/23 18:00 + */ +public interface StaffService { + /** + * 组织首页-工作人员列表 + * + * @param fromDTO 参数 + * @return Result + * @author zhaoqifeng + */ + Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index 212e5246a1..77292f2710 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -28,11 +28,16 @@ import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerStaffAgencyDTO; import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.dto.result.StaffInfoResultDTO; +import com.epmet.dto.result.StaffsInAgencyResultDTO; +import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerStaffAgencyRedis; +import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerStaffAgencyService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -42,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 人员-机关单位关系表 @@ -58,6 +64,8 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl page(Map params) { @@ -121,8 +129,7 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl staffInfo = - epmetUserFeignClient.getCustomerStaffInfoByUserId(customerStaffParam); + Result staffInfo = epmetUserFeignClient.getCustomerStaffInfoByUserId(customerStaffParam); resultDTO.setStaffHeadPhoto(staffInfo.getData().getHeadPhoto()); resultDTO.setGender(staffInfo.getData().getGender()); //获取客户名称 @@ -133,4 +140,12 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl().ok(resultDTO); } + @Override + public Result> getCustomerStaffAgencyList(StaffsInAgencyFromDTO fromDTO) { + + List customerStaffAgencyList = baseDao.selectCustomerStaffAgencyList(fromDTO.getAgencyId()); + + return new Result>().ok(customerStaffAgencyList); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java new file mode 100644 index 0000000000..6f3108abd7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -0,0 +1,54 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffInfoResultDTO; +import com.epmet.dto.result.StaffsInAgencyResultDTO; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.OperCrmFeignClient; +import com.epmet.service.CustomerAgencyService; +import com.epmet.service.CustomerStaffAgencyService; +import com.epmet.service.StaffService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/23 18:05 + */ +@Service +public class StaffServiceImpl implements StaffService { + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private OperCrmFeignClient operCrmFeignClient; + @Autowired + private CustomerAgencyService customerAgencyService; + @Autowired + private CustomerStaffAgencyService customerStaffAgencyService; + @Override + public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + StaffsInAgencyResultDTO resultDTO = new StaffsInAgencyResultDTO(); + //获取机关所在客户ID和人员总数 + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + resultDTO.setStaffCount(customerAgencyEntity.getTotalUser()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + List customerStaffAgencyList = customerStaffAgencyService.getCustomerStaffAgencyList(fromDTO).getData(); + if (null == customerStaffAgencyList || customerStaffAgencyList.size() == 0) { + return new Result().ok(null); + } + //提取所有userID + List staffIds = customerStaffAgencyList.stream().map(CustomerStaffAgencyDTO::getUserId).collect(Collectors.toList()); + fromDTO.setStaffList(staffIds); + //获取用户信息 + Result> staffInfoListResult = epmetUserFeignClient.getStaffInfoForHome(fromDTO); + resultDTO.setStaffList(staffInfoListResult.getData()); + return new Result().ok(resultDTO); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 016f75962a..a9b8baea0d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -28,5 +28,15 @@ CREATED_TIME DESC LIMIT 1 + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java index 6fbd80dd49..a247d4e450 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java @@ -128,4 +128,9 @@ public class CustomerStaffDTO implements Serializable { * 客户id */ private String customerId; + + /** + * 角色名称 + */ + private String roleName; } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 103d4163fc..42c39a6022 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -30,6 +30,8 @@ import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.excel.CustomerStaffExcel; import com.epmet.service.CustomerStaffService; import org.springframework.beans.factory.annotation.Autowired; @@ -143,4 +145,14 @@ public class CustomerStaffController { public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { return customerStaffService.getCustomerStaffInfoByUserId(formDTO); } + + /** + * 组织首页-工作人员列表 + * @param fromDTO + * @return + */ + @PostMapping("staffsinagency") + public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + return customerStaffService.getStaffInfoForHome(fromDTO); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index ef1a5955eb..ea050b7501 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -22,6 +22,8 @@ import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import org.apache.ibatis.annotations.Mapper; @@ -54,8 +56,23 @@ public interface CustomerStaffDao extends BaseDao { **/ CustomerStaffDTO selectListCustomerStaffInfo(CustomerStaffFormDTO formDTO); - CustomerStaffDTO selectStaffInfoByUserId(CustomerStaffDTO formDTO); + CustomerStaffDTO selectStaffInfoByUserId(CustomerStaffDTO formDTO); + /** + * 根据userId查询查询网格下的用户信息 + * + * @param customerStaffGridDTOS + * @return + */ + List selectStaffGridListByUserId(List customerStaffGridDTOS); + + /** + * 根据用户ID列表获取用户信息 + * + * @param fromDTO + * @return + */ + List selectCustomerStaffList(StaffsInAgencyFromDTO fromDTO); /** * 根据userId查询查询网格下的用户信息 * @param customerStaffGridDTOS diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 3775510742..4a7ceb335f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -23,8 +23,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import java.util.List; @@ -132,4 +133,11 @@ public interface CustomerStaffService extends BaseService { * @return */ Result> selectStaffGridListByUserId(List customerStaffGridDTOS); + + /** + * 组织首页-工作人员列表 + * @param fromDTO + * @return + */ + Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 4ac6f5a529..560fe0008c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -30,8 +30,9 @@ import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import com.epmet.redis.CustomerStaffRedis; import com.epmet.service.CustomerStaffService; @@ -149,4 +150,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(staffGridListDTOS); } + @Override + public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + List list = baseDao.selectCustomerStaffList(fromDTO); + return new Result>().ok(list); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 8528391aac..ab8ad974a5 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -41,6 +41,33 @@ AND cs.del_flag = 0 + SELECT - ca.pid AS orgId, - ca.CUSTOMER_ID AS customerId, - ca.ORGANIZATION_NAME AS orgName + ca.pid AS agencyId, + ca.ORGANIZATION_NAME AS agencyName, + ca.CUSTOMER_ID AS customerId FROM customer_agency ca WHERE diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerFormDTO.java new file mode 100644 index 0000000000..b4fbbeff49 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 根据客户id查询客户信息 + * @Author yinzuomei + * @Date 2020/4/24 9:09 + */ +@Data +public class CustomerFormDTO implements Serializable { + /** + * 客户id集合 + * */ + private List customerIdList; +} + diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 4e683e3ffc..1605fd6c80 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -26,6 +26,7 @@ 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.CustomerFormDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.excel.CustomerExcel; import com.epmet.service.CustomerService; @@ -144,4 +145,15 @@ public class CustomerController { return customerService.getCustomerInfo(dto); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据客户id查询客户信息 + * @Date 2020/4/24 9:13 + **/ + @PostMapping("queryCustomerList") + public Result> queryCustomerList(@RequestBody CustomerFormDTO formDTO) { + return customerService.queryCustomerList(formDTO); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java index 661cc151c4..6a958cc6d2 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java @@ -18,9 +18,11 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.entity.CustomerEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -40,4 +42,13 @@ public interface CustomerDao extends BaseDao { * @date 2020-03-11 */ List selectListValidCustomerResultDTO(); + + /** + * @return java.util.List + * @param customerIdList + * @Author yinzuomei + * @Description 根据客户id查询客户信息 + * @Date 2020/4/24 9:21 + **/ + List selectListByIds(@Param("customerIdList") List customerIdList); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index b36bd6f5b2..a50c87a138 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; 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.result.ValidCustomerResultDTO; import com.epmet.entity.CustomerEntity; @@ -120,4 +121,13 @@ public interface CustomerService extends BaseService { * @return */ Result getCustomerInfo(CustomerDTO dto); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据客户id查询客户信息 + * @Date 2020/4/24 9:13 + **/ + Result> queryCustomerList(CustomerFormDTO formDTO); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 5384193128..89bab2936a 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerDao; import com.epmet.dto.CustomerDTO; +import com.epmet.dto.form.CustomerFormDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.entity.CustomerEntity; import com.epmet.redis.CustomerRedis; @@ -135,4 +136,10 @@ public class CustomerServiceImpl extends BaseServiceImpl().ok(ConvertUtils.sourceToTarget(entity, CustomerDTO.class)); } + @Override + public Result> queryCustomerList(CustomerFormDTO formDTO) { + List customerDTOList = baseDao.selectListByIds(formDTO.getCustomerIdList()); + return new Result>().ok(customerDTOList); + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml index 2a7e3c22ab..340883f472 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml @@ -34,4 +34,18 @@ ORDER BY CONVERT ( c.CUSTOMER_NAME USING gbk ) ASC + + + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java index 126dfd728c..11fb4702ca 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java @@ -112,7 +112,7 @@ public class StaffAgencyVisitedServiceImpl extends BaseServiceImpl getLatestStaffWechatLoginRecord(String openId) { - if (StringUtils.isNotBlank(openId)) { + if (StringUtils.isBlank(openId)) { logger.error("openId 不能为空"); return new Result(); } From 055520dd82718664b41904cc38dc90e08020ffe3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Apr 2020 10:07:23 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/security/dto/GovTokenDto.java | 6 +++ .../epmet/service/CustomerAgencyService.java | 40 +++++++++++++++++++ .../java/com/epmet/dao/CustomerStaffDao.java | 6 --- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java index 2a8fd7c05b..bfb7e6dc67 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java @@ -4,6 +4,7 @@ import lombok.Data; import java.io.Serializable; import java.util.List; +import java.util.Set; /** * @Description 政府端登录信息 @@ -62,5 +63,10 @@ public class GovTokenDto extends BaseTokenDto implements Serializable { * 最后一次更新时间 */ private long updateTime; + + /** + * 功能权限列表,实际上是gov_staff => staff_role => role_operation查询到的operationKey + */ + private List permissions; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 24a4e17b35..7076fe6d2d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -107,4 +107,44 @@ public interface CustomerAgencyService extends BaseService * @Date 2020/4/20 21:45 **/ Result> getStaffOrgList(StaffOrgFormDTO staffOrgsFormDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加组织 + */ + Result addAgency(AddAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织名称编辑 + */ + Result editAgency(EditAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除组织机关 + */ + Result removeAgency(RemoveAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取组织机构信息 + */ + Result agencyDetail(AgencydetailFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-下级机关列表 + */ + Result subAgencyList(SubAgencyFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index ea050b7501..b552832c2d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -73,12 +73,6 @@ public interface CustomerStaffDao extends BaseDao { * @return */ List selectCustomerStaffList(StaffsInAgencyFromDTO fromDTO); - /** - * 根据userId查询查询网格下的用户信息 - * @param customerStaffGridDTOS - * @return - */ - List selectStaffGridListByUserId(List customerStaffGridDTOS); /** * @return com.epmet.entity.CustomerStaffEntity From 30849f12da06f80c9c6790b89b289d224880239d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Apr 2020 10:24:29 +0800 Subject: [PATCH 5/5] =?UTF-8?q?gov=E7=AB=AF=E7=82=B9=E7=99=BB=E5=BD=95toke?= =?UTF-8?q?n=E5=AD=97=E7=AC=A6=E4=B8=B2=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/GovLoginServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 0928771668..35ce90b25c 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -255,9 +255,9 @@ public class GovLoginServiceImpl implements GovLoginService { Map map = new HashMap<>(); map.put("app", LoginConstant.APP_GOV); map.put("client", LoginConstant.CLIENT_WXMP); - map.put("staffId", staffId); + map.put("userId", staffId); String token = jwtTokenUtils.createToken(map); - logger.info("app:" + LoginConstant.APP_GOV + ";client:" + LoginConstant.CLIENT_WXMP + ";staffId:" + staffId + ";生成token[" + token + "]"); + logger.info("app:" + LoginConstant.APP_GOV + ";client:" + LoginConstant.CLIENT_WXMP + ";userId:" + staffId + ";生成token[" + token + "]"); return token; }