From 6de6509b1919b712d982c66a9a3f948e61499351 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Apr 2020 16:15:53 +0800 Subject: [PATCH 001/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E7=99=BB=E5=BD=95=E5=8F=91=E9=80=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E3=80=81wxCode=E8=8E=B7=E5=8F=96=E6=9C=80?= =?UTF-8?q?=E8=BF=91=E4=B8=80=E6=AC=A1=E7=99=BB=E5=BD=95=E8=B4=A6=E6=88=B7?= =?UTF-8?q?token=E3=80=81enterorg=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/pom.xml | 14 +- .../epmet/controller/GovLoginController.java | 81 ++++++ .../com/epmet/controller/LoginController.java | 31 +- .../epmet/dto/form/GovWxmpEnteOrgFormDTO.java | 39 +++ .../com/epmet/dto/form/GovWxmpFormDTO.java | 21 ++ ...ormDTO.java => GovWxmpGetOrgsFormDTO.java} | 10 +- .../epmet/dto/form/SendSmsCodeFormDTO.java | 4 +- .../com/epmet/feign/EpmetUserFeignClient.java | 43 ++- .../com/epmet/feign/GovOrgFeignClient.java | 23 ++ .../EpmetUserFeignClientFallback.java | 24 +- .../fallback/GovOrgFeignClientFallback.java | 25 ++ .../java/com/epmet/redis/CaptchaRedis.java | 9 +- .../com/epmet/service/GovLoginService.java | 51 ++++ .../java/com/epmet/service/LoginService.java | 19 -- .../service/impl/GovLoginServiceImpl.java | 264 ++++++++++++++++++ .../epmet/service/impl/LoginServiceImpl.java | 99 ------- .../commons/tools/annotation/LoginUser.java | 2 +- .../tools/exception/EpmetErrorCode.java | 1 + .../tools/security/dto/GovTokenDto.java | 80 ++++++ ...oginUserHandlerMethodArgumentResolver.java | 11 +- .../tools/utils/CpUserDetailRedis.java | 31 ++ epmet-gateway/pom.xml | 60 ++-- .../epmet/dto/form/StaffGridInfoFormDTO.java | 30 ++ .../dto/result/StaffGridInfoResultDTO.java | 39 +++ .../controller/CustomerGridController.java | 19 +- .../java/com/epmet/dao/CustomerGridDao.java | 16 +- .../epmet/service/CustomerGridService.java | 11 + .../service/impl/CustomerGridServiceImpl.java | 8 + .../main/resources/mapper/CustomerGridDao.xml | 20 ++ .../epmet/controller/OperMenuController.java | 13 +- .../epmet/controller/CustomerController.java | 3 +- .../controller/ResiCommentController.java | 6 +- .../group/controller/ResiGroupController.java | 34 ++- .../controller/GroupInvitationController.java | 11 +- .../controller/ResiGroupMemberController.java | 25 +- .../topic/controller/ResiTopicController.java | 17 +- .../StrangerResiGuideController.java | 3 +- .../epmet/controller/UserGuideController.java | 3 +- .../controller/ResiMineGridController.java | 3 +- .../controller/UserMessageController.java | 7 +- .../controller/PartyMemberController.java | 9 +- .../controller/ResiRegisterController.java | 7 +- .../controller/ResiWarmheartedController.java | 5 +- .../com/epmet/dto/StaffLoginHistoryDTO.java | 102 +++++++ .../epmet/dto/form/CustomerStaffFormDTO.java | 21 ++ .../dto/form/StaffLoginHistoryFormDTO.java | 44 +++ .../LatestStaffWechatLoginResultDTO.java | 46 +++ .../controller/CustomerStaffController.java | 36 ++- .../epmet/controller/OperUserController.java | 3 +- .../StaffLoginHistoryController.java | 64 +++++ .../com/epmet/controller/UserController.java | 3 +- .../java/com/epmet/dao/CustomerStaffDao.java | 23 +- .../com/epmet/dao/StaffLoginHistoryDao.java | 42 +++ .../epmet/entity/StaffLoginHistoryEntity.java | 68 +++++ .../epmet/service/CustomerStaffService.java | 14 +- .../service/StaffLoginHistoryService.java | 116 ++++++++ .../impl/CustomerStaffServiceImpl.java | 26 +- .../impl/StaffLoginHistoryServiceImpl.java | 121 ++++++++ .../resources/db/migration/epmet_user.sql | 20 +- .../resources/mapper/CustomerStaffDao.xml | 34 +-- .../resources/mapper/StaffLoginHistoryDao.xml | 40 +++ 61 files changed, 1705 insertions(+), 349 deletions(-) create mode 100644 epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java rename epmet-auth/src/main/java/com/epmet/dto/form/{LoginByPhoneFormDTO.java => GovWxmpGetOrgsFormDTO.java} (60%) create mode 100644 epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java create mode 100644 epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java create mode 100644 epmet-auth/src/main/java/com/epmet/service/GovLoginService.java create mode 100644 epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffGridInfoFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffGridInfoResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffLoginHistoryDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginHistoryFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestStaffWechatLoginResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffLoginHistoryController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffLoginHistoryDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffLoginHistoryEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffLoginHistoryService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffLoginHistoryServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/StaffLoginHistoryDao.xml diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 9d1876810e..be588da1e1 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -92,6 +92,12 @@ 2.0.0 compile + + com.epmet + gov-org-client + 2.0.0 + compile + @@ -187,8 +193,8 @@ wx9b6102a8ee5add65 16fdb68bc2b3e732324ba5d8b8a9b5e2 - wx3d1372029eb816a3 - 651f02d71ed3f123dfb584b8bf0f4d8b + wx3d1372029eb816a3 + 651f02d71ed3f123dfb584b8bf0f4d8b @@ -224,8 +230,8 @@ wx9b6102a8ee5add65 16fdb68bc2b3e732324ba5d8b8a9b5e2 - wx3d1372029eb816a3 - 651f02d71ed3f123dfb584b8bf0f4d8b + wx3d1372029eb816a3 + 651f02d71ed3f123dfb584b8bf0f4d8b diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java new file mode 100644 index 0000000000..0539be499d --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java @@ -0,0 +1,81 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.GovWxmpEnteOrgFormDTO; +import com.epmet.dto.form.GovWxmpFormDTO; +import com.epmet.dto.form.GovWxmpGetOrgsFormDTO; +import com.epmet.dto.form.SendSmsCodeFormDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.service.GovLoginService; +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; + +/** + * @Description 政府端登录 + * @Author yinzuomei + * @Date 2020/4/20 10:54 + */ +@RestController +@RequestMapping("gov") +public class GovLoginController { + @Autowired + private GovLoginService govLoginService; + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 1、政府端小程序根据wxCode获取上一次登录信息,返回token + * @Date 2020/4/20 11:22 + **/ + @PostMapping(value = "/loginwxmp/loginbywxcode") + public Result loginByWxCode(GovWxmpFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return govLoginService.loginByWxCode(formDTO); + } + + /** + * @param formDTO 手机号 + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 2、政府端微信小程序登录-发送验证码 + * @Date 2020/4/18 10:58 + **/ + @PostMapping(value = "/loginwxmp/sendsmscode") + public Result sendSmsCode(@RequestBody SendSmsCodeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return govLoginService.sendSmsCode(formDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 3、手机验证码获取组织 + * @Date 2020/4/18 21:14 + **/ + @PostMapping(value = "/loginwxmp/getorgs") + public Result getorgs(GovWxmpGetOrgsFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return govLoginService.getorgs(formDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 4、选择组织,进入首页 + * @Date 2020/4/20 13:07 + **/ + @PostMapping(value = "/loginwxmp/enterorg") + public Result enterOrg(GovWxmpEnteOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return govLoginService.enterOrg(formDTO); + } + +} + diff --git a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java index 47c778977a..dc876a1ccc 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -1,15 +1,12 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.LoginByPassWordFormDTO; -import com.epmet.dto.form.LoginByPhoneFormDTO; import com.epmet.dto.form.LoginByWxCodeFormDTO; -import com.epmet.dto.form.SendSmsCodeFormDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.CaptchaService; import com.epmet.service.LoginService; @@ -95,34 +92,8 @@ public class LoginController { * @Date 2020/3/18 22:43 **/ @PostMapping(value = "logout") - public Result logout(@LoginUser TokenDto tokenDto, HttpServletRequest request) { + public Result logout(TokenDto tokenDto, HttpServletRequest request) { //String token = request.getParameter(Constant.TOKEN_HEADER); return loginService.logoutByToken(tokenDto); } - - /** - * @param formDTO 手机号 - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 政府端微信小程序登录-发送验证码 - * @Date 2020/4/18 10:58 - **/ - @PostMapping(value = "/govwxmp/sendsmscode") - public Result sendSmsCode(@RequestBody SendSmsCodeFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); - return loginService.sendSmsCode(formDTO); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 政府端微信小程序登录-手机验证码登录 - * @Date 2020/4/18 21:14 - **/ - @PostMapping(value = "/govwxmp/loginbyphone") - public Result loginByPhone(LoginByPhoneFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); - return loginService.loginByPhone(formDTO); - } } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java new file mode 100644 index 0000000000..8655268c8e --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 选择组织,进入首页入参Dto + * @Author yinzuomei + * @Date 2020/4/20 13:03 + */ +@Data +public class GovWxmpEnteOrgFormDTO implements Serializable { + /** + * wxCode + */ + @NotBlank(message = "wxCode不能为空") + private String wxCode; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空") + private String mobile; + + /** + * 选择的组织所属的id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; + + /** + * 选择的要进入的组织(根组织id) + */ + @NotBlank(message = "组织id不能为空") + private String orgId; +} + diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java new file mode 100644 index 0000000000..72c43cbfa7 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description 政府端小程序根据wxCode获取上一次登录信息,返回token + * @Author yinzuomei + * @Date 2020/4/20 11:20 + */ +@Data +public class GovWxmpFormDTO extends LoginCommonFormDTO{ + private static final long serialVersionUID = -207861963128774742L; + /** + * wxCode + */ + @NotBlank(message = "wxCode不能为空") + private String wxCode; +} + diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPhoneFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpGetOrgsFormDTO.java similarity index 60% rename from epmet-auth/src/main/java/com/epmet/dto/form/LoginByPhoneFormDTO.java rename to epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpGetOrgsFormDTO.java index 591e6063b1..b2674f3277 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPhoneFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpGetOrgsFormDTO.java @@ -6,22 +6,18 @@ import javax.validation.constraints.NotBlank; import java.io.Serializable; /** - * @Description 政府端手机号+验证码登录接口入参 + * @Description 手机验证码获取组织接口入参 * @Author yinzuomei * @Date 2020/4/18 10:38 */ @Data -public class LoginByPhoneFormDTO extends LoginCommonFormDTO implements Serializable { +public class GovWxmpGetOrgsFormDTO implements Serializable { private static final long serialVersionUID = 4193133227120225342L; - @NotBlank(message = "wxCode不能为空") - private String wxCode; - @NotBlank(message = "手机号不能为空") - private String phone; + private String mobile; @NotBlank(message="验证码不能为空") private String smsCode; - } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/SendSmsCodeFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/SendSmsCodeFormDTO.java index 806ddc43e2..8d82624aee 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/SendSmsCodeFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SendSmsCodeFormDTO.java @@ -11,9 +11,9 @@ import java.io.Serializable; * @Date 2020/04/18 10:26 */ @Data -public class SendSmsCodeFormDTO extends LoginCommonFormDTO implements Serializable { +public class SendSmsCodeFormDTO implements Serializable { private static final long serialVersionUID = -1852541457359282018L; @NotBlank(message = "手机号不能为空") - private String phone; + private String mobile; } diff --git a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 5b339e18ce..45fe847c49 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -5,9 +5,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; -import com.epmet.dto.form.PasswordLoginUserInfoFormDTO; -import com.epmet.dto.form.StaffWechatFormDTO; -import com.epmet.dto.form.WxLoginUserInfoFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -17,6 +16,8 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import java.util.List; + /** * @Description * @Author yinzuomei @@ -58,14 +59,14 @@ public interface EpmetUserFeignClient { Result selectLoginUserInfoByPassword(@RequestBody PasswordLoginUserInfoFormDTO passwordLoginUserInfoFormDTO); /** - * @param phone + * @param mobile * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei * @Description 根据手机号查询政府端工作人员基本信息,校验用户是否存在 * @Date 2020/4/18 14:03 **/ - @GetMapping(value = "epmetuser/customerstaff/getcustsomerstaffbyphone/{phone}") - Result checkCustomerStaff(@PathVariable("phone") String phone); + @GetMapping(value = "epmetuser/customerstaff/getcustsomerstaffbyphone/{mobile}") + Result> checkCustomerStaff(@PathVariable("mobile") String mobile); /** * @param staffWechatFormDTO @@ -76,4 +77,34 @@ public interface EpmetUserFeignClient { **/ @PostMapping(value = "epmetuser/staffwechat/savestaffwechat", consumes = MediaType.APPLICATION_JSON_VALUE) Result savestaffwechat(@RequestBody StaffWechatFormDTO staffWechatFormDTO); + + /** + * @param openId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取当前微信上次登录的账号信息 + * @Date 2020/4/20 12:53 + **/ + @GetMapping(value = "epmetuser/staffloginhistory/getlatest/{openId}") + Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId); + + /** + * @param customerStaffFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据手机号+客户id获取工作人员基本信息 + * @Date 2020/4/20 14:16 + **/ + @PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfo", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getCustomerStaffInfo(@RequestBody CustomerStaffFormDTO customerStaffFormDTO); + + /** + * @param staffLoginHistoryFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存登录日志 + * @Date 2020/4/20 14:38 + **/ + @PostMapping(value = "epmetuser/staffloginhistory/saveStaffLoginRecord", consumes = MediaType.APPLICATION_JSON_VALUE) + Result saveStaffLoginRecord(StaffLoginHistoryFormDTO staffLoginHistoryFormDTO); } diff --git a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java new file mode 100644 index 0000000000..0d3fe7c566 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -0,0 +1,23 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.StaffGridInfoFormDTO; +import com.epmet.dto.result.StaffGridInfoResultDTO; +import com.epmet.feign.fallback.GovOrgFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * @Description 政府端组织机构模块 + * @Author yinzuomei + * @Date 2020/4/20 15:18 + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallback.class) +public interface GovOrgFeignClient { + @PostMapping(value = "getStaffGridInfo",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO); +} diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 60b63d04da..9126cf63b8 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -6,13 +6,14 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; -import com.epmet.dto.form.PasswordLoginUserInfoFormDTO; -import com.epmet.dto.form.StaffWechatFormDTO; -import com.epmet.dto.form.WxLoginUserInfoFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * @Description * @Author yinzuomei @@ -37,7 +38,7 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { } @Override - public Result checkCustomerStaff(String phone) { + public Result> checkCustomerStaff(String phone) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByPhone", phone); } @@ -46,4 +47,19 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffWechat", staffWechatFormDTO); } + @Override + public Result getLatestStaffWechatLoginRecord(String openId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLatestStaffWechatLoginRecord", openId); + } + + @Override + public Result getCustomerStaffInfo(CustomerStaffFormDTO customerStaffFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfo", customerStaffFormDTO); + } + + @Override + public Result saveStaffLoginRecord(StaffLoginHistoryFormDTO staffLoginHistoryFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffLoginRecord", staffLoginHistoryFormDTO); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java new file mode 100644 index 0000000000..94a235f3ec --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java @@ -0,0 +1,25 @@ +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.form.StaffGridInfoFormDTO; +import com.epmet.dto.result.StaffGridInfoResultDTO; +import com.epmet.feign.GovOrgFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Description 政府端组织机构模块 + * @Author yinzuomei + * @Date 2020/4/20 15:19 + */ +@Component +public class GovOrgFeignClientFallback implements GovOrgFeignClient { + @Override + public Result> getStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridInfo", staffGridInfoFormDTO); + } +} + diff --git a/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java b/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java index 7363eb93c2..0ec9158dae 100644 --- a/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java +++ b/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java @@ -8,9 +8,10 @@ package com.epmet.redis; +import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.dto.form.LoginByPhoneFormDTO; +import com.epmet.dto.form.GovWxmpGetOrgsFormDTO; import com.epmet.dto.form.SendSmsCodeFormDTO; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -65,7 +66,7 @@ public class CaptchaRedis { * @Date 2020/4/18 13:53 **/ public void saveSmsCode(SendSmsCodeFormDTO sendSmsCodeFormDTO, String smsCode) { - String smsCodeKey = RedisKeys.getLoginSmsCodeKey(sendSmsCodeFormDTO.getApp(), sendSmsCodeFormDTO.getClient(), sendSmsCodeFormDTO.getPhone()); + String smsCodeKey = RedisKeys.getLoginSmsCodeKey(LoginConstant.APP_GOV, LoginConstant.CLIENT_WXMP, sendSmsCodeFormDTO.getMobile()); logger.info(String.format("短信验证码key=%s", smsCodeKey)); redisUtils.set(smsCodeKey, smsCode, MINUTE_THIRTY_EXPIRE); } @@ -77,8 +78,8 @@ public class CaptchaRedis { * @Description 获取登录时发送的验证码 * @Date 2020/4/18 21:33 **/ - public String getSmsCode(LoginByPhoneFormDTO formDTO) { - String smsCodeKey = RedisKeys.getLoginSmsCodeKey(formDTO.getApp(), formDTO.getClient(), formDTO.getPhone()); + public String getSmsCode(GovWxmpGetOrgsFormDTO formDTO) { + String smsCodeKey = RedisKeys.getLoginSmsCodeKey(LoginConstant.APP_GOV, LoginConstant.CLIENT_WXMP, formDTO.getMobile()); String smsCode = (String) redisUtils.get(smsCodeKey); return smsCode; } diff --git a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java new file mode 100644 index 0000000000..b805bbf217 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java @@ -0,0 +1,51 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.GovWxmpEnteOrgFormDTO; +import com.epmet.dto.form.GovWxmpFormDTO; +import com.epmet.dto.form.GovWxmpGetOrgsFormDTO; +import com.epmet.dto.form.SendSmsCodeFormDTO; +import com.epmet.dto.result.UserTokenResultDTO; + +/** + * @Description 政府端登录服务 + * @Author yinzuomei + * @Date 2020/4/20 10:56 + */ +public interface GovLoginService { + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 政府端微信小程序登录-发送验证码 + * @Date 2020/4/18 10:59 + **/ + Result sendSmsCode(SendSmsCodeFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 3、手机验证码获取组织 + * @Date 2020/4/18 21:11 + **/ + Result getorgs(GovWxmpGetOrgsFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 政府端小程序根据wxCode获取上一次登录信息,返回token + * @Date 2020/4/20 11:23 + **/ + Result loginByWxCode(GovWxmpFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 4、选择组织,进入首页 + * @Date 2020/4/20 13:08 + **/ + Result enterOrg(GovWxmpEnteOrgFormDTO formDTO); +} diff --git a/epmet-auth/src/main/java/com/epmet/service/LoginService.java b/epmet-auth/src/main/java/com/epmet/service/LoginService.java index 1433393413..37ab5f8f74 100644 --- a/epmet-auth/src/main/java/com/epmet/service/LoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/LoginService.java @@ -4,9 +4,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.LoginByPassWordFormDTO; -import com.epmet.dto.form.LoginByPhoneFormDTO; import com.epmet.dto.form.LoginByWxCodeFormDTO; -import com.epmet.dto.form.SendSmsCodeFormDTO; import com.epmet.dto.result.UserTokenResultDTO; /** @@ -52,21 +50,4 @@ public interface LoginService { **/ WxMaJscode2SessionResult getWxMaUser(String app, String wxCode); - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 政府端微信小程序登录-发送验证码 - * @Date 2020/4/18 10:59 - **/ - Result sendSmsCode(SendSmsCodeFormDTO formDTO); - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 政府端微信小程序登录-手机验证码登录 - * @Date 2020/4/18 21:11 - **/ - Result loginByPhone(LoginByPhoneFormDTO formDTO); } 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 new file mode 100644 index 0000000000..f41e0b81d9 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -0,0 +1,264 @@ +package com.epmet.service.impl; + +import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; +import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.commons.tools.utils.CpUserDetailRedis; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.PhoneValidatorUtils; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; +import com.epmet.dto.result.StaffGridInfoResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.GovOrgFeignClient; +import com.epmet.feign.MessageFeignClient; +import com.epmet.jwt.JwtTokenProperties; +import com.epmet.jwt.JwtTokenUtils; +import com.epmet.redis.CaptchaRedis; +import com.epmet.service.GovLoginService; +import com.epmet.service.LoginService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description 政府端登录服务 + * @Author yinzuomei + * @Date 2020/4/20 10:56 + */ +@Service +public class GovLoginServiceImpl implements GovLoginService { + private static final Logger logger = LoggerFactory.getLogger(GovLoginServiceImpl.class); + private static final String SEND_SMS_CODE_ERROR = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]"; + @Autowired + private LoginService loginService; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private CaptchaRedis captchaRedis; + @Autowired + private MessageFeignClient messageFeignClient; + @Autowired + private JwtTokenUtils jwtTokenUtils; + @Autowired + private JwtTokenProperties jwtTokenProperties; + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + @Autowired + private GovOrgFeignClient govOrgFeignClient; + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 政府端微信小程序登录-发送验证码 + * @Date 2020/4/18 10:59 + **/ + @Override + public Result sendSmsCode(SendSmsCodeFormDTO formDTO) { + //1、校验手机号是否符合规范 + if (!PhoneValidatorUtils.isMobile(formDTO.getMobile())) { + logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg())); + return new Result().error(EpmetErrorCode.ERROR_PHONE.getCode()); + } + //2、根据手机号校验用户是否存在 + Result> customerStaffResult = epmetUserFeignClient.checkCustomerStaff(formDTO.getMobile()); + if (!customerStaffResult.success()) { + logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); + return new Result().error(customerStaffResult.getCode()); + } + //3、发送短信验证码 + Result> smsCodeResult = messageFeignClient.sendSmsCaptcha(formDTO.getMobile()); + if (!smsCodeResult.success()) { + logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), smsCodeResult.getCode(), smsCodeResult.getMsg())); + return new Result().error(smsCodeResult.getCode()); + } + //4、保存短信验证码(删除现有短信验证码、将新的短信验证码存入Redis) + captchaRedis.saveSmsCode(formDTO, smsCodeResult.getData().get("code")); + logger.info(String.format("发送短信验证码成功,手机号[%s]", formDTO.getMobile())); + return new Result(); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 3、手机验证码获取组织 + * @Date 2020/4/18 21:11 + **/ + @Override + public Result getorgs(GovWxmpGetOrgsFormDTO formDTO) { + //1、根据手机号查询到用户信息 + Result> customerStaffResult = epmetUserFeignClient.checkCustomerStaff(formDTO.getMobile()); + if (!customerStaffResult.success()) { + logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); + return new Result().error(customerStaffResult.getCode()); + } + //2、验证码是否正确 + String rightSmsCode = captchaRedis.getSmsCode(formDTO); + if (!formDTO.getSmsCode().equals(rightSmsCode)) { + return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + } + //3、TODO返回组织树 + return new Result(); + } + + @Override + public Result loginByWxCode(GovWxmpFormDTO formDTO) { + //1、解析微信用户 + WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(formDTO.getApp(), formDTO.getWxCode()); + Result latestStaffWechat = epmetUserFeignClient.getLatestStaffWechatLoginRecord(wxMaJscode2SessionResult.getOpenid()); + if (!latestStaffWechat.success() || null == latestStaffWechat.getData()) { + logger.error(String.format("没有获取到用户最近一次登录账户信息,code[%s],msg[%s]", EpmetErrorCode.PLEASE_LOGIN.getCode(), EpmetErrorCode.PLEASE_LOGIN.getMsg())); + return new Result().error(EpmetErrorCode.PLEASE_LOGIN.getCode()); + } + LatestStaffWechatLoginResultDTO latestStaffWechatLoginDTO = latestStaffWechat.getData(); + //2、记录staff_wechat + this.savestaffwechat(latestStaffWechatLoginDTO.getStaffId(), wxMaJscode2SessionResult.getOpenid()); + //3、记录登录日志 + this.saveStaffLoginRecord(latestStaffWechatLoginDTO); + //4、获取用户token + String token = this.generateGovWxmpToken(latestStaffWechatLoginDTO.getStaffId()); + //5、保存到redis + this.saveGovTokenDto(latestStaffWechatLoginDTO.getOrgId(), latestStaffWechatLoginDTO.getGridId(), latestStaffWechatLoginDTO.getStaffId(), wxMaJscode2SessionResult, token); + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + return new Result().ok(userTokenResultDTO); + } + + //保存登录日志 + private Result saveStaffLoginRecord(LatestStaffWechatLoginResultDTO latestStaffWechatLoginDTO) { + StaffLoginHistoryFormDTO staffLoginHistoryFormDTO = new StaffLoginHistoryFormDTO(); + staffLoginHistoryFormDTO.setCustomerId(latestStaffWechatLoginDTO.getCustomerId()); + staffLoginHistoryFormDTO.setStaffId(latestStaffWechatLoginDTO.getStaffId()); + staffLoginHistoryFormDTO.setWxOpenId(latestStaffWechatLoginDTO.getWxOpenId()); + staffLoginHistoryFormDTO.setMobile(latestStaffWechatLoginDTO.getMobile()); + staffLoginHistoryFormDTO.setOrgId(latestStaffWechatLoginDTO.getOrgId()); + staffLoginHistoryFormDTO.setGridId(latestStaffWechatLoginDTO.getGridId()); + Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginHistoryFormDTO); + return staffLoginRecordResult; + } + + @Override + public Result enterOrg(GovWxmpEnteOrgFormDTO formDTO) { + //1、需要校验要登录的客户,是否被禁用 + CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); + customerStaffFormDTO.setCustomerId(formDTO.getCustomerId()); + customerStaffFormDTO.setMobile(formDTO.getMobile()); + Result customerStaffDTOResult = epmetUserFeignClient.getCustomerStaffInfo(customerStaffFormDTO); + if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { + logger.error(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + return new Result().error(customerStaffDTOResult.getCode()); + } + CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); + //2、解析微信用户 + WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode()); + //3、记录staff_wechat + this.savestaffwechat(customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); + //4、记录登录日志 + StaffGridInfoFormDTO staffGridInfoFormDTO = new StaffGridInfoFormDTO(); + staffGridInfoFormDTO.setCustomerId(formDTO.getCustomerId()); + staffGridInfoFormDTO.setOrgId(formDTO.getOrgId()); + staffGridInfoFormDTO.setStaffId(customerStaff.getUserId()); + Result> staffGridInfoListResult = govOrgFeignClient.getStaffGridInfo(staffGridInfoFormDTO); + String gridId = null; + if (staffGridInfoListResult.success() && null != staffGridInfoListResult.getData() && staffGridInfoListResult.getData().size() > 0) { + gridId = staffGridInfoListResult.getData().get(0).getGridId(); + } + this.saveStaffLoginRecord(formDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid(), gridId); + UserTokenResultDTO userTokenResultDTO = this.getAuthorizationInfo(formDTO.getOrgId(), gridId, customerStaff.getUserId(), wxMaJscode2SessionResult); + return new Result().ok(userTokenResultDTO); + } + + //保存登录日志 + private Result saveStaffLoginRecord(GovWxmpEnteOrgFormDTO formDTO, String staffId, String openId, String grid) { + StaffLoginHistoryFormDTO staffLoginHistoryFormDTO = new StaffLoginHistoryFormDTO(); + staffLoginHistoryFormDTO.setCustomerId(formDTO.getCustomerId()); + staffLoginHistoryFormDTO.setStaffId(staffId); + staffLoginHistoryFormDTO.setWxOpenId(openId); + staffLoginHistoryFormDTO.setMobile(formDTO.getMobile()); + staffLoginHistoryFormDTO.setOrgId(formDTO.getOrgId()); + staffLoginHistoryFormDTO.setGridId(grid); + Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginHistoryFormDTO); + return staffLoginRecordResult; + } + + private UserTokenResultDTO getAuthorizationInfo(String orgId, + String gridId, + String staffId, + WxMaJscode2SessionResult wxMaJscode2SessionResult) { + //1、获取用户token + String token = this.generateGovWxmpToken(staffId); + //2、保存到redis + this.saveGovTokenDto(orgId, gridId, staffId, wxMaJscode2SessionResult, token); + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + return userTokenResultDTO; + } + + /** + * @param userId + * @param openid + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存微信和当前登录用户关系 + * @Date 2020/4/18 22:54 + **/ + private Result savestaffwechat(String userId, String openid) { + StaffWechatFormDTO staffWechatFormDTO = new StaffWechatFormDTO(); + staffWechatFormDTO.setUserId(userId); + staffWechatFormDTO.setWxOpenId(openid); + return epmetUserFeignClient.savestaffwechat(staffWechatFormDTO); + } + + /** + * @Description 生成token + * @Date 2020/4/18 23:04 + **/ + private String generateGovWxmpToken(String staffId) { + Map map = new HashMap<>(); + map.put("app", LoginConstant.APP_GOV); + map.put("client", LoginConstant.CLIENT_WXMP); + map.put("staffId", staffId); + String token = jwtTokenUtils.createToken(map); + logger.info("app:" + LoginConstant.APP_GOV + ";client:" + LoginConstant.CLIENT_WXMP + ";staffId:" + staffId + ";生成token[" + token + "]"); + return token; + } + + /** + * @Description 生成token + * @Date 2020/4/18 23:04 + **/ + private String saveGovTokenDto(String orgId, + String gridId, + String staffId, + WxMaJscode2SessionResult wxMaJscode2SessionResult, + String token) { + int expire = jwtTokenProperties.getExpire(); + GovTokenDto govTokenDto = new GovTokenDto(); + govTokenDto.setApp(LoginConstant.APP_GOV); + govTokenDto.setClient(LoginConstant.CLIENT_WXMP); + govTokenDto.setStaffId(staffId); + govTokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid()); + govTokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey()); + govTokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid()); + govTokenDto.setToken(token); + govTokenDto.setUpdateTime(System.currentTimeMillis()); + govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + govTokenDto.setOrgId(orgId); + govTokenDto.setGridId(gridId); + cpUserDetailRedis.set(govTokenDto, expire); + logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); + return token; + } +} + diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 669c0596a5..225e2520fb 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -3,7 +3,6 @@ package com.epmet.service.impl; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; import com.epmet.common.token.constant.LoginConstant; -import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; @@ -11,18 +10,14 @@ import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.PhoneValidatorUtils; -import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.MessageFeignClient; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; -import com.epmet.redis.CaptchaRedis; import com.epmet.service.CaptchaService; import com.epmet.service.LoginService; import com.epmet.utils.WxMaServiceUtils; @@ -65,12 +60,6 @@ public class LoginServiceImpl implements LoginService { @Autowired private CaptchaService captchaService; - @Autowired - private CaptchaRedis captchaRedis; - - @Autowired - private MessageFeignClient messageFeignClient; - /** * 居民端微信小程序登录 * @@ -327,94 +316,6 @@ public class LoginServiceImpl implements LoginService { return new Result().ok("退出登录!"); } - private static final String SEND_SMS_CODE_ERROR="发送短信验证码异常,手机号[%s],code[%s],msg[%s]"; - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 政府端微信小程序登录-发送验证码 - * @Date 2020/4/18 10:59 - **/ - @Override - public Result sendSmsCode(SendSmsCodeFormDTO formDTO) { - //1、校验手机号是否符合规范 - if(!PhoneValidatorUtils.isMobile(formDTO.getPhone())){ - logger.error(String.format(SEND_SMS_CODE_ERROR,formDTO.getPhone(), EpmetErrorCode.ERROR_PHONE.getCode(),EpmetErrorCode.ERROR_PHONE.getMsg())); - return new Result().error(EpmetErrorCode.ERROR_PHONE.getCode()); - } - //2、根据手机号校验用户是否存在 - Result customerStaffResult=epmetUserFeignClient.checkCustomerStaff(formDTO.getPhone()); - if(!customerStaffResult.success()){ - logger.error(String.format(SEND_SMS_CODE_ERROR,formDTO.getPhone(),customerStaffResult.getCode(),customerStaffResult.getMsg())); - return new Result().error(customerStaffResult.getCode()); - } - //3、发送短信验证码 - Result> smsCodeResult=messageFeignClient.sendSmsCaptcha(formDTO.getPhone()); - if(!smsCodeResult.success()){ - logger.error(String.format(SEND_SMS_CODE_ERROR,formDTO.getPhone(),smsCodeResult.getCode(),smsCodeResult.getMsg())); - return new Result().error(smsCodeResult.getCode()); - } - //4、保存短信验证码(删除现有短信验证码、将新的短信验证码存入Redis) - captchaRedis.saveSmsCode(formDTO,smsCodeResult.getData().get("code")); - logger.info(String.format("发送短信验证码成功,手机号[%s]",formDTO.getPhone())); - return new Result(); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 政府端微信小程序登录-手机验证码登录 - * @Date 2020/4/18 21:11 - **/ - @Override - public Result loginByPhone(LoginByPhoneFormDTO formDTO) { - //1、根据手机号查询到用户信息 - Result customerStaffResult=epmetUserFeignClient.checkCustomerStaff(formDTO.getPhone()); - if(!customerStaffResult.success()){ - logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]",formDTO.getPhone(),customerStaffResult.getCode(),customerStaffResult.getMsg())); - return new Result().error(customerStaffResult.getCode()); - } - //2、验证码是否正确 - String rightSmsCode=captchaRedis.getSmsCode(formDTO); - if(!formDTO.getSmsCode().equals(rightSmsCode)){ - return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); - } - //3、解析wxCode - UserTokenResultDTO userTokenResultDTO=this.getAuthorizationInfo(formDTO,customerStaffResult.getData()); - return new Result().ok(userTokenResultDTO); - } - - private UserTokenResultDTO getAuthorizationInfo(LoginByPhoneFormDTO formDTO, CustomerStaffDTO customerStaff) { - //1、解析微信用户 - WxMaJscode2SessionResult wxMaJscode2SessionResult=this.getWxMaUser(formDTO.getApp(),formDTO.getWxCode()); - //2、记录staff_wechat - this.savestaffwechat(customerStaff.getUserId(),wxMaJscode2SessionResult.getOpenid()); - //3、获取用户token - String token=this.generateToken(formDTO,customerStaff.getUserId()); - //4、保存到redis - this.saveTokenDto(formDTO,customerStaff.getUserId(),wxMaJscode2SessionResult,token); - UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); - userTokenResultDTO.setToken(token); - return userTokenResultDTO; - } - - /** - * @return com.epmet.commons.tools.utils.Result - * @param userId - * @param openid - * @Author yinzuomei - * @Description 保存微信和当前登录用户关系 - * @Date 2020/4/18 22:54 - **/ - private Result savestaffwechat(String userId, String openid) { - StaffWechatFormDTO staffWechatFormDTO = new StaffWechatFormDTO(); - staffWechatFormDTO.setUserId(userId); - staffWechatFormDTO.setWxOpenId(openid); - return epmetUserFeignClient.savestaffwechat(staffWechatFormDTO); - } - /** * @Description 生成token * @Date 2020/4/18 23:04 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LoginUser.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LoginUser.java index 0a7f7b625a..03ba0cb04f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LoginUser.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LoginUser.java @@ -19,7 +19,7 @@ package com.epmet.commons.tools.annotation; import java.lang.annotation.*; /** - * 登录用户信息 + * 居民登录用户信息 * * @author chenshun * @email sunlightcs@gmail.com diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index a77e4f3130..230c53fbc8 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -14,6 +14,7 @@ public enum EpmetErrorCode { GOV_STAFF_DISABLED(8005,"您好,您的账户已被冻结,请联系管理员。"), LOSE_EFFICACY(8006,"此邀请链接已过期"), ERROR_PHONE(8007,"请输入正确的手机号"), + PLEASE_LOGIN(8008,"请重新登录"), MOBILE_HAS_BEEN_USED(8101, "该手机号已注册,请更换手机号或使用原绑定的微信账号登录"), MOBILE_CODE_ERROR(8102, "验证码错误"), AUTO_CONFIRM_FAILED(8103, "党员注册失败"), 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 new file mode 100644 index 0000000000..08d9954eda --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java @@ -0,0 +1,80 @@ +package com.epmet.commons.tools.security.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 政府端登录信息 + * @Author yinzuomei + * @Date 2020/4/20 11:01 + */ +@Data +public class GovTokenDto implements Serializable { + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + private String app; + + /** + * PC端:web、微信小程序:wxmp + */ + private String client; + + /** + * 用户ID + */ + private String staffId; + + /** + * sessionKey + */ + private String sessionKey; + + /** + * openId + */ + private String openId; + + /** + * unionId + */ + private String unionId; + + /** + * token字符串 + */ + private String token; + + /** + * 过期时间戳 + */ + private Long expireTime; + + /** + * 最后一次更新时间 + */ + private long updateTime; + + /** + * 当前登录的组织id + */ + private String orgId; + + /** + * 待定 + */ + private String orgIdPath; + + /** + * 待定 + */ + private String gridId; + + /** + * 待定 + */ + private List deptIdList; +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java index 7af851b8bf..ec70df9403 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java @@ -72,12 +72,11 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu if (StringUtils.isEmpty(redisKey)) { throw new RenException(ErrorCode.UNAUTHORIZED); } - String[] keyArray=redisKey.split("-"); - String app=keyArray[0]; - String client=keyArray[1]; - String userId=keyArray[2]; - - //TokenDto tokenDto = cpUserDetailRedis.get(app,client,userId); +// String[] keyArray=redisKey.split("-"); +// String app=keyArray[0]; +// String client=keyArray[1]; +// String userId=keyArray[2]; +// TokenDto tokenDto = cpUserDetailRedis.get(app,client,userId); TokenDto tokenDto = new TokenDto(); tokenDto.setUserId(request.getHeader("userId")); tokenDto.setApp(request.getHeader("app")); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java index f49c9ddcb5..100c583a01 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java @@ -12,6 +12,7 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.map.MapUtil; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -99,4 +100,34 @@ public class CpUserDetailRedis { public long getExpire(String app, String client, String userId) { return redisUtils.getExpire(RedisKeys.getCpUserKey(app, client, userId)); } + + public void set(GovTokenDto user, long expire) { + if (user == null) { + return; + } + String key = RedisKeys.getCpUserKey(user.getApp(), user.getClient(), user.getStaffId()); + //bean to map + Map map = BeanUtil.beanToMap(user, false, true); + redisUtils.hMSet(key, map, expire); + } + + /** + * 获取token信息 + * + * @param app 居民端resi;政府端gov;运营端oper + * @param client PC端:web;微信小程序端:wxmp + * @param userId oper_user、customer_user、customer_staff表主键 + * @return + */ + public GovTokenDto getGovTokenDto(String app, String client, String userId) { + String key = RedisKeys.getCpUserKey(app,client,userId); + + Map map = redisUtils.hGetAll(key); + if (MapUtil.isEmpty(map)) { + return null; + } + //map to bean + GovTokenDto govTokenDto = BeanUtil.mapToBean(map, GovTokenDto.class, true); + return govTokenDto; + } } diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index a451ebf0b2..eed74d589d 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -108,53 +108,53 @@ - - http://127.0.0.1:8081 + lb://epmet-auth-server + - - http://127.0.0.1:8082 + lb://epmet-admin-server + - - http://127.0.0.1:8083 + lb://epmet-oss-server + - - http://127.0.0.1:8085 + lb://epmet-message-server + - - http://127.0.0.1:8086 + lb://epmet-activiti-server + - - http://127.0.0.1:8084 + lb://epmet-job-server + - - http://127.0.0.1:8087 + lb://epmet-user-server + http://127.0.0.1:8088 - - http://127.0.0.1:8089 + lb://oper-customize-server + - - http://127.0.0.1:8090 + lb://oper-crm-server + - - http://127.0.0.1:8091 + lb://resi-guide-server + - - http://127.0.0.1:8092 + lb://gov-org-server + - - http://127.0.0.1:8093 + lb://oper-access-server + - - http://127.0.0.1:8094 + lb://resi-mine-server + - - http://127.0.0.1:8095 + lb://resi-group-server + - http://127.0.0.1:8096 - + + lb://resi-partymember-server diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffGridInfoFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffGridInfoFormDTO.java new file mode 100644 index 0000000000..85b321f25a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffGridInfoFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 根据用户选择的组织,查询用户与网格的关系列表 + * @Author yinzuomei + * @Date 2020/4/20 15:29 + */ +@Data +public class StaffGridInfoFormDTO implements Serializable { + /** + * 用户选择的组织所属的id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; + + /** + * 用户选择的要进入的组织(根组织id) + */ + @NotBlank(message = "组织id不能为空") + private String orgId; + + @NotBlank(message = "staffId不能为空") + private String staffId; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffGridInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffGridInfoResultDTO.java new file mode 100644 index 0000000000..e636db75ee --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffGridInfoResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 根据用户选择的组织,查询用户与网格的关系列表 + * @Author yinzuomei + * @Date 2020/4/20 15:22 + */ +@Data +public class StaffGridInfoResultDTO implements Serializable { + /** + * ID 唯一标识 + */ + private String gridId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index ed7db2c1c7..8163a30c15 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -23,12 +23,14 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.form.StaffGridInfoFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.StaffGridInfoResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -124,4 +126,17 @@ public class CustomerGridController { CustomerGridDTO data = customerGridService.get(id); return new Result().ok(data); } + + /** + * @param staffGridInfoFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 根据用户选择的组织,查询用户与网格的关系列表 + * @Date 2020/4/20 15:34 + **/ + @PostMapping(value = "getStaffGridInfo") + public Result> getStaffGridInfo(@RequestBody StaffGridInfoFormDTO staffGridInfoFormDTO) { + ValidatorUtils.validateEntity(staffGridInfoFormDTO); + return customerGridService.listStaffGridInfo(staffGridInfoFormDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index a0b7899e9c..b42077b396 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -18,13 +18,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.form.StaffGridInfoFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.StaffGridInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -61,4 +62,13 @@ public interface CustomerGridDao extends BaseDao { List selectRestGridWithoutGivenAreaCode(Map paramsMap); CustomerGridDTO getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + + /** + * @param staffGridInfoFormDTO + * @return java.util.List + * @Author yinzuomei + * @Description 查询工作人员绑定的网格列表 + * @Date 2020/4/20 15:36 + **/ + List selectListStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 3da56bc4d2..d8728c39dd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -23,7 +23,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.form.StaffGridInfoFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.StaffGridInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -113,4 +115,13 @@ public interface CustomerGridService extends BaseService { * @date 2020-03-17 */ Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + + /** + * @param staffGridInfoFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 根据用户选择的组织,查询用户与网格的关系列表 + * @Date 2020/4/20 15:35 + **/ + Result> listStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index ea8bc48c65..d4e61df8b1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -28,7 +28,9 @@ import com.epmet.dao.CustomerGridDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.form.StaffGridInfoFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.StaffGridInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.redis.CustomerGridRedis; @@ -152,4 +154,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(baseDao.getCustomerGridByGridId(customerGridFormDTO)); } + @Override + public Result> listStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO) { + List list = baseDao.selectListStaffGridInfo(staffGridInfoFormDTO); + return new Result>().ok(list); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 7c35a3e1c5..6ea3950fb8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -92,4 +92,24 @@ LIMIT #{pageNo}, #{pageSize} + + + \ No newline at end of file diff --git a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java index 80f82dff81..12e8fae171 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java +++ b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -58,7 +57,7 @@ public class OperMenuController { } @PostMapping - public Result save(@RequestBody OperMenuDTO dto, @LoginUser TokenDto tokenDto){ + public Result save(@RequestBody OperMenuDTO dto, TokenDto tokenDto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); operMenuService.save(dto,tokenDto); @@ -66,7 +65,7 @@ public class OperMenuController { } @PutMapping - public Result update(@RequestBody OperMenuDTO dto, @LoginUser TokenDto tokenDto){ + public Result update(@RequestBody OperMenuDTO dto, TokenDto tokenDto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); operMenuService.update(dto,tokenDto); @@ -82,7 +81,7 @@ public class OperMenuController { } @DeleteMapping("{id}") - public Result delete(@PathVariable("id") String id, @LoginUser TokenDto tokenDto){ + public Result delete(@PathVariable("id") String id, TokenDto tokenDto){ //效验数据 AssertUtils.isNull(id, "id"); @@ -121,7 +120,7 @@ public class OperMenuController { * @return List */ @GetMapping("nav") - public Result> nav(@LoginUser TokenDto tokenDto){ + public Result> nav(TokenDto tokenDto){ List list = operMenuService.getUserMenuNavList(tokenDto); return new Result>().ok(list); } @@ -132,7 +131,7 @@ public class OperMenuController { * @return Set */ @GetMapping("permissions") - public Result> permissions(@LoginUser TokenDto tokenDto){ + public Result> permissions(TokenDto tokenDto){ Set set = operMenuService.getUserPermissions(tokenDto); return new Result>().ok(set); } @@ -143,7 +142,7 @@ public class OperMenuController { * @return */ @GetMapping("select") - public Result> select(@LoginUser TokenDto tokenDto){ + public Result> select(TokenDto tokenDto){ List list = operMenuService.getUserMenuList(tokenDto, null); return new Result>().ok(list); 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 4a9bbd1119..7cca833383 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 @@ -18,7 +18,6 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -133,7 +132,7 @@ public class CustomerController { * @Date 2020/3/11 21:58 **/ @GetMapping("getvalidcustomerlist") - public Result> getValidCustomerList(@LoginUser TokenDto tokenDTO) { + public Result> getValidCustomerList(TokenDto tokenDTO) { logger.info("getvalidcustomerlist:"+ JSON.toJSONString(tokenDTO)); return customerService.getValidCustomerList(); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java index 4b37c30352..bc29a28ee2 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java @@ -1,11 +1,9 @@ package com.epmet.modules.comment.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.modules.topic.service.ResiTopicCommentService; -import com.epmet.modules.utils.ModuleConstant; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; @@ -39,7 +37,7 @@ public class ResiCommentController { * @Date 2020.04.01 18:06 **/ @PostMapping("commenttopic") - public Result commentTopic(@LoginUser TokenDto tokenDto, @RequestBody ResiPublishCommentFormDTO publishCommentFormDTO){ + public Result commentTopic(TokenDto tokenDto, @RequestBody ResiPublishCommentFormDTO publishCommentFormDTO){ ValidatorUtils.validateEntity(publishCommentFormDTO); return commentService.commentTopic(tokenDto,publishCommentFormDTO); } @@ -53,7 +51,7 @@ public class ResiCommentController { * @Date 2020.04.01 23:49 **/ @PostMapping("getcommentlistoftopic") - public Result> getCommentListOfTopic(@LoginUser TokenDto tokenDto,@RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){ + public Result> getCommentListOfTopic(TokenDto tokenDto, @RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){ ValidatorUtils.validateEntity(queryCommentFormDTO); return commentService.getCommentList(tokenDto,queryCommentFormDTO); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index ef1bbd22c8..54db90c905 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -17,12 +17,10 @@ package com.epmet.modules.group.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.modules.group.service.ResiGroupService; import com.epmet.modules.utils.ModuleConstant; import com.epmet.resi.group.dto.group.form.*; @@ -65,7 +63,7 @@ public class ResiGroupController { * @Date 2020/3/28 20:36 **/ @PostMapping("getmygroup") - public Result> getMyGroup(@LoginUser TokenDto tokenDto, @RequestBody MyGroupFormDTO myGroupFormDTO) { + public Result> getMyGroup(TokenDto tokenDto, @RequestBody MyGroupFormDTO myGroupFormDTO) { myGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(myGroupFormDTO); return resiGroupService.getMyGroup(myGroupFormDTO); @@ -80,8 +78,8 @@ public class ResiGroupController { * @Date 2020/3/28 19:52 **/ @PostMapping("getrecommendgroup") - public Result> getRecommendGroup(@LoginUser TokenDto tokenDto, - @RequestBody RecommendGroupFormDTO recommendGroupFormDTO) { + public Result> getRecommendGroup(TokenDto tokenDto, + @RequestBody RecommendGroupFormDTO recommendGroupFormDTO) { recommendGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(recommendGroupFormDTO); return resiGroupService.getRecommendGroup(recommendGroupFormDTO); @@ -96,8 +94,8 @@ public class ResiGroupController { * @Date 2020/3/28 21:59 **/ @PostMapping("getcreated") - public Result> getCreated(@LoginUser TokenDto tokenDto, - @RequestBody CreatedFormDTO createdFormDTO) { + public Result> getCreated(TokenDto tokenDto, + @RequestBody CreatedFormDTO createdFormDTO) { createdFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(createdFormDTO); return resiGroupService.getCreated(createdFormDTO); @@ -112,7 +110,7 @@ public class ResiGroupController { * @Date 2020/3/28 22:20 **/ @PostMapping("modifygroup") - public Result modifyGroup(@LoginUser TokenDto tokenDto, @RequestBody ModifyGroupFormDTO modifyGroupFormDTO) { + public Result modifyGroup(TokenDto tokenDto, @RequestBody ModifyGroupFormDTO modifyGroupFormDTO) { modifyGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(modifyGroupFormDTO); return resiGroupService.modifyGroup(modifyGroupFormDTO); @@ -127,8 +125,8 @@ public class ResiGroupController { * @Date 2020/3/29 17:32 **/ @PostMapping("getgroupsummarize") - public Result getGroupSummarize(@LoginUser TokenDto tokenDto, - @RequestBody GroupSummarizeFormDTO groupSummarizeFormDTO) { + public Result getGroupSummarize(TokenDto tokenDto, + @RequestBody GroupSummarizeFormDTO groupSummarizeFormDTO) { groupSummarizeFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(groupSummarizeFormDTO); return resiGroupService.getGroupSummarize(groupSummarizeFormDTO); @@ -143,8 +141,8 @@ public class ResiGroupController { * @Date 2020/3/29 19:26 **/ @PostMapping("applycreategroup") - public Result applyCreateGroup(@LoginUser TokenDto tokenDto, - @RequestBody ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { + public Result applyCreateGroup(TokenDto tokenDto, + @RequestBody ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { applyCreateGroupFormDTO.setUserId(tokenDto.getUserId()); applyCreateGroupFormDTO.setApp(tokenDto.getApp()); ValidatorUtils.validateEntity(applyCreateGroupFormDTO); @@ -160,8 +158,8 @@ public class ResiGroupController { * @Date 2020/3/30 10:11 **/ @PostMapping("initapplygroup") - public Result initApplyGroup(@LoginUser TokenDto tokenDto, - @RequestBody InitApplyGroupFormDTO initApplyGroupFormDTO) { + public Result initApplyGroup(TokenDto tokenDto, + @RequestBody InitApplyGroupFormDTO initApplyGroupFormDTO) { if (null == tokenDto) { logger.error(ModuleConstant.USER_NOT_NULL); throw new RenException(ModuleConstant.USER_NOT_NULL); @@ -180,8 +178,8 @@ public class ResiGroupController { * @Date 2020/3/30 15:44 **/ @PostMapping("initapplycreategroup") - public Result initApplyCreatedGroup(@LoginUser TokenDto tokenDto, - @RequestBody InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO) { + public Result initApplyCreatedGroup(TokenDto tokenDto, + @RequestBody InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO) { if (null == tokenDto) { logger.error(ModuleConstant.USER_NOT_NULL); throw new RenException(ModuleConstant.USER_NOT_NULL); @@ -200,7 +198,7 @@ public class ResiGroupController { * @Date 2020/3/31 12:31 **/ @PostMapping("agreeapplygroup") - public Result agreeApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { + public Result agreeApplyGroup(TokenDto tokenDto, @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { agreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(agreeApplyGroupFormDTO); return resiGroupService.agreeApplyGroup(agreeApplyGroupFormDTO); @@ -215,7 +213,7 @@ public class ResiGroupController { * @Date 2020/3/31 13:23 **/ @PostMapping("disagreeapplygroup") - public Result disagreeApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { + public Result disagreeApplyGroup(TokenDto tokenDto, @RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { disAgreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/GroupInvitationController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/GroupInvitationController.java index 62a9bbd452..6fcc9f75f9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/GroupInvitationController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/GroupInvitationController.java @@ -17,7 +17,6 @@ package com.epmet.modules.invitation.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -56,8 +55,8 @@ public class GroupInvitationController { * @Date 2020/3/31 22:50 **/ @PostMapping("creategroupinvitation") - public Result createGroupInvitation(@LoginUser TokenDto tokenDto, - @RequestBody CreateGroupInvitationFormDTO formDTO) { + public Result createGroupInvitation(TokenDto tokenDto, + @RequestBody CreateGroupInvitationFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO); return groupInvitationService.createGroupInvitation(formDTO); @@ -71,8 +70,8 @@ public class GroupInvitationController { * @Date 2020/3/31 23:11 **/ @PostMapping("getlinkgroupinfo") - public Result getLinkGroupInfo(@LoginUser TokenDto tokenDto, - @RequestBody LinkGroupInfoFormDTO formDTO) { + public Result getLinkGroupInfo(TokenDto tokenDto, + @RequestBody LinkGroupInfoFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO); return groupInvitationService.getLinkGroupInfo(formDTO); @@ -87,7 +86,7 @@ public class GroupInvitationController { * @Date 2020/3/31 23:47 **/ @PostMapping("acceptinvitation") - public Result accetInvitation(@LoginUser TokenDto tokenDto, + public Result accetInvitation(TokenDto tokenDto, @RequestBody AccetInvitationFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); formDTO.setApp(tokenDto.getApp()); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java index 0ddb15285e..c358e1917c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java @@ -17,7 +17,6 @@ package com.epmet.modules.member.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -52,8 +51,8 @@ public class ResiGroupMemberController { * @Date 2020/3/29 20:01 **/ @PostMapping("applyjoingroup") - public Result applyJoinGroup(@LoginUser TokenDto tokenDto, - @RequestBody ApplyJoinGroupFormDTO applyJoinGroupFormDTO) { + public Result applyJoinGroup(TokenDto tokenDto, + @RequestBody ApplyJoinGroupFormDTO applyJoinGroupFormDTO) { applyJoinGroupFormDTO.setUserId(tokenDto.getUserId()); applyJoinGroupFormDTO.setApp(tokenDto.getApp()); ValidatorUtils.validateEntity(applyJoinGroupFormDTO); @@ -69,8 +68,8 @@ public class ResiGroupMemberController { * @Date 2020/3/30 21:14 **/ @PostMapping("getgroupmember") - public Result> getGroupMemberList(@LoginUser TokenDto tokenDto, - @RequestBody GroupMemberListFormDTO groupMemberListFormDTO) { + public Result> getGroupMemberList(TokenDto tokenDto, + @RequestBody GroupMemberListFormDTO groupMemberListFormDTO) { ValidatorUtils.validateEntity(groupMemberListFormDTO); return resiGroupMemberService.getGroupMemberList(groupMemberListFormDTO); } @@ -84,8 +83,8 @@ public class ResiGroupMemberController { * @Date 2020/3/30 21:37 **/ @PostMapping("getapplyingmember") - public Result> getApplyingMember(@LoginUser TokenDto tokenDto, - @RequestBody ApplyingMemberFormDTO applyingMemberFormDTO) { + public Result> getApplyingMember(TokenDto tokenDto, + @RequestBody ApplyingMemberFormDTO applyingMemberFormDTO) { ValidatorUtils.validateEntity(applyingMemberFormDTO); return resiGroupMemberService.getApplyingMember(applyingMemberFormDTO); } @@ -99,8 +98,8 @@ public class ResiGroupMemberController { * @Date 2020/3/30 22:07 **/ @PostMapping("agreeapply") - public Result agreeApply(@LoginUser TokenDto tokenDto, - @RequestBody AgreeApplyFormDTO agreeApplyFormDTO) { + public Result agreeApply(TokenDto tokenDto, + @RequestBody AgreeApplyFormDTO agreeApplyFormDTO) { agreeApplyFormDTO.setUserId(tokenDto.getUserId()); agreeApplyFormDTO.setApp(tokenDto.getApp()); ValidatorUtils.validateEntity(agreeApplyFormDTO); @@ -116,8 +115,8 @@ public class ResiGroupMemberController { * @Date 2020/3/30 22:07 **/ @PostMapping("disagreeapply") - public Result disAgreeApply(@LoginUser TokenDto tokenDto, - @RequestBody DisagreeApplyFormDTO disagreeApplyFormDTO) { + public Result disAgreeApply(TokenDto tokenDto, + @RequestBody DisagreeApplyFormDTO disagreeApplyFormDTO) { disagreeApplyFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(disagreeApplyFormDTO); return resiGroupMemberService.disAgreeApply(disagreeApplyFormDTO); @@ -128,7 +127,7 @@ public class ResiGroupMemberController { * @Description 楼院小组--删除组成员 **/ @PostMapping("removemember") - public Result removeMember(@LoginUser TokenDto tokenDto, @RequestBody RemoveMemberFormDTO removeMemberFormDTO) { + public Result removeMember(TokenDto tokenDto, @RequestBody RemoveMemberFormDTO removeMemberFormDTO) { removeMemberFormDTO.setUserId(tokenDto.getUserId()); removeMemberFormDTO.setApp(tokenDto.getApp()); ValidatorUtils.validateEntity(removeMemberFormDTO); @@ -143,7 +142,7 @@ public class ResiGroupMemberController { * @Description 楼院小组--禁言组员 **/ @PostMapping("slientmember") - public Result slientMember(@LoginUser TokenDto tokenDto, @RequestBody SlientMemberFormDTO slientMemberFormDTO) { + public Result slientMember(TokenDto tokenDto, @RequestBody SlientMemberFormDTO slientMemberFormDTO) { slientMemberFormDTO.setUserId(tokenDto.getUserId()); slientMemberFormDTO.setApp(tokenDto.getApp()); ValidatorUtils.validateEntity(slientMemberFormDTO); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index 9415d59760..6b8af29d96 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -1,6 +1,5 @@ package com.epmet.modules.topic.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -36,7 +35,7 @@ public class ResiTopicController { * @Date 2020.03.31 13:15 **/ @PostMapping("createtopic") - public Result createTopic(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPublishFormDTO topicPublishFormDTO){ + public Result createTopic(TokenDto tokenDto, @RequestBody ResiTopicPublishFormDTO topicPublishFormDTO){ ValidatorUtils.validateEntity(topicPublishFormDTO); return topicService.createTopic(tokenDto,topicPublishFormDTO); @@ -51,7 +50,7 @@ public class ResiTopicController { * @Date 2020.04.01 23:48 **/ @PostMapping("gettopicdetail") - public Result getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicDetailFormDTO topicDetailFormDTO ){ + public Result getTopicDetail(TokenDto tokenDto, @RequestBody ResiTopicDetailFormDTO topicDetailFormDTO ){ ValidatorUtils.validateEntity(topicDetailFormDTO); return topicService.getTopicDetail(tokenDto,topicDetailFormDTO.getTopicId()); } @@ -65,7 +64,7 @@ public class ResiTopicController { * @Date 2020.04.01 10:36 **/ @PostMapping("getpasttopiclist") - public Result> getPastTopicList(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){ + public Result> getPastTopicList(TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){ ValidatorUtils.validateEntity(topicPageFormDTO); return topicService.getPastTopicList(tokenDto,topicPageFormDTO); } @@ -79,7 +78,7 @@ public class ResiTopicController { * @Date 2020.04.02 00:01 **/ @PostMapping("getlatesttopics") - Result> getLatestTopics(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicDefaultPageFormDTO topicDefaultPageFormDTO){ + Result> getLatestTopics(TokenDto tokenDto, @RequestBody ResiTopicDefaultPageFormDTO topicDefaultPageFormDTO){ ValidatorUtils.validateEntity(topicDefaultPageFormDTO); return topicService.getLatestTopics(tokenDto,topicDefaultPageFormDTO.getGroupId()); } @@ -93,7 +92,7 @@ public class ResiTopicController { * @Date 2020.04.01 12:38 **/ @RequestMapping("hidetopic") - Result hideTopic(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicOperationFormDTO hiddenFormDTO){ + Result hideTopic(TokenDto tokenDto, @RequestBody ResiTopicOperationFormDTO hiddenFormDTO){ ValidatorUtils.validateEntity(hiddenFormDTO); return topicService.hideTopic(tokenDto,hiddenFormDTO); } @@ -107,7 +106,7 @@ public class ResiTopicController { * @Date 2020.04.01 16:45 **/ @PostMapping("gethiddentopic") - Result> getHiddenTopic(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicPageFormDTO topicPageFormDTO){ + Result> getHiddenTopic(TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){ ValidatorUtils.validateEntity(topicPageFormDTO); return topicService.getHiddenTopics(tokenDto,topicPageFormDTO); } @@ -121,7 +120,7 @@ public class ResiTopicController { * @Date 2020.04.01 14:17 **/ @PostMapping("cancelhiddentopics") - Result cancelHiddenTopics(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicCancelHiddenFormDTO cancelHiddenFormDTO){ + Result cancelHiddenTopics(TokenDto tokenDto, @RequestBody ResiTopicCancelHiddenFormDTO cancelHiddenFormDTO){ return topicService.cancelHiddenTopics(tokenDto,cancelHiddenFormDTO.getTopicIds()); } @@ -134,7 +133,7 @@ public class ResiTopicController { * @Date 2020.04.01 15:37 **/ @PostMapping("closetopic") - Result closeTopic(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicOperationFormDTO closeFormDTO){ + Result closeTopic(TokenDto tokenDto, @RequestBody ResiTopicOperationFormDTO closeFormDTO){ ValidatorUtils.validateEntity(closeFormDTO); return topicService.closeTopic(tokenDto,closeFormDTO); } diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java index 7c3b78194f..4e9aa206cc 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java @@ -17,7 +17,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -54,7 +53,7 @@ public class StrangerResiGuideController { * @Date 2020/3/16 **/ @PostMapping("getgridhome") - public Result getGridHome( @LoginUser TokenDto tokenDTO, @RequestBody StrangerFormDTO strangerFormDTO) throws Exception { + public Result getGridHome( TokenDto tokenDTO, @RequestBody StrangerFormDTO strangerFormDTO) throws Exception { return strangerAccessRecordService.getGridHome(tokenDTO, strangerFormDTO); } diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java index fe4d4d15ea..81e59f7130 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -27,7 +26,7 @@ public class UserGuideController { private UserAccessService userAccessService; @PostMapping("entergrid") - Result enterGrid(@LoginUser TokenDto token, @RequestBody UserEnterGridFormDTO userEnterGridFormDTO){ + Result enterGrid(TokenDto token, @RequestBody UserEnterGridFormDTO userEnterGridFormDTO){ ValidatorUtils.validateEntity(userEnterGridFormDTO); diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java index 626f78bfd4..1127ec72b5 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java @@ -1,6 +1,5 @@ package com.epmet.modules.grid.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.LatestGridInfoResultDTO; @@ -29,7 +28,7 @@ public class ResiMineGridController { * @Date 2020/3/24 11:10 **/ @GetMapping("getlatestgridinfo") - public Result getLatestGridInfo(@LoginUser TokenDto tokenDto){ + public Result getLatestGridInfo(TokenDto tokenDto){ return resiMineGridService.getLatestGridInfo(tokenDto); } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java index 2af9dfb554..c0c2b493aa 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java @@ -1,6 +1,5 @@ package com.epmet.modules.message.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -35,8 +34,8 @@ public class UserMessageController { * @Date 2020/3/29 20:53 **/ @PostMapping("getmymessage") - public Result> getMyMessage(@LoginUser TokenDto tokenDto, - @RequestBody MymessageFormDTO mymessageFormDTO) { + public Result> getMyMessage(TokenDto tokenDto, + @RequestBody MymessageFormDTO mymessageFormDTO) { mymessageFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(mymessageFormDTO); //逻辑待实现 @@ -64,7 +63,7 @@ public class UserMessageController { * @Date 2020/3/29 21:06 **/ @PostMapping("readallmsg") - public Result readAllMessage(@LoginUser TokenDto tokenDto, @RequestBody UserMessageDTO userMessageDTO) { + public Result readAllMessage(TokenDto tokenDto, @RequestBody UserMessageDTO userMessageDTO) { //逻辑待实现 return userMessageService.readAllMessage(tokenDto, userMessageDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberController.java index 379a9491e9..bfa776d92e 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberController.java @@ -1,6 +1,5 @@ package com.epmet.modules.partymember.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.partymember.service.PartyMemberService; @@ -34,7 +33,7 @@ public class PartyMemberController { * @return Result */ @PostMapping("init") - public Result init(@LoginUser TokenDto tokenDto, @RequestBody PartyMemberInitFromDTO fromDto) { + public Result init(TokenDto tokenDto, @RequestBody PartyMemberInitFromDTO fromDto) { fromDto.setUserId(tokenDto.getUserId()); return partyMemberService.init(fromDto); } @@ -47,7 +46,7 @@ public class PartyMemberController { * @date 2020/3/30 13:50 */ @PostMapping("getverificationcode") - public Result getVerificationCode(@LoginUser TokenDto tokenDto, @RequestBody VerificationCodeFromDTO fromDto) { + public Result getVerificationCode(TokenDto tokenDto, @RequestBody VerificationCodeFromDTO fromDto) { return partyMemberService.getVerificationCode(tokenDto, fromDto); } @@ -59,7 +58,7 @@ public class PartyMemberController { * @date 2020/3/30 13:50 */ @PostMapping("submit") - public Result submit(@LoginUser TokenDto tokenDto, @RequestBody PartyMemberSubmitFromDTO fromDto) { + public Result submit(TokenDto tokenDto, @RequestBody PartyMemberSubmitFromDTO fromDto) { return partyMemberService.submit(tokenDto, fromDto); } @@ -71,7 +70,7 @@ public class PartyMemberController { * @date 2020/3/30 13:50 */ @PostMapping("extra") - public Result partyMemberInfoExtra(@LoginUser TokenDto tokenDto, @RequestBody PartyMemberSubmitFromDTO fromDto) { + public Result partyMemberInfoExtra(TokenDto tokenDto, @RequestBody PartyMemberSubmitFromDTO fromDto) { return partyMemberService.partyMemberInfoExtra(tokenDto, fromDto); } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/controller/ResiRegisterController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/controller/ResiRegisterController.java index e9d591581e..3a8c6dee7b 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/controller/ResiRegisterController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/controller/ResiRegisterController.java @@ -1,6 +1,5 @@ package com.epmet.modules.resiregister.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -34,7 +33,7 @@ public class ResiRegisterController { * @Date 2020/3/30 **/ @PostMapping("init") - public Result init(@LoginUser TokenDto tokenDTO, @RequestBody ResiRegisterFormDTO resiRegisterFormDTO) { + public Result init(TokenDto tokenDTO, @RequestBody ResiRegisterFormDTO resiRegisterFormDTO) { ValidatorUtils.validateEntity(resiRegisterFormDTO); return resiRegisterService.init(tokenDTO, resiRegisterFormDTO); } @@ -45,7 +44,7 @@ public class ResiRegisterController { * @Description 居民端-居民注册信息提交 **/ @PostMapping("submit") - public Result submit(@LoginUser TokenDto tokenDTO, @RequestBody ResiInfoSubmitFormDTO resiInfoSubmitFormDTO) { + public Result submit(TokenDto tokenDTO, @RequestBody ResiInfoSubmitFormDTO resiInfoSubmitFormDTO) { ValidatorUtils.validateEntity(resiInfoSubmitFormDTO); return resiRegisterService.submit(tokenDTO, resiInfoSubmitFormDTO); } @@ -56,7 +55,7 @@ public class ResiRegisterController { * @Description 居民端-居民注册根据手机号获取验证码 **/ @PostMapping("getverificationcode") - public Result getVerificationCode(@LoginUser TokenDto tokenDTO, @RequestBody VerificationCodeFormDTO formDTO) { + public Result getVerificationCode(TokenDto tokenDTO, @RequestBody VerificationCodeFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return resiRegisterService.getVerificationCode(tokenDTO, formDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java index 03283c179a..9d555d6d40 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java @@ -1,6 +1,5 @@ package com.epmet.modules.warmhearted.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -31,7 +30,7 @@ public class ResiWarmheartedController { * @Description 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 **/ @PostMapping("init") - public Result init(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedFormDTO resiWarmheartedFormDTO) { + public Result init(TokenDto tokenDTO, @RequestBody ResiWarmheartedFormDTO resiWarmheartedFormDTO) { ValidatorUtils.validateEntity(resiWarmheartedFormDTO); return resiWarmheartedService.init(tokenDTO, resiWarmheartedFormDTO); } @@ -42,7 +41,7 @@ public class ResiWarmheartedController { * @Description 居民端-热心居民申请-提交申请数据 **/ @PostMapping("submit") - public Result submit(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedSubmitFormDTO formDTO) { + public Result submit(TokenDto tokenDTO, @RequestBody ResiWarmheartedSubmitFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return resiWarmheartedService.submit(tokenDTO, formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffLoginHistoryDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffLoginHistoryDTO.java new file mode 100644 index 0000000000..6d1674936f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffLoginHistoryDTO.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +public class StaffLoginHistoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 组织机构id + */ + private String orgId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间,登录时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffFormDTO.java new file mode 100644 index 0000000000..43acb11d1c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 根据手机号+客户id获取工作人员基本信息 + * @Author yinzuomei + * @Date 2020/4/20 14:02 + */ +@Data +public class CustomerStaffFormDTO implements Serializable { + private static final long serialVersionUID = 7619815083427853431L; + @NotBlank(message = "手机号不能为空") + private String mobile; + @NotBlank(message = "客户id不能为空") + private String customerId; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginHistoryFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginHistoryFormDTO.java new file mode 100644 index 0000000000..14a205d032 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginHistoryFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 保存工作人员登录日志 + * @Author yinzuomei + * @Date 2020/4/20 14:26 + */ +@Data +public class StaffLoginHistoryFormDTO implements Serializable { + /** + * 客户ID + */ + private String customerId; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 组织机构id + */ + private String orgId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestStaffWechatLoginResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestStaffWechatLoginResultDTO.java new file mode 100644 index 0000000000..5ad4ebde86 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestStaffWechatLoginResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 当前微信上次登录的账号信息返参DTO + * @Author yinzuomei + * @Date 2020/4/20 12:23 + */ +@Data +public class LatestStaffWechatLoginResultDTO implements Serializable { + private static final long serialVersionUID = -7088774184276785902L; + + /** + * 客户ID + */ + private String customerId; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 组织机构id + */ + private String orgId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; +} + 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 f097f86d5e..b68ea382c6 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 @@ -23,9 +23,10 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.excel.CustomerStaffExcel; import com.epmet.service.CustomerStaffService; import org.springframework.beans.factory.annotation.Autowired; @@ -45,24 +46,24 @@ import java.util.Map; @RestController @RequestMapping("customerstaff") public class CustomerStaffController { - + @Autowired private CustomerStaffService customerStaffService; @GetMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = customerStaffService.page(params); return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { CustomerStaffDTO data = customerStaffService.get(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody CustomerStaffDTO dto){ + public Result save(@RequestBody CustomerStaffDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); customerStaffService.save(dto); @@ -70,7 +71,7 @@ public class CustomerStaffController { } @PutMapping - public Result update(@RequestBody CustomerStaffDTO dto){ + public Result update(@RequestBody CustomerStaffDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); customerStaffService.update(dto); @@ -78,7 +79,7 @@ public class CustomerStaffController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); customerStaffService.delete(ids); @@ -92,14 +93,27 @@ public class CustomerStaffController { } /** - * @param phone 手机号 + * @param mobile 手机号 * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei * @Description 根据手机号查询政府端工作人员基本信息,校验用户是否存在 * @Date 2020/4/18 14:07 **/ - @GetMapping(value = "getcustsomerstaffbyphone/{phone}") - public Result getCustsomerStaffByPhone(@PathVariable("phone") String phone) { - return customerStaffService.getCustsomerStaffByPhone(phone); + @GetMapping(value = "getcustsomerstaffbyphone/{mobile}") + public Result> getCustsomerStaffByPhone(@PathVariable("mobile") String mobile) { + return customerStaffService.getCustsomerStaffByPhone(mobile); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据手机号+客户id获取工作人员基本信息 + * @Date 2020/4/20 14:04 + **/ + @PostMapping(value = "getcustomerstaffinfo") + public Result getCustomerStaffInfo(@RequestBody CustomerStaffFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return customerStaffService.getCustomerStaffInfo(formDTO); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java index f9d88ddd6a..b44f404523 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java @@ -17,7 +17,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; @@ -109,7 +108,7 @@ public class OperUserController { * @author zhaoqifeng */ @GetMapping("queryOperUserDto") - public Result queryOperUserDto(@LoginUser TokenDto tokenDto) { + public Result queryOperUserDto(TokenDto tokenDto) { OperUserDTO data = operUserService.getOperUserInfoById(tokenDto.getUserId()); QueryOperUserResultDto dto = ConvertUtils.sourceToTarget(data, QueryOperUserResultDto.class); return new Result().ok(dto); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffLoginHistoryController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffLoginHistoryController.java new file mode 100644 index 0000000000..08c8e02c94 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffLoginHistoryController.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.StaffLoginHistoryFormDTO; +import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; +import com.epmet.service.StaffLoginHistoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@RestController +@RequestMapping("staffloginhistory") +public class StaffLoginHistoryController { + + @Autowired + private StaffLoginHistoryService staffLoginHistoryService; + + /** + * @param openId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取当前微信上次登录的账号信息 + * @Date 2020/4/20 12:42 + **/ + @GetMapping(value = "getlatest/{openId}") + public Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId) { + return staffLoginHistoryService.getLatestStaffWechatLoginRecord(openId); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存登录日志 + * @Date 2020/4/20 14:29 + **/ + @PostMapping(value = "saveStaffLoginRecord") + public Result saveStaffLoginRecord(@RequestBody StaffLoginHistoryFormDTO formDTO) { + return staffLoginHistoryService.saveStaffLoginRecord(formDTO); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index 6081d38fe1..8c1930d6ac 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -80,7 +79,7 @@ public class UserController { * @Description 居民端个人信息-同步用户微信信息 **/ @PostMapping("updatewxuserinfo") - public Result updateWxUserInfo(@LoginUser TokenDto tokenDTO, @RequestBody WxUserInfoFormDTO wxUserInfoFormDTO) { + public Result updateWxUserInfo(TokenDto tokenDTO, @RequestBody WxUserInfoFormDTO wxUserInfoFormDTO) { wxUserInfoFormDTO.setUserId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(wxUserInfoFormDTO); return userService.updateWxUserInfo(wxUserInfoFormDTO); 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 89f2754a38..a676eb8a2c 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 @@ -18,9 +18,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.entity.CustomerStaffEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 政府工作人员表 * @@ -29,5 +33,22 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerStaffDao extends BaseDao { - + + /** + * @param mobile + * @return java.util.List + * @Author yinzuomei + * @Description 根据手机号查询工作人员信息 + * @Date 2020/4/20 13:17 + **/ + List selectListCustomerStaffDTO(String mobile); + + /** + * @param formDTO + * @return com.epmet.dto.CustomerStaffDTO + * @Author yinzuomei + * @Description 根据手机号+客户id获取工作人员基本信息 + * @Date 2020/4/20 14:08 + **/ + CustomerStaffDTO selectListCustomerStaffInfo(CustomerStaffFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffLoginHistoryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffLoginHistoryDao.java new file mode 100644 index 0000000000..1458be2a28 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffLoginHistoryDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; +import com.epmet.entity.StaffLoginHistoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Mapper +public interface StaffLoginHistoryDao extends BaseDao { + + /** + * @return com.epmet.dto.result.LatestStaffWechatLoginDTO + * @param openId + * @Author yinzuomei + * @Description 获取当前微信上次登录的账号信息 + * @Date 2020/4/20 12:45 + **/ + LatestStaffWechatLoginResultDTO selectLatestStaffWechatLoginRecord(String openId); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffLoginHistoryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffLoginHistoryEntity.java new file mode 100644 index 0000000000..9a9377ecfe --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffLoginHistoryEntity.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_login_history") +public class StaffLoginHistoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 组织机构id + */ + private String orgId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; + +} 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 ef5d1559b9..b459bdb83c 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 @@ -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.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.entity.CustomerStaffEntity; import java.util.List; @@ -95,11 +96,20 @@ public interface CustomerStaffService extends BaseService { void delete(String[] ids); /** - * @param phone 手机号 + * @param mobile 手机号 * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei * @Description 根据手机号查询政府端工作人员基本信息,校验用户是否存在 * @Date 2020/4/18 14:07 **/ - Result getCustsomerStaffByPhone(String phone); + Result> getCustsomerStaffByPhone(String mobile); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据手机号+客户id获取工作人员基本信息 + * @Date 2020/4/20 14:05 + **/ + Result getCustomerStaffInfo(CustomerStaffFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffLoginHistoryService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffLoginHistoryService.java new file mode 100644 index 0000000000..fab2c9f20e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffLoginHistoryService.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +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.StaffLoginHistoryDTO; +import com.epmet.dto.form.StaffLoginHistoryFormDTO; +import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; +import com.epmet.entity.StaffLoginHistoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +public interface StaffLoginHistoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return StaffLoginHistoryDTO + * @author generator + * @date 2020-04-20 + */ + StaffLoginHistoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-20 + */ + void save(StaffLoginHistoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-20 + */ + void update(StaffLoginHistoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-20 + */ + void delete(String[] ids); + + /** + * @param openId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取当前微信上次登录的账号信息 + * @Date 2020/4/20 12:43 + **/ + Result getLatestStaffWechatLoginRecord(String openId); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存登录日志 + * @Date 2020/4/20 14:33 + **/ + Result saveStaffLoginRecord(StaffLoginHistoryFormDTO formDTO); +} \ 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 7470edc96d..7fdbb725e3 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 @@ -28,6 +28,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserConstant; import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.entity.CustomerStaffEntity; import com.epmet.redis.CustomerStaffRedis; import com.epmet.service.CustomerStaffService; @@ -107,23 +108,26 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getCustsomerStaffByPhone(String phone) { + public Result> getCustsomerStaffByPhone(String mobile) { //判断用户是否存在 - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(phone), FieldConstant.MOBILE, phone); - List customerStaffEntityList = baseDao.selectList(wrapper); - if (null == customerStaffEntityList || customerStaffEntityList.size() == 0) { - logger.error(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]",phone,EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(),EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + List customerStaffDTOList = baseDao.selectListCustomerStaffDTO(mobile); + if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) { + logger.error(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", mobile, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); } + return new Result>().ok(customerStaffDTOList); + } + + + @Override + public Result getCustomerStaffInfo(CustomerStaffFormDTO formDTO) { + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(formDTO); //判断用户是否已被禁用 - CustomerStaffEntity customerStaff = customerStaffEntityList.get(0); - if (UserConstant.DISABLED.equals(customerStaff.getEnableFlag())) { - logger.error(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]",phone,EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); + if (null != customerStaffDTO && UserConstant.DISABLED.equals(customerStaffDTO.getEnableFlag())) { + logger.error(String.format("根据手机号查询用户异常,手机号:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); return new Result().error(EpmetErrorCode.GOV_STAFF_DISABLED.getCode()); } - CustomerStaffDTO customerStaffDTO=ConvertUtils.sourceToTarget(customerStaff, CustomerStaffDTO.class); - return new Result().ok(customerStaffDTO); + return new Result().ok(customerStaffDTO); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffLoginHistoryServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffLoginHistoryServiceImpl.java new file mode 100644 index 0000000000..2cccdf9f3e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffLoginHistoryServiceImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.StaffLoginHistoryDao; +import com.epmet.dto.StaffLoginHistoryDTO; +import com.epmet.dto.form.StaffLoginHistoryFormDTO; +import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; +import com.epmet.entity.StaffLoginHistoryEntity; +import com.epmet.service.StaffLoginHistoryService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作人员登录日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Service +public class StaffLoginHistoryServiceImpl extends BaseServiceImpl implements StaffLoginHistoryService { + private static final Logger logger = LoggerFactory.getLogger(StaffLoginHistoryServiceImpl.class); + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, StaffLoginHistoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, StaffLoginHistoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public StaffLoginHistoryDTO get(String id) { + StaffLoginHistoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, StaffLoginHistoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(StaffLoginHistoryDTO dto) { + StaffLoginHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffLoginHistoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(StaffLoginHistoryDTO dto) { + StaffLoginHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffLoginHistoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result getLatestStaffWechatLoginRecord(String openId) { + if (StringUtils.isNotBlank(openId)) { + logger.error("openId 不能为空"); + return new Result(); + } + LatestStaffWechatLoginResultDTO latestStaffWechatLoginDTO = baseDao.selectLatestStaffWechatLoginRecord(openId); + return new Result().ok(latestStaffWechatLoginDTO); + } + + @Override + public Result saveStaffLoginRecord(StaffLoginHistoryFormDTO formDTO) { + StaffLoginHistoryEntity entity = ConvertUtils.sourceToTarget(formDTO, StaffLoginHistoryEntity.class); + insert(entity); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql index 19f25df536..e09dd173a2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql @@ -35,4 +35,22 @@ CREATE TABLE `staff_wechat` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员微信关系表 '; -alter table grid_latest MODIFY COLUMN PID VARCHAR(64) comment'上级组织ID (数据统计字段)' \ No newline at end of file +alter table grid_latest MODIFY COLUMN PID VARCHAR(64) comment'上级组织ID (数据统计字段)'; +alter table staff_wechat add column LATEST_LOGIN_TIME datetime NOT NULL COMMENT '最后一次登录时间'; +alter table staff_wechat drop column LATEST_LOGIN_TIME; +CREATE TABLE `staff_login_history` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `STAFF_ID` varchar(64) NOT NULL COMMENT 'customer_staff.userId', + WX_OPEN_ID varchar(64) NOT NULL COMMENT '微信openId', + `MOBILE` varchar(20) NOT NULL COMMENT '手机号', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织机构id', + `GRID_ID` varchar(64) COMMENT '网格表Id (CUSTOMER_GRID.id)', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间,登录时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员登录日志表'; \ 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 c5ba17deab..1a8958a306 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 @@ -3,26 +3,18 @@ - - - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffLoginHistoryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffLoginHistoryDao.xml new file mode 100644 index 0000000000..4f382bfa10 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffLoginHistoryDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 4b96cd16ecd32d6436f4094ab7b8d878b488c2c0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Apr 2020 16:24:24 +0800 Subject: [PATCH 002/174] =?UTF-8?q?=E4=BF=AE=E6=94=B9auth=E3=80=81gateway?= =?UTF-8?q?=E6=A8=A1=E5=9D=97redis=E8=BF=9E=E6=8E=A5=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/pom.xml | 2 +- epmet-gateway/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index be588da1e1..93feb4625c 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -135,7 +135,7 @@ 0 - 127.0.0.1 + 192.168.1.130 6379 123456 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index eed74d589d..5b943229db 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -95,7 +95,7 @@ 0 - 127.0.0.1 + 192.168.1.130 6379 123456 From 3d2c935228c2024bf311bd06bbc1bb8de6ec81d2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Apr 2020 16:36:04 +0800 Subject: [PATCH 003/174] =?UTF-8?q?getCustomerStaffInfo=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/GovLoginService.java | 2 +- .../main/java/com/epmet/service/impl/GovLoginServiceImpl.java | 4 ++-- .../java/com/epmet/service/impl/CustomerStaffServiceImpl.java | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java index b805bbf217..f01e6ef096 100644 --- a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java @@ -29,7 +29,7 @@ public interface GovLoginService { * @Description 3、手机验证码获取组织 * @Date 2020/4/18 21:11 **/ - Result getorgs(GovWxmpGetOrgsFormDTO formDTO); + Result getorgs(GovWxmpGetOrgsFormDTO formDTO); /** * @param formDTO 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 f41e0b81d9..055d169e27 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 @@ -96,7 +96,7 @@ public class GovLoginServiceImpl implements GovLoginService { * @Date 2020/4/18 21:11 **/ @Override - public Result getorgs(GovWxmpGetOrgsFormDTO formDTO) { + public Result getorgs(GovWxmpGetOrgsFormDTO formDTO) { //1、根据手机号查询到用户信息 Result> customerStaffResult = epmetUserFeignClient.checkCustomerStaff(formDTO.getMobile()); if (!customerStaffResult.success()) { @@ -106,7 +106,7 @@ public class GovLoginServiceImpl implements GovLoginService { //2、验证码是否正确 String rightSmsCode = captchaRedis.getSmsCode(formDTO); if (!formDTO.getSmsCode().equals(rightSmsCode)) { - return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + return new Result<>().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); } //3、TODO返回组织树 return new Result(); 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 7fdbb725e3..9d9e11a64c 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 @@ -122,6 +122,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getCustomerStaffInfo(CustomerStaffFormDTO formDTO) { CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(formDTO); + if (null == customerStaffDTO) { + logger.error(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + } //判断用户是否已被禁用 if (null != customerStaffDTO && UserConstant.DISABLED.equals(customerStaffDTO.getEnableFlag())) { logger.error(String.format("根据手机号查询用户异常,手机号:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); From 84614c5a14bea25dc11859a5760ef823fc3c788b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Apr 2020 22:32:08 +0800 Subject: [PATCH 004/174] =?UTF-8?q?=E8=B5=9E=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/GovLoginController.java | 11 +- ...OrgsFormDTO.java => StaffOrgsFormDTO.java} | 8 +- .../com/epmet/feign/EpmetUserFeignClient.java | 2 +- .../com/epmet/feign/GovOrgFeignClient.java | 27 ++++- .../EpmetUserFeignClientFallback.java | 2 +- .../fallback/GovOrgFeignClientFallback.java | 15 ++- .../java/com/epmet/redis/CaptchaRedis.java | 7 +- .../com/epmet/service/GovLoginService.java | 7 +- .../service/impl/GovLoginServiceImpl.java | 104 +++++++++++------- .../tools/security/dto/GovTokenDto.java | 13 ++- ....java => StaffLatestLoginGridFormDTO.java} | 5 +- .../com/epmet/dto/form/StaffOrgFormDTO.java | 18 +++ ...ava => StaffLatestLoginGridResultDTO.java} | 2 +- .../epmet/dto/result/StaffOrgsResultDTO.java | 31 ++++++ .../controller/CustomerAgencyController.java | 15 ++- .../java/com/epmet/dao/CustomerAgencyDao.java | 13 ++- .../epmet/service/CustomerAgencyService.java | 12 ++ .../impl/CustomerAgencyServiceImpl.java | 13 ++- .../resources/mapper/CustomerAgencyDao.xml | 17 ++- .../resources/mapper/CustomerStaffDao.xml | 1 + 20 files changed, 254 insertions(+), 69 deletions(-) rename epmet-auth/src/main/java/com/epmet/dto/form/{GovWxmpGetOrgsFormDTO.java => StaffOrgsFormDTO.java} (79%) rename epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/{StaffGridInfoFormDTO.java => StaffLatestLoginGridFormDTO.java} (85%) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffOrgFormDTO.java rename epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/{StaffGridInfoResultDTO.java => StaffLatestLoginGridResultDTO.java} (89%) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgsResultDTO.java diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java index 0539be499d..ea4b5c8974 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java @@ -4,8 +4,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.GovWxmpEnteOrgFormDTO; import com.epmet.dto.form.GovWxmpFormDTO; -import com.epmet.dto.form.GovWxmpGetOrgsFormDTO; import com.epmet.dto.form.SendSmsCodeFormDTO; +import com.epmet.dto.form.StaffOrgsFormDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.GovLoginService; import org.springframework.beans.factory.annotation.Autowired; @@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @Description 政府端登录 * @Author yinzuomei @@ -58,10 +61,10 @@ public class GovLoginController { * @Description 3、手机验证码获取组织 * @Date 2020/4/18 21:14 **/ - @PostMapping(value = "/loginwxmp/getorgs") - public Result getorgs(GovWxmpGetOrgsFormDTO formDTO) { + @PostMapping(value = "/loginwxmp/getmyorg") + public Result> getmyorg(StaffOrgsFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return govLoginService.getorgs(formDTO); + return govLoginService.getMyOrg(formDTO); } /** diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpGetOrgsFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/StaffOrgsFormDTO.java similarity index 79% rename from epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpGetOrgsFormDTO.java rename to epmet-auth/src/main/java/com/epmet/dto/form/StaffOrgsFormDTO.java index b2674f3277..e36c100809 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpGetOrgsFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/StaffOrgsFormDTO.java @@ -11,12 +11,18 @@ import java.io.Serializable; * @Date 2020/4/18 10:38 */ @Data -public class GovWxmpGetOrgsFormDTO implements Serializable { +public class StaffOrgsFormDTO implements Serializable { private static final long serialVersionUID = 4193133227120225342L; + /** + * 手机号 + */ @NotBlank(message = "手机号不能为空") private String mobile; + /** + * 验证码 + */ @NotBlank(message="验证码不能为空") private String smsCode; } diff --git a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 45fe847c49..d62c41b2c4 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -76,7 +76,7 @@ public interface EpmetUserFeignClient { * @Date 2020/4/18 22:44 **/ @PostMapping(value = "epmetuser/staffwechat/savestaffwechat", consumes = MediaType.APPLICATION_JSON_VALUE) - Result savestaffwechat(@RequestBody StaffWechatFormDTO staffWechatFormDTO); + Result saveStaffWechat(@RequestBody StaffWechatFormDTO staffWechatFormDTO); /** * @param openId diff --git a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 0d3fe7c566..f284da98ab 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -2,8 +2,10 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.StaffGridInfoFormDTO; -import com.epmet.dto.result.StaffGridInfoResultDTO; +import com.epmet.dto.form.StaffLatestLoginGridFormDTO; +import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.StaffLatestLoginGridResultDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -18,6 +20,23 @@ import java.util.List; */ @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallback.class) public interface GovOrgFeignClient { - @PostMapping(value = "getStaffGridInfo",consumes = MediaType.APPLICATION_JSON_VALUE) - Result> getStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO); + /** + * @return com.epmet.commons.tools.utils.Result> + * @param staffGridInfoFormDTO + * @Author yinzuomei + * @Description + * @Date 2020/4/20 21:36 + **/ + @PostMapping(value = "gov/org/customergrid/getStaffGridInfo",consumes = MediaType.APPLICATION_JSON_VALUE) + Result getStaffLatestLoginGrid(StaffLatestLoginGridFormDTO staffGridInfoFormDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param staffOrgFormDTO + * @Author yinzuomei + * @Description 获取客户对应的根级组织名称 + * @Date 2020/4/20 21:37 + **/ + @PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO); } diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 9126cf63b8..571785b43f 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -43,7 +43,7 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { } @Override - public Result savestaffwechat(StaffWechatFormDTO staffWechatFormDTO) { + public Result saveStaffWechat(StaffWechatFormDTO staffWechatFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffWechat", staffWechatFormDTO); } diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java index 94a235f3ec..6121363dfd 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java @@ -3,8 +3,10 @@ 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.form.StaffGridInfoFormDTO; -import com.epmet.dto.result.StaffGridInfoResultDTO; +import com.epmet.dto.form.StaffLatestLoginGridFormDTO; +import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.StaffLatestLoginGridResultDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -18,8 +20,13 @@ import java.util.List; @Component public class GovOrgFeignClientFallback implements GovOrgFeignClient { @Override - public Result> getStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridInfo", staffGridInfoFormDTO); + public Result getStaffLatestLoginGrid(StaffLatestLoginGridFormDTO staffLatestLoginGridFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffLatestLoginGrid", staffLatestLoginGridFormDTO); + } + + @Override + public Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffOrgList", staffOrgFormDTO); } } diff --git a/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java b/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java index 0ec9158dae..acdd85f490 100644 --- a/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java +++ b/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java @@ -11,7 +11,6 @@ package com.epmet.redis; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.dto.form.GovWxmpGetOrgsFormDTO; import com.epmet.dto.form.SendSmsCodeFormDTO; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -72,14 +71,14 @@ public class CaptchaRedis { } /** - * @param formDTO + * @param mobile * @return java.lang.String * @Author yinzuomei * @Description 获取登录时发送的验证码 * @Date 2020/4/18 21:33 **/ - public String getSmsCode(GovWxmpGetOrgsFormDTO formDTO) { - String smsCodeKey = RedisKeys.getLoginSmsCodeKey(LoginConstant.APP_GOV, LoginConstant.CLIENT_WXMP, formDTO.getMobile()); + public String getSmsCode(String mobile) { + String smsCodeKey = RedisKeys.getLoginSmsCodeKey(LoginConstant.APP_GOV, LoginConstant.CLIENT_WXMP, mobile); String smsCode = (String) redisUtils.get(smsCodeKey); return smsCode; } diff --git a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java index f01e6ef096..8e98ad44de 100644 --- a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java @@ -3,10 +3,13 @@ package com.epmet.service; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.GovWxmpEnteOrgFormDTO; import com.epmet.dto.form.GovWxmpFormDTO; -import com.epmet.dto.form.GovWxmpGetOrgsFormDTO; import com.epmet.dto.form.SendSmsCodeFormDTO; +import com.epmet.dto.form.StaffOrgsFormDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; +import java.util.List; + /** * @Description 政府端登录服务 * @Author yinzuomei @@ -29,7 +32,7 @@ public interface GovLoginService { * @Description 3、手机验证码获取组织 * @Date 2020/4/18 21:11 **/ - Result getorgs(GovWxmpGetOrgsFormDTO formDTO); + Result> getMyOrg(StaffOrgsFormDTO formDTO); /** * @param formDTO 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 055d169e27..5f6480ef2c 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 @@ -10,9 +10,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; -import com.epmet.dto.result.StaffGridInfoResultDTO; -import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.feign.MessageFeignClient; @@ -26,6 +24,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -96,7 +95,7 @@ public class GovLoginServiceImpl implements GovLoginService { * @Date 2020/4/18 21:11 **/ @Override - public Result getorgs(GovWxmpGetOrgsFormDTO formDTO) { + public Result> getMyOrg(StaffOrgsFormDTO formDTO) { //1、根据手机号查询到用户信息 Result> customerStaffResult = epmetUserFeignClient.checkCustomerStaff(formDTO.getMobile()); if (!customerStaffResult.success()) { @@ -104,12 +103,19 @@ public class GovLoginServiceImpl implements GovLoginService { return new Result().error(customerStaffResult.getCode()); } //2、验证码是否正确 - String rightSmsCode = captchaRedis.getSmsCode(formDTO); + String rightSmsCode = captchaRedis.getSmsCode(formDTO.getMobile()); if (!formDTO.getSmsCode().equals(rightSmsCode)) { - return new Result<>().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + return new Result>().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); } - //3、TODO返回组织树 - return new Result(); + //3、查询用户所有的组织信息 + List customerIdList = new ArrayList<>(); + for (CustomerStaffDTO customerStaffDTO : customerStaffResult.getData()) { + customerIdList.add(customerStaffDTO.getCustomerId()); + } + StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO(); + staffOrgFormDTO.setCustomerIdList(customerIdList); + Result> result = govOrgFeignClient.getStaffOrgList(staffOrgFormDTO); + return result; } @Override @@ -129,12 +135,34 @@ public class GovLoginServiceImpl implements GovLoginService { //4、获取用户token String token = this.generateGovWxmpToken(latestStaffWechatLoginDTO.getStaffId()); //5、保存到redis - this.saveGovTokenDto(latestStaffWechatLoginDTO.getOrgId(), latestStaffWechatLoginDTO.getGridId(), latestStaffWechatLoginDTO.getStaffId(), wxMaJscode2SessionResult, token); + this.saveLatestGovTokenDto(latestStaffWechatLoginDTO, wxMaJscode2SessionResult, token); UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setToken(token); return new Result().ok(userTokenResultDTO); } + //保存tokenDto到redis + private void saveLatestGovTokenDto(LatestStaffWechatLoginResultDTO latestStaffWechatLoginDTO, + WxMaJscode2SessionResult wxMaJscode2SessionResult, + String token) { + int expire = jwtTokenProperties.getExpire(); + GovTokenDto govTokenDto = new GovTokenDto(); + govTokenDto.setApp(LoginConstant.APP_GOV); + govTokenDto.setClient(LoginConstant.CLIENT_WXMP); + govTokenDto.setStaffId(latestStaffWechatLoginDTO.getStaffId()); + govTokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid()); + govTokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey()); + govTokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid()); + govTokenDto.setToken(token); + govTokenDto.setUpdateTime(System.currentTimeMillis()); + govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + govTokenDto.setOrgId(latestStaffWechatLoginDTO.getOrgId()); + govTokenDto.setGridId(latestStaffWechatLoginDTO.getGridId()); + govTokenDto.setCustomerId(latestStaffWechatLoginDTO.getCustomerId()); + cpUserDetailRedis.set(govTokenDto, expire); + logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); + } + //保存登录日志 private Result saveStaffLoginRecord(LatestStaffWechatLoginResultDTO latestStaffWechatLoginDTO) { StaffLoginHistoryFormDTO staffLoginHistoryFormDTO = new StaffLoginHistoryFormDTO(); @@ -164,19 +192,30 @@ public class GovLoginServiceImpl implements GovLoginService { WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode()); //3、记录staff_wechat this.savestaffwechat(customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); - //4、记录登录日志 - StaffGridInfoFormDTO staffGridInfoFormDTO = new StaffGridInfoFormDTO(); + //4、查询用户绑定的网格 + StaffLatestLoginGridResultDTO latestGridInfo = this.getLatestGridInfo(formDTO, customerStaff.getUserId()); + //5、记录登录日志 + this.saveStaffLoginRecord(formDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid(), latestGridInfo.getGridId()); + //1、获取用户token + String token = this.generateGovWxmpToken(customerStaff.getUserId()); + //2、保存到redis + this.saveGovTokenDto(formDTO.getOrgId(), formDTO.getCustomerId(), latestGridInfo.getGridId(), customerStaff.getUserId(), wxMaJscode2SessionResult, token); + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + return new Result().ok(userTokenResultDTO); + } + + //查询用户绑定的网格 + private StaffLatestLoginGridResultDTO getLatestGridInfo(GovWxmpEnteOrgFormDTO formDTO, String userId) { + StaffLatestLoginGridFormDTO staffGridInfoFormDTO = new StaffLatestLoginGridFormDTO(); staffGridInfoFormDTO.setCustomerId(formDTO.getCustomerId()); staffGridInfoFormDTO.setOrgId(formDTO.getOrgId()); - staffGridInfoFormDTO.setStaffId(customerStaff.getUserId()); - Result> staffGridInfoListResult = govOrgFeignClient.getStaffGridInfo(staffGridInfoFormDTO); - String gridId = null; - if (staffGridInfoListResult.success() && null != staffGridInfoListResult.getData() && staffGridInfoListResult.getData().size() > 0) { - gridId = staffGridInfoListResult.getData().get(0).getGridId(); + staffGridInfoFormDTO.setStaffId(userId); + Result staffGridInfoListResult = govOrgFeignClient.getStaffLatestLoginGrid(staffGridInfoFormDTO); + if (staffGridInfoListResult.success() && null != staffGridInfoListResult.getData()) { + return staffGridInfoListResult.getData(); } - this.saveStaffLoginRecord(formDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid(), gridId); - UserTokenResultDTO userTokenResultDTO = this.getAuthorizationInfo(formDTO.getOrgId(), gridId, customerStaff.getUserId(), wxMaJscode2SessionResult); - return new Result().ok(userTokenResultDTO); + return new StaffLatestLoginGridResultDTO(); } //保存登录日志 @@ -192,18 +231,6 @@ public class GovLoginServiceImpl implements GovLoginService { return staffLoginRecordResult; } - private UserTokenResultDTO getAuthorizationInfo(String orgId, - String gridId, - String staffId, - WxMaJscode2SessionResult wxMaJscode2SessionResult) { - //1、获取用户token - String token = this.generateGovWxmpToken(staffId); - //2、保存到redis - this.saveGovTokenDto(orgId, gridId, staffId, wxMaJscode2SessionResult, token); - UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); - userTokenResultDTO.setToken(token); - return userTokenResultDTO; - } /** * @param userId @@ -217,7 +244,7 @@ public class GovLoginServiceImpl implements GovLoginService { StaffWechatFormDTO staffWechatFormDTO = new StaffWechatFormDTO(); staffWechatFormDTO.setUserId(userId); staffWechatFormDTO.setWxOpenId(openid); - return epmetUserFeignClient.savestaffwechat(staffWechatFormDTO); + return epmetUserFeignClient.saveStaffWechat(staffWechatFormDTO); } /** @@ -238,11 +265,12 @@ public class GovLoginServiceImpl implements GovLoginService { * @Description 生成token * @Date 2020/4/18 23:04 **/ - private String saveGovTokenDto(String orgId, - String gridId, - String staffId, - WxMaJscode2SessionResult wxMaJscode2SessionResult, - String token) { + private void saveGovTokenDto(String orgId, + String customerId, + String gridId, + String staffId, + WxMaJscode2SessionResult wxMaJscode2SessionResult, + String token) { int expire = jwtTokenProperties.getExpire(); GovTokenDto govTokenDto = new GovTokenDto(); govTokenDto.setApp(LoginConstant.APP_GOV); @@ -256,9 +284,9 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); govTokenDto.setOrgId(orgId); govTokenDto.setGridId(gridId); + govTokenDto.setCustomerId(customerId); cpUserDetailRedis.set(govTokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); - return token; } } 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 08d9954eda..e46a4c1119 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 @@ -58,22 +58,27 @@ public class GovTokenDto implements Serializable { private long updateTime; /** - * 当前登录的组织id + * 当前工作人员进入的客户id + */ + private String customerId; + + /** + * 当前登录的组织id(顶级) */ private String orgId; /** - * 待定 + * 当前网格对应的组织结构id的全路径用:隔开 */ private String orgIdPath; /** - * 待定 + * 当前所在网格id */ private String gridId; /** - * 待定 + * 部门id列表 */ private List deptIdList; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffGridInfoFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java similarity index 85% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffGridInfoFormDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java index 85b321f25a..f07e657f73 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffGridInfoFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java @@ -11,7 +11,7 @@ import java.io.Serializable; * @Date 2020/4/20 15:29 */ @Data -public class StaffGridInfoFormDTO implements Serializable { +public class StaffLatestLoginGridFormDTO implements Serializable { /** * 用户选择的组织所属的id */ @@ -24,6 +24,9 @@ public class StaffGridInfoFormDTO implements Serializable { @NotBlank(message = "组织id不能为空") private String orgId; + /** + * 工作人员id + */ @NotBlank(message = "staffId不能为空") private String staffId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffOrgFormDTO.java new file mode 100644 index 0000000000..d2cb982645 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffOrgFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 根据客户id查询组织结构信息入参 + * @Author yinzuomei + * @Date 2020/4/20 21:42 + */ +@Data +public class StaffOrgFormDTO implements Serializable { + private static final long serialVersionUID = 2514896455028592288L; + private List customerIdList; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffGridInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java similarity index 89% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffGridInfoResultDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java index e636db75ee..4c067bdbe2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffGridInfoResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java @@ -10,7 +10,7 @@ import java.io.Serializable; * @Date 2020/4/20 15:22 */ @Data -public class StaffGridInfoResultDTO implements Serializable { +public class StaffLatestLoginGridResultDTO implements Serializable { /** * ID 唯一标识 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgsResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgsResultDTO.java new file mode 100644 index 0000000000..58955cc634 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgsResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 政府端工作人员获取我的组织 + * @Author yinzuomei + * @Date 2020/4/20 18:45 + */ +@Data +public class StaffOrgsResultDTO implements Serializable { + private static final long serialVersionUID = -9148184731135509803L; + + /** + * 组织id + */ + private String orgId; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织名称 + */ + private String orgName; +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 550cdb1832..a1e5ea58fe 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -23,9 +23,11 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.excel.CustomerAgencyExcel; import com.epmet.service.CustomerAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +93,15 @@ public class CustomerAgencyController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerAgencyExcel.class); } + /** + * @return com.epmet.commons.tools.utils.Result> + * @param staffOrgsFormDTO + * @Author yinzuomei + * @Description 登录-获取工作人员所有组织 + * @Date 2020/4/20 21:59 + **/ + @PostMapping("getStaffOrgList") + public Result> getStaffOrgList(@RequestBody StaffOrgFormDTO staffOrgsFormDTO){ + return customerAgencyService.getStaffOrgList(staffOrgsFormDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 185d2d33a1..4f85e09091 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.entity.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 机关单位信息表 @@ -29,5 +33,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerAgencyDao extends BaseDao { - + /** + * @param customerIdList + * @return java.util.List + * @Author yinzuomei + * @Description 查询客户对应的根级组织 + * @Date 2020/4/20 21:48 + **/ + List selectStaffOrgList(@Param("customerIdList") List customerIdList); } \ No newline at end of file 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 319e26890f..62892b4576 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 @@ -19,7 +19,10 @@ package com.epmet.service; 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.CustomerAgencyDTO; +import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.entity.CustomerAgencyEntity; import java.util.List; @@ -92,4 +95,13 @@ public interface CustomerAgencyService extends BaseService * @date 2020-04-20 */ void delete(String[] ids); + + /** + * @param staffOrgsFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 根据客户id查询组织名称 + * @Date 2020/4/20 21:45 + **/ + Result> getStaffOrgList(StaffOrgFormDTO staffOrgsFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index fa513326e4..2a2b79a024 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -20,11 +20,14 @@ 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.constant.FieldConstant; 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.CustomerAgencyDao; import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.CustomerAgencyService; @@ -101,4 +104,12 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl> getStaffOrgList(StaffOrgFormDTO staffOrgsFormDTO) { + if (null == staffOrgsFormDTO || staffOrgsFormDTO.getCustomerIdList().size() == 0) { + return new Result<>(); + } + List list = baseDao.selectStaffOrgList(staffOrgsFormDTO.getCustomerIdList()); + return new Result>().ok(list); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 18bb63b7b9..03f2671806 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -21,5 +21,20 @@ - + + \ 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 1a8958a306..3478b0fbba 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 @@ -8,6 +8,7 @@ select * from customer_staff cs where cs.MOBILE=#{mobile} and cs.DEL_FLAG='1' + order by cs.ACTIVE_TIME desc,cs.CREATED_TIME asc From aa2c0d1ab76fd874fae0fa70ac03cda29a8a5b98 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Apr 2020 23:06:26 +0800 Subject: [PATCH 005/174] =?UTF-8?q?=E5=88=A0=E9=99=A4staff=5Flogin=5Fhisto?= =?UTF-8?q?ry=EF=BC=8C=E6=94=B9=E4=B8=BAstaff=5Fagency=5Fhistory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/EpmetUserFeignClient.java | 10 ++-- .../EpmetUserFeignClientFallback.java | 6 +- .../service/impl/GovLoginServiceImpl.java | 58 +++++++++--------- .../controller/CustomerGridController.java | 6 +- .../java/com/epmet/dao/CustomerGridDao.java | 6 +- .../epmet/service/CustomerGridService.java | 6 +- .../service/impl/CustomerGridServiceImpl.java | 16 ++--- .../main/resources/mapper/CustomerGridDao.xml | 2 +- ...ava => StaffLoginAgencyRecordFormDTO.java} | 2 +- ...O.java => StaffLatestAgencyResultDTO.java} | 7 +-- ...java => StaffAgencyHistoryController.java} | 23 +++---- ...oryDao.java => StaffAgencyHistoryDao.java} | 13 ++-- ...ce.java => StaffAgencyHistoryService.java} | 33 +++++----- ...ava => StaffAgencyHistoryServiceImpl.java} | 60 +++++++++---------- 14 files changed, 121 insertions(+), 127 deletions(-) rename epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/{StaffLoginHistoryFormDTO.java => StaffLoginAgencyRecordFormDTO.java} (89%) rename epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/{LatestStaffWechatLoginResultDTO.java => StaffLatestAgencyResultDTO.java} (80%) rename epmet-user/epmet-user-server/src/main/java/com/epmet/controller/{StaffLoginHistoryController.java => StaffAgencyHistoryController.java} (68%) rename epmet-user/epmet-user-server/src/main/java/com/epmet/dao/{StaffLoginHistoryDao.java => StaffAgencyHistoryDao.java} (78%) rename epmet-user/epmet-user-server/src/main/java/com/epmet/service/{StaffLoginHistoryService.java => StaffAgencyHistoryService.java} (71%) rename epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/{StaffLoginHistoryServiceImpl.java => StaffAgencyHistoryServiceImpl.java} (54%) diff --git a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index d62c41b2c4..d0a61aa757 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -6,8 +6,8 @@ import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; +import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -85,8 +85,8 @@ public interface EpmetUserFeignClient { * @Description 获取当前微信上次登录的账号信息 * @Date 2020/4/20 12:53 **/ - @GetMapping(value = "epmetuser/staffloginhistory/getlatest/{openId}") - Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId); + @GetMapping(value = "epmetuser/staffagencyhistory/getlatest/{openId}") + Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId); /** * @param customerStaffFormDTO @@ -105,6 +105,6 @@ public interface EpmetUserFeignClient { * @Description 保存登录日志 * @Date 2020/4/20 14:38 **/ - @PostMapping(value = "epmetuser/staffloginhistory/saveStaffLoginRecord", consumes = MediaType.APPLICATION_JSON_VALUE) - Result saveStaffLoginRecord(StaffLoginHistoryFormDTO staffLoginHistoryFormDTO); + @PostMapping(value = "epmetuser/staffagencyhistory/saveStaffLoginRecord", consumes = MediaType.APPLICATION_JSON_VALUE) + Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO staffLoginHistoryFormDTO); } diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 571785b43f..b08fcbca1a 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -7,8 +7,8 @@ import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; +import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -48,7 +48,7 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { } @Override - public Result getLatestStaffWechatLoginRecord(String openId) { + public Result getLatestStaffWechatLoginRecord(String openId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLatestStaffWechatLoginRecord", openId); } @@ -58,7 +58,7 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { } @Override - public Result saveStaffLoginRecord(StaffLoginHistoryFormDTO staffLoginHistoryFormDTO) { + public Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO staffLoginHistoryFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffLoginRecord", staffLoginHistoryFormDTO); } 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 5f6480ef2c..d8ebf53c1e 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 @@ -122,57 +122,55 @@ public class GovLoginServiceImpl implements GovLoginService { public Result loginByWxCode(GovWxmpFormDTO formDTO) { //1、解析微信用户 WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(formDTO.getApp(), formDTO.getWxCode()); - Result latestStaffWechat = epmetUserFeignClient.getLatestStaffWechatLoginRecord(wxMaJscode2SessionResult.getOpenid()); + Result latestStaffWechat = epmetUserFeignClient.getLatestStaffWechatLoginRecord(wxMaJscode2SessionResult.getOpenid()); if (!latestStaffWechat.success() || null == latestStaffWechat.getData()) { logger.error(String.format("没有获取到用户最近一次登录账户信息,code[%s],msg[%s]", EpmetErrorCode.PLEASE_LOGIN.getCode(), EpmetErrorCode.PLEASE_LOGIN.getMsg())); return new Result().error(EpmetErrorCode.PLEASE_LOGIN.getCode()); } - LatestStaffWechatLoginResultDTO latestStaffWechatLoginDTO = latestStaffWechat.getData(); + StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData(); //2、记录staff_wechat - this.savestaffwechat(latestStaffWechatLoginDTO.getStaffId(), wxMaJscode2SessionResult.getOpenid()); + this.savestaffwechat(staffLatestAgencyResultDTO.getStaffId(), wxMaJscode2SessionResult.getOpenid()); //3、记录登录日志 - this.saveStaffLoginRecord(latestStaffWechatLoginDTO); + this.saveStaffLoginRecord(staffLatestAgencyResultDTO); //4、获取用户token - String token = this.generateGovWxmpToken(latestStaffWechatLoginDTO.getStaffId()); + String token = this.generateGovWxmpToken(staffLatestAgencyResultDTO.getStaffId()); //5、保存到redis - this.saveLatestGovTokenDto(latestStaffWechatLoginDTO, wxMaJscode2SessionResult, token); + this.saveLatestGovTokenDto(staffLatestAgencyResultDTO, wxMaJscode2SessionResult, token); UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setToken(token); return new Result().ok(userTokenResultDTO); } //保存tokenDto到redis - private void saveLatestGovTokenDto(LatestStaffWechatLoginResultDTO latestStaffWechatLoginDTO, + private void saveLatestGovTokenDto(StaffLatestAgencyResultDTO staffLatestAgency, WxMaJscode2SessionResult wxMaJscode2SessionResult, String token) { int expire = jwtTokenProperties.getExpire(); GovTokenDto govTokenDto = new GovTokenDto(); govTokenDto.setApp(LoginConstant.APP_GOV); govTokenDto.setClient(LoginConstant.CLIENT_WXMP); - govTokenDto.setStaffId(latestStaffWechatLoginDTO.getStaffId()); + govTokenDto.setStaffId(staffLatestAgency.getStaffId()); govTokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid()); govTokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey()); govTokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid()); govTokenDto.setToken(token); govTokenDto.setUpdateTime(System.currentTimeMillis()); govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); - govTokenDto.setOrgId(latestStaffWechatLoginDTO.getOrgId()); - govTokenDto.setGridId(latestStaffWechatLoginDTO.getGridId()); - govTokenDto.setCustomerId(latestStaffWechatLoginDTO.getCustomerId()); + govTokenDto.setOrgId(staffLatestAgency.getOrgId()); + govTokenDto.setCustomerId(staffLatestAgency.getCustomerId()); cpUserDetailRedis.set(govTokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); } //保存登录日志 - private Result saveStaffLoginRecord(LatestStaffWechatLoginResultDTO latestStaffWechatLoginDTO) { - StaffLoginHistoryFormDTO staffLoginHistoryFormDTO = new StaffLoginHistoryFormDTO(); - staffLoginHistoryFormDTO.setCustomerId(latestStaffWechatLoginDTO.getCustomerId()); - staffLoginHistoryFormDTO.setStaffId(latestStaffWechatLoginDTO.getStaffId()); - staffLoginHistoryFormDTO.setWxOpenId(latestStaffWechatLoginDTO.getWxOpenId()); - staffLoginHistoryFormDTO.setMobile(latestStaffWechatLoginDTO.getMobile()); - staffLoginHistoryFormDTO.setOrgId(latestStaffWechatLoginDTO.getOrgId()); - staffLoginHistoryFormDTO.setGridId(latestStaffWechatLoginDTO.getGridId()); - Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginHistoryFormDTO); + private Result saveStaffLoginRecord(StaffLatestAgencyResultDTO latestStaffWechatLoginDTO) { + StaffLoginAgencyRecordFormDTO staffLoginAgencyRecordFormDTO = new StaffLoginAgencyRecordFormDTO(); + staffLoginAgencyRecordFormDTO.setCustomerId(latestStaffWechatLoginDTO.getCustomerId()); + staffLoginAgencyRecordFormDTO.setStaffId(latestStaffWechatLoginDTO.getStaffId()); + staffLoginAgencyRecordFormDTO.setWxOpenId(latestStaffWechatLoginDTO.getWxOpenId()); + staffLoginAgencyRecordFormDTO.setMobile(latestStaffWechatLoginDTO.getMobile()); + staffLoginAgencyRecordFormDTO.setOrgId(latestStaffWechatLoginDTO.getOrgId()); + Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginAgencyRecordFormDTO); return staffLoginRecordResult; } @@ -199,7 +197,7 @@ public class GovLoginServiceImpl implements GovLoginService { //1、获取用户token String token = this.generateGovWxmpToken(customerStaff.getUserId()); //2、保存到redis - this.saveGovTokenDto(formDTO.getOrgId(), formDTO.getCustomerId(), latestGridInfo.getGridId(), customerStaff.getUserId(), wxMaJscode2SessionResult, token); + this.saveGovTokenDto(formDTO.getOrgId(), formDTO.getCustomerId(), customerStaff.getUserId(), wxMaJscode2SessionResult, token); UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setToken(token); return new Result().ok(userTokenResultDTO); @@ -220,14 +218,14 @@ public class GovLoginServiceImpl implements GovLoginService { //保存登录日志 private Result saveStaffLoginRecord(GovWxmpEnteOrgFormDTO formDTO, String staffId, String openId, String grid) { - StaffLoginHistoryFormDTO staffLoginHistoryFormDTO = new StaffLoginHistoryFormDTO(); - staffLoginHistoryFormDTO.setCustomerId(formDTO.getCustomerId()); - staffLoginHistoryFormDTO.setStaffId(staffId); - staffLoginHistoryFormDTO.setWxOpenId(openId); - staffLoginHistoryFormDTO.setMobile(formDTO.getMobile()); - staffLoginHistoryFormDTO.setOrgId(formDTO.getOrgId()); - staffLoginHistoryFormDTO.setGridId(grid); - Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginHistoryFormDTO); + StaffLoginAgencyRecordFormDTO staffLoginAgencyRecordFormDTO = new StaffLoginAgencyRecordFormDTO(); + staffLoginAgencyRecordFormDTO.setCustomerId(formDTO.getCustomerId()); + staffLoginAgencyRecordFormDTO.setStaffId(staffId); + staffLoginAgencyRecordFormDTO.setWxOpenId(openId); + staffLoginAgencyRecordFormDTO.setMobile(formDTO.getMobile()); + staffLoginAgencyRecordFormDTO.setOrgId(formDTO.getOrgId()); + staffLoginAgencyRecordFormDTO.setGridId(grid); + Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginAgencyRecordFormDTO); return staffLoginRecordResult; } @@ -267,7 +265,6 @@ public class GovLoginServiceImpl implements GovLoginService { **/ private void saveGovTokenDto(String orgId, String customerId, - String gridId, String staffId, WxMaJscode2SessionResult wxMaJscode2SessionResult, String token) { @@ -283,7 +280,6 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setUpdateTime(System.currentTimeMillis()); govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); govTokenDto.setOrgId(orgId); - govTokenDto.setGridId(gridId); govTokenDto.setCustomerId(customerId); cpUserDetailRedis.set(govTokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 8163a30c15..b9c8f8672f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -28,9 +28,9 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffGridInfoFormDTO; +import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffGridInfoResultDTO; +import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -135,7 +135,7 @@ public class CustomerGridController { * @Date 2020/4/20 15:34 **/ @PostMapping(value = "getStaffGridInfo") - public Result> getStaffGridInfo(@RequestBody StaffGridInfoFormDTO staffGridInfoFormDTO) { + public Result getStaffGridInfo(@RequestBody StaffLatestLoginGridFormDTO staffGridInfoFormDTO) { ValidatorUtils.validateEntity(staffGridInfoFormDTO); return customerGridService.listStaffGridInfo(staffGridInfoFormDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index b42077b396..d8c308ec90 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -21,9 +21,9 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffGridInfoFormDTO; +import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffGridInfoResultDTO; +import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -70,5 +70,5 @@ public interface CustomerGridDao extends BaseDao { * @Description 查询工作人员绑定的网格列表 * @Date 2020/4/20 15:36 **/ - List selectListStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO); + List selectListStaffGridInfo(StaffLatestLoginGridFormDTO staffGridInfoFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index d8728c39dd..7b48c8724d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -23,9 +23,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffGridInfoFormDTO; +import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffGridInfoResultDTO; +import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -123,5 +123,5 @@ public interface CustomerGridService extends BaseService { * @Description 根据用户选择的组织,查询用户与网格的关系列表 * @Date 2020/4/20 15:35 **/ - Result> listStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO); + Result listStaffGridInfo(StaffLatestLoginGridFormDTO staffGridInfoFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index d4e61df8b1..b27f57019f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -20,19 +20,18 @@ 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.constant.FieldConstant; 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.CustomerGridDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffGridInfoFormDTO; +import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffGridInfoResultDTO; +import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.entity.CustomerGridEntity; - import com.epmet.redis.CustomerGridRedis; import com.epmet.service.CustomerGridService; import com.epmet.util.ModuleConstant; @@ -155,9 +154,12 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> listStaffGridInfo(StaffGridInfoFormDTO staffGridInfoFormDTO) { - List list = baseDao.selectListStaffGridInfo(staffGridInfoFormDTO); - return new Result>().ok(list); + public Result listStaffGridInfo(StaffLatestLoginGridFormDTO staffGridInfoFormDTO) { + List list = baseDao.selectListStaffGridInfo(staffGridInfoFormDTO); + if(null!=list&&list.size()>0){ + return new Result().ok(list.get(0)); + } + return new Result<>(); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 6ea3950fb8..5fa9468faa 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -94,7 +94,7 @@ - SELECT csg.GRID_ID, cg.CUSTOMER_ID, diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginHistoryFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java similarity index 89% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginHistoryFormDTO.java rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java index 14a205d032..c4fe580a11 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginHistoryFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java @@ -10,7 +10,7 @@ import java.io.Serializable; * @Date 2020/4/20 14:26 */ @Data -public class StaffLoginHistoryFormDTO implements Serializable { +public class StaffLoginAgencyRecordFormDTO implements Serializable { /** * 客户ID */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestStaffWechatLoginResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffLatestAgencyResultDTO.java similarity index 80% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestStaffWechatLoginResultDTO.java rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffLatestAgencyResultDTO.java index 5ad4ebde86..4b006dd8e6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestStaffWechatLoginResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffLatestAgencyResultDTO.java @@ -10,7 +10,7 @@ import java.io.Serializable; * @Date 2020/4/20 12:23 */ @Data -public class LatestStaffWechatLoginResultDTO implements Serializable { +public class StaffLatestAgencyResultDTO implements Serializable { private static final long serialVersionUID = -7088774184276785902L; /** @@ -37,10 +37,5 @@ public class LatestStaffWechatLoginResultDTO implements Serializable { * 组织机构id */ private String orgId; - - /** - * 网格表Id (CUSTOMER_GRID.id) - */ - private String gridId; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffLoginHistoryController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyHistoryController.java similarity index 68% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffLoginHistoryController.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyHistoryController.java index 08c8e02c94..aa1a81426f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffLoginHistoryController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyHistoryController.java @@ -18,25 +18,26 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.StaffLoginHistoryFormDTO; -import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; -import com.epmet.service.StaffLoginHistoryService; +import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; +import com.epmet.dto.result.StaffLatestAgencyResultDTO; +import com.epmet.service.StaffAgencyHistoryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** - * 工作人员登录日志表 + * 工作人员登录组织日志表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 */ @RestController -@RequestMapping("staffloginhistory") -public class StaffLoginHistoryController { +@RequestMapping("staffagencyhistory") +public class StaffAgencyHistoryController { @Autowired - private StaffLoginHistoryService staffLoginHistoryService; + private StaffAgencyHistoryService staffAgencyHistoryService; + /** * @param openId @@ -46,8 +47,8 @@ public class StaffLoginHistoryController { * @Date 2020/4/20 12:42 **/ @GetMapping(value = "getlatest/{openId}") - public Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId) { - return staffLoginHistoryService.getLatestStaffWechatLoginRecord(openId); + public Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId) { + return staffAgencyHistoryService.getLatestStaffWechatLoginRecord(openId); } /** @@ -58,7 +59,7 @@ public class StaffLoginHistoryController { * @Date 2020/4/20 14:29 **/ @PostMapping(value = "saveStaffLoginRecord") - public Result saveStaffLoginRecord(@RequestBody StaffLoginHistoryFormDTO formDTO) { - return staffLoginHistoryService.saveStaffLoginRecord(formDTO); + public Result saveStaffLoginRecord(@RequestBody StaffLoginAgencyRecordFormDTO formDTO) { + return staffAgencyHistoryService.saveStaffLoginRecord(formDTO); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffLoginHistoryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyHistoryDao.java similarity index 78% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffLoginHistoryDao.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyHistoryDao.java index 1458be2a28..0e6739ad58 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffLoginHistoryDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyHistoryDao.java @@ -18,25 +18,24 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; -import com.epmet.entity.StaffLoginHistoryEntity; +import com.epmet.dto.result.StaffLatestAgencyResultDTO; +import com.epmet.entity.StaffAgencyHistoryEntity; import org.apache.ibatis.annotations.Mapper; /** - * 工作人员登录日志表 + * 工作人员登录组织日志表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 */ @Mapper -public interface StaffLoginHistoryDao extends BaseDao { - +public interface StaffAgencyHistoryDao extends BaseDao { /** - * @return com.epmet.dto.result.LatestStaffWechatLoginDTO * @param openId + * @return com.epmet.dto.result.LatestStaffWechatLoginDTO * @Author yinzuomei * @Description 获取当前微信上次登录的账号信息 * @Date 2020/4/20 12:45 **/ - LatestStaffWechatLoginResultDTO selectLatestStaffWechatLoginRecord(String openId); + StaffLatestAgencyResultDTO selectLatestStaffWechatLoginRecord(String openId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffLoginHistoryService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyHistoryService.java similarity index 71% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffLoginHistoryService.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyHistoryService.java index fab2c9f20e..413c555f7d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffLoginHistoryService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyHistoryService.java @@ -20,51 +20,51 @@ package com.epmet.service; 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.StaffLoginHistoryDTO; -import com.epmet.dto.form.StaffLoginHistoryFormDTO; -import com.epmet.dto.result.LatestStaffWechatLoginResultDTO; -import com.epmet.entity.StaffLoginHistoryEntity; +import com.epmet.dto.StaffAgencyHistoryDTO; +import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; +import com.epmet.dto.result.StaffLatestAgencyResultDTO; +import com.epmet.entity.StaffAgencyHistoryEntity; import java.util.List; import java.util.Map; /** - * 工作人员登录日志表 + * 工作人员登录组织日志表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 */ -public interface StaffLoginHistoryService extends BaseService { +public interface StaffAgencyHistoryService extends BaseService { /** * 默认分页 * * @param params - * @return PageData + * @return PageData * @author generator * @date 2020-04-20 */ - PageData page(Map params); + PageData page(Map params); /** * 默认查询 * * @param params - * @return java.util.List + * @return java.util.List * @author generator * @date 2020-04-20 */ - List list(Map params); + List list(Map params); /** * 单条查询 * * @param id - * @return StaffLoginHistoryDTO + * @return StaffAgencyHistoryDTO * @author generator * @date 2020-04-20 */ - StaffLoginHistoryDTO get(String id); + StaffAgencyHistoryDTO get(String id); /** * 默认保存 @@ -74,7 +74,7 @@ public interface StaffLoginHistoryService extends BaseService @@ -103,7 +104,7 @@ public interface StaffLoginHistoryService extends BaseService getLatestStaffWechatLoginRecord(String openId); + Result getLatestStaffWechatLoginRecord(String openId); /** * @param formDTO @@ -112,5 +113,5 @@ public interface StaffLoginHistoryService extends BaseService implements StaffLoginHistoryService { - private static final Logger logger = LoggerFactory.getLogger(StaffLoginHistoryServiceImpl.class); +public class StaffAgencyHistoryServiceImpl extends BaseServiceImpl implements StaffAgencyHistoryService { + private static final Logger logger = LoggerFactory.getLogger(StaffAgencyHistoryServiceImpl.class); + @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( + public PageData page(Map params) { + IPage page = baseDao.selectPage( getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) ); - return getPageData(page, StaffLoginHistoryDTO.class); + return getPageData(page, StaffAgencyHistoryDTO.class); } @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); - return ConvertUtils.sourceToTarget(entityList, StaffLoginHistoryDTO.class); + return ConvertUtils.sourceToTarget(entityList, StaffAgencyHistoryDTO.class); } - private QueryWrapper getWrapper(Map params){ + private QueryWrapper getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); - QueryWrapper wrapper = new QueryWrapper<>(); + QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); return wrapper; } @Override - public StaffLoginHistoryDTO get(String id) { - StaffLoginHistoryEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, StaffLoginHistoryDTO.class); + public StaffAgencyHistoryDTO get(String id) { + StaffAgencyHistoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, StaffAgencyHistoryDTO.class); } @Override @Transactional(rollbackFor = Exception.class) - public void save(StaffLoginHistoryDTO dto) { - StaffLoginHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffLoginHistoryEntity.class); + public void save(StaffAgencyHistoryDTO dto) { + StaffAgencyHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyHistoryEntity.class); insert(entity); } @Override @Transactional(rollbackFor = Exception.class) - public void update(StaffLoginHistoryDTO dto) { - StaffLoginHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffLoginHistoryEntity.class); + public void update(StaffAgencyHistoryDTO dto) { + StaffAgencyHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyHistoryEntity.class); updateById(entity); } @@ -102,20 +103,19 @@ public class StaffLoginHistoryServiceImpl extends BaseServiceImpl getLatestStaffWechatLoginRecord(String openId) { + public Result getLatestStaffWechatLoginRecord(String openId) { if (StringUtils.isNotBlank(openId)) { logger.error("openId 不能为空"); return new Result(); } - LatestStaffWechatLoginResultDTO latestStaffWechatLoginDTO = baseDao.selectLatestStaffWechatLoginRecord(openId); - return new Result().ok(latestStaffWechatLoginDTO); + StaffLatestAgencyResultDTO latestStaffWechatLoginDTO = baseDao.selectLatestStaffWechatLoginRecord(openId); + return new Result().ok(latestStaffWechatLoginDTO); } @Override - public Result saveStaffLoginRecord(StaffLoginHistoryFormDTO formDTO) { - StaffLoginHistoryEntity entity = ConvertUtils.sourceToTarget(formDTO, StaffLoginHistoryEntity.class); + public Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO formDTO) { + StaffAgencyHistoryEntity entity = ConvertUtils.sourceToTarget(formDTO, StaffAgencyHistoryEntity.class); insert(entity); return new Result(); } - } \ No newline at end of file From b05fb2a12bb06b3a6b74394ff9e8a06cd8284183 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Apr 2020 23:07:26 +0800 Subject: [PATCH 006/174] =?UTF-8?q?=E5=88=A0=E9=99=A4staff=5Flogin=5Fhisto?= =?UTF-8?q?ry=EF=BC=8C=E6=94=B9=E4=B8=BAstaff=5Fagency=5Fhistory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oryDTO.java => StaffAgencyHistoryDTO.java} | 9 ++---- ...ity.java => StaffAgencyHistoryEntity.java} | 14 ++++------ ...storyDao.xml => StaffAgencyHistoryDao.xml} | 28 +++++++++---------- 3 files changed, 21 insertions(+), 30 deletions(-) rename epmet-user/epmet-user-client/src/main/java/com/epmet/dto/{StaffLoginHistoryDTO.java => StaffAgencyHistoryDTO.java} (91%) rename epmet-user/epmet-user-server/src/main/java/com/epmet/entity/{StaffLoginHistoryEntity.java => StaffAgencyHistoryEntity.java} (87%) rename epmet-user/epmet-user-server/src/main/resources/mapper/{StaffLoginHistoryDao.xml => StaffAgencyHistoryDao.xml} (64%) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffLoginHistoryDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyHistoryDTO.java similarity index 91% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffLoginHistoryDTO.java rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyHistoryDTO.java index 6d1674936f..21b6eb47b6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffLoginHistoryDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyHistoryDTO.java @@ -24,13 +24,13 @@ import java.util.Date; /** - * 工作人员登录日志表 + * 工作人员登录组织日志表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 */ @Data -public class StaffLoginHistoryDTO implements Serializable { +public class StaffAgencyHistoryDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -64,11 +64,6 @@ public class StaffLoginHistoryDTO implements Serializable { */ private String orgId; - /** - * 网格表Id (CUSTOMER_GRID.id) - */ - private String gridId; - /** * 删除标识:0.未删除 1.已删除 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffLoginHistoryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyHistoryEntity.java similarity index 87% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffLoginHistoryEntity.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyHistoryEntity.java index 9a9377ecfe..618bcba59f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffLoginHistoryEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyHistoryEntity.java @@ -18,20 +18,23 @@ 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-04-20 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("staff_login_history") -public class StaffLoginHistoryEntity extends BaseEpmetEntity { +@TableName("staff_agency_history") +public class StaffAgencyHistoryEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; @@ -60,9 +63,4 @@ public class StaffLoginHistoryEntity extends BaseEpmetEntity { */ private String orgId; - /** - * 网格表Id (CUSTOMER_GRID.id) - */ - private String gridId; - } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffLoginHistoryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyHistoryDao.xml similarity index 64% rename from epmet-user/epmet-user-server/src/main/resources/mapper/StaffLoginHistoryDao.xml rename to epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyHistoryDao.xml index 4f382bfa10..a9ce119bff 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffLoginHistoryDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyHistoryDao.xml @@ -1,16 +1,15 @@ - + - + - @@ -18,23 +17,22 @@ + - SELECT - slh.CUSTOMER_ID, - slh.STAFF_ID, - slh.WX_OPEN_ID, - slh.MOBILE, - slh.ORG_ID, - slh.GRID_ID + sah.CUSTOMER_ID, + sah.STAFF_ID, + sah.WX_OPEN_ID, + sah.MOBILE, + sah.ORG_ID FROM - staff_login_history slh + staff_agency_history sah WHERE - slh.DEL_FLAG = '0' - AND slh.WX_OPEN_ID =#{openId} + sah.DEL_FLAG = '0' + AND sah.WX_OPEN_ID =#{openId} ORDER BY - slh.CREATED_TIME DESC + sah.CREATED_TIME DESC LIMIT 1 - \ No newline at end of file From 0919eb7a454b85c830c362b5f06faf451184b3d7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Apr 2020 23:16:33 +0800 Subject: [PATCH 007/174] =?UTF-8?q?/loginwxmp/getmyorg=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/GovOrgFeignClient.java | 12 ------ .../fallback/GovOrgFeignClientFallback.java | 6 --- .../service/impl/GovLoginServiceImpl.java | 20 +--------- .../dto/form/StaffLatestLoginGridFormDTO.java | 33 ---------------- .../result/StaffLatestLoginGridResultDTO.java | 39 ------------------- .../controller/CustomerGridController.java | 14 ------- .../java/com/epmet/dao/CustomerGridDao.java | 10 ----- .../epmet/service/CustomerGridService.java | 10 ----- .../service/impl/CustomerGridServiceImpl.java | 11 ------ .../main/resources/mapper/CustomerGridDao.xml | 19 --------- .../form/StaffLoginAgencyRecordFormDTO.java | 4 -- 11 files changed, 2 insertions(+), 176 deletions(-) delete mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java delete mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java diff --git a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java index f284da98ab..527db417ef 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -2,9 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.form.StaffOrgFormDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -20,16 +18,6 @@ import java.util.List; */ @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallback.class) public interface GovOrgFeignClient { - /** - * @return com.epmet.commons.tools.utils.Result> - * @param staffGridInfoFormDTO - * @Author yinzuomei - * @Description - * @Date 2020/4/20 21:36 - **/ - @PostMapping(value = "gov/org/customergrid/getStaffGridInfo",consumes = MediaType.APPLICATION_JSON_VALUE) - Result getStaffLatestLoginGrid(StaffLatestLoginGridFormDTO staffGridInfoFormDTO); - /** * @return com.epmet.commons.tools.utils.Result> * @param staffOrgFormDTO diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java index 6121363dfd..a1ccd0bdf0 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java @@ -3,9 +3,7 @@ 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.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.form.StaffOrgFormDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -19,10 +17,6 @@ import java.util.List; */ @Component public class GovOrgFeignClientFallback implements GovOrgFeignClient { - @Override - public Result getStaffLatestLoginGrid(StaffLatestLoginGridFormDTO staffLatestLoginGridFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffLatestLoginGrid", staffLatestLoginGridFormDTO); - } @Override public Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO) { 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 d8ebf53c1e..6ceb130e79 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 @@ -190,10 +190,8 @@ public class GovLoginServiceImpl implements GovLoginService { WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode()); //3、记录staff_wechat this.savestaffwechat(customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); - //4、查询用户绑定的网格 - StaffLatestLoginGridResultDTO latestGridInfo = this.getLatestGridInfo(formDTO, customerStaff.getUserId()); //5、记录登录日志 - this.saveStaffLoginRecord(formDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid(), latestGridInfo.getGridId()); + this.saveStaffLoginRecord(formDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); //1、获取用户token String token = this.generateGovWxmpToken(customerStaff.getUserId()); //2、保存到redis @@ -203,28 +201,14 @@ public class GovLoginServiceImpl implements GovLoginService { return new Result().ok(userTokenResultDTO); } - //查询用户绑定的网格 - private StaffLatestLoginGridResultDTO getLatestGridInfo(GovWxmpEnteOrgFormDTO formDTO, String userId) { - StaffLatestLoginGridFormDTO staffGridInfoFormDTO = new StaffLatestLoginGridFormDTO(); - staffGridInfoFormDTO.setCustomerId(formDTO.getCustomerId()); - staffGridInfoFormDTO.setOrgId(formDTO.getOrgId()); - staffGridInfoFormDTO.setStaffId(userId); - Result staffGridInfoListResult = govOrgFeignClient.getStaffLatestLoginGrid(staffGridInfoFormDTO); - if (staffGridInfoListResult.success() && null != staffGridInfoListResult.getData()) { - return staffGridInfoListResult.getData(); - } - return new StaffLatestLoginGridResultDTO(); - } - //保存登录日志 - private Result saveStaffLoginRecord(GovWxmpEnteOrgFormDTO formDTO, String staffId, String openId, String grid) { + private Result saveStaffLoginRecord(GovWxmpEnteOrgFormDTO formDTO, String staffId, String openId) { StaffLoginAgencyRecordFormDTO staffLoginAgencyRecordFormDTO = new StaffLoginAgencyRecordFormDTO(); staffLoginAgencyRecordFormDTO.setCustomerId(formDTO.getCustomerId()); staffLoginAgencyRecordFormDTO.setStaffId(staffId); staffLoginAgencyRecordFormDTO.setWxOpenId(openId); staffLoginAgencyRecordFormDTO.setMobile(formDTO.getMobile()); staffLoginAgencyRecordFormDTO.setOrgId(formDTO.getOrgId()); - staffLoginAgencyRecordFormDTO.setGridId(grid); Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginAgencyRecordFormDTO); return staffLoginRecordResult; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java deleted file mode 100644 index f07e657f73..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.epmet.dto.form; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @Description 根据用户选择的组织,查询用户与网格的关系列表 - * @Author yinzuomei - * @Date 2020/4/20 15:29 - */ -@Data -public class StaffLatestLoginGridFormDTO implements Serializable { - /** - * 用户选择的组织所属的id - */ - @NotBlank(message = "客户id不能为空") - private String customerId; - - /** - * 用户选择的要进入的组织(根组织id) - */ - @NotBlank(message = "组织id不能为空") - private String orgId; - - /** - * 工作人员id - */ - @NotBlank(message = "staffId不能为空") - private String staffId; -} - diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java deleted file mode 100644 index 4c067bdbe2..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description 根据用户选择的组织,查询用户与网格的关系列表 - * @Author yinzuomei - * @Date 2020/4/20 15:22 - */ -@Data -public class StaffLatestLoginGridResultDTO implements Serializable { - /** - * ID 唯一标识 - */ - private String gridId; - - /** - * 客户ID - */ - private String customerId; - - /** - * 网格名称 - */ - private String gridName; - - /** - * 所属组织机构ID(customer_organization.id) - */ - private String pid; - - /** - * 所有上级组织ID - */ - private String pids; -} - diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index b9c8f8672f..2599fa67e3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -28,9 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -127,16 +125,4 @@ public class CustomerGridController { return new Result().ok(data); } - /** - * @param staffGridInfoFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 根据用户选择的组织,查询用户与网格的关系列表 - * @Date 2020/4/20 15:34 - **/ - @PostMapping(value = "getStaffGridInfo") - public Result getStaffGridInfo(@RequestBody StaffLatestLoginGridFormDTO staffGridInfoFormDTO) { - ValidatorUtils.validateEntity(staffGridInfoFormDTO); - return customerGridService.listStaffGridInfo(staffGridInfoFormDTO); - } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index d8c308ec90..a8113682c4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -21,9 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -63,12 +61,4 @@ public interface CustomerGridDao extends BaseDao { CustomerGridDTO getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); - /** - * @param staffGridInfoFormDTO - * @return java.util.List - * @Author yinzuomei - * @Description 查询工作人员绑定的网格列表 - * @Date 2020/4/20 15:36 - **/ - List selectListStaffGridInfo(StaffLatestLoginGridFormDTO staffGridInfoFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 7b48c8724d..cf24460d88 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -23,9 +23,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -116,12 +114,4 @@ public interface CustomerGridService extends BaseService { */ Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); - /** - * @param staffGridInfoFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 根据用户选择的组织,查询用户与网格的关系列表 - * @Date 2020/4/20 15:35 - **/ - Result listStaffGridInfo(StaffLatestLoginGridFormDTO staffGridInfoFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index b27f57019f..86cb83f0c2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -28,9 +28,7 @@ import com.epmet.dao.CustomerGridDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.redis.CustomerGridRedis; import com.epmet.service.CustomerGridService; @@ -151,15 +149,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) { return new Result().ok(baseDao.getCustomerGridByGridId(customerGridFormDTO)); -} - - @Override - public Result listStaffGridInfo(StaffLatestLoginGridFormDTO staffGridInfoFormDTO) { - List list = baseDao.selectListStaffGridInfo(staffGridInfoFormDTO); - if(null!=list&&list.size()>0){ - return new Result().ok(list.get(0)); - } - return new Result<>(); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 5fa9468faa..a2421ac708 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -93,23 +93,4 @@ - - \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java index c4fe580a11..ad67aba726 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java @@ -36,9 +36,5 @@ public class StaffLoginAgencyRecordFormDTO implements Serializable { */ private String orgId; - /** - * 网格表Id (CUSTOMER_GRID.id) - */ - private String gridId; } From 106382199c575afb1a062f0d6fd1752ffc74e1ff Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Apr 2020 23:18:28 +0800 Subject: [PATCH 008/174] =?UTF-8?q?=E5=88=A0=E9=99=A4staff=5Flogin=5Fhisto?= =?UTF-8?q?ry=E8=A1=A8=EF=BC=8C=E5=88=9B=E5=BB=BAstaff=5Fagency=5Fhistory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/epmet_user.sql | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql index e09dd173a2..90e2427edd 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql @@ -53,4 +53,22 @@ CREATE TABLE `staff_login_history` ( `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`ID`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员登录日志表'; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员登录日志表'; + +drop table if EXISTS staff_login_history; + +CREATE TABLE `staff_agency_history` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `STAFF_ID` varchar(64) NOT NULL COMMENT 'customer_staff.userId', + `WX_OPEN_ID` varchar(64) NOT NULL COMMENT '微信openId', + `MOBILE` varchar(20) NOT NULL COMMENT '手机号', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织机构id', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间,登录时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员登录组织日志表'; \ No newline at end of file From e51b747bc21300e64dd368fa91b75db94a6aa715 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 21 Apr 2020 13:30:51 +0800 Subject: [PATCH 009/174] =?UTF-8?q?1.=E6=96=B0=E5=A2=9Egov-access=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-access/gov-access-client/pom.xml | 16 ++ .../gov-access/gov-access-server/pom.xml | 182 ++++++++++++++++++ .../java/com/epmet/GovAccessApplication.java | 20 ++ .../com/epmet/config/ModuleConfigImpl.java | 26 +++ .../src/main/resources/bootstrap.yml | 103 ++++++++++ .../src/main/resources/logback-spring.xml | 159 +++++++++++++++ epmet-module/gov-access/pom.xml | 21 ++ epmet-module/pom.xml | 3 +- 8 files changed, 529 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-access/gov-access-client/pom.xml create mode 100644 epmet-module/gov-access/gov-access-server/pom.xml create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/GovAccessApplication.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/config/ModuleConfigImpl.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml create mode 100644 epmet-module/gov-access/pom.xml diff --git a/epmet-module/gov-access/gov-access-client/pom.xml b/epmet-module/gov-access/gov-access-client/pom.xml new file mode 100644 index 0000000000..ad7c7ab019 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/pom.xml @@ -0,0 +1,16 @@ + + + 0.3.0 + + gov-access + com.epmet + 0.3.0 + + 4.0.0 + + gov-access-client + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml new file mode 100644 index 0000000000..31695bd331 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -0,0 +1,182 @@ + + + 0.3.0 + + gov-access + com.epmet + 0.3.0 + + 4.0.0 + + gov-access-server + jar + + + + com.epmet + gov-access-client + 0.3.0 + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + + dev-local + + true + + + 8097 + dev + + + + + + epmet_gov_access_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + dev + + + 8093 + dev + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + + + test + + + 8093 + test + + + + + + epmet + elink@833066 + + 0 + 10.10.10.248 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/GovAccessApplication.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/GovAccessApplication.java new file mode 100644 index 0000000000..f4781aa923 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/GovAccessApplication.java @@ -0,0 +1,20 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class GovAccessApplication { + public static void main(String[] args) { + SpringApplication.run(GovAccessApplication.class, args); + } +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..128f1060ef --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息-新闻公告模块 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "govaccess"; + } +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..cf118b769a --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml @@ -0,0 +1,103 @@ +server: + port: @server.port@ + servlet: + context-path: /gov/access + +spring: + main: + allow-bean-definition-overriding: true + application: + name: gov-access-server + #环境 dev|test|prod + profiles: + active: dev + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml + #指定共享配置,且支持动态刷新 +# ext-config: +# - data-id: datasource.yaml +# group: ${spring.cloud.nacos.config.group} +# refresh: true +# - data-id: common.yaml +# group: ${spring.cloud.nacos.config.group} +# refresh: true +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..86fc4a6979 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/gov-access/pom.xml b/epmet-module/gov-access/pom.xml new file mode 100644 index 0000000000..3c5ac0d7dd --- /dev/null +++ b/epmet-module/gov-access/pom.xml @@ -0,0 +1,21 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + gov-access + pom + 0.3.0 + + gov-access-client + gov-access-server + + + + \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index f48d428c3e..d4fc0c7ae2 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -27,6 +27,7 @@ resi-mine resi-group resi-partymember - + gov-access + From 0b50a182f313d6112923a759254b5eff770a9513 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 21 Apr 2020 13:35:52 +0800 Subject: [PATCH 010/174] =?UTF-8?q?1.CustomerDepartment=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5org=5Fid=E6=94=B9=E4=B8=BAagency=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/entity/CustomerDepartmentEntity.java | 4 ++-- .../src/main/resources/mapper/CustomerDepartmentDao.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java index b34f814bc1..70771bee51 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java @@ -44,9 +44,9 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity { private String customerId; /** - * 所属组织机构ID(customer_organization.id) + * 所属组织机构ID(customer_agency.id) */ - private String orgId; + private String agencyId; /** * 部门名称 diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml index 9f595da2fe..7543fe31f6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -6,7 +6,7 @@ - + From c80183c7cdd7b78ae5cf9486653361faf6a3662c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Apr 2020 16:10:17 +0800 Subject: [PATCH 011/174] =?UTF-8?q?=E6=9A=82=E5=AD=981?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/EpmetUserFeignClient.java | 4 +- .../service/impl/GovLoginServiceImpl.java | 4 +- .../src/main/resources/application.yml | 6 +- .../com/epmet/dto/CustomerDepartmentDTO.java | 7 +- .../entity/CustomerDepartmentEntity.java | 5 +- .../resources/db/migration/epmet_gov_org.sql | 34 +++---- ...oryDTO.java => StaffAgencyVisitedDTO.java} | 13 ++- .../com/epmet/dto/StaffGridVisitedDTO.java | 86 ++++++++++++++++ ...java => StaffAgencyVisitedController.java} | 17 ++-- .../StaffGridVisitedController.java | 39 ++++++++ ...oryDao.java => StaffAgencyVisitedDao.java} | 8 +- .../com/epmet/dao/StaffGridVisitedDao.java | 33 +++++++ ...ity.java => StaffAgencyVisitedEntity.java} | 12 +-- .../epmet/entity/StaffGridVisitedEntity.java | 56 +++++++++++ ...ce.java => StaffAgencyVisitedService.java} | 39 ++++---- .../service/StaffGridVisitedService.java | 95 ++++++++++++++++++ .../service/UserResiRegisterVisitService.java | 2 - ...ava => StaffAgencyVisitedServiceImpl.java} | 48 ++++----- .../impl/StaffGridVisitedServiceImpl.java | 99 +++++++++++++++++++ .../resources/db/migration/epmet_user.sql | 20 +++- ...storyDao.xml => StaffAgencyVisitedDao.xml} | 6 +- .../resources/mapper/StaffGridVisitedDao.xml | 20 ++++ 22 files changed, 544 insertions(+), 109 deletions(-) rename epmet-user/epmet-user-client/src/main/java/com/epmet/dto/{StaffAgencyHistoryDTO.java => StaffAgencyVisitedDTO.java} (89%) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffGridVisitedDTO.java rename epmet-user/epmet-user-server/src/main/java/com/epmet/controller/{StaffAgencyHistoryController.java => StaffAgencyVisitedController.java} (82%) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java rename epmet-user/epmet-user-server/src/main/java/com/epmet/dao/{StaffAgencyHistoryDao.java => StaffAgencyVisitedDao.java} (86%) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java rename epmet-user/epmet-user-server/src/main/java/com/epmet/entity/{StaffAgencyHistoryEntity.java => StaffAgencyVisitedEntity.java} (85%) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffGridVisitedEntity.java rename epmet-user/epmet-user-server/src/main/java/com/epmet/service/{StaffAgencyHistoryService.java => StaffAgencyVisitedService.java} (74%) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java rename epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/{StaffAgencyHistoryServiceImpl.java => StaffAgencyVisitedServiceImpl.java} (67%) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffGridVisitedServiceImpl.java rename epmet-user/epmet-user-server/src/main/resources/mapper/{StaffAgencyHistoryDao.xml => StaffAgencyVisitedDao.xml} (86%) create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml diff --git a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index d0a61aa757..6bebb97f96 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -85,7 +85,7 @@ public interface EpmetUserFeignClient { * @Description 获取当前微信上次登录的账号信息 * @Date 2020/4/20 12:53 **/ - @GetMapping(value = "epmetuser/staffagencyhistory/getlatest/{openId}") + @GetMapping(value = "epmetuser/staffagencyvisited/getlatest/{openId}") Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId); /** @@ -105,6 +105,6 @@ public interface EpmetUserFeignClient { * @Description 保存登录日志 * @Date 2020/4/20 14:38 **/ - @PostMapping(value = "epmetuser/staffagencyhistory/saveStaffLoginRecord", consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "epmetuser/staffagencyvisited/saveStaffLoginRecord", consumes = MediaType.APPLICATION_JSON_VALUE) Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO staffLoginHistoryFormDTO); } 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 6ceb130e79..85c6991c39 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 @@ -149,7 +149,7 @@ public class GovLoginServiceImpl implements GovLoginService { GovTokenDto govTokenDto = new GovTokenDto(); govTokenDto.setApp(LoginConstant.APP_GOV); govTokenDto.setClient(LoginConstant.CLIENT_WXMP); - govTokenDto.setStaffId(staffLatestAgency.getStaffId()); + govTokenDto.setUserId(staffLatestAgency.getStaffId()); govTokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid()); govTokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey()); govTokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid()); @@ -256,7 +256,7 @@ public class GovLoginServiceImpl implements GovLoginService { GovTokenDto govTokenDto = new GovTokenDto(); govTokenDto.setApp(LoginConstant.APP_GOV); govTokenDto.setClient(LoginConstant.CLIENT_WXMP); - govTokenDto.setStaffId(staffId); + govTokenDto.setUserId(staffId); govTokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid()); govTokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey()); govTokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid()); diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index ec95859518..f759f036b9 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,9 +9,9 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://localhost:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false - username: epmet - password: elink@833066 + url: jdbc:mysql://192.168.1.130:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false + username: epmet_dba + password: EpmEt-dbA-UsEr #oracle配置 # driverClassName: oracle.jdbc.OracleDriver # url: jdbc:oracle:thin:@192.168.10.10:1521:helowin diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java index 0248ff77e2..3c97da56b3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -44,9 +45,9 @@ public class CustomerDepartmentDTO implements Serializable { private String customerId; /** - * 所属组织机构ID(customer_organization.id) + * 所属组织机构ID(customer_organization.id)AGENCY_ID */ - private String orgId; + private String agencyId; /** * 部门名称 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java index b34f814bc1..4c0ccf2156 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java @@ -18,13 +18,10 @@ 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; - /** * 客户部门表 * @@ -46,7 +43,7 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity { /** * 所属组织机构ID(customer_organization.id) */ - private String orgId; + private String agencyId; /** * 部门名称 diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql index c53d7724f0..34bf6d70cc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql @@ -2,7 +2,7 @@ DROP TABLE IF EXISTS `customer_department`; CREATE TABLE `customer_department` ( `ID` varchar(64) NOT NULL COMMENT 'ID 唯一标识', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', - `ORG_ID` varchar(64) NOT NULL COMMENT '所属组织机构ID(customer_organization.id)', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '所属机关ID(customer_agency.id)', `DEPARTMENT_NAME` varchar(128) NOT NULL COMMENT '部门名称', `DEPARTMENT_DUTY` varchar(255) NOT NULL COMMENT '部门职责', `TOTAL_USER` int(11) NOT NULL COMMENT '总人数', @@ -12,19 +12,19 @@ CREATE TABLE `customer_department` ( `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户部门表 '; + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='客户部门表 '; -- ----------------------------------------------------------------------- -- ----------------------------------------------------------------------- -DROP TABLE IF EXISTS `customer_organization`; -CREATE TABLE `customer_organization` ( +DROP TABLE IF EXISTS `customer_agency`; +CREATE TABLE `customer_agency` ( `ID` varchar(64) NOT NULL COMMENT 'ID', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', `PID` varchar(64) NOT NULL COMMENT '上级组织机构ID', `PIDS` varchar(1024) NOT NULL COMMENT '所有上级组织机构ID(以英文:隔开)', `ALL_PARENT_NAME` varchar(1024) DEFAULT NULL COMMENT '所有上级名称,以-连接', `ORGANIZATION_NAME` varchar(64) NOT NULL COMMENT '组织名称', - `LEVEL` int(10) NOT NULL COMMENT '机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province)', + `LEVEL` varchar(30) NOT NULL COMMENT '机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province)', `AREA_CODE` int(10) NOT NULL COMMENT '地区编码', `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', `REVISION` int(10) NOT NULL COMMENT '乐观锁', @@ -33,8 +33,8 @@ CREATE TABLE `customer_organization` ( `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', `TOTAL_USER` int(11) DEFAULT NULL COMMENT '总人数', - PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织机构表 '; + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='机关单位信息表'; -- ----------------------------------------------------------------------- -- ----------------------------------------------------------------------- DROP TABLE IF EXISTS `customer_staff_department`; @@ -49,8 +49,8 @@ CREATE TABLE `customer_staff_department` ( `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门人员关系表 '; + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='部门人员关系表 '; -- ----------------------------------------------------------------------- -- ----------------------------------------------------------------------- @@ -66,24 +66,24 @@ CREATE TABLE `customer_staff_grid` ( `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网格人员关系表 '; + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格人员关系表 '; -- ----------------------------------------------------------------------- -- ----------------------------------------------------------------------- -DROP TABLE IF EXISTS `customer_staff_organization`; -CREATE TABLE `customer_staff_organization` ( +DROP TABLE IF EXISTS `customer_staff_agency`; +CREATE TABLE `customer_staff_agency` ( `ID` varchar(64) NOT NULL COMMENT 'ID', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', `USER_ID` varchar(64) NOT NULL COMMENT '用户ID', - `ORG_ID` varchar(64) NOT NULL COMMENT '组织机构ID customer_organization.id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织机构ID customer_agency.id', `DEL_FLAG` int(10) NOT NULL COMMENT '删除标识', `REVISION` int(10) NOT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织人员关系表 '; + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='人员-机关单位关系表'; -- ----------------------------------------------------------------------- -- ----------------------------------------------------------------------- diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyHistoryDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyVisitedDTO.java similarity index 89% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyHistoryDTO.java rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyVisitedDTO.java index 21b6eb47b6..45c5c443a8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyHistoryDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyVisitedDTO.java @@ -17,20 +17,19 @@ package com.epmet.dto; -import lombok.Data; - import java.io.Serializable; import java.util.Date; +import lombok.Data; /** - * 工作人员登录组织日志表 + * 工作人员进入组织日志表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2020-04-21 */ @Data -public class StaffAgencyHistoryDTO implements Serializable { +public class StaffAgencyVisitedDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -60,9 +59,9 @@ public class StaffAgencyHistoryDTO implements Serializable { private String mobile; /** - * 组织机构id + * 机关单位id来源于customer_agency.id */ - private String orgId; + private String agencyId; /** * 删除标识:0.未删除 1.已删除 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffGridVisitedDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffGridVisitedDTO.java new file mode 100644 index 0000000000..328aafad2e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffGridVisitedDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员进入网格日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-21 + */ +@Data +public class StaffGridVisitedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间,登录时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyHistoryController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java similarity index 82% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyHistoryController.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java index aa1a81426f..5111dc2a25 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyHistoryController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java @@ -20,24 +20,23 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; -import com.epmet.service.StaffAgencyHistoryService; +import com.epmet.service.StaffAgencyVisitedService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** - * 工作人员登录组织日志表 + * 工作人员进入组织日志表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2020-04-21 */ @RestController -@RequestMapping("staffagencyhistory") -public class StaffAgencyHistoryController { +@RequestMapping("staffagencyvisited") +public class StaffAgencyVisitedController { @Autowired - private StaffAgencyHistoryService staffAgencyHistoryService; - + private StaffAgencyVisitedService staffAgencyVisitedService; /** * @param openId @@ -48,7 +47,7 @@ public class StaffAgencyHistoryController { **/ @GetMapping(value = "getlatest/{openId}") public Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId) { - return staffAgencyHistoryService.getLatestStaffWechatLoginRecord(openId); + return staffAgencyVisitedService.getLatestStaffWechatLoginRecord(openId); } /** @@ -60,6 +59,6 @@ public class StaffAgencyHistoryController { **/ @PostMapping(value = "saveStaffLoginRecord") public Result saveStaffLoginRecord(@RequestBody StaffLoginAgencyRecordFormDTO formDTO) { - return staffAgencyHistoryService.saveStaffLoginRecord(formDTO); + return staffAgencyVisitedService.saveStaffLoginRecord(formDTO); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java new file mode 100644 index 0000000000..ec34fb21fb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.service.StaffGridVisitedService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 工作人员进入网格日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-21 + */ +@RestController +@RequestMapping("staffgridvisited") +public class StaffGridVisitedController { + + @Autowired + private StaffGridVisitedService staffGridVisitedService; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyHistoryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java similarity index 86% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyHistoryDao.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java index 0e6739ad58..189b179f0c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyHistoryDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java @@ -19,17 +19,17 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.result.StaffLatestAgencyResultDTO; -import com.epmet.entity.StaffAgencyHistoryEntity; +import com.epmet.entity.StaffAgencyVisitedEntity; import org.apache.ibatis.annotations.Mapper; /** - * 工作人员登录组织日志表 + * 工作人员进入组织日志表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2020-04-21 */ @Mapper -public interface StaffAgencyHistoryDao extends BaseDao { +public interface StaffAgencyVisitedDao extends BaseDao { /** * @param openId * @return com.epmet.dto.result.LatestStaffWechatLoginDTO diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java new file mode 100644 index 0000000000..d905202603 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.StaffGridVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员进入网格日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-21 + */ +@Mapper +public interface StaffGridVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyHistoryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyVisitedEntity.java similarity index 85% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyHistoryEntity.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyVisitedEntity.java index 618bcba59f..44c0ab2f51 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyHistoryEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyVisitedEntity.java @@ -26,15 +26,15 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 工作人员登录组织日志表 + * 工作人员进入组织日志表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2020-04-21 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("staff_agency_history") -public class StaffAgencyHistoryEntity extends BaseEpmetEntity { +@TableName("staff_agency_visited") +public class StaffAgencyVisitedEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; @@ -59,8 +59,8 @@ public class StaffAgencyHistoryEntity extends BaseEpmetEntity { private String mobile; /** - * 组织机构id + * 机关单位id来源于customer_agency.id */ - private String orgId; + private String agencyId; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffGridVisitedEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffGridVisitedEntity.java new file mode 100644 index 0000000000..9c6ffe281e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffGridVisitedEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-04-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_grid_visited") +public class StaffGridVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * customer_staff.userId + */ + private String staffId; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyHistoryService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java similarity index 74% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyHistoryService.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java index 413c555f7d..4b67657992 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyHistoryService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java @@ -20,51 +20,51 @@ package com.epmet.service; 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.StaffAgencyHistoryDTO; +import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; -import com.epmet.entity.StaffAgencyHistoryEntity; +import com.epmet.entity.StaffAgencyVisitedEntity; import java.util.List; import java.util.Map; /** - * 工作人员登录组织日志表 + * 工作人员进入组织日志表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2020-04-21 */ -public interface StaffAgencyHistoryService extends BaseService { +public interface StaffAgencyVisitedService extends BaseService { /** * 默认分页 * * @param params - * @return PageData + * @return PageData * @author generator - * @date 2020-04-20 + * @date 2020-04-21 */ - PageData page(Map params); + PageData page(Map params); /** * 默认查询 * * @param params - * @return java.util.List + * @return java.util.List * @author generator - * @date 2020-04-20 + * @date 2020-04-21 */ - List list(Map params); + List list(Map params); /** * 单条查询 * * @param id - * @return StaffAgencyHistoryDTO + * @return StaffAgencyVisitedDTO * @author generator - * @date 2020-04-20 + * @date 2020-04-21 */ - StaffAgencyHistoryDTO get(String id); + StaffAgencyVisitedDTO get(String id); /** * 默认保存 @@ -72,9 +72,9 @@ public interface StaffAgencyHistoryService extends BaseService diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java new file mode 100644 index 0000000000..ce181b1323 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.StaffGridVisitedDTO; +import com.epmet.entity.StaffGridVisitedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作人员进入网格日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-21 + */ +public interface StaffGridVisitedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return StaffGridVisitedDTO + * @author generator + * @date 2020-04-21 + */ + StaffGridVisitedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-21 + */ + void save(StaffGridVisitedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-21 + */ + void update(StaffGridVisitedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-21 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiRegisterVisitService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiRegisterVisitService.java index 579cb1e1c3..414706ee2c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiRegisterVisitService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiRegisterVisitService.java @@ -19,12 +19,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserResiRegisterVisitDTO; import com.epmet.dto.form.ResiRegisterFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.form.VerificationCodeFormDTO; import com.epmet.dto.result.ResiRegisterResultDTO; import com.epmet.entity.UserResiRegisterVisitEntity; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyHistoryServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java similarity index 67% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyHistoryServiceImpl.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java index 90d2e6160d..399b4c6bf0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyHistoryServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java @@ -24,12 +24,12 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dao.StaffAgencyHistoryDao; -import com.epmet.dto.StaffAgencyHistoryDTO; +import com.epmet.dao.StaffAgencyVisitedDao; +import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; -import com.epmet.entity.StaffAgencyHistoryEntity; -import com.epmet.service.StaffAgencyHistoryService; +import com.epmet.entity.StaffAgencyVisitedEntity; +import com.epmet.service.StaffAgencyVisitedService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,57 +41,57 @@ import java.util.List; import java.util.Map; /** - * 工作人员登录组织日志表 + * 工作人员进入组织日志表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2020-04-21 */ @Service -public class StaffAgencyHistoryServiceImpl extends BaseServiceImpl implements StaffAgencyHistoryService { - private static final Logger logger = LoggerFactory.getLogger(StaffAgencyHistoryServiceImpl.class); +public class StaffAgencyVisitedServiceImpl extends BaseServiceImpl implements StaffAgencyVisitedService { + private static final Logger logger = LoggerFactory.getLogger(StaffAgencyVisitedServiceImpl.class); @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( + public PageData page(Map params) { + IPage page = baseDao.selectPage( getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) ); - return getPageData(page, StaffAgencyHistoryDTO.class); + return getPageData(page, StaffAgencyVisitedDTO.class); } @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); - return ConvertUtils.sourceToTarget(entityList, StaffAgencyHistoryDTO.class); + return ConvertUtils.sourceToTarget(entityList, StaffAgencyVisitedDTO.class); } - private QueryWrapper getWrapper(Map params){ + private QueryWrapper getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); - QueryWrapper wrapper = new QueryWrapper<>(); + QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); return wrapper; } @Override - public StaffAgencyHistoryDTO get(String id) { - StaffAgencyHistoryEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, StaffAgencyHistoryDTO.class); + public StaffAgencyVisitedDTO get(String id) { + StaffAgencyVisitedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, StaffAgencyVisitedDTO.class); } @Override @Transactional(rollbackFor = Exception.class) - public void save(StaffAgencyHistoryDTO dto) { - StaffAgencyHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyHistoryEntity.class); + public void save(StaffAgencyVisitedDTO dto) { + StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyVisitedEntity.class); insert(entity); } @Override @Transactional(rollbackFor = Exception.class) - public void update(StaffAgencyHistoryDTO dto) { - StaffAgencyHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyHistoryEntity.class); + public void update(StaffAgencyVisitedDTO dto) { + StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyVisitedEntity.class); updateById(entity); } @@ -114,7 +114,7 @@ public class StaffAgencyHistoryServiceImpl extends BaseServiceImpl + * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.StaffGridVisitedDao; +import com.epmet.dto.StaffGridVisitedDTO; +import com.epmet.entity.StaffGridVisitedEntity; +import com.epmet.service.StaffGridVisitedService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作人员进入网格日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-21 + */ +@Service +public class StaffGridVisitedServiceImpl extends BaseServiceImpl implements StaffGridVisitedService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, StaffGridVisitedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, StaffGridVisitedDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public StaffGridVisitedDTO get(String id) { + StaffGridVisitedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, StaffGridVisitedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(StaffGridVisitedDTO dto) { + StaffGridVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffGridVisitedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(StaffGridVisitedDTO dto) { + StaffGridVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffGridVisitedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql index 90e2427edd..9283e23220 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql @@ -57,13 +57,13 @@ CREATE TABLE `staff_login_history` ( drop table if EXISTS staff_login_history; -CREATE TABLE `staff_agency_history` ( +CREATE TABLE `staff_agency_visited` ( `ID` varchar(64) NOT NULL COMMENT '唯一标识', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', `STAFF_ID` varchar(64) NOT NULL COMMENT 'customer_staff.userId', `WX_OPEN_ID` varchar(64) NOT NULL COMMENT '微信openId', `MOBILE` varchar(20) NOT NULL COMMENT '手机号', - `ORG_ID` varchar(64) NOT NULL COMMENT '组织机构id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关单位id来源于customer_agency.id', `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', `REVISION` int(11) NOT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', @@ -71,4 +71,18 @@ CREATE TABLE `staff_agency_history` ( `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`ID`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员登录组织日志表'; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员进入组织日志表'; + +CREATE TABLE `staff_grid_visited` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `STAFF_ID` varchar(64) NOT NULL COMMENT 'customer_staff.userId', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间,登录时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员进入网格日志表'; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyHistoryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml similarity index 86% rename from epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyHistoryDao.xml rename to epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml index a9ce119bff..687edca880 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyHistoryDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml @@ -1,15 +1,15 @@ - + - + - + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml new file mode 100644 index 0000000000..38ce0bff3c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 02ab6e9e62b11c0ea20e3a6994f31d2e3df547de Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Apr 2020 16:27:45 +0800 Subject: [PATCH 012/174] =?UTF-8?q?=E6=89=BE=E5=9B=9E@LoginUser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/LoginController.java | 3 ++- .../tools/security/dto/GovTokenDto.java | 2 +- .../tools/utils/CpUserDetailRedis.java | 2 +- .../epmet/controller/OperMenuController.java | 13 ++++++----- .../epmet/controller/CustomerController.java | 5 +++-- .../controller/ResiCommentController.java | 5 +++-- .../group/controller/ResiGroupController.java | 21 +++++++++--------- .../controller/GroupInvitationController.java | 7 +++--- .../controller/ResiGroupMemberController.java | 20 ++++++++++------- .../topic/controller/ResiTopicController.java | 22 +++++++++++-------- .../StrangerResiGuideController.java | 3 ++- .../epmet/controller/UserGuideController.java | 3 ++- .../controller/ResiMineGridController.java | 3 ++- .../controller/UserMessageController.java | 5 +++-- .../controller/PartyMemberController.java | 9 ++++---- .../controller/ResiRegisterController.java | 7 +++--- .../controller/ResiWarmheartedController.java | 5 +++-- .../epmet/controller/OperUserController.java | 5 +++-- .../com/epmet/controller/UserController.java | 3 ++- 19 files changed, 83 insertions(+), 60 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java index dc876a1ccc..12f697188a 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -92,7 +93,7 @@ public class LoginController { * @Date 2020/3/18 22:43 **/ @PostMapping(value = "logout") - public Result logout(TokenDto tokenDto, HttpServletRequest request) { + public Result logout(@LoginUser TokenDto tokenDto, HttpServletRequest request) { //String token = request.getParameter(Constant.TOKEN_HEADER); return loginService.logoutByToken(tokenDto); } 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 e46a4c1119..e2b6b18bda 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 @@ -25,7 +25,7 @@ public class GovTokenDto implements Serializable { /** * 用户ID */ - private String staffId; + private String userId; /** * sessionKey diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java index 100c583a01..9d3e2c3083 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java @@ -105,7 +105,7 @@ public class CpUserDetailRedis { if (user == null) { return; } - String key = RedisKeys.getCpUserKey(user.getApp(), user.getClient(), user.getStaffId()); + String key = RedisKeys.getCpUserKey(user.getApp(), user.getClient(), user.getUserId()); //bean to map Map map = BeanUtil.beanToMap(user, false, true); redisUtils.hMSet(key, map, expire); diff --git a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java index 12e8fae171..80f82dff81 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java +++ b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -57,7 +58,7 @@ public class OperMenuController { } @PostMapping - public Result save(@RequestBody OperMenuDTO dto, TokenDto tokenDto){ + public Result save(@RequestBody OperMenuDTO dto, @LoginUser TokenDto tokenDto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); operMenuService.save(dto,tokenDto); @@ -65,7 +66,7 @@ public class OperMenuController { } @PutMapping - public Result update(@RequestBody OperMenuDTO dto, TokenDto tokenDto){ + public Result update(@RequestBody OperMenuDTO dto, @LoginUser TokenDto tokenDto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); operMenuService.update(dto,tokenDto); @@ -81,7 +82,7 @@ public class OperMenuController { } @DeleteMapping("{id}") - public Result delete(@PathVariable("id") String id, TokenDto tokenDto){ + public Result delete(@PathVariable("id") String id, @LoginUser TokenDto tokenDto){ //效验数据 AssertUtils.isNull(id, "id"); @@ -120,7 +121,7 @@ public class OperMenuController { * @return List */ @GetMapping("nav") - public Result> nav(TokenDto tokenDto){ + public Result> nav(@LoginUser TokenDto tokenDto){ List list = operMenuService.getUserMenuNavList(tokenDto); return new Result>().ok(list); } @@ -131,7 +132,7 @@ public class OperMenuController { * @return Set */ @GetMapping("permissions") - public Result> permissions(TokenDto tokenDto){ + public Result> permissions(@LoginUser TokenDto tokenDto){ Set set = operMenuService.getUserPermissions(tokenDto); return new Result>().ok(set); } @@ -142,7 +143,7 @@ public class OperMenuController { * @return */ @GetMapping("select") - public Result> select(TokenDto tokenDto){ + public Result> select(@LoginUser TokenDto tokenDto){ List list = operMenuService.getUserMenuList(tokenDto, null); return new Result>().ok(list); 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 7cca833383..87b1f0f38b 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 @@ -18,6 +18,7 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -25,8 +26,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.excel.CustomerExcel; @@ -132,7 +133,7 @@ public class CustomerController { * @Date 2020/3/11 21:58 **/ @GetMapping("getvalidcustomerlist") - public Result> getValidCustomerList(TokenDto tokenDTO) { + public Result> getValidCustomerList(@LoginUser TokenDto tokenDTO) { logger.info("getvalidcustomerlist:"+ JSON.toJSONString(tokenDTO)); return customerService.getValidCustomerList(); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java index bc29a28ee2..321069290b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java @@ -1,5 +1,6 @@ package com.epmet.modules.comment.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -37,7 +38,7 @@ public class ResiCommentController { * @Date 2020.04.01 18:06 **/ @PostMapping("commenttopic") - public Result commentTopic(TokenDto tokenDto, @RequestBody ResiPublishCommentFormDTO publishCommentFormDTO){ + public Result commentTopic(@LoginUser TokenDto tokenDto, @RequestBody ResiPublishCommentFormDTO publishCommentFormDTO){ ValidatorUtils.validateEntity(publishCommentFormDTO); return commentService.commentTopic(tokenDto,publishCommentFormDTO); } @@ -51,7 +52,7 @@ public class ResiCommentController { * @Date 2020.04.01 23:49 **/ @PostMapping("getcommentlistoftopic") - public Result> getCommentListOfTopic(TokenDto tokenDto, @RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){ + public Result> getCommentListOfTopic(@LoginUser TokenDto tokenDto, @RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){ ValidatorUtils.validateEntity(queryCommentFormDTO); return commentService.getCommentList(tokenDto,queryCommentFormDTO); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index 54db90c905..ccb77ea7cb 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -17,6 +17,7 @@ package com.epmet.modules.group.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -63,7 +64,7 @@ public class ResiGroupController { * @Date 2020/3/28 20:36 **/ @PostMapping("getmygroup") - public Result> getMyGroup(TokenDto tokenDto, @RequestBody MyGroupFormDTO myGroupFormDTO) { + public Result> getMyGroup(@LoginUser TokenDto tokenDto, @RequestBody MyGroupFormDTO myGroupFormDTO) { myGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(myGroupFormDTO); return resiGroupService.getMyGroup(myGroupFormDTO); @@ -78,7 +79,7 @@ public class ResiGroupController { * @Date 2020/3/28 19:52 **/ @PostMapping("getrecommendgroup") - public Result> getRecommendGroup(TokenDto tokenDto, + public Result> getRecommendGroup(@LoginUser TokenDto tokenDto, @RequestBody RecommendGroupFormDTO recommendGroupFormDTO) { recommendGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(recommendGroupFormDTO); @@ -94,7 +95,7 @@ public class ResiGroupController { * @Date 2020/3/28 21:59 **/ @PostMapping("getcreated") - public Result> getCreated(TokenDto tokenDto, + public Result> getCreated(@LoginUser TokenDto tokenDto, @RequestBody CreatedFormDTO createdFormDTO) { createdFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(createdFormDTO); @@ -110,7 +111,7 @@ public class ResiGroupController { * @Date 2020/3/28 22:20 **/ @PostMapping("modifygroup") - public Result modifyGroup(TokenDto tokenDto, @RequestBody ModifyGroupFormDTO modifyGroupFormDTO) { + public Result modifyGroup(@LoginUser TokenDto tokenDto, @RequestBody ModifyGroupFormDTO modifyGroupFormDTO) { modifyGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(modifyGroupFormDTO); return resiGroupService.modifyGroup(modifyGroupFormDTO); @@ -125,7 +126,7 @@ public class ResiGroupController { * @Date 2020/3/29 17:32 **/ @PostMapping("getgroupsummarize") - public Result getGroupSummarize(TokenDto tokenDto, + public Result getGroupSummarize(@LoginUser TokenDto tokenDto, @RequestBody GroupSummarizeFormDTO groupSummarizeFormDTO) { groupSummarizeFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(groupSummarizeFormDTO); @@ -141,7 +142,7 @@ public class ResiGroupController { * @Date 2020/3/29 19:26 **/ @PostMapping("applycreategroup") - public Result applyCreateGroup(TokenDto tokenDto, + public Result applyCreateGroup(@LoginUser TokenDto tokenDto, @RequestBody ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { applyCreateGroupFormDTO.setUserId(tokenDto.getUserId()); applyCreateGroupFormDTO.setApp(tokenDto.getApp()); @@ -158,7 +159,7 @@ public class ResiGroupController { * @Date 2020/3/30 10:11 **/ @PostMapping("initapplygroup") - public Result initApplyGroup(TokenDto tokenDto, + public Result initApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody InitApplyGroupFormDTO initApplyGroupFormDTO) { if (null == tokenDto) { logger.error(ModuleConstant.USER_NOT_NULL); @@ -178,7 +179,7 @@ public class ResiGroupController { * @Date 2020/3/30 15:44 **/ @PostMapping("initapplycreategroup") - public Result initApplyCreatedGroup(TokenDto tokenDto, + public Result initApplyCreatedGroup(@LoginUser TokenDto tokenDto, @RequestBody InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO) { if (null == tokenDto) { logger.error(ModuleConstant.USER_NOT_NULL); @@ -198,7 +199,7 @@ public class ResiGroupController { * @Date 2020/3/31 12:31 **/ @PostMapping("agreeapplygroup") - public Result agreeApplyGroup(TokenDto tokenDto, @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { + public Result agreeApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { agreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(agreeApplyGroupFormDTO); return resiGroupService.agreeApplyGroup(agreeApplyGroupFormDTO); @@ -213,7 +214,7 @@ public class ResiGroupController { * @Date 2020/3/31 13:23 **/ @PostMapping("disagreeapplygroup") - public Result disagreeApplyGroup(TokenDto tokenDto, @RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { + public Result disagreeApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { disAgreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/GroupInvitationController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/GroupInvitationController.java index 6fcc9f75f9..1364dcbba8 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/GroupInvitationController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/GroupInvitationController.java @@ -17,6 +17,7 @@ package com.epmet.modules.invitation.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -55,7 +56,7 @@ public class GroupInvitationController { * @Date 2020/3/31 22:50 **/ @PostMapping("creategroupinvitation") - public Result createGroupInvitation(TokenDto tokenDto, + public Result createGroupInvitation(@LoginUser TokenDto tokenDto, @RequestBody CreateGroupInvitationFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO); @@ -70,7 +71,7 @@ public class GroupInvitationController { * @Date 2020/3/31 23:11 **/ @PostMapping("getlinkgroupinfo") - public Result getLinkGroupInfo(TokenDto tokenDto, + public Result getLinkGroupInfo(@LoginUser TokenDto tokenDto, @RequestBody LinkGroupInfoFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO); @@ -86,7 +87,7 @@ public class GroupInvitationController { * @Date 2020/3/31 23:47 **/ @PostMapping("acceptinvitation") - public Result accetInvitation(TokenDto tokenDto, + public Result accetInvitation(@LoginUser TokenDto tokenDto, @RequestBody AccetInvitationFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); formDTO.setApp(tokenDto.getApp()); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java index c358e1917c..75489585f9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java @@ -17,6 +17,7 @@ package com.epmet.modules.member.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -25,7 +26,10 @@ import com.epmet.resi.group.dto.member.form.*; import com.epmet.resi.group.dto.member.result.ApplyingMemberResultDTO; import com.epmet.resi.group.dto.member.result.GroupMemberListResultDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +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 java.util.List; @@ -51,7 +55,7 @@ public class ResiGroupMemberController { * @Date 2020/3/29 20:01 **/ @PostMapping("applyjoingroup") - public Result applyJoinGroup(TokenDto tokenDto, + public Result applyJoinGroup(@LoginUser TokenDto tokenDto, @RequestBody ApplyJoinGroupFormDTO applyJoinGroupFormDTO) { applyJoinGroupFormDTO.setUserId(tokenDto.getUserId()); applyJoinGroupFormDTO.setApp(tokenDto.getApp()); @@ -68,7 +72,7 @@ public class ResiGroupMemberController { * @Date 2020/3/30 21:14 **/ @PostMapping("getgroupmember") - public Result> getGroupMemberList(TokenDto tokenDto, + public Result> getGroupMemberList(@LoginUser TokenDto tokenDto, @RequestBody GroupMemberListFormDTO groupMemberListFormDTO) { ValidatorUtils.validateEntity(groupMemberListFormDTO); return resiGroupMemberService.getGroupMemberList(groupMemberListFormDTO); @@ -83,7 +87,7 @@ public class ResiGroupMemberController { * @Date 2020/3/30 21:37 **/ @PostMapping("getapplyingmember") - public Result> getApplyingMember(TokenDto tokenDto, + public Result> getApplyingMember(@LoginUser TokenDto tokenDto, @RequestBody ApplyingMemberFormDTO applyingMemberFormDTO) { ValidatorUtils.validateEntity(applyingMemberFormDTO); return resiGroupMemberService.getApplyingMember(applyingMemberFormDTO); @@ -98,7 +102,7 @@ public class ResiGroupMemberController { * @Date 2020/3/30 22:07 **/ @PostMapping("agreeapply") - public Result agreeApply(TokenDto tokenDto, + public Result agreeApply(@LoginUser TokenDto tokenDto, @RequestBody AgreeApplyFormDTO agreeApplyFormDTO) { agreeApplyFormDTO.setUserId(tokenDto.getUserId()); agreeApplyFormDTO.setApp(tokenDto.getApp()); @@ -115,7 +119,7 @@ public class ResiGroupMemberController { * @Date 2020/3/30 22:07 **/ @PostMapping("disagreeapply") - public Result disAgreeApply(TokenDto tokenDto, + public Result disAgreeApply(@LoginUser TokenDto tokenDto, @RequestBody DisagreeApplyFormDTO disagreeApplyFormDTO) { disagreeApplyFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(disagreeApplyFormDTO); @@ -127,7 +131,7 @@ public class ResiGroupMemberController { * @Description 楼院小组--删除组成员 **/ @PostMapping("removemember") - public Result removeMember(TokenDto tokenDto, @RequestBody RemoveMemberFormDTO removeMemberFormDTO) { + public Result removeMember(@LoginUser TokenDto tokenDto, @RequestBody RemoveMemberFormDTO removeMemberFormDTO) { removeMemberFormDTO.setUserId(tokenDto.getUserId()); removeMemberFormDTO.setApp(tokenDto.getApp()); ValidatorUtils.validateEntity(removeMemberFormDTO); @@ -142,7 +146,7 @@ public class ResiGroupMemberController { * @Description 楼院小组--禁言组员 **/ @PostMapping("slientmember") - public Result slientMember(TokenDto tokenDto, @RequestBody SlientMemberFormDTO slientMemberFormDTO) { + public Result slientMember(@LoginUser TokenDto tokenDto, @RequestBody SlientMemberFormDTO slientMemberFormDTO) { slientMemberFormDTO.setUserId(tokenDto.getUserId()); slientMemberFormDTO.setApp(tokenDto.getApp()); ValidatorUtils.validateEntity(slientMemberFormDTO); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index 6b8af29d96..b8dba5abcc 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -1,5 +1,6 @@ package com.epmet.modules.topic.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -8,7 +9,10 @@ import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +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 java.util.List; @@ -35,7 +39,7 @@ public class ResiTopicController { * @Date 2020.03.31 13:15 **/ @PostMapping("createtopic") - public Result createTopic(TokenDto tokenDto, @RequestBody ResiTopicPublishFormDTO topicPublishFormDTO){ + public Result createTopic(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPublishFormDTO topicPublishFormDTO){ ValidatorUtils.validateEntity(topicPublishFormDTO); return topicService.createTopic(tokenDto,topicPublishFormDTO); @@ -50,7 +54,7 @@ public class ResiTopicController { * @Date 2020.04.01 23:48 **/ @PostMapping("gettopicdetail") - public Result getTopicDetail(TokenDto tokenDto, @RequestBody ResiTopicDetailFormDTO topicDetailFormDTO ){ + public Result getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicDetailFormDTO topicDetailFormDTO ){ ValidatorUtils.validateEntity(topicDetailFormDTO); return topicService.getTopicDetail(tokenDto,topicDetailFormDTO.getTopicId()); } @@ -64,7 +68,7 @@ public class ResiTopicController { * @Date 2020.04.01 10:36 **/ @PostMapping("getpasttopiclist") - public Result> getPastTopicList(TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){ + public Result> getPastTopicList(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){ ValidatorUtils.validateEntity(topicPageFormDTO); return topicService.getPastTopicList(tokenDto,topicPageFormDTO); } @@ -78,7 +82,7 @@ public class ResiTopicController { * @Date 2020.04.02 00:01 **/ @PostMapping("getlatesttopics") - Result> getLatestTopics(TokenDto tokenDto, @RequestBody ResiTopicDefaultPageFormDTO topicDefaultPageFormDTO){ + Result> getLatestTopics(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicDefaultPageFormDTO topicDefaultPageFormDTO){ ValidatorUtils.validateEntity(topicDefaultPageFormDTO); return topicService.getLatestTopics(tokenDto,topicDefaultPageFormDTO.getGroupId()); } @@ -92,7 +96,7 @@ public class ResiTopicController { * @Date 2020.04.01 12:38 **/ @RequestMapping("hidetopic") - Result hideTopic(TokenDto tokenDto, @RequestBody ResiTopicOperationFormDTO hiddenFormDTO){ + Result hideTopic(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicOperationFormDTO hiddenFormDTO){ ValidatorUtils.validateEntity(hiddenFormDTO); return topicService.hideTopic(tokenDto,hiddenFormDTO); } @@ -106,7 +110,7 @@ public class ResiTopicController { * @Date 2020.04.01 16:45 **/ @PostMapping("gethiddentopic") - Result> getHiddenTopic(TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){ + Result> getHiddenTopic(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){ ValidatorUtils.validateEntity(topicPageFormDTO); return topicService.getHiddenTopics(tokenDto,topicPageFormDTO); } @@ -120,7 +124,7 @@ public class ResiTopicController { * @Date 2020.04.01 14:17 **/ @PostMapping("cancelhiddentopics") - Result cancelHiddenTopics(TokenDto tokenDto, @RequestBody ResiTopicCancelHiddenFormDTO cancelHiddenFormDTO){ + Result cancelHiddenTopics(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicCancelHiddenFormDTO cancelHiddenFormDTO){ return topicService.cancelHiddenTopics(tokenDto,cancelHiddenFormDTO.getTopicIds()); } @@ -133,7 +137,7 @@ public class ResiTopicController { * @Date 2020.04.01 15:37 **/ @PostMapping("closetopic") - Result closeTopic(TokenDto tokenDto, @RequestBody ResiTopicOperationFormDTO closeFormDTO){ + Result closeTopic(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicOperationFormDTO closeFormDTO){ ValidatorUtils.validateEntity(closeFormDTO); return topicService.closeTopic(tokenDto,closeFormDTO); } diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java index 4e9aa206cc..875d4badd0 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java @@ -17,6 +17,7 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -53,7 +54,7 @@ public class StrangerResiGuideController { * @Date 2020/3/16 **/ @PostMapping("getgridhome") - public Result getGridHome( TokenDto tokenDTO, @RequestBody StrangerFormDTO strangerFormDTO) throws Exception { + public Result getGridHome(@LoginUser TokenDto tokenDTO, @RequestBody StrangerFormDTO strangerFormDTO) throws Exception { return strangerAccessRecordService.getGridHome(tokenDTO, strangerFormDTO); } diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java index 81e59f7130..fe4d4d15ea 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -26,7 +27,7 @@ public class UserGuideController { private UserAccessService userAccessService; @PostMapping("entergrid") - Result enterGrid(TokenDto token, @RequestBody UserEnterGridFormDTO userEnterGridFormDTO){ + Result enterGrid(@LoginUser TokenDto token, @RequestBody UserEnterGridFormDTO userEnterGridFormDTO){ ValidatorUtils.validateEntity(userEnterGridFormDTO); diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java index 1127ec72b5..626f78bfd4 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java @@ -1,5 +1,6 @@ package com.epmet.modules.grid.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.LatestGridInfoResultDTO; @@ -28,7 +29,7 @@ public class ResiMineGridController { * @Date 2020/3/24 11:10 **/ @GetMapping("getlatestgridinfo") - public Result getLatestGridInfo(TokenDto tokenDto){ + public Result getLatestGridInfo(@LoginUser TokenDto tokenDto){ return resiMineGridService.getLatestGridInfo(tokenDto); } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java index c0c2b493aa..217c08d278 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java @@ -1,5 +1,6 @@ package com.epmet.modules.message.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -34,7 +35,7 @@ public class UserMessageController { * @Date 2020/3/29 20:53 **/ @PostMapping("getmymessage") - public Result> getMyMessage(TokenDto tokenDto, + public Result> getMyMessage(@LoginUser TokenDto tokenDto, @RequestBody MymessageFormDTO mymessageFormDTO) { mymessageFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(mymessageFormDTO); @@ -63,7 +64,7 @@ public class UserMessageController { * @Date 2020/3/29 21:06 **/ @PostMapping("readallmsg") - public Result readAllMessage(TokenDto tokenDto, @RequestBody UserMessageDTO userMessageDTO) { + public Result readAllMessage(@LoginUser TokenDto tokenDto, @RequestBody UserMessageDTO userMessageDTO) { //逻辑待实现 return userMessageService.readAllMessage(tokenDto, userMessageDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberController.java index bfa776d92e..379a9491e9 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberController.java @@ -1,5 +1,6 @@ package com.epmet.modules.partymember.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.partymember.service.PartyMemberService; @@ -33,7 +34,7 @@ public class PartyMemberController { * @return Result */ @PostMapping("init") - public Result init(TokenDto tokenDto, @RequestBody PartyMemberInitFromDTO fromDto) { + public Result init(@LoginUser TokenDto tokenDto, @RequestBody PartyMemberInitFromDTO fromDto) { fromDto.setUserId(tokenDto.getUserId()); return partyMemberService.init(fromDto); } @@ -46,7 +47,7 @@ public class PartyMemberController { * @date 2020/3/30 13:50 */ @PostMapping("getverificationcode") - public Result getVerificationCode(TokenDto tokenDto, @RequestBody VerificationCodeFromDTO fromDto) { + public Result getVerificationCode(@LoginUser TokenDto tokenDto, @RequestBody VerificationCodeFromDTO fromDto) { return partyMemberService.getVerificationCode(tokenDto, fromDto); } @@ -58,7 +59,7 @@ public class PartyMemberController { * @date 2020/3/30 13:50 */ @PostMapping("submit") - public Result submit(TokenDto tokenDto, @RequestBody PartyMemberSubmitFromDTO fromDto) { + public Result submit(@LoginUser TokenDto tokenDto, @RequestBody PartyMemberSubmitFromDTO fromDto) { return partyMemberService.submit(tokenDto, fromDto); } @@ -70,7 +71,7 @@ public class PartyMemberController { * @date 2020/3/30 13:50 */ @PostMapping("extra") - public Result partyMemberInfoExtra(TokenDto tokenDto, @RequestBody PartyMemberSubmitFromDTO fromDto) { + public Result partyMemberInfoExtra(@LoginUser TokenDto tokenDto, @RequestBody PartyMemberSubmitFromDTO fromDto) { return partyMemberService.partyMemberInfoExtra(tokenDto, fromDto); } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/controller/ResiRegisterController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/controller/ResiRegisterController.java index 3a8c6dee7b..e9d591581e 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/controller/ResiRegisterController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/controller/ResiRegisterController.java @@ -1,5 +1,6 @@ package com.epmet.modules.resiregister.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -33,7 +34,7 @@ public class ResiRegisterController { * @Date 2020/3/30 **/ @PostMapping("init") - public Result init(TokenDto tokenDTO, @RequestBody ResiRegisterFormDTO resiRegisterFormDTO) { + public Result init(@LoginUser TokenDto tokenDTO, @RequestBody ResiRegisterFormDTO resiRegisterFormDTO) { ValidatorUtils.validateEntity(resiRegisterFormDTO); return resiRegisterService.init(tokenDTO, resiRegisterFormDTO); } @@ -44,7 +45,7 @@ public class ResiRegisterController { * @Description 居民端-居民注册信息提交 **/ @PostMapping("submit") - public Result submit(TokenDto tokenDTO, @RequestBody ResiInfoSubmitFormDTO resiInfoSubmitFormDTO) { + public Result submit(@LoginUser TokenDto tokenDTO, @RequestBody ResiInfoSubmitFormDTO resiInfoSubmitFormDTO) { ValidatorUtils.validateEntity(resiInfoSubmitFormDTO); return resiRegisterService.submit(tokenDTO, resiInfoSubmitFormDTO); } @@ -55,7 +56,7 @@ public class ResiRegisterController { * @Description 居民端-居民注册根据手机号获取验证码 **/ @PostMapping("getverificationcode") - public Result getVerificationCode(TokenDto tokenDTO, @RequestBody VerificationCodeFormDTO formDTO) { + public Result getVerificationCode(@LoginUser TokenDto tokenDTO, @RequestBody VerificationCodeFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return resiRegisterService.getVerificationCode(tokenDTO, formDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java index 9d555d6d40..03283c179a 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java @@ -1,5 +1,6 @@ package com.epmet.modules.warmhearted.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -30,7 +31,7 @@ public class ResiWarmheartedController { * @Description 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 **/ @PostMapping("init") - public Result init(TokenDto tokenDTO, @RequestBody ResiWarmheartedFormDTO resiWarmheartedFormDTO) { + public Result init(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedFormDTO resiWarmheartedFormDTO) { ValidatorUtils.validateEntity(resiWarmheartedFormDTO); return resiWarmheartedService.init(tokenDTO, resiWarmheartedFormDTO); } @@ -41,7 +42,7 @@ public class ResiWarmheartedController { * @Description 居民端-热心居民申请-提交申请数据 **/ @PostMapping("submit") - public Result submit(TokenDto tokenDTO, @RequestBody ResiWarmheartedSubmitFormDTO formDTO) { + public Result submit(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedSubmitFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return resiWarmheartedService.submit(tokenDTO, formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java index b44f404523..acc2bb9e9f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java @@ -17,6 +17,7 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; @@ -25,8 +26,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.OperUserDTO; import com.epmet.dto.result.QueryOperUserResultDto; import com.epmet.excel.OperUserExcel; @@ -108,7 +109,7 @@ public class OperUserController { * @author zhaoqifeng */ @GetMapping("queryOperUserDto") - public Result queryOperUserDto(TokenDto tokenDto) { + public Result queryOperUserDto(@LoginUser TokenDto tokenDto) { OperUserDTO data = operUserService.getOperUserInfoById(tokenDto.getUserId()); QueryOperUserResultDto dto = ConvertUtils.sourceToTarget(data, QueryOperUserResultDto.class); return new Result().ok(dto); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index 8c1930d6ac..6081d38fe1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -79,7 +80,7 @@ public class UserController { * @Description 居民端个人信息-同步用户微信信息 **/ @PostMapping("updatewxuserinfo") - public Result updateWxUserInfo(TokenDto tokenDTO, @RequestBody WxUserInfoFormDTO wxUserInfoFormDTO) { + public Result updateWxUserInfo(@LoginUser TokenDto tokenDTO, @RequestBody WxUserInfoFormDTO wxUserInfoFormDTO) { wxUserInfoFormDTO.setUserId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(wxUserInfoFormDTO); return userService.updateWxUserInfo(wxUserInfoFormDTO); From fd166da9645e03b094f7ef7baeb01b7bd7b4d2b1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Apr 2020 16:43:06 +0800 Subject: [PATCH 013/174] =?UTF-8?q?orgId=E6=94=B9=E4=B8=BAagencyId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/GovLoginServiceImpl.java | 8 ++++---- .../tools/security/dto/GovTokenDto.java | 2 +- .../form/StaffLoginAgencyRecordFormDTO.java | 2 +- .../dto/result/StaffLatestAgencyResultDTO.java | 2 +- .../resources/mapper/StaffAgencyVisitedDao.xml | 18 +++++++++--------- 5 files changed, 16 insertions(+), 16 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 85c6991c39..c9b5d05ac2 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 @@ -156,7 +156,7 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setToken(token); govTokenDto.setUpdateTime(System.currentTimeMillis()); govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); - govTokenDto.setOrgId(staffLatestAgency.getOrgId()); + govTokenDto.setAgencyId(staffLatestAgency.getAgencyId()); govTokenDto.setCustomerId(staffLatestAgency.getCustomerId()); cpUserDetailRedis.set(govTokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); @@ -169,7 +169,7 @@ public class GovLoginServiceImpl implements GovLoginService { staffLoginAgencyRecordFormDTO.setStaffId(latestStaffWechatLoginDTO.getStaffId()); staffLoginAgencyRecordFormDTO.setWxOpenId(latestStaffWechatLoginDTO.getWxOpenId()); staffLoginAgencyRecordFormDTO.setMobile(latestStaffWechatLoginDTO.getMobile()); - staffLoginAgencyRecordFormDTO.setOrgId(latestStaffWechatLoginDTO.getOrgId()); + staffLoginAgencyRecordFormDTO.setAgencyId(latestStaffWechatLoginDTO.getAgencyId()); Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginAgencyRecordFormDTO); return staffLoginRecordResult; } @@ -208,7 +208,7 @@ public class GovLoginServiceImpl implements GovLoginService { staffLoginAgencyRecordFormDTO.setStaffId(staffId); staffLoginAgencyRecordFormDTO.setWxOpenId(openId); staffLoginAgencyRecordFormDTO.setMobile(formDTO.getMobile()); - staffLoginAgencyRecordFormDTO.setOrgId(formDTO.getOrgId()); + staffLoginAgencyRecordFormDTO.setAgencyId(formDTO.getOrgId()); Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginAgencyRecordFormDTO); return staffLoginRecordResult; } @@ -263,7 +263,7 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setToken(token); govTokenDto.setUpdateTime(System.currentTimeMillis()); govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); - govTokenDto.setOrgId(orgId); + govTokenDto.setAgencyId(orgId); govTokenDto.setCustomerId(customerId); cpUserDetailRedis.set(govTokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); 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 e2b6b18bda..182a6b0576 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 @@ -65,7 +65,7 @@ public class GovTokenDto implements Serializable { /** * 当前登录的组织id(顶级) */ - private String orgId; + private String agencyId; /** * 当前网格对应的组织结构id的全路径用:隔开 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java index ad67aba726..6bfb38de7b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java @@ -34,7 +34,7 @@ public class StaffLoginAgencyRecordFormDTO implements Serializable { /** * 组织机构id */ - private String orgId; + private String agencyId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffLatestAgencyResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffLatestAgencyResultDTO.java index 4b006dd8e6..45dcef0416 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffLatestAgencyResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffLatestAgencyResultDTO.java @@ -36,6 +36,6 @@ public class StaffLatestAgencyResultDTO implements Serializable { /** * 组织机构id */ - private String orgId; + private String agencyId; } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml index 687edca880..d211f53ac4 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml @@ -21,18 +21,18 @@ \ No newline at end of file From 142dead6b2cc828f4e037f85e90f66770a7b9d1f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Apr 2020 18:47:20 +0800 Subject: [PATCH 014/174] =?UTF-8?q?=E9=80=89=E6=8B=A9=E7=BB=84=E7=BB=87?= =?UTF-8?q?=EF=BC=8C=E8=BF=9B=E5=85=A5=E9=A6=96=E9=A1=B5=E5=85=A5=E5=8F=82?= =?UTF-8?q?Dto=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java | 2 +- .../main/java/com/epmet/service/impl/GovLoginServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java index 8655268c8e..42920853ee 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java @@ -34,6 +34,6 @@ public class GovWxmpEnteOrgFormDTO implements Serializable { * 选择的要进入的组织(根组织id) */ @NotBlank(message = "组织id不能为空") - private String orgId; + private String agencyId; } 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 c9b5d05ac2..75cf5d7300 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 @@ -195,7 +195,7 @@ public class GovLoginServiceImpl implements GovLoginService { //1、获取用户token String token = this.generateGovWxmpToken(customerStaff.getUserId()); //2、保存到redis - this.saveGovTokenDto(formDTO.getOrgId(), formDTO.getCustomerId(), customerStaff.getUserId(), wxMaJscode2SessionResult, token); + this.saveGovTokenDto(formDTO.getAgencyId(), formDTO.getCustomerId(), customerStaff.getUserId(), wxMaJscode2SessionResult, token); UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setToken(token); return new Result().ok(userTokenResultDTO); @@ -208,7 +208,7 @@ public class GovLoginServiceImpl implements GovLoginService { staffLoginAgencyRecordFormDTO.setStaffId(staffId); staffLoginAgencyRecordFormDTO.setWxOpenId(openId); staffLoginAgencyRecordFormDTO.setMobile(formDTO.getMobile()); - staffLoginAgencyRecordFormDTO.setAgencyId(formDTO.getOrgId()); + staffLoginAgencyRecordFormDTO.setAgencyId(formDTO.getAgencyId()); Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginAgencyRecordFormDTO); return staffLoginRecordResult; } From d551b175f95005472d650bcd7be483d42fece00c Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 21 Apr 2020 18:47:42 +0800 Subject: [PATCH 015/174] =?UTF-8?q?1.=E8=B0=83=E6=95=B4=E6=8B=A6=E6=88=AAT?= =?UTF-8?q?okenDto=20Filter=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0BaseTokenDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/security/dto/BaseTokenDto.java | 42 ++++++++++++++++ .../tools/security/dto/GovTokenDto.java | 41 +++++----------- .../commons/tools/security/dto/TokenDto.java | 22 +-------- .../filter/CpAuthGatewayFilterFactory.java | 48 +++++++++++++------ .../com/epmet/filter/FeignRequestFilter.java | 14 ++++-- .../com/epmet/filter/UserTokenFilter.java | 27 ++++------- 6 files changed, 108 insertions(+), 86 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/BaseTokenDto.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/BaseTokenDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/BaseTokenDto.java new file mode 100644 index 0000000000..c3065c7200 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/BaseTokenDto.java @@ -0,0 +1,42 @@ +package com.epmet.commons.tools.security.dto; + +import lombok.Data; + +@Data +public class BaseTokenDto { + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + private String app; + + /** + * PC端:web、微信小程序:wxmp + */ + private String client; + + /** + * 用户ID + */ + private String userId; + + /** + * token字符串 + */ + private String token; + + public BaseTokenDto() { + } + + public BaseTokenDto(String app, String client, String userId) { + this.app = app; + this.client = client; + this.userId = userId; + } + + public BaseTokenDto(String app, String client, String userId, String token) { + this.app = app; + this.client = client; + this.userId = userId; + this.token = token; + } +} 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 182a6b0576..2a8fd7c05b 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 @@ -11,21 +11,7 @@ import java.util.List; * @Date 2020/4/20 11:01 */ @Data -public class GovTokenDto implements Serializable { - /** - * 政府端:gov、居民端:resi、运营端:oper - */ - private String app; - - /** - * PC端:web、微信小程序:wxmp - */ - private String client; - - /** - * 用户ID - */ - private String userId; +public class GovTokenDto extends BaseTokenDto implements Serializable { /** * sessionKey @@ -42,21 +28,6 @@ public class GovTokenDto implements Serializable { */ private String unionId; - /** - * token字符串 - */ - private String token; - - /** - * 过期时间戳 - */ - private Long expireTime; - - /** - * 最后一次更新时间 - */ - private long updateTime; - /** * 当前工作人员进入的客户id */ @@ -81,5 +52,15 @@ public class GovTokenDto implements Serializable { * 部门id列表 */ private List deptIdList; + + /** + * 过期时间戳 + */ + private Long expireTime; + + /** + * 最后一次更新时间 + */ + private long updateTime; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/TokenDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/TokenDto.java index fb8a5dd7ec..402dfc1b59 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/TokenDto.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/TokenDto.java @@ -11,22 +11,8 @@ import java.io.Serializable; * @Date 2020-03-14 */ @Data -public class TokenDto implements Serializable { +public class TokenDto extends BaseTokenDto implements Serializable { private static final long serialVersionUID = 8883581762088390769L; - /** - * 政府端:gov、居民端:resi、运营端:oper - */ - private String app; - - /** - * PC端:web、微信小程序:wxmp - */ - private String client; - - /** - * 用户ID - */ - private String userId; /** * sessionKey @@ -43,11 +29,6 @@ public class TokenDto implements Serializable { */ private String unionId; - /** - * token字符串 - */ - private String token; - /** * 过期时间戳 */ @@ -57,4 +38,5 @@ public class TokenDto implements Serializable { * 最后一次更新时间 */ private long updateTime; + } diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index e398b5978a..c4687b2ea6 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -6,6 +6,7 @@ import com.epmet.common.token.enums.ErrorCode; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.BaseTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; @@ -91,24 +92,22 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(ErrorCode.ERR10005.getCode(),ErrorCode.ERR10005.getMsg())); } try { + BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); + validateTokenDto(baseTokenDto, token); + //当前登录用户userId,添加到header中 - TokenDto user = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis); - if (user != null) { - String redisKey = user.getApp() + "-" + user.getClient() + "-" + user.getUserId(); - logger.info("redisKey=" + redisKey); - ServerHttpRequest build = exchange.getRequest().mutate() - .header(Constant.APP_USER_KEY, redisKey) - .header(AppClientConstant.APP,user.getApp()) - .header(AppClientConstant.CLIENT,user.getClient()) - .header(AppClientConstant.USER_ID,user.getUserId()) - .build(); - return chain.filter(exchange.mutate().request(build).build()); - } + String redisKey = baseTokenDto.getApp() + "-" + baseTokenDto.getClient() + "-" + baseTokenDto.getUserId(); + logger.info("redisKey=" + redisKey); + ServerHttpRequest build = exchange.getRequest().mutate() + .header(Constant.APP_USER_KEY, redisKey) + .header(AppClientConstant.APP,baseTokenDto.getApp()) + .header(AppClientConstant.CLIENT,baseTokenDto.getClient()) + .header(AppClientConstant.USER_ID,baseTokenDto.getUserId()) + .build(); + return chain.filter(exchange.mutate().request(build).build()); }catch(RenException e){ return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); } - - return chain.filter(exchange); }; } @@ -182,4 +181,25 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory T getLoginUserInfoByToken(String token, JwtTokenUtils jwtTokenUtils, CpUserDetailRedis cpUserDetailRedis, Class clz) { + BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); + //查询Redis + T tokenDto = (T)cpUserDetailRedis.get(baseTokenDto.getApp(), baseTokenDto.getClient(), baseTokenDto.getUserId()); return tokenDto; } From 1314211d3981324a5c5339aeb16dc1c312445075 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Apr 2020 19:03:07 +0800 Subject: [PATCH 016/174] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8Fid=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 93feb4625c..d7f65bb65c 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -156,8 +156,8 @@ wx9b6102a8ee5add65 16fdb68bc2b3e732324ba5d8b8a9b5e2 - wx3d1372029eb816a3 - 651f02d71ed3f123dfb584b8bf0f4d8b + wx3d1372029eb816a3 + 651f02d71ed3f123dfb584b8bf0f4d8b From 022bf25985d87aca78c648d1a5c66a44b0448b27 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 21 Apr 2020 19:06:59 +0800 Subject: [PATCH 017/174] =?UTF-8?q?1.=E8=B0=83=E6=95=B4=E6=8B=A6=E6=88=AAT?= =?UTF-8?q?okenDto=20Filter=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/common/token/util/TokenUtil.java | 5 ----- .../epmet/commons/tools/utils/CpUserDetailRedis.java | 6 ++---- .../com/epmet/filter/CpAuthGatewayFilterFactory.java | 11 ++++++++++- .../main/java/com/epmet/filter/UserTokenFilter.java | 3 +-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/TokenUtil.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/TokenUtil.java index efefc5e16a..8042695c85 100644 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/TokenUtil.java +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/util/TokenUtil.java @@ -25,11 +25,6 @@ public class TokenUtil { @Autowired private CpUserDetailRedis redisUtils; - public TokenDto getTokenInfo(String app, String client, String userId) { - TokenDto tokenDto = redisUtils.get(app,client,userId); - return tokenDto; - } - public void expireToken(String app,String client,String userId) { redisUtils.logout(app,client,userId); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java index 9d3e2c3083..4c0845fc6c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/CpUserDetailRedis.java @@ -49,7 +49,7 @@ public class CpUserDetailRedis { * @param userId oper_user、customer_user、customer_staff表主键 * @return */ - public TokenDto get(String app, String client, String userId) { + public T get(String app, String client, String userId, Class clz) { String key = RedisKeys.getCpUserKey(app,client,userId); Map map = redisUtils.hGetAll(key); @@ -58,9 +58,7 @@ public class CpUserDetailRedis { } //map to bean - TokenDto user = BeanUtil.mapToBean(map, TokenDto.class, true); - - return user; + return BeanUtil.mapToBean(map, clz, true); } /** diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index c4687b2ea6..ba348745d9 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.BaseTokenDto; +import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; @@ -93,7 +94,15 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory T getLoginUserInfoByToken(String token, JwtTokenUtils jwtTokenUtils, CpUserDetailRedis cpUserDetailRedis, Class clz) { BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); //查询Redis - T tokenDto = (T)cpUserDetailRedis.get(baseTokenDto.getApp(), baseTokenDto.getClient(), baseTokenDto.getUserId()); - return tokenDto; + return cpUserDetailRedis.get(baseTokenDto.getApp(), baseTokenDto.getClient(), baseTokenDto.getUserId(), clz); } } From d85b33f637114ad69e4e77ed3ce5f819f93fd9d7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Apr 2020 22:48:15 +0800 Subject: [PATCH 018/174] =?UTF-8?q?=E5=88=A0=E9=99=A4ErrorCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/GovLoginController.java | 13 +++++ .../com/epmet/service/GovLoginService.java | 10 ++++ .../service/impl/GovLoginServiceImpl.java | 16 +++++- .../epmet/service/impl/LoginServiceImpl.java | 2 +- .../epmet/common/token/enums/ErrorCode.java | 51 ------------------- .../epmet/common/token/error/IErrorCode.java | 11 ---- .../tools/exception/EpmetErrorCode.java | 5 ++ .../filter/CpAuthGatewayFilterFactory.java | 10 ++-- .../com/epmet/filter/FeignRequestFilter.java | 5 -- .../com/epmet/filter/UserTokenFilter.java | 5 +- .../com/epmet/dto/form/StaffOrgFormDTO.java | 4 ++ .../epmet/controller/CustomerController.java | 6 +-- .../controller/UserMessageController.java | 11 ++-- 13 files changed, 59 insertions(+), 90 deletions(-) delete mode 100644 epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/enums/ErrorCode.java delete mode 100644 epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/error/IErrorCode.java diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java index ea4b5c8974..886fb67bd0 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java @@ -1,5 +1,7 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.GovWxmpEnteOrgFormDTO; @@ -80,5 +82,16 @@ public class GovLoginController { return govLoginService.enterOrg(formDTO); } + /** + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 政府端小程序退出 + * @Date 2020/4/21 22:22 + **/ + @PostMapping("/loginwxmp/loginout") + public Result loginOut(@LoginUser TokenDto tokenDto) { + return govLoginService.loginOut(tokenDto); + } } diff --git a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java index 8e98ad44de..f61e9c8fab 100644 --- a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java @@ -1,5 +1,6 @@ package com.epmet.service; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.GovWxmpEnteOrgFormDTO; import com.epmet.dto.form.GovWxmpFormDTO; @@ -51,4 +52,13 @@ public interface GovLoginService { * @Date 2020/4/20 13:08 **/ Result enterOrg(GovWxmpEnteOrgFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param tokenDto + * @Author yinzuomei + * @Description 政府端工作人员退出登录 + * @Date 2020/4/21 22:08 + **/ + Result loginOut(TokenDto tokenDto); } 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 75cf5d7300..2c0300a947 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 @@ -3,14 +3,18 @@ package com.epmet.service.impl; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.*; +import com.epmet.dto.result.StaffLatestAgencyResultDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.feign.MessageFeignClient; @@ -201,6 +205,16 @@ public class GovLoginServiceImpl implements GovLoginService { return new Result().ok(userTokenResultDTO); } + @Override + public Result loginOut(TokenDto tokenDto) { + if(null == tokenDto){ + logger.error("token解析失败,直接跳转重新登录即可"); + throw new RenException("当前用户信息获取失败"); + } + cpUserDetailRedis.logout(tokenDto.getApp() , tokenDto.getClient() , tokenDto.getUserId()); + return new Result(); + } + //保存登录日志 private Result saveStaffLoginRecord(GovWxmpEnteOrgFormDTO formDTO, String staffId, String openId) { StaffLoginAgencyRecordFormDTO staffLoginAgencyRecordFormDTO = new StaffLoginAgencyRecordFormDTO(); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 225e2520fb..f3cef61f98 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -313,7 +313,7 @@ public class LoginServiceImpl implements LoginService { } cpUserDetailRedis.logout(tokenDto.getApp() , tokenDto.getClient() , tokenDto.getUserId()); //web端清空菜单栏和权限 - return new Result().ok("退出登录!"); + return new Result(); } /** diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/enums/ErrorCode.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/enums/ErrorCode.java deleted file mode 100644 index 9296333cac..0000000000 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/enums/ErrorCode.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.epmet.common.token.enums; - - -import com.epmet.common.token.error.IErrorCode; - -/** - * client token错误码 - * - * @author rongchao - * @Date 18-11-24 - */ -public enum ErrorCode implements IErrorCode { - - SUCCESS(0, "请求成功"), - - ERR10001(10001, "token解析失败"), - ERR10002(10002, "token失效"), - ERR10003(10003, "token生成失败,请重试。"), - ERR10004(10004, "返回的Object类型不是EsuaResponse,无法添加token!"), - ERR10005(10005, "token不能为空"), - ERR10006(10006, "登录超时,请重新登录"), - ERR10007(10007, "当前帐号已在别处登录"), - - ERR500(500, "Internal Server Error"), - ERR501(501, "参数绑定异常"), - ERR401(401, "未授权"), - - - ERR(ErrorCode.COMMON_ERR_CODE, "其他异常"); - - private int code; - - private String msg; - - ErrorCode(final int code, final String msg) { - this.code = code; - this.msg = msg; - } - - public static final int COMMON_ERR_CODE = -1; - - @Override - public int getCode() { - return code; - } - - @Override - public String getMsg() { - return msg; - } -} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/error/IErrorCode.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/error/IErrorCode.java deleted file mode 100644 index 9b58ccc96e..0000000000 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/error/IErrorCode.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.epmet.common.token.error; - -/** - * @author rongchao - * @Date 18-11-20 - */ -public interface IErrorCode { - int getCode(); - - String getMsg(); -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 230c53fbc8..0ddc89d09b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -6,6 +6,11 @@ package com.epmet.commons.tools.exception; * @Description: */ public enum EpmetErrorCode { + ERR10005(10005, "token不能为空"), + ERR10006(10006, "登录超时,请重新登录"), + ERR10007(10007, "当前帐号已在别处登录"), + ERR401(401, "未授权"), + SERVER_ERROR(8000, "服务器开小差了..."), CANNOT_JOIN_GROUP(8001, "只有认证党员和居民才可以加入小组,请选择您的身份"), CANNOT_CREATE_GROUP(8002, "只有党员和热心居民才能创建小组,请选择您的身份"), diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index ba348745d9..d3c7d60b6d 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -2,9 +2,9 @@ package com.epmet.filter; import com.alibaba.fastjson.JSON; -import com.epmet.common.token.enums.ErrorCode; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.BaseTokenDto; import com.epmet.commons.tools.security.dto.GovTokenDto; @@ -12,7 +12,6 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.jwt.JwtTokenUtils; -import io.jsonwebtoken.Claims; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,7 +32,6 @@ import reactor.core.publisher.Mono; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; -import java.util.function.Consumer; /** * app接口权限过滤器 @@ -90,7 +88,7 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(ErrorCode.ERR10005.getCode(),ErrorCode.ERR10005.getMsg())); + return response(exchange,new Result<>().error(EpmetErrorCode.ERR10005.getCode(),EpmetErrorCode.ERR10005.getMsg())); } try { BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); @@ -199,7 +197,7 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory 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 87b1f0f38b..4beebeae8d 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 @@ -17,10 +17,7 @@ package com.epmet.controller; -import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -133,8 +130,7 @@ public class CustomerController { * @Date 2020/3/11 21:58 **/ @GetMapping("getvalidcustomerlist") - public Result> getValidCustomerList(@LoginUser TokenDto tokenDTO) { - logger.info("getvalidcustomerlist:"+ JSON.toJSONString(tokenDTO)); + public Result> getValidCustomerList() { return customerService.getValidCustomerList(); } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java index 217c08d278..e7d2ed2bf2 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/message/controller/UserMessageController.java @@ -30,7 +30,7 @@ public class UserMessageController { /** * @param * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei + * @Author zhaoqifeng * @Description 查询我的消息 * @Date 2020/3/29 20:53 **/ @@ -39,33 +39,30 @@ public class UserMessageController { @RequestBody MymessageFormDTO mymessageFormDTO) { mymessageFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(mymessageFormDTO); - //逻辑待实现 return userMessageService.getMessageList(tokenDto, mymessageFormDTO); } /** * @param fromDTO * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei + * @Author zhaoqifeng * @Description 单条消息标记为已读 * @Date 2020/3/29 21:05 **/ @PostMapping("readmsg") - public Result readMessage(@RequestBody ReadMessageFromDTO fromDTO) { - //逻辑待实现 + public Result readMessage(@LoginUser TokenDto tokenDto,@RequestBody ReadMessageFromDTO fromDTO) { return userMessageService.readMessage(fromDTO.getMessageId()); } /** * @param tokenDto * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei + * @Author zhaoqifeng * @Description 全部已读 * @Date 2020/3/29 21:06 **/ @PostMapping("readallmsg") public Result readAllMessage(@LoginUser TokenDto tokenDto, @RequestBody UserMessageDTO userMessageDTO) { - //逻辑待实现 return userMessageService.readAllMessage(tokenDto, userMessageDTO); } } From 10b427ed2fda16ba523190c2dd6975fbd9db9768 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 22 Apr 2020 11:09:35 +0800 Subject: [PATCH 019/174] =?UTF-8?q?1.=E6=96=B0=E5=A2=9Egov-mine=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/logback-spring.xml | 2 +- epmet-module/gov-mine/gov-mine-client/pom.xml | 17 ++ epmet-module/gov-mine/gov-mine-server/pom.xml | 159 ++++++++++++++++++ .../src/main/resources/bootstrap.yml | 96 +++++++++++ .../src/main/resources/logback-spring.xml | 159 ++++++++++++++++++ epmet-module/gov-mine/pom.xml | 19 +++ epmet-module/pom.xml | 1 + 7 files changed, 452 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-mine/gov-mine-client/pom.xml create mode 100644 epmet-module/gov-mine/gov-mine-server/pom.xml create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml create mode 100644 epmet-module/gov-mine/pom.xml diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml index 86fc4a6979..e43fd0e845 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/logback-spring.xml @@ -2,7 +2,7 @@ - + + + + epmet-module + com.epmet + 2.0.0 + ../../pom.xml + + 4.0.0 + + gov-mine-client + 0.3.0 + + + \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml new file mode 100644 index 0000000000..69ec7833d8 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -0,0 +1,159 @@ + + + + epmet-module + com.epmet + 2.0.0 + ../../pom.xml + + 4.0.0 + + gov-mine-server + 0.3.0 + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + + dev-local + + true + + + 8098 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + dev + + + 8098 + dev + + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + + + test + + + 8098 + test + + + 0 + 10.10.10.248 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..372d057000 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml @@ -0,0 +1,96 @@ +server: + port: @server.port@ + servlet: + context-path: /gov/mine + +spring: + main: + allow-bean-definition-overriding: true + application: + name: gov-mine-server + #环境 dev|test|prod + profiles: + active: dev + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml + #指定共享配置,且支持动态刷新 +# ext-config: +# - data-id: datasource.yaml +# group: ${spring.cloud.nacos.config.group} +# refresh: true +# - data-id: common.yaml +# group: ${spring.cloud.nacos.config.group} +# refresh: true +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..e12ce1b94a --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/gov-mine/pom.xml b/epmet-module/gov-mine/pom.xml new file mode 100644 index 0000000000..ef1a4d528b --- /dev/null +++ b/epmet-module/gov-mine/pom.xml @@ -0,0 +1,19 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + gov-mine + + + gov-mine-client + gov-mine-server + + + \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index d4fc0c7ae2..f1e9ea9c5b 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -28,6 +28,7 @@ resi-group resi-partymember gov-access + gov-mine From 794f3f0d3f40c0711c6a1a086929f7538c572303 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 22 Apr 2020 12:32:03 +0800 Subject: [PATCH 020/174] =?UTF-8?q?1.=E6=96=B0=E5=A2=9Eepmet-user,gov-acce?= =?UTF-8?q?ss,oper-customize=20db=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db.migration/epmet_gov_access.sql | 92 +++++++++++++++++++ .../db.migration/customer_foot_bar.sql | 36 ++++++++ .../resources/db/migration/epmet_user.sql | 33 ++++++- 3 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql new file mode 100644 index 0000000000..89cfdb3d94 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql @@ -0,0 +1,92 @@ +/* + Date: 22/04/2020 12:13:38 +*/ + +-- SET NAMES utf8mb4; +-- #SET FOREIGN_KEY_CHECKS = 0; + +-- DROP TABLE IF EXISTS `permission_scope`; +CREATE TABLE `permission_scope` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id', + `SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围key', + `SCOPE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围名称', + `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', + `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限范围表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for resource_ope +-- ---------------------------- +DROP TABLE IF EXISTS `resource_ope`; +CREATE TABLE `resource_ope` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `OPERATION_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `BRIEF` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作简介', + `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, + `REVISION` int(10) NULL DEFAULT NULL, + `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `CREATED_TIME` datetime(0) NULL DEFAULT NULL, + `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作类型表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for role_operation +-- ---------------------------- +DROP TABLE IF EXISTS `role_operation`; +CREATE TABLE `role_operation` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', + `OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作key', + `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', + `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能进行那些操作' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for role_scope +-- ---------------------------- +DROP TABLE IF EXISTS `role_scope`; +CREATE TABLE `role_scope` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', + `PERMISSION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '权限key', + `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', + `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能操作哪些范围' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for role_template +-- ---------------------------- +DROP TABLE IF EXISTS `role_template`; +CREATE TABLE `role_template` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', + `ROLE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色key', + `ROLE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名称', + `ORG_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色所属体系类型:org,dept,grid', + `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, + `REVISION` int(10) NULL DEFAULT NULL, + `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `CREATED_TIME` datetime(0) NULL DEFAULT NULL, + `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '政府端角色模板表' ROW_FORMAT = Dynamic; + +-- SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql new file mode 100644 index 0000000000..fc496afa9a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql @@ -0,0 +1,36 @@ +/* + Date: 22/04/2020 12:21:32 wxz +*/ + +-- SET NAMES utf8mb4; +-- SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for customer_foot_bar +-- ---------------------------- +DROP TABLE IF EXISTS `customer_foot_bar`; +CREATE TABLE `customer_foot_bar` ( + `ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '唯一标识', + `BAR_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'bar名称', + `KEY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'KEY', + `PAGE_TITLE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '页面标题', + `ICON_PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标路径', + `SELECTED_ICON_PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '选中页面图标路径', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'APP底部菜单栏信息' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of customer_foot_bar +-- ---------------------------- +INSERT INTO `customer_foot_bar` VALUES ('1', '工作', 'work', '党群e事通-政府端', NULL, NULL, 0, 0, 'wxz', '2020-04-22 10:53:22', 'wxz', '2020-04-22 10:53:26'); +INSERT INTO `customer_foot_bar` VALUES ('2', '组织', 'org', '组织机构', NULL, NULL, 0, 0, 'wxz', '2020-04-22 10:53:56', 'wxz', '2020-04-22 10:54:00'); +INSERT INTO `customer_foot_bar` VALUES ('3', '数据', 'data', '数据', NULL, NULL, 0, 0, 'wxz', '2020-04-22 11:20:54', 'wxz', '2020-04-22 11:20:58'); +INSERT INTO `customer_foot_bar` VALUES ('4', '发现', 'find', '发现', NULL, NULL, 0, 0, 'wxz', '2020-04-22 11:21:48', 'wxz', '2020-04-22 11:21:53'); + +-- SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql index 9283e23220..0076d0ef90 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql @@ -85,4 +85,35 @@ CREATE TABLE `staff_grid_visited` ( `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`ID`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员进入网格日志表'; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员进入网格日志表'; + +-- 2020.4.22 增加政府端角色表&政府工作人员-角色关系表 + +CREATE TABLE `staff_role` ( + `ID` varchar(64) NOT NULL, + `STAFF_ID` varchar(64) NOT NULL COMMENT '用户ID', + `ROLE_ID` varchar(64) NOT NULL COMMENT '角色ID', + `ORG_ID` varchar(255) DEFAULT NULL COMMENT '角色所属类型的ID。例如,机关的角色,那该字段就是所属机关的ID;部门的角色,该字段就是所属部门的ID;网格的角色,该字段就是所属网格ID', + `DEL_FLAG` tinyint(1) DEFAULT NULL, + `REVISION` int(10) DEFAULT NULL, + `CREATED_BY` varchar(64) DEFAULT NULL, + `CREATED_TIME` datetime DEFAULT NULL, + `UPDATED_BY` varchar(64) DEFAULT NULL, + `UPDATED_TIME` datetime DEFAULT NULL, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作人员-角色关系表'; + +CREATE TABLE `gov_staff_role` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。', + `ROLE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色key', + `ROLE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名称', + `ORG_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色所属体系类型:agency,department,grid', + `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, + `REVISION` int(10) NULL DEFAULT NULL, + `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `CREATED_TIME` datetime(0) NULL DEFAULT NULL, + `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '政府端角色表' ROW_FORMAT = Dynamic; From d521b63fa62443ea296de5bde79fb20e60a0025c Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 22 Apr 2020 12:45:56 +0800 Subject: [PATCH 021/174] =?UTF-8?q?1.db=E8=84=9A=E6=9C=AC=E8=A1=A5?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db.migration/epmet_gov_access.sql | 18 --------------- .../resources/db/migration/epmet_user.sql | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql index 89cfdb3d94..c7c63b6c42 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql @@ -71,22 +71,4 @@ CREATE TABLE `role_scope` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能操作哪些范围' ROW_FORMAT = Dynamic; --- ---------------------------- --- Table structure for role_template --- ---------------------------- -DROP TABLE IF EXISTS `role_template`; -CREATE TABLE `role_template` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', - `ROLE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色key', - `ROLE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名称', - `ORG_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色所属体系类型:org,dept,grid', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, - `REVISION` int(10) NULL DEFAULT NULL, - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `CREATED_TIME` datetime(0) NULL DEFAULT NULL, - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '政府端角色模板表' ROW_FORMAT = Dynamic; - -- SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql index 0076d0ef90..bdefcc6a31 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql @@ -117,3 +117,26 @@ CREATE TABLE `gov_staff_role` ( `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '政府端角色表' ROW_FORMAT = Dynamic; + +CREATE TABLE `gov_role_template` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', + `ROLE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色key', + `ROLE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称', + `ORG_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色所属体系类型:org,dept,grid', + `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, + `REVISION` int(10) NULL DEFAULT NULL, + `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `CREATED_TIME` datetime(0) NULL DEFAULT NULL, + `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '政府端角色模板表' ROW_FORMAT = Dynamic; + +INSERT INTO `gov_role_template` VALUES ('1', 'agency_leader', '单位领导', 'agency', 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_role_template` VALUES ('2', 'dept_leader', '部门领导', 'department', 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_role_template` VALUES ('3', 'party_principals', '党建负责人', '', 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_role_template` VALUES ('4', 'manager', '管理员', NULL, 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_role_template` VALUES ('5', 'staff', '工作人员', NULL, 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_role_template` VALUES ('6', 'grid_manager', '网格长', NULL, 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_role_template` VALUES ('7', 'grid_party_director', '网格党建指导员', NULL, 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_role_template` VALUES ('8', 'grid_member', '网格员', NULL, 0, NULL, NULL, NULL, NULL, NULL); \ No newline at end of file From fd00986a70e1f2a0aaa87e4f995afc78956d8ddd Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 22 Apr 2020 12:50:08 +0800 Subject: [PATCH 022/174] =?UTF-8?q?1.db=E8=84=9A=E6=9C=AC=E8=A1=A5?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/epmet_user.sql | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql index bdefcc6a31..10c5d34b4c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql @@ -107,7 +107,7 @@ CREATE TABLE `gov_staff_role` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。', `ROLE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色key', - `ROLE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名称', + `ROLE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称', `ORG_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色所属体系类型:agency,department,grid', `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, `REVISION` int(10) NULL DEFAULT NULL, @@ -118,7 +118,7 @@ CREATE TABLE `gov_staff_role` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '政府端角色表' ROW_FORMAT = Dynamic; -CREATE TABLE `gov_role_template` ( +CREATE TABLE `gov_staff_role_template` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', `ROLE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色key', `ROLE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称', @@ -132,11 +132,11 @@ CREATE TABLE `gov_role_template` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '政府端角色模板表' ROW_FORMAT = Dynamic; -INSERT INTO `gov_role_template` VALUES ('1', 'agency_leader', '单位领导', 'agency', 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `gov_role_template` VALUES ('2', 'dept_leader', '部门领导', 'department', 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `gov_role_template` VALUES ('3', 'party_principals', '党建负责人', '', 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `gov_role_template` VALUES ('4', 'manager', '管理员', NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `gov_role_template` VALUES ('5', 'staff', '工作人员', NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `gov_role_template` VALUES ('6', 'grid_manager', '网格长', NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `gov_role_template` VALUES ('7', 'grid_party_director', '网格党建指导员', NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `gov_role_template` VALUES ('8', 'grid_member', '网格员', NULL, 0, NULL, NULL, NULL, NULL, NULL); \ No newline at end of file +INSERT INTO `gov_staff_role_template` VALUES ('1', 'agency_leader', '单位领导', 'agency', 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_staff_role_template` VALUES ('2', 'dept_leader', '部门领导', 'department', 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_staff_role_template` VALUES ('3', 'party_principals', '党建负责人', '', 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_staff_role_template` VALUES ('4', 'manager', '管理员', NULL, 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_staff_role_template` VALUES ('5', 'staff', '工作人员', NULL, 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_staff_role_template` VALUES ('6', 'grid_manager', '网格长', NULL, 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_staff_role_template` VALUES ('7', 'grid_party_director', '网格党建指导员', NULL, 0, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `gov_staff_role_template` VALUES ('8', 'grid_member', '网格员', NULL, 0, NULL, NULL, NULL, NULL, NULL); \ No newline at end of file From b0b8ecb4fa645de1a348ecf6491da538315da9d0 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 22 Apr 2020 13:38:38 +0800 Subject: [PATCH 023/174] =?UTF-8?q?gov-mine=E6=9C=8D=E5=8A=A1=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=96=87=E4=BB=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/config/.gitkeep | 0 .../controller/CustomerAgencyController.java | 33 +++++++++++++ .../src/main/java/com/epmet/dao/.gitkeep | 0 .../src/main/java/com/epmet/entity/.gitkeep | 0 .../src/main/java/com/epmet/excel/.gitkeep | 0 .../com/epmet/feign/EpmetUserFeignClient.java | 13 +++++ .../com/epmet/feign/GovOrgFeignClient.java | 14 ++++++ .../EpmetUserFeignClientFallback.java | 13 +++++ .../fallback/GovOrgFeignClientFallBack.java | 13 +++++ .../com/epmet/redis/CustomerAgencyRedis.java | 47 +++++++++++++++++++ .../epmet/service/CustomerAgencyService.java | 35 ++++++++++++++ .../impl/CustomerAgencyServiceImpl.java | 34 ++++++++++++++ 12 files changed, 202 insertions(+) create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/.gitkeep create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/CustomerAgencyController.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/dao/.gitkeep create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/entity/.gitkeep create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/excel/.gitkeep create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/.gitkeep b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/CustomerAgencyController.java new file mode 100644 index 0000000000..ae25f3a97f --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + */ +@RestController +@RequestMapping("agency") +public class CustomerAgencyController { + + @Autowired + private CustomerAgencyService customerAgencyService; + + +} \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/dao/.gitkeep b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/dao/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/entity/.gitkeep b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/entity/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/excel/.gitkeep b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/excel/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java new file mode 100644 index 0000000000..07d46c559d --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -0,0 +1,13 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.EpmetUserFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; + +/** + * @Description + * @Author sun + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) +public interface EpmetUserFeignClient { +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java new file mode 100644 index 0000000000..fd2853340f --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -0,0 +1,14 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.GovOrgFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; + +/** + * @Description + * @Author sun + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) +public interface GovOrgFeignClient { + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java new file mode 100644 index 0000000000..9c5a63a4fd --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -0,0 +1,13 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.EpmetUserFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Description + * @Author sun + */ +@Component +public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java new file mode 100644 index 0000000000..80ab9be7be --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -0,0 +1,13 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.GovOrgFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Description + * @Author sun + */ +@Component +public class GovOrgFeignClientFallBack implements GovOrgFeignClient { + +} \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java new file mode 100644 index 0000000000..3b8e96c9a2 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Component +public class CustomerAgencyRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java new file mode 100644 index 0000000000..8f685b7f7e --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.CustomerAgencyEntity; + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + */ +public interface CustomerAgencyService extends BaseService { + + @Autowired + private GovOrgFeignClient govOrgFeignClient; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + +} \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java new file mode 100644 index 0000000000..de50deb280 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.CustomerAgencyDao; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.service.CustomerAgencyService; +import org.springframework.stereotype.Service; + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + */ +@Service +public class CustomerAgencyServiceImpl extends BaseServiceImpl implements CustomerAgencyService { + +} \ No newline at end of file From 93e5db24f7521060418bd3b4b1815b52447bf269 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 22 Apr 2020 13:44:32 +0800 Subject: [PATCH 024/174] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/CustomerAgencyService.java | 5 ----- .../com/epmet/service/impl/CustomerAgencyServiceImpl.java | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 8f685b7f7e..85de6deeaf 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -27,9 +27,4 @@ import com.epmet.entity.CustomerAgencyEntity; */ public interface CustomerAgencyService extends BaseService { - @Autowired - private GovOrgFeignClient govOrgFeignClient; - @Autowired - private EpmetUserFeignClient epmetUserFeignClient; - } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index de50deb280..1f89cc5bd7 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -31,4 +31,10 @@ import org.springframework.stereotype.Service; @Service public class CustomerAgencyServiceImpl extends BaseServiceImpl implements CustomerAgencyService { + @Autowired + private GovOrgFeignClient govOrgFeignClient; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + } \ No newline at end of file From 56980799b5428dc53424df472a06259d37b0f4d4 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 22 Apr 2020 14:09:02 +0800 Subject: [PATCH 025/174] =?UTF-8?q?=E6=A0=B9=E6=8D=AEuserId=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=BD=91=E6=A0=BC=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-mine/gov-mine-server/pom.xml | 18 ++++++ .../controller/CustomerAgencyController.java | 33 ----------- .../controller/StaffAgencyController.java | 55 +++++++++++++++++++ .../com/epmet/feign/GovOrgFeignClient.java | 14 +++++ .../fallback/GovOrgFeignClientFallBack.java | 10 ++++ ...AgencyRedis.java => StaffAgencyRedis.java} | 2 +- ...cyService.java => StaffAgencyService.java} | 16 +++++- ...eImpl.java => StaffAgencyServiceImpl.java} | 25 +++++++-- .../result/CustomerGridByUserIdResultDTO.java | 30 ++++++++++ .../controller/CustomerGridController.java | 11 ++++ .../java/com/epmet/dao/CustomerGridDao.java | 8 +++ .../epmet/service/CustomerGridService.java | 8 +++ .../service/impl/CustomerGridServiceImpl.java | 12 ++++ .../main/resources/mapper/CustomerGridDao.xml | 16 ++++++ 14 files changed, 216 insertions(+), 42 deletions(-) delete mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/CustomerAgencyController.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java rename epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/{CustomerAgencyRedis.java => StaffAgencyRedis.java} (97%) rename epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/{CustomerAgencyService.java => StaffAgencyService.java} (65%) rename epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/{CustomerAgencyServiceImpl.java => StaffAgencyServiceImpl.java} (57%) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridByUserIdResultDTO.java diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index 69ec7833d8..a6077f5fa3 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -55,6 +55,24 @@ feign-httpclient 10.3.0 + + com.epmet + gov-org-client + 2.0.0 + compile + + + com.epmet + gov-org-client + 2.0.0 + compile + + + com.epmet + gov-org-client + 2.0.0 + compile + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/CustomerAgencyController.java deleted file mode 100644 index ae25f3a97f..0000000000 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * 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. - *

- * 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. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.controller; - -/** - * 机关单位信息表 - * - * @author generator generator@elink-cn.com - */ -@RestController -@RequestMapping("agency") -public class CustomerAgencyController { - - @Autowired - private CustomerAgencyService customerAgencyService; - - -} \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java new file mode 100644 index 0000000000..4ba21fb7be --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.service.StaffAgencyService; +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 generator generator@elink-cn.com + */ +@RestController +@RequestMapping("agency") +public class StaffAgencyController { + + @Autowired + private StaffAgencyService staffAgencyService; + + /** + * @param tokenDTO + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + @PostMapping("getmygrids") + public Result> getMyGrids(@LoginUser TokenDto tokenDTO) { + return staffAgencyService.getMyGrids(tokenDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index fd2853340f..6866e03ecd 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -1,8 +1,14 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; /** * @Description @@ -11,4 +17,12 @@ import org.springframework.cloud.openfeign.FeignClient; @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) public interface GovOrgFeignClient { + /** + * @param userId + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + @GetMapping(value = "/gov/org/customergrid/getmygrids/{userId}") + Result> getMyGrids(@PathVariable("userId") String userId); } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 80ab9be7be..7e7b838d38 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -1,8 +1,14 @@ 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.result.CustomerGridByUserIdResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * @Description * @Author sun @@ -10,4 +16,8 @@ import org.springframework.stereotype.Component; @Component public class GovOrgFeignClientFallBack implements GovOrgFeignClient { + @Override + public Result> getMyGrids(String userId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getMyGrids", userId); + } } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/StaffAgencyRedis.java similarity index 97% rename from epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java rename to epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/StaffAgencyRedis.java index 3b8e96c9a2..73608057c8 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/redis/StaffAgencyRedis.java @@ -28,7 +28,7 @@ import org.springframework.stereotype.Component; * @since v1.0.0 2020-04-20 */ @Component -public class CustomerAgencyRedis { +public class StaffAgencyRedis { @Autowired private RedisUtils redisUtils; diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java similarity index 65% rename from epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java rename to epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java index 85de6deeaf..ae1329232c 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java @@ -17,14 +17,24 @@ package com.epmet.service; -import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; + +import java.util.List; /** * 机关单位信息表 * * @author generator generator@elink-cn.com */ -public interface CustomerAgencyService extends BaseService { +public interface StaffAgencyService { + /** + * @param tokenDTO + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + Result> getMyGrids(TokenDto tokenDTO); } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java similarity index 57% rename from epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java rename to epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index 1f89cc5bd7..c65f231671 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -17,24 +17,39 @@ package com.epmet.service.impl; -import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.dao.CustomerAgencyDao; -import com.epmet.entity.CustomerAgencyEntity; -import com.epmet.service.CustomerAgencyService; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.GovOrgFeignClient; +import com.epmet.service.StaffAgencyService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * 机关单位信息表 * * @author generator generator@elink-cn.com */ @Service -public class CustomerAgencyServiceImpl extends BaseServiceImpl implements CustomerAgencyService { +public class StaffAgencyServiceImpl implements StaffAgencyService { @Autowired private GovOrgFeignClient govOrgFeignClient; @Autowired private EpmetUserFeignClient epmetUserFeignClient; + /** + * @param tokenDTO + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + @Override + public Result> getMyGrids(TokenDto tokenDTO) { + return govOrgFeignClient.getMyGrids(tokenDTO.getUserId()); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridByUserIdResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridByUserIdResultDTO.java new file mode 100644 index 0000000000..b0b04da974 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridByUserIdResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 根据userId查询该用户涉及的所有网格返回结果 + * @ClassName CustomerGridByUserIdResultDTO + * @Author sun + */ +@Data +public class CustomerGridByUserIdResultDTO implements Serializable { + private static final long serialVersionUID = -1L; + + /** + * 网格直属组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 2599fa67e3..1e565d5b76 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; @@ -125,4 +126,14 @@ public class CustomerGridController { return new Result().ok(data); } + /** + * @param userId + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + @PostMapping("getmygrids/{userId}") + public Result> getMyGrids(@PathVariable("userId") String userId) { + return customerGridService.getMyGrids(userId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index a8113682c4..edf49d86d1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -61,4 +62,11 @@ public interface CustomerGridDao extends BaseDao { CustomerGridDTO getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + /** + * @param userId + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + List getMyGrids(String userId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index cf24460d88..44b206c7c5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.entity.CustomerGridEntity; @@ -114,4 +115,11 @@ public interface CustomerGridService extends BaseService { */ Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + /** + * @param userId + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + Result> getMyGrids(String userId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 86cb83f0c2..f11352265f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.dao.CustomerGridDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.redis.CustomerGridRedis; @@ -151,4 +152,15 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(baseDao.getCustomerGridByGridId(customerGridFormDTO)); } + /** + * @param userId + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + @Override + public Result> getMyGrids(String userId) { + return new Result>().ok(baseDao.getMyGrids(userId)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index a2421ac708..343558b7d7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -93,4 +93,20 @@ + + \ No newline at end of file From 9bcd561b561ffb11e412eb32c80081750d54529a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 22 Apr 2020 16:23:49 +0800 Subject: [PATCH 026/174] =?UTF-8?q?customer=5Fagency=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/epmet_gov_org.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql index 34bf6d70cc..2dc0bba345 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql @@ -106,3 +106,8 @@ alter table customer_grid drop column SORT; alter table customer_grid add column ORG_ID varchar(64) NOT NULL COMMENT '所属组织机构ID(customer_organization.id)'; alter table customer_grid add column MANAGE_DISTRICT varchar(255) DEFAULT "" NOT NULL COMMENT '管辖区域'; alter table customer_grid add column TOTAL_USER INT(11) DEFAULT 0 NOT NULL COMMENT '当前网格总人数'; +ALTER TABLE customer_agency ADD ( + COUNTRY VARCHAR (32) DEFAULT NULL COMMENT '国家', + PROVINCE VARCHAR (32) DEFAULT NULL COMMENT '省份', + CITY VARCHAR (32) DEFAULT NULL COMMENT '城市' +); \ No newline at end of file From 74af1354c6840a0ef271a2937d3fbf2925160dac Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 22 Apr 2020 17:00:20 +0800 Subject: [PATCH 027/174] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E7=99=BB=E5=BD=95=E7=9A=84=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-mine/gov-mine-server/pom.xml | 6 + .../controller/StaffAgencyController.java | 38 ++-- .../com/epmet/feign/EpmetUserFeignClient.java | 13 ++ .../EpmetUserFeignClientFallback.java | 8 + .../com/epmet/service/StaffAgencyService.java | 8 + .../service/impl/StaffAgencyServiceImpl.java | 7 + .../epmet/controller/CustomerController.java | 11 ++ .../com/epmet/service/CustomerService.java | 7 + .../service/impl/CustomerServiceImpl.java | 6 + .../dto/result/LatestCustomerResultDTO.java | 31 ++++ epmet-user/epmet-user-server/pom.xml | 6 + .../StaffAgencyVisitedController.java | 63 ++++--- .../java/com/epmet/dao/CustomerStaffDao.java | 2 + .../com/epmet/dao/StaffAgencyVisitedDao.java | 3 + .../com/epmet/feign/OperCrmFeignClient.java | 25 +++ .../fallback/OperCrmFeignClientFallBack.java | 19 ++ .../epmet/service/CustomerStaffService.java | 150 ++++++++------- .../service/StaffAgencyVisitedService.java | 151 ++++++++------- .../impl/CustomerStaffServiceImpl.java | 6 + .../impl/StaffAgencyVisitedServiceImpl.java | 172 +++++++++++------- .../resources/mapper/CustomerStaffDao.xml | 5 + .../mapper/StaffAgencyVisitedDao.xml | 15 ++ 22 files changed, 504 insertions(+), 248 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index a6077f5fa3..aac182bf35 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -73,6 +73,12 @@ 2.0.0 compile + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java index 4ba21fb7be..a4718c4482 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java @@ -21,6 +21,7 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.service.StaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -38,18 +39,29 @@ import java.util.List; @RequestMapping("agency") public class StaffAgencyController { - @Autowired - private StaffAgencyService staffAgencyService; - - /** - * @param tokenDTO - * @return - * @Description 根据userId查询该用户涉及的所有网格列表 - * @Author sun - */ - @PostMapping("getmygrids") - public Result> getMyGrids(@LoginUser TokenDto tokenDTO) { - return staffAgencyService.getMyGrids(tokenDTO); - } + @Autowired + private StaffAgencyService staffAgencyService; + + /** + * @param tokenDTO + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + @PostMapping("getmygrids") + public Result> getMyGrids(@LoginUser TokenDto tokenDTO) { + return staffAgencyService.getMyGrids(tokenDTO); + } + + /** + * 获取最近一次登录的客户信息 + * + * @param tokenDTO + * @return + */ + @PostMapping("getlatestcustomer") + public Result getLatestCustomer(@LoginUser TokenDto tokenDTO) { + return staffAgencyService.getLatestCustomer(tokenDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 07d46c559d..78f955955d 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -1,8 +1,13 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; /** * @Description @@ -10,4 +15,12 @@ import org.springframework.cloud.openfeign.FeignClient; */ @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) public interface EpmetUserFeignClient { + /** + * 获取最近一次登录的客户信息 + * + * @param userId + * @return + */ + @GetMapping("/epmetuser/staffagencyvisited/getlatestcustomer/{userId}") + Result getLatestCustomer(@PathVariable("userId") String userId); } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 9c5a63a4fd..dfd80859f3 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -1,5 +1,9 @@ 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.result.LatestCustomerResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -10,4 +14,8 @@ import org.springframework.stereotype.Component; @Component public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { + @Override + public Result getLatestCustomer(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLatestCustomer", userId); + } } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java index ae1329232c..589a0ed64e 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import java.util.List; @@ -37,4 +38,11 @@ public interface StaffAgencyService { * @Author sun */ Result> getMyGrids(TokenDto tokenDTO); + + /** + * 获取最近一次登录的客户信息 + * @param tokenDTO + * @return + */ + Result getLatestCustomer(TokenDto tokenDTO); } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index c65f231671..5ead6f7e81 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -20,6 +20,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.StaffAgencyService; @@ -52,4 +53,10 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { return govOrgFeignClient.getMyGrids(tokenDTO.getUserId()); } + @Override + public Result getLatestCustomer(TokenDto tokenDTO) { + return epmetUserFeignClient.getLatestCustomer(tokenDTO.getUserId()); + } + + } \ No newline at end of file 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 4beebeae8d..4e683e3ffc 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 @@ -133,4 +133,15 @@ public class CustomerController { public Result> getValidCustomerList() { return customerService.getValidCustomerList(); } + + /** + * 获取客户信息 + * @param dto + * @return + */ + @PostMapping("getcostomerInfo") + public Result getCustomerInfo(@RequestBody CustomerDTO dto) { + return customerService.getCustomerInfo(dto); + } + } 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 1ef60f3762..b36bd6f5b2 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 @@ -113,4 +113,11 @@ public interface CustomerService extends BaseService { * @Date 2020/3/18 9:44 **/ Result saveCustomerInfo(CustomerDTO dto); + + /** + * 获取客户信息 + * @param dto + * @return + */ + Result getCustomerInfo(CustomerDTO dto); } 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 512eb55d40..5384193128 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 @@ -129,4 +129,10 @@ public class CustomerServiceImpl extends BaseServiceImpl().ok(entity.getId()); } + @Override + public Result getCustomerInfo(CustomerDTO dto) { + CustomerEntity entity = baseDao.selectById(dto.getId()); + return new Result().ok(ConvertUtils.sourceToTarget(entity, CustomerDTO.class)); + } + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java new file mode 100644 index 0000000000..5bdf00228b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/22 9:59 + */ +@Data +public class LatestCustomerResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户ID + */ + private String customerId; + /** + * 客户名称 + */ + private String customerName; + /** + * 客户顶级名称 + */ + private String agencyId; + /** + * 工作人员头像 + */ + private String staffHeadPhoto; +} diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index adc3bba016..761a0299a9 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -70,6 +70,12 @@ 2.0.0 compile + + com.epmet + oper-crm-client + 2.0.0 + compile + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java index 5111dc2a25..73d2ea4d27 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java @@ -19,6 +19,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.service.StaffAgencyVisitedService; import org.springframework.beans.factory.annotation.Autowired; @@ -34,31 +35,43 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("staffagencyvisited") public class StaffAgencyVisitedController { - - @Autowired - private StaffAgencyVisitedService staffAgencyVisitedService; - /** - * @param openId - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 获取当前微信上次登录的账号信息 - * @Date 2020/4/20 12:42 - **/ - @GetMapping(value = "getlatest/{openId}") - public Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId) { - return staffAgencyVisitedService.getLatestStaffWechatLoginRecord(openId); - } + @Autowired + private StaffAgencyVisitedService staffAgencyVisitedService; - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 保存登录日志 - * @Date 2020/4/20 14:29 - **/ - @PostMapping(value = "saveStaffLoginRecord") - public Result saveStaffLoginRecord(@RequestBody StaffLoginAgencyRecordFormDTO formDTO) { - return staffAgencyVisitedService.saveStaffLoginRecord(formDTO); - } + /** + * @param openId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取当前微信上次登录的账号信息 + * @Date 2020/4/20 12:42 + **/ + @GetMapping(value = "getlatest/{openId}") + public Result getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId) { + return staffAgencyVisitedService.getLatestStaffWechatLoginRecord(openId); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存登录日志 + * @Date 2020/4/20 14:29 + **/ + @PostMapping(value = "saveStaffLoginRecord") + public Result saveStaffLoginRecord(@RequestBody StaffLoginAgencyRecordFormDTO formDTO) { + return staffAgencyVisitedService.saveStaffLoginRecord(formDTO); + } + + /** + * 获取最近一次登录的客户信息 + * + * @param userId 参数 + * @return Result + * @author zhaoqifeng + */ + @GetMapping("getlatestcustomer/{userId}") + public Result getLatestCustomer(@PathVariable("userId") String userId) { + return staffAgencyVisitedService.getLatestCustomer(userId); + } } \ 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 a676eb8a2c..689af6a49b 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 @@ -51,4 +51,6 @@ public interface CustomerStaffDao extends BaseDao { * @Date 2020/4/20 14:08 **/ CustomerStaffDTO selectListCustomerStaffInfo(CustomerStaffFormDTO formDTO); + + CustomerStaffDTO selectStaffInfoByUserId(CustomerStaffDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java index 189b179f0c..4e55a5e731 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java @@ -38,4 +38,7 @@ public interface StaffAgencyVisitedDao extends BaseDao * @Date 2020/4/20 12:45 **/ StaffLatestAgencyResultDTO selectLatestStaffWechatLoginRecord(String openId); + + + StaffLatestAgencyResultDTO selectLatestCustomer(String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java new file mode 100644 index 0000000000..9cd6369f4f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java @@ -0,0 +1,25 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerDTO; +import com.epmet.feign.fallback.OperCrmFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/22 10:41 + */ +@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmFeignClientFallBack.class) +public interface OperCrmFeignClient { + /** + * 获取客户信息 + * @param dto + * @return + */ + @PostMapping("/oper/crm/customer/getcostomerInfo") + Result getCustomerInfo(@RequestBody CustomerDTO dto); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java new file mode 100644 index 0000000000..473a1fe64f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -0,0 +1,19 @@ +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.CustomerDTO; +import com.epmet.feign.OperCrmFeignClient; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/22 10:43 + */ +public class OperCrmFeignClientFallBack implements OperCrmFeignClient { + @Override + public Result getCustomerInfo(CustomerDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerInfo", dto); + } +} 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 b459bdb83c..12c2c04c52 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 @@ -35,81 +35,91 @@ import java.util.Map; */ public interface CustomerStaffService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-04-18 - */ - PageData page(Map params); + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-18 + */ + PageData page(Map params); - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-04-18 - */ - List list(Map params); + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-18 + */ + List list(Map params); - /** - * 单条查询 - * - * @param id - * @return CustomerStaffDTO - * @author generator - * @date 2020-04-18 - */ - CustomerStaffDTO get(String id); + /** + * 单条查询 + * + * @param id + * @return CustomerStaffDTO + * @author generator + * @date 2020-04-18 + */ + CustomerStaffDTO get(String id); - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-18 - */ - void save(CustomerStaffDTO dto); + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-18 + */ + void save(CustomerStaffDTO dto); - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-18 - */ - void update(CustomerStaffDTO dto); + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-18 + */ + void update(CustomerStaffDTO dto); - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-04-18 - */ - void delete(String[] ids); + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-18 + */ + void delete(String[] ids); - /** - * @param mobile 手机号 - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 根据手机号查询政府端工作人员基本信息,校验用户是否存在 - * @Date 2020/4/18 14:07 - **/ - Result> getCustsomerStaffByPhone(String mobile); + /** + * @param mobile 手机号 + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据手机号查询政府端工作人员基本信息,校验用户是否存在 + * @Date 2020/4/18 14:07 + **/ + Result> getCustsomerStaffByPhone(String mobile); - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 根据手机号+客户id获取工作人员基本信息 - * @Date 2020/4/20 14:05 - **/ - Result getCustomerStaffInfo(CustomerStaffFormDTO formDTO); + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据手机号+客户id获取工作人员基本信息 + * @Date 2020/4/20 14:05 + **/ + Result getCustomerStaffInfo(CustomerStaffFormDTO formDTO); + + /** + * 根据用户ID获取工作人员基本信息 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/4/22 10:05 + **/ + Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java index 4b67657992..d8a3dc064e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java @@ -19,9 +19,11 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.entity.StaffAgencyVisitedEntity; @@ -36,81 +38,90 @@ import java.util.Map; */ public interface StaffAgencyVisitedService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-04-21 - */ - PageData page(Map params); + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-21 + */ + PageData page(Map params); - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-04-21 - */ - List list(Map params); + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-21 + */ + List list(Map params); - /** - * 单条查询 - * - * @param id - * @return StaffAgencyVisitedDTO - * @author generator - * @date 2020-04-21 - */ - StaffAgencyVisitedDTO get(String id); + /** + * 单条查询 + * + * @param id + * @return StaffAgencyVisitedDTO + * @author generator + * @date 2020-04-21 + */ + StaffAgencyVisitedDTO get(String id); - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-21 - */ - void save(StaffAgencyVisitedDTO dto); + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-21 + */ + void save(StaffAgencyVisitedDTO dto); - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-21 - */ - void update(StaffAgencyVisitedDTO dto); + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-21 + */ + void update(StaffAgencyVisitedDTO dto); - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-04-21 - */ - void delete(String[] ids); + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-21 + */ + void delete(String[] ids); - /** - * @param openId - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 获取当前微信上次登录的账号信息 - * @Date 2020/4/20 12:43 - **/ - Result getLatestStaffWechatLoginRecord(String openId); + /** + * @param openId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取当前微信上次登录的账号信息 + * @Date 2020/4/20 12:43 + **/ + Result getLatestStaffWechatLoginRecord(String openId); - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 保存登录日志 - * @Date 2020/4/20 14:33 - **/ - Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO formDTO); + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存登录日志 + * @Date 2020/4/20 14:33 + **/ + Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO formDTO); + + /** + * 获取最近一次登录的客户信息 + * + * @param userId 参数 + * @return Result + * @author zhaoqifeng + */ + Result getLatestCustomer(String userId); } \ 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 9d9e11a64c..e0d2c3ac8f 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 @@ -134,4 +134,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().ok(customerStaffDTO); } + @Override + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfoByUserId(formDTO); + return new Result().ok(customerStaffDTO); + } + } \ No newline at end of file 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 399b4c6bf0..5108b1d8a5 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 @@ -22,17 +22,24 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.StaffAgencyVisitedDao; +import com.epmet.dto.CustomerDTO; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.entity.StaffAgencyVisitedEntity; +import com.epmet.feign.OperCrmFeignClient; +import com.epmet.service.CustomerStaffService; import com.epmet.service.StaffAgencyVisitedService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,74 +55,99 @@ import java.util.Map; */ @Service public class StaffAgencyVisitedServiceImpl extends BaseServiceImpl implements StaffAgencyVisitedService { - private static final Logger logger = LoggerFactory.getLogger(StaffAgencyVisitedServiceImpl.class); - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, StaffAgencyVisitedDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, StaffAgencyVisitedDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public StaffAgencyVisitedDTO get(String id) { - StaffAgencyVisitedEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, StaffAgencyVisitedDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(StaffAgencyVisitedDTO dto) { - StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyVisitedEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(StaffAgencyVisitedDTO dto) { - StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyVisitedEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - @Override - public Result getLatestStaffWechatLoginRecord(String openId) { - if (StringUtils.isNotBlank(openId)) { - logger.error("openId 不能为空"); - return new Result(); - } - StaffLatestAgencyResultDTO latestStaffWechatLoginDTO = baseDao.selectLatestStaffWechatLoginRecord(openId); - return new Result().ok(latestStaffWechatLoginDTO); - } - - @Override - public Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO formDTO) { - StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(formDTO, StaffAgencyVisitedEntity.class); - insert(entity); - return new Result(); - } + private static final Logger logger = LoggerFactory.getLogger(StaffAgencyVisitedServiceImpl.class); + + @Autowired + private CustomerStaffService customerStaffService; + @Autowired + private OperCrmFeignClient operCrmFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, StaffAgencyVisitedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, StaffAgencyVisitedDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public StaffAgencyVisitedDTO get(String id) { + StaffAgencyVisitedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, StaffAgencyVisitedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(StaffAgencyVisitedDTO dto) { + StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyVisitedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(StaffAgencyVisitedDTO dto) { + StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyVisitedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result getLatestStaffWechatLoginRecord(String openId) { + if (StringUtils.isNotBlank(openId)) { + logger.error("openId 不能为空"); + return new Result(); + } + StaffLatestAgencyResultDTO latestStaffWechatLoginDTO = baseDao.selectLatestStaffWechatLoginRecord(openId); + return new Result().ok(latestStaffWechatLoginDTO); + } + + @Override + public Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO formDTO) { + StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(formDTO, StaffAgencyVisitedEntity.class); + insert(entity); + return new Result(); + } + + @Override + public Result getLatestCustomer(String userId) { + LatestCustomerResultDTO resultDTO = new LatestCustomerResultDTO(); + StaffLatestAgencyResultDTO latestCustomer = baseDao.selectLatestCustomer(userId); + resultDTO.setAgencyId(latestCustomer.getAgencyId()); + resultDTO.setCustomerId(latestCustomer.getCustomerId()); + //获取工作人员头像 + CustomerStaffDTO customerStaffParam = new CustomerStaffDTO(); + customerStaffParam.setUserId(userId); + Result staffInfo = + customerStaffService.getCustomerStaffInfoByUserId(customerStaffParam); + resultDTO.setStaffHeadPhoto(staffInfo.getData().getHeadPhoto()); + //获取客户名称 + CustomerDTO customerDTO = new CustomerDTO(); + customerDTO.setId(latestCustomer.getCustomerId()); + Result customerResult = operCrmFeignClient.getCustomerInfo(customerDTO); + resultDTO.setCustomerName(customerResult.getData().getCustomerName()); + return new Result().ok(resultDTO); + } } \ 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 3478b0fbba..08b3afb984 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 @@ -18,4 +18,9 @@ and cs.CUSTOMER_ID=#{customerId} and cs.DEL_FLAG='1' + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml index d211f53ac4..82bc2cace3 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml @@ -35,4 +35,19 @@ sav.CREATED_TIME DESC LIMIT 1 + \ No newline at end of file From 455d84210d0281541a007cc8cbc0e670969db321 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 22 Apr 2020 17:02:43 +0800 Subject: [PATCH 028/174] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E7=99=BB=E5=BD=95=E7=9A=84=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/fallback/OperCrmFeignClientFallBack.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java index 473a1fe64f..d40619a04c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -5,12 +5,14 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; import com.epmet.feign.OperCrmFeignClient; +import org.springframework.stereotype.Component; /** * @author zhaoqifeng * @dscription * @date 2020/4/22 10:43 */ +@Component public class OperCrmFeignClientFallBack implements OperCrmFeignClient { @Override public Result getCustomerInfo(CustomerDTO dto) { From 4e4c0700bf986b91a2da39e926ecbc2a14eeadce Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 22 Apr 2020 17:27:46 +0800 Subject: [PATCH 029/174] =?UTF-8?q?1.gov=E2=80=94mine=E5=92=8Cgov-access?= =?UTF-8?q?=E5=BE=AE=E6=9C=8D=E5=8A=A1=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-access/gov-access-server/pom.xml | 6 ++--- epmet-module/gov-mine/gov-mine-client/pom.xml | 25 ++++++++++++++++--- epmet-module/gov-mine/gov-mine-server/pom.xml | 11 ++++---- .../java/com/epmet/GovMineApplication.java | 13 ++++++++++ .../com/epmet/config/ModuleConfigImpl.java | 24 ++++++++++++++++++ 5 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/ModuleConfigImpl.java diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index 31695bd331..b6da423ab1 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -93,7 +93,7 @@ true - 8097 + 8099 dev @@ -123,7 +123,7 @@ true --> - 8093 + 8099 dev @@ -153,7 +153,7 @@ true --> - 8093 + 8099 test diff --git a/epmet-module/gov-mine/gov-mine-client/pom.xml b/epmet-module/gov-mine/gov-mine-client/pom.xml index c97b0dceb3..193f0aeebd 100644 --- a/epmet-module/gov-mine/gov-mine-client/pom.xml +++ b/epmet-module/gov-mine/gov-mine-client/pom.xml @@ -2,16 +2,35 @@ + 0.3.0 - epmet-module com.epmet + gov-mine 2.0.0 - ../../pom.xml 4.0.0 gov-mine-client - 0.3.0 + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + + + ${project.artifactId} + \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index a6077f5fa3..71d033d62d 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -2,26 +2,25 @@ + 0.3.0 - epmet-module com.epmet + gov-mine 2.0.0 - ../../pom.xml 4.0.0 gov-mine-server - 0.3.0 com.epmet - epmet-commons-tools - 2.0.0 + gov-mine-client + 0.3.0 com.epmet - epmet-commons-mybatis + epmet-commons-tools 2.0.0 diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java new file mode 100644 index 0000000000..ab542b8327 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java @@ -0,0 +1,13 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class GovMineApplication { + + public static void main(String[] args) { + SpringApplication.run(GovMineApplication.class, args); + } + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..8ccca90cd1 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "govmine"; + } +} From fafe406379eda124c91a0d65e8c2dce20c5f1a88 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 22 Apr 2020 17:54:26 +0800 Subject: [PATCH 030/174] =?UTF-8?q?1.=E8=A7=A3=E5=86=B3=E5=AF=B9client?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=BE=9D=E8=B5=96=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-mine/gov-mine-server/pom.xml | 12 ------------ epmet-module/gov-mine/pom.xml | 1 + epmet-module/gov-org/gov-org-server/pom.xml | 5 ----- epmet-module/resi-mine/resi-mine-server/pom.xml | 5 ----- 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index cd7d669cdd..877a7af756 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -60,18 +60,6 @@ 2.0.0 compile - - com.epmet - gov-org-client - 2.0.0 - compile - - - com.epmet - gov-org-client - 2.0.0 - compile - com.epmet epmet-user-client diff --git a/epmet-module/gov-mine/pom.xml b/epmet-module/gov-mine/pom.xml index ef1a4d528b..2aa523997f 100644 --- a/epmet-module/gov-mine/pom.xml +++ b/epmet-module/gov-mine/pom.xml @@ -8,6 +8,7 @@ 2.0.0 4.0.0 + pom gov-mine diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index deb18a6168..3bb6930492 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -56,11 +56,6 @@ - - com.epmet - gov-org-client - 2.0.0 - com.epmet resi-partymember-client diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 18d3fdbc41..77cc559c92 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -12,11 +12,6 @@ jar - - com.epmet - resi-mine-client - 2.0.0 - com.epmet epmet-commons-tools From 6f57c14b09c341f265830054f138fc7dfc08a49f Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 22 Apr 2020 18:20:32 +0800 Subject: [PATCH 031/174] =?UTF-8?q?1.gov-access=E5=92=8Cgov-mine=E5=BE=AE?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E8=B0=83=E6=95=B4=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=94=99=E8=AF=AF=202.=E5=B0=86=E6=96=B0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=B0gateway=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/pom.xml | 19 +++++++++++++++ .../src/main/resources/bootstrap.yml | 23 +++++++++++++++++++ .../com/epmet/controller/TestController.java | 17 ++++++++++++++ .../controller/StaffAgencyController.java | 2 +- 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/TestController.java diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 5b943229db..57d6203598 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -155,6 +155,14 @@ lb://resi-partymember-server + + + + lb://gov-access-server + + + + lb://gov-mine-server @@ -211,6 +219,12 @@ lb://resi-group-server lb://resi-partymember-server + + + lb://gov-access-server + + + lb://gov-mine-server @@ -267,6 +281,11 @@ lb://resi-group-server lb://resi-partymember-server + + lb://gov-access-server + + + lb://gov-mine-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index dec03ba191..d7f1d28a50 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -167,6 +167,27 @@ spring: filters: - StripPrefix=1 - CpAuth=true + + + #政府端权限服务 + - id: gov-access-server + uri: @gateway.routes.gov-access-server.uri@ + order: 18 + predicates: + - Path=${server.servlet.context-path}/gov/access/** + filters: + - StripPrefix=1 + - CpAuth=true + + #政府端-我的-服务 + - id: gov-mine-server + uri: @gateway.routes.gov-mine-server.uri@ + order: 19 + predicates: + - Path=${server.servlet.context-path}/gov/mine/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ @@ -272,6 +293,8 @@ epmet: - /resi/mine/** - /resi/group/** - /resi/partymember/** +# - /gov/mine/** +# - /gov/access/** swaggerUrls: jwt: diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/TestController.java new file mode 100644 index 0000000000..438f105eab --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/TestController.java @@ -0,0 +1,17 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("test") +public class TestController { + + @GetMapping("test") + public void test() { + System.out.println(666); + } + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java index a4718c4482..83b649e63a 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java @@ -49,7 +49,7 @@ public class StaffAgencyController { * @Author sun */ @PostMapping("getmygrids") - public Result> getMyGrids(@LoginUser TokenDto tokenDTO) { + public Result> getMyGrids(TokenDto tokenDTO) { return staffAgencyService.getMyGrids(tokenDTO); } From 4c29ed52a72de911e3bb43842065045606f851d3 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 22 Apr 2020 22:07:31 +0800 Subject: [PATCH 032/174] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=AE=A2=E6=88=B7footbar=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-mine/gov-mine-server/pom.xml | 5 + .../java/com/epmet/GovMineApplication.java | 4 + .../com/epmet/controller/AppController.java | 37 ++++++ .../epmet/feign/OperCustomizeFeignClient.java | 21 ++++ .../OperCustomizeFeignClientFallBack.java | 22 ++++ .../com/epmet/dto/CustomerFootBarDTO.java | 96 ++++++++++++++ .../dto/form/CustomerFootBarFormDTO.java | 13 ++ .../dto/result/CustomerFootBarResultDTO.java | 97 +++++++++++++++ .../controller/CustomerFootBarController.java | 117 ++++++++++++++++++ .../com/epmet/dao/CustomerFootBarDao.java | 37 ++++++ .../epmet/entity/CustomerFootBarEntity.java | 66 ++++++++++ .../com/epmet/excel/CustomerFootBarExcel.java | 71 +++++++++++ .../com/epmet/redis/CustomerFootBarRedis.java | 47 +++++++ .../epmet/service/CustomerFootBarService.java | 97 +++++++++++++++ .../impl/CustomerFootBarServiceImpl.java | 109 ++++++++++++++++ .../db.migration/customer_foot_bar.sql | 3 +- .../resources/mapper/CustomerFootBarDao.xml | 34 +++++ 17 files changed, 875 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AppController.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFootBarExcel.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index 877a7af756..8b45fb732d 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -18,6 +18,11 @@ gov-mine-client 0.3.0 + + com.epmet + oper-customize-client + 2.0.0 + com.epmet epmet-commons-tools diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java index ab542b8327..f804c3926e 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/GovMineApplication.java @@ -2,8 +2,12 @@ package com.epmet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients public class GovMineApplication { public static void main(String[] args) { diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AppController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AppController.java new file mode 100644 index 0000000000..93fef03372 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AppController.java @@ -0,0 +1,37 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.feign.OperCustomizeFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +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 java.util.List; + +@RestController +@RequestMapping("app") +public class AppController { + + @Autowired + private OperCustomizeFeignClient operCustomizeFeign; + + /** + * 查询 + * @param formDTO + * @return + */ + @PostMapping("getcustomerfootbars") + public Result> getCustomerFootBars(@RequestBody CustomerFootBarFormDTO formDTO) { + Result> result = operCustomizeFeign.getCustomerfootbars(formDTO); + if (CollectionUtils.isEmpty(result.getData())) { + formDTO.setCustomerId("default"); + result = operCustomizeFeign.getCustomerfootbars(formDTO); + } + return result; + } +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java new file mode 100644 index 0000000000..a645d0d44b --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java @@ -0,0 +1,21 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.feign.fallback.OperCustomizeFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeFeignClientFallBack.class) +public interface OperCustomizeFeignClient { + + @PostMapping(value = "/oper/customize/customerfootbar/customerfootbars", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO); + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java new file mode 100644 index 0000000000..6f343f3857 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java @@ -0,0 +1,22 @@ +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.CustomerFootBarDTO; +import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.dto.form.CustomerHomeFormDTO; +import com.epmet.dto.result.HomeDesignByCustomerResultDTO; +import com.epmet.feign.OperCustomizeFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class OperCustomizeFeignClientFallBack implements OperCustomizeFeignClient { + + @Override + public Result> getCustomerfootbars(CustomerFootBarFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerfootbars",formDTO); + } +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java new file mode 100644 index 0000000000..2cc9b89b0e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class CustomerFootBarDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * bar名称 + */ + private String barName; + + /** + * KEY + */ + private String barKey; + + /** + * 页面标题 + */ + private String pageTitle; + + /** + * 图标路径 + */ + private String iconPath; + + /** + * 选中页面图标路径 + */ + private String selectedIconPath; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java new file mode 100644 index 0000000000..73b4c7b500 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class CustomerFootBarFormDTO { + + //@NotBlank(message = "客户ID不能为空") + private String customerId; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java new file mode 100644 index 0000000000..832e06944c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class CustomerFootBarResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * bar名称 + */ + private String barName; + + /** + * KEY + */ + private String barKey; + + /** + * 页面标题 + */ + private String pageTitle; + + /** + * 图标路径 + */ + private String iconPath; + + /** + * 选中页面图标路径 + */ + private String selectedIconPath; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java new file mode 100644 index 0000000000..a0bd33d16c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +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.CustomerFootBarDTO; +import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.entity.CustomerFootBarEntity; +import com.epmet.excel.CustomerFootBarExcel; +import com.epmet.service.CustomerFootBarService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@RestController +@RequestMapping("customerfootbar") +public class CustomerFootBarController { + + @Autowired + private CustomerFootBarService customerFootBarService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerFootBarService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerFootBarDTO data = customerFootBarService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerFootBarDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerFootBarService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerFootBarDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerFootBarService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerFootBarService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerFootBarService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerFootBarExcel.class); + } + + /** + * 查询客户的APP footbar + * @param formDTO + * @return + */ + @PostMapping("customerfootbars") + public Result> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + String customerId = formDTO.getCustomerId(); + + List footbars = customerFootBarService.listCustomerFootBars(customerId); + List barDTOS = new LinkedList<>(); + footbars.forEach(barEntity -> { + CustomerFootBarDTO barDTO = new CustomerFootBarDTO(); + BeanUtils.copyProperties(barEntity, barDTO); + barDTOS.add(barDTO); + }); + return new Result>().ok(barDTOS); + } +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java new file mode 100644 index 0000000000..f22bc917ad --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerFootBarEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Mapper +public interface CustomerFootBarDao extends BaseDao { + + List listCustomerFootBars(@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java new file mode 100644 index 0000000000..8bfc92afb1 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_foot_bar") +public class CustomerFootBarEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * bar名称 + */ + private String barName; + + /** + * KEY + */ + private String barKey; + + /** + * 页面标题 + */ + private String pageTitle; + + /** + * 图标路径 + */ + private String iconPath; + + /** + * 选中页面图标路径 + */ + private String selectedIconPath; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFootBarExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFootBarExcel.java new file mode 100644 index 0000000000..d282380f8f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFootBarExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class CustomerFootBarExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "bar名称") + private String barName; + + @Excel(name = "KEY") + private String key; + + @Excel(name = "页面标题") + private String pageTitle; + + @Excel(name = "图标路径") + private String iconPath; + + @Excel(name = "选中页面图标路径") + private String selectedIconPath; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java new file mode 100644 index 0000000000..1d120429d8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Component +public class CustomerFootBarRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java new file mode 100644 index 0000000000..f3a793793d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.entity.CustomerFootBarEntity; + +import java.util.List; +import java.util.Map; + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +public interface CustomerFootBarService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerFootBarDTO + * @author generator + * @date 2020-04-22 + */ + CustomerFootBarDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-22 + */ + void save(CustomerFootBarDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-22 + */ + void update(CustomerFootBarDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-22 + */ + void delete(String[] ids); + + List listCustomerFootBars(String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java new file mode 100644 index 0000000000..15336d92fc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.CustomerFootBarDao; +import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.entity.CustomerFootBarEntity; +import com.epmet.redis.CustomerFootBarRedis; +import com.epmet.service.CustomerFootBarService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Service +public class CustomerFootBarServiceImpl extends BaseServiceImpl implements CustomerFootBarService { + + @Autowired + private CustomerFootBarRedis customerFootBarRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerFootBarDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerFootBarDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CustomerFootBarDTO get(String id) { + CustomerFootBarEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerFootBarDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerFootBarDTO dto) { + CustomerFootBarEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFootBarEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerFootBarDTO dto) { + CustomerFootBarEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFootBarEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listCustomerFootBars(String customerId) { + return baseDao.listCustomerFootBars(customerId); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql index fc496afa9a..dc9eebc971 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql @@ -11,8 +11,9 @@ DROP TABLE IF EXISTS `customer_foot_bar`; CREATE TABLE `customer_foot_bar` ( `ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '客户ID', `BAR_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'bar名称', - `KEY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'KEY', + `BAR_KEY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'KEY', `PAGE_TITLE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '页面标题', `ICON_PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标路径', `SELECTED_ICON_PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '选中页面图标路径', diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml new file mode 100644 index 0000000000..a11df38ba6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 6fa3ed19b846d5020d7a606d2204c06bf09744f3 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 22 Apr 2020 22:16:32 +0800 Subject: [PATCH 033/174] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9pom=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-access/gov-access-client/pom.xml | 3 +-- epmet-module/gov-access/gov-access-server/pom.xml | 4 ++-- epmet-module/gov-access/pom.xml | 2 +- epmet-module/gov-mine/gov-mine-client/pom.xml | 1 - epmet-module/gov-mine/gov-mine-server/pom.xml | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/epmet-module/gov-access/gov-access-client/pom.xml b/epmet-module/gov-access/gov-access-client/pom.xml index ad7c7ab019..35a138e635 100644 --- a/epmet-module/gov-access/gov-access-client/pom.xml +++ b/epmet-module/gov-access/gov-access-client/pom.xml @@ -2,11 +2,10 @@ - 0.3.0 gov-access com.epmet - 0.3.0 + 2.0.0 4.0.0 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index b6da423ab1..f71a21d4a0 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -6,7 +6,7 @@ gov-access com.epmet - 0.3.0 + 2.0.0 4.0.0 @@ -17,7 +17,7 @@ com.epmet gov-access-client - 0.3.0 + 2.0.0 com.epmet diff --git a/epmet-module/gov-access/pom.xml b/epmet-module/gov-access/pom.xml index 3c5ac0d7dd..b81b68f895 100644 --- a/epmet-module/gov-access/pom.xml +++ b/epmet-module/gov-access/pom.xml @@ -11,7 +11,7 @@ gov-access pom - 0.3.0 + gov-access-client gov-access-server diff --git a/epmet-module/gov-mine/gov-mine-client/pom.xml b/epmet-module/gov-mine/gov-mine-client/pom.xml index 193f0aeebd..7dd4b864f7 100644 --- a/epmet-module/gov-mine/gov-mine-client/pom.xml +++ b/epmet-module/gov-mine/gov-mine-client/pom.xml @@ -2,7 +2,6 @@ - 0.3.0 com.epmet gov-mine diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index 8b45fb732d..e9965f902b 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -16,7 +16,7 @@ com.epmet gov-mine-client - 0.3.0 + 2.0.0 com.epmet From c7c2ce05be0de7dcf733d927b1562af38f72992b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 23 Apr 2020 09:53:08 +0800 Subject: [PATCH 034/174] =?UTF-8?q?customer=5Fagency=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B1=9E=E6=80=A7=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/CustomerAgencyDTO.java | 15 +++++++++++++++ .../com/epmet/entity/CustomerAgencyEntity.java | 15 +++++++++++++++ .../java/com/epmet/excel/CustomerAgencyExcel.java | 9 +++++++++ 3 files changed, 39 insertions(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java index 9523753483..d1e6c3f40a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java @@ -112,4 +112,19 @@ public class CustomerAgencyDTO implements Serializable { */ private Integer totalUser; + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index b06e833347..84f0e78f1c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java @@ -82,4 +82,19 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { */ private Integer totalUser; + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java index 27422f3157..61ea84eb40 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java @@ -76,5 +76,14 @@ public class CustomerAgencyExcel { @Excel(name = "总人数") private Integer totalUser; + @Excel(name = "国家") + private String country; + + @Excel(name = "省份") + private String province; + + @Excel(name = "城市") + private String city; + } \ No newline at end of file From c55ca2d106e52f12f0f87aef47509c267564b5d5 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 23 Apr 2020 10:19:33 +0800 Subject: [PATCH 035/174] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E4=B8=80=E6=AC=A1=E7=99=BB=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/EpmetUserFeignClient.java | 10 +- .../com/epmet/feign/GovOrgFeignClient.java | 10 ++ .../EpmetUserFeignClientFallback.java | 4 - .../service/impl/StaffAgencyServiceImpl.java | 2 +- .../com/epmet/dto/CustomerStaffAgencyDTO.java | 2 +- .../dto/result/LatestCustomerResultDTO.java | 4 + epmet-module/gov-org/gov-org-server/pom.xml | 12 ++ .../CustomerStaffAgencyController.java | 13 ++ .../com/epmet/dao/CustomerStaffAgencyDao.java | 8 ++ .../entity/CustomerStaffAgencyEntity.java | 2 +- .../com/epmet/feign/EpmetUserFeignClient.java | 30 +++++ .../com/epmet/feign/OperCrmFeignClient.java | 25 ++++ .../EpmetUserFeignClientFallback.java | 23 ++++ .../fallback/OperCrmFeignClientFallBack.java | 21 ++++ .../service/CustomerStaffAgencyService.java | 118 ++++++++++-------- .../impl/CustomerStaffAgencyServiceImpl.java | 31 +++++ .../mapper/CustomerStaffAgencyDao.xml | 16 ++- .../controller/CustomerStaffController.java | 13 ++ .../StaffAgencyVisitedController.java | 12 -- .../service/StaffAgencyVisitedService.java | 10 -- .../impl/StaffAgencyVisitedServiceImpl.java | 23 ---- 21 files changed, 272 insertions(+), 117 deletions(-) rename {epmet-user/epmet-user-client => epmet-module/gov-org/gov-org-client}/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java (91%) create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 78f955955d..af24c8b644 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -7,7 +7,6 @@ import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; /** * @Description @@ -15,12 +14,5 @@ import org.springframework.web.bind.annotation.RequestBody; */ @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) public interface EpmetUserFeignClient { - /** - * 获取最近一次登录的客户信息 - * - * @param userId - * @return - */ - @GetMapping("/epmetuser/staffagencyvisited/getlatestcustomer/{userId}") - Result getLatestCustomer(@PathVariable("userId") String userId); + } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 6866e03ecd..f87abc24e4 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; @@ -25,4 +26,13 @@ public interface GovOrgFeignClient { */ @GetMapping(value = "/gov/org/customergrid/getmygrids/{userId}") Result> getMyGrids(@PathVariable("userId") String userId); + + /** + * 获取最近一次登录的客户信息 + * + * @param userId + * @return + */ + @GetMapping("/gov/org/customerstaffagency/getlatestcustomer/{userId}") + Result getLatestCustomer(@PathVariable("userId") String userId); } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index dfd80859f3..5f551bef80 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -14,8 +14,4 @@ import org.springframework.stereotype.Component; @Component public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { - @Override - public Result getLatestCustomer(String userId) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLatestCustomer", userId); - } } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index 5ead6f7e81..1a7a56e39a 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -55,7 +55,7 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { @Override public Result getLatestCustomer(TokenDto tokenDTO) { - return epmetUserFeignClient.getLatestCustomer(tokenDTO.getUserId()); + return govOrgFeignClient.getLatestCustomer(tokenDTO.getUserId()); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java index c97e5097a1..8cc0f73320 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java @@ -51,7 +51,7 @@ public class CustomerStaffAgencyDTO implements Serializable { /** * 组织机构ID customer_organization.id */ - private String orgId; + private String agencyId; /** * 删除标识 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java similarity index 91% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java index 5bdf00228b..1979096f1a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java @@ -28,4 +28,8 @@ public class LatestCustomerResultDTO implements Serializable { * 工作人员头像 */ private String staffHeadPhoto; + /** + * 性别 + */ + private Integer gender; } diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 3bb6930492..a9bd2b6ba3 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -62,6 +62,18 @@ 2.0.0 compile + + com.epmet + oper-crm-client + 2.0.0 + compile + + + com.epmet + epmet-user-client + 2.0.0 + compile + 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 58219da027..fa1976bf6d 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,6 +26,7 @@ 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.result.LatestCustomerResultDTO; import com.epmet.excel.CustomerStaffAgencyExcel; import com.epmet.service.CustomerStaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +92,16 @@ public class CustomerStaffAgencyController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffAgencyExcel.class); } + /** + * 获取最近一次登录的客户信息 + * + * @param userId 参数 + * @return Result + * @author zhaoqifeng + */ + @GetMapping("getlatestcustomer/{userId}") + public Result getLatestCustomer(@PathVariable("userId") String userId) { + 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/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 8ac905edcb..828c6cdd98 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 @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerStaffAgencyDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerStaffAgencyDao extends BaseDao { + + /** + * 获取最近一次登录的客户信息 + * @param userId + * @return + */ + CustomerStaffAgencyDTO selectLatestCustomerByStaff(String userId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java index 9c333137a9..0aa07837ec 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java @@ -51,6 +51,6 @@ public class CustomerStaffAgencyEntity extends BaseEpmetEntity { /** * 组织机构ID customer_organization.id */ - private String orgId; + private String agencyId; } 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 new file mode 100644 index 0000000000..27332bf916 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -0,0 +1,30 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.feign.fallback.EpmetUserFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/3/19 9:32 + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) +public interface EpmetUserFeignClient { + /** + * 根据用户ID获取工作人员基本信息 + * + * @param formDTO + * @return Result + * @author zhaoqifeng + * @date 2020/4/22 10:05 + **/ + @PostMapping(value = "/epmetuser/customerstaff/getstaffinfobyuserid") + Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO); + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java new file mode 100644 index 0000000000..9cd6369f4f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java @@ -0,0 +1,25 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerDTO; +import com.epmet.feign.fallback.OperCrmFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/22 10:41 + */ +@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmFeignClientFallBack.class) +public interface OperCrmFeignClient { + /** + * 获取客户信息 + * @param dto + * @return + */ + @PostMapping("/oper/crm/customer/getcostomerInfo") + Result getCustomerInfo(@RequestBody CustomerDTO dto); +} 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 new file mode 100644 index 0000000000..df59c03f22 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -0,0 +1,23 @@ +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.CustomerStaffDTO; +import com.epmet.dto.OperUserDTO; +import com.epmet.feign.EpmetUserFeignClient; +import org.springframework.stereotype.Component; + +/** + * 用户模块 + * @author zhaoqifeng + * @date 2020/3/19 9:34 + */ +@Component +public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { + + @Override + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerStaffInfoByUserId", formDTO); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java new file mode 100644 index 0000000000..d40619a04c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -0,0 +1,21 @@ +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.CustomerDTO; +import com.epmet.feign.OperCrmFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/22 10:43 + */ +@Component +public class OperCrmFeignClientFallBack implements OperCrmFeignClient { + @Override + public Result getCustomerInfo(CustomerDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerInfo", dto); + } +} 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 9ba776f271..2aaee92578 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 @@ -19,7 +19,9 @@ package com.epmet.service; 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.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import java.util.List; @@ -33,63 +35,71 @@ import java.util.Map; */ public interface CustomerStaffAgencyService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-04-20 - */ - PageData page(Map params); + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-20 + */ + PageData page(Map params); - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-04-20 - */ - List list(Map params); + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-20 + */ + List list(Map params); - /** - * 单条查询 - * - * @param id - * @return CustomerStaffAgencyDTO - * @author generator - * @date 2020-04-20 - */ - CustomerStaffAgencyDTO get(String id); + /** + * 单条查询 + * + * @param id + * @return CustomerStaffAgencyDTO + * @author generator + * @date 2020-04-20 + */ + CustomerStaffAgencyDTO get(String id); - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-20 - */ - void save(CustomerStaffAgencyDTO dto); + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-20 + */ + void save(CustomerStaffAgencyDTO dto); - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-20 - */ - void update(CustomerStaffAgencyDTO dto); + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-20 + */ + void update(CustomerStaffAgencyDTO dto); - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-04-20 - */ - void delete(String[] ids); + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-20 + */ + void delete(String[] ids); + + /** + * 获取最近一次登录的客户信息 + * + * @param userId + * @return + */ + Result getLatestCustomer(String userId); } \ No newline at end of file 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 f1786860da..57d8ae21d8 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 @@ -23,9 +23,14 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.CustomerStaffAgencyDao; +import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.entity.CustomerStaffAgencyEntity; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerStaffAgencyRedis; import com.epmet.service.CustomerStaffAgencyService; import org.apache.commons.lang3.StringUtils; @@ -48,6 +53,10 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +110,26 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl getLatestCustomer(String userId) { + LatestCustomerResultDTO resultDTO = new LatestCustomerResultDTO(); + CustomerStaffAgencyDTO customerStaffAgencyDTO = baseDao.selectLatestCustomerByStaff(userId); + + resultDTO.setAgencyId(customerStaffAgencyDTO.getAgencyId()); + resultDTO.setCustomerId(customerStaffAgencyDTO.getCustomerId()); + //获取工作人员头像 + CustomerStaffDTO customerStaffParam = new CustomerStaffDTO(); + customerStaffParam.setUserId(userId); + Result staffInfo = + epmetUserFeignClient.getCustomerStaffInfoByUserId(customerStaffParam); + resultDTO.setStaffHeadPhoto(staffInfo.getData().getHeadPhoto()); + resultDTO.setGender(staffInfo.getData().getGender()); + //获取客户名称 + CustomerDTO customerDTO = new CustomerDTO(); + customerDTO.setId(customerStaffAgencyDTO.getCustomerId()); + Result customerResult = operCrmFeignClient.getCustomerInfo(customerDTO); + resultDTO.setCustomerName(customerResult.getData().getCustomerName()); + return new Result().ok(resultDTO); + } + } \ No newline at end of file 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 33dbb3e61d..016f75962a 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 @@ -7,7 +7,7 @@ - + @@ -15,6 +15,18 @@ - + \ 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 b68ea382c6..6ae1285955 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 @@ -116,4 +116,17 @@ public class CustomerStaffController { ValidatorUtils.validateEntity(formDTO); return customerStaffService.getCustomerStaffInfo(formDTO); } + + /** + * 根据用户ID获取工作人员基本信息 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/4/22 10:05 + **/ + @PostMapping(value = "getstaffinfobyuserid") + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + return customerStaffService.getCustomerStaffInfoByUserId(formDTO); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java index 73d2ea4d27..488a103ef0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java @@ -19,7 +19,6 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; -import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.service.StaffAgencyVisitedService; import org.springframework.beans.factory.annotation.Autowired; @@ -63,15 +62,4 @@ public class StaffAgencyVisitedController { return staffAgencyVisitedService.saveStaffLoginRecord(formDTO); } - /** - * 获取最近一次登录的客户信息 - * - * @param userId 参数 - * @return Result - * @author zhaoqifeng - */ - @GetMapping("getlatestcustomer/{userId}") - public Result getLatestCustomer(@PathVariable("userId") String userId) { - return staffAgencyVisitedService.getLatestCustomer(userId); - } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java index d8a3dc064e..71622dfa4a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java @@ -19,11 +19,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; -import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.entity.StaffAgencyVisitedEntity; @@ -116,12 +114,4 @@ public interface StaffAgencyVisitedService extends BaseService getLatestCustomer(String userId); } \ No newline at end of file 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 5108b1d8a5..126dfd728c 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 @@ -22,15 +22,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.StaffAgencyVisitedDao; -import com.epmet.dto.CustomerDTO; -import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; -import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.entity.StaffAgencyVisitedEntity; import com.epmet.feign.OperCrmFeignClient; @@ -131,23 +127,4 @@ public class StaffAgencyVisitedServiceImpl extends BaseServiceImpl getLatestCustomer(String userId) { - LatestCustomerResultDTO resultDTO = new LatestCustomerResultDTO(); - StaffLatestAgencyResultDTO latestCustomer = baseDao.selectLatestCustomer(userId); - resultDTO.setAgencyId(latestCustomer.getAgencyId()); - resultDTO.setCustomerId(latestCustomer.getCustomerId()); - //获取工作人员头像 - CustomerStaffDTO customerStaffParam = new CustomerStaffDTO(); - customerStaffParam.setUserId(userId); - Result staffInfo = - customerStaffService.getCustomerStaffInfoByUserId(customerStaffParam); - resultDTO.setStaffHeadPhoto(staffInfo.getData().getHeadPhoto()); - //获取客户名称 - CustomerDTO customerDTO = new CustomerDTO(); - customerDTO.setId(latestCustomer.getCustomerId()); - Result customerResult = operCrmFeignClient.getCustomerInfo(customerDTO); - resultDTO.setCustomerName(customerResult.getData().getCustomerName()); - return new Result().ok(resultDTO); - } } \ No newline at end of file From 95dad66035272d52252d30a6117a231f0c5fbbe4 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 23 Apr 2020 10:26:36 +0800 Subject: [PATCH 036/174] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E4=B8=80=E6=AC=A1=E7=99=BB=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 57d8ae21d8..212e5246a1 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,6 +28,7 @@ import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerStaffAgencyDTO; import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperCrmFeignClient; From a3c60823e93ae9213760817dd42f8ad1dc9f6fb0 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 23 Apr 2020 10:54:06 +0800 Subject: [PATCH 037/174] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E4=B8=80=E6=AC=A1=E7=99=BB=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/fallback/GovOrgFeignClientFallBack.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 7e7b838d38..944eef1619 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -4,6 +4,7 @@ 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.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -20,4 +21,9 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { public Result> getMyGrids(String userId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getMyGrids", userId); } + + @Override + public Result getLatestCustomer(String userId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getLatestCustomer", userId); + } } \ No newline at end of file From f243849a3c754115bd153240ab3a05ef020421c9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Apr 2020 10:56:20 +0800 Subject: [PATCH 038/174] =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/SwitchGridFormDTO.java | 27 +++++++++++++++++++ .../controller/StaffAgencyController.java | 16 ++++++++++- .../com/epmet/service/StaffAgencyService.java | 11 ++++++++ .../service/impl/StaffAgencyServiceImpl.java | 12 ++++++--- 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/SwitchGridFormDTO.java diff --git a/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/SwitchGridFormDTO.java b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/SwitchGridFormDTO.java new file mode 100644 index 0000000000..f9908e24dc --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/SwitchGridFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 切换网格入参 + * @Author yinzuomei + * @Date 2020/4/23 10:41 + */ +@Data +public class SwitchGridFormDTO implements Serializable { + private static final long serialVersionUID = -2898130727929596798L; + + /** + * sessionKey + */ + private String customerId; + + /** + * sessionKey + */ + private String gridId; + +} + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java index 83b649e63a..372936494b 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java @@ -20,14 +20,17 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.service.StaffAgencyService; 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 javax.validation.Valid; import java.util.List; /** @@ -49,7 +52,7 @@ public class StaffAgencyController { * @Author sun */ @PostMapping("getmygrids") - public Result> getMyGrids(TokenDto tokenDTO) { + public Result> getMyGrids(@LoginUser TokenDto tokenDTO) { return staffAgencyService.getMyGrids(tokenDTO); } @@ -64,4 +67,15 @@ public class StaffAgencyController { return staffAgencyService.getLatestCustomer(tokenDTO); } + /** + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 切换网格 + * @Date 2020/4/23 10:34 + **/ + @PostMapping("switchgrid") + public Result> switchGrid(@LoginUser TokenDto tokenDto, @RequestBody @Valid SwitchGridFormDTO switchGridFormDTO) { + return staffAgencyService.switchGrid(switchGridFormDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java index 589a0ed64e..d2f7254998 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java @@ -19,6 +19,7 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; @@ -41,8 +42,18 @@ public interface StaffAgencyService { /** * 获取最近一次登录的客户信息 + * * @param tokenDTO * @return */ Result getLatestCustomer(TokenDto tokenDTO); + + /** + * @param switchGridFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 切换网格 + * @Date 2020/4/23 10:49 + **/ + Result> switchGrid(SwitchGridFormDTO switchGridFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index 1a7a56e39a..575ab2ef4d 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -19,9 +19,9 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; -import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.StaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -39,8 +39,6 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { @Autowired private GovOrgFeignClient govOrgFeignClient; - @Autowired - private EpmetUserFeignClient epmetUserFeignClient; /** * @param tokenDTO @@ -59,4 +57,12 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { } + @Override + public Result> switchGrid(SwitchGridFormDTO switchGridFormDTO) { + //记录网格访问记录 + //查询网格的权限 + return new Result<>(); + } + + } \ No newline at end of file From d5edd5952baea7b4b762cf43a869312746b7b885 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 23 Apr 2020 11:13:56 +0800 Subject: [PATCH 039/174] =?UTF-8?q?1.=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=9C=89=E6=9D=83=E9=99=90=E7=9A=84=E6=93=8D=E4=BD=9C=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/ServiceConstant.java | 5 + .../gov-access/gov-access-client/pom.xml | 8 +- .../java/com/epmet/dto/RoleOperationDTO.java | 82 +++++++++++++ .../dto/result/RoleOperationResultDTO.java | 87 +++++++++++++ .../com/epmet/controller/RoleController.java | 33 +++++ .../java/com/epmet/dao/RoleOperationDao.java | 38 ++++++ .../com/epmet/entity/RoleOperationEntity.java | 51 ++++++++ .../com/epmet/excel/RoleOperationExcel.java | 62 ++++++++++ .../com/epmet/redis/RoleOperationRedis.java | 47 ++++++++ .../epmet/service/RoleOperationService.java | 103 ++++++++++++++++ .../impl/RoleOperationServiceImpl.java | 110 +++++++++++++++++ .../db.migration/epmet_gov_access.sql | 10 +- .../resources/mapper/RoleOperationDao.xml | 33 +++++ .../com/epmet/dto/form/StaffOperationDTO.java | 13 ++ .../com/epmet/dto/form/StaffRoleFormDTO.java | 9 ++ epmet-module/gov-mine/gov-mine-server/pom.xml | 6 + .../epmet/controller/AccessController.java | 42 +++++++ .../com/epmet/feign/EpmetUserFeignClient.java | 20 +++ .../com/epmet/feign/GovAccessFeignClient.java | 25 ++++ .../EpmetUserFeignClientFallback.java | 13 ++ .../GovAccessFeignClientFallback.java | 28 +++++ .../java/com/epmet/service/AccessService.java | 19 +++ .../epmet/service/impl/AccessServiceImpl.java | 61 ++++++++++ .../java/com/epmet/dto/GovStaffRoleDTO.java | 91 ++++++++++++++ .../main/java/com/epmet/dto/StaffRoleDTO.java | 86 +++++++++++++ .../com/epmet/dto/form/StaffRoleFormDTO.java | 18 +++ .../epmet/controller/StaffRoleController.java | 53 ++++++++ .../java/com/epmet/dao/GovStaffRoleDao.java | 37 ++++++ .../main/java/com/epmet/dao/StaffRoleDao.java | 33 +++++ .../com/epmet/entity/GovStaffRoleEntity.java | 61 ++++++++++ .../com/epmet/entity/StaffRoleEntity.java | 56 +++++++++ .../com/epmet/excel/GovStaffRoleExcel.java | 68 +++++++++++ .../java/com/epmet/excel/StaffRoleExcel.java | 65 ++++++++++ .../com/epmet/redis/GovStaffRoleRedis.java | 47 ++++++++ .../java/com/epmet/redis/StaffRoleRedis.java | 47 ++++++++ .../epmet/service/GovStaffRoleService.java | 102 ++++++++++++++++ .../com/epmet/service/StaffRoleService.java | 95 +++++++++++++++ .../service/impl/GovStaffRoleServiceImpl.java | 114 ++++++++++++++++++ .../service/impl/StaffRoleServiceImpl.java | 104 ++++++++++++++++ .../main/resources/mapper/GovStaffRoleDao.xml | 32 +++++ .../main/resources/mapper/StaffRoleDao.xml | 20 +++ 41 files changed, 2028 insertions(+), 6 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleOperationDTO.java create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationResultDTO.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/RoleController.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDao.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationEntity.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/RoleOperationExcel.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleOperationService.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDao.xml create mode 100644 epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/StaffOperationDTO.java create mode 100644 epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/AccessService.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffRoleDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffRoleEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GovStaffRoleExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/StaffRoleExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index eab4df7b72..f8fb4b718d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -73,4 +73,9 @@ public interface ServiceConstant { * 消息服务 */ String EPMET_MESSAGE_SERVER = "epmet-message-server"; + + /** + * 政府端权限服务 + */ + String GOV_ACCESS_SERVER = "gov-access-server"; } diff --git a/epmet-module/gov-access/gov-access-client/pom.xml b/epmet-module/gov-access/gov-access-client/pom.xml index 35a138e635..b20a28582a 100644 --- a/epmet-module/gov-access/gov-access-client/pom.xml +++ b/epmet-module/gov-access/gov-access-client/pom.xml @@ -11,5 +11,11 @@ gov-access-client - + + + com.epmet + epmet-commons-tools + 2.0.0 + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleOperationDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleOperationDTO.java new file mode 100644 index 0000000000..bda4931386 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleOperationDTO.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 角色能进行那些操作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class RoleOperationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 角色ID + */ + private String roleId; + + /** + * 操作key + */ + private String operationKey; + + /** + * 是否删除,0:未删除,1:已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建者id + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新者id + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationResultDTO.java new file mode 100644 index 0000000000..dc7fc1559e --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationResultDTO.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 角色能进行那些操作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class RoleOperationResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 角色ID + */ + private String roleId; + + /** + * 操作key + */ + private String operationKey; + + /** + * 操作名称 + */ + private String operationName; + + /** + * 是否删除,0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建者id + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新者id + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/RoleController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/RoleController.java new file mode 100644 index 0000000000..8e9778734b --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/RoleController.java @@ -0,0 +1,33 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.RoleOperationResultDTO; +import com.epmet.service.RoleOperationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +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; + +@RestController +@RequestMapping("role") +public class RoleController { + + @Autowired + private RoleOperationService roleOperationService; + + /** + * 查询角色对应的操作列表 + * @param roleId + * @return + */ + @PostMapping("operations/{roleId}") + public Result> listOperationsByRoleId(@PathVariable("roleId") String roleId) { + List roleOperationResultDTOS = roleOperationService.listOperationsByRoleId(roleId); + return new Result>().ok(roleOperationResultDTOS); + } + + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDao.java new file mode 100644 index 0000000000..a1b408ba7a --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDao.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.RoleOperationResultDTO; +import com.epmet.entity.RoleOperationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 角色能进行那些操作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Mapper +public interface RoleOperationDao extends BaseDao { + + List listOperationsByRoleId(@Param("roleId") String roleId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationEntity.java new file mode 100644 index 0000000000..96f70de1be --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-04-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("role_operation") +public class RoleOperationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private String roleId; + + /** + * 操作key + */ + private String operationKey; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/RoleOperationExcel.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/RoleOperationExcel.java new file mode 100644 index 0000000000..4b0c4ee373 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/RoleOperationExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 角色能进行那些操作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class RoleOperationExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "角色ID") + private String roleId; + + @Excel(name = "操作key") + private String operationKey; + + @Excel(name = "是否删除,0:未删除,1:已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建者id") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新者id") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java new file mode 100644 index 0000000000..d57c02ebde --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色能进行那些操作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Component +public class RoleOperationRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleOperationService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleOperationService.java new file mode 100644 index 0000000000..ebc000a36b --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleOperationService.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.RoleOperationDTO; +import com.epmet.dto.result.RoleOperationResultDTO; +import com.epmet.entity.RoleOperationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色能进行那些操作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +public interface RoleOperationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return RoleOperationDTO + * @author generator + * @date 2020-04-22 + */ + RoleOperationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-22 + */ + void save(RoleOperationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-22 + */ + void update(RoleOperationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-22 + */ + void delete(String[] ids); + + /** + * 查询角色对应的操作列表 + * @param roleId + * @return + */ + List listOperationsByRoleId(String roleId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java new file mode 100644 index 0000000000..bb6d914d2e --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.RoleOperationDao; +import com.epmet.dto.RoleOperationDTO; +import com.epmet.dto.result.RoleOperationResultDTO; +import com.epmet.entity.RoleOperationEntity; +import com.epmet.redis.RoleOperationRedis; +import com.epmet.service.RoleOperationService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 角色能进行那些操作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Service +public class RoleOperationServiceImpl extends BaseServiceImpl implements RoleOperationService { + + @Autowired + private RoleOperationRedis roleOperationRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RoleOperationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RoleOperationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public RoleOperationDTO get(String id) { + RoleOperationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RoleOperationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(RoleOperationDTO dto) { + RoleOperationEntity entity = ConvertUtils.sourceToTarget(dto, RoleOperationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RoleOperationDTO dto) { + RoleOperationEntity entity = ConvertUtils.sourceToTarget(dto, RoleOperationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listOperationsByRoleId(String roleId) { + return baseDao.listOperationsByRoleId(roleId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql index c7c63b6c42..67e7a5c7b2 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql @@ -6,7 +6,7 @@ -- #SET FOREIGN_KEY_CHECKS = 0; -- DROP TABLE IF EXISTS `permission_scope`; -CREATE TABLE `permission_scope` ( +CREATE TABLE `operation_scope` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id', `SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围key', `SCOPE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围名称', @@ -22,8 +22,8 @@ CREATE TABLE `permission_scope` ( -- ---------------------------- -- Table structure for resource_ope -- ---------------------------- -DROP TABLE IF EXISTS `resource_ope`; -CREATE TABLE `resource_ope` ( +-- DROP TABLE IF EXISTS `operation`; +CREATE TABLE `operation` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `OPERATION_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `resource_ope` ( -- ---------------------------- -- Table structure for role_operation -- ---------------------------- -DROP TABLE IF EXISTS `role_operation`; +-- DROP TABLE IF EXISTS `role_operation`; CREATE TABLE `role_operation` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', @@ -57,7 +57,7 @@ CREATE TABLE `role_operation` ( -- ---------------------------- -- Table structure for role_scope -- ---------------------------- -DROP TABLE IF EXISTS `role_scope`; +-- DROP TABLE IF EXISTS `role_scope`; CREATE TABLE `role_scope` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDao.xml new file mode 100644 index 0000000000..0845fc5202 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDao.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/StaffOperationDTO.java b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/StaffOperationDTO.java new file mode 100644 index 0000000000..220f1f4a8f --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/StaffOperationDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.form; + +import lombok.Data; + +@Data +public class StaffOperationDTO { + + //@NotBlank(message = "角色所属组织ID不能为空") + private String agencyId; + + //@NotBlank(message = "角色所属网格ID不能为空") + private String gridId; +} diff --git a/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java new file mode 100644 index 0000000000..48938483bb --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java @@ -0,0 +1,9 @@ +package com.epmet.dto.form; + +import lombok.Data; + +@Data +public class StaffRoleFormDTO { + private String staffId; + private String orgId; +} diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index e9965f902b..b06d8fc331 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -71,6 +71,12 @@ 2.0.0 compile + + com.epmet + gov-access-client + 2.0.0 + compile + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java new file mode 100644 index 0000000000..9cef45a3b4 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java @@ -0,0 +1,42 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.StaffOperationDTO; +import com.epmet.service.AccessService; +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 java.util.List; +import java.util.Set; + +/** + * @return + * 我的权限相关 + * @Author wxz + * @Description + * @Date 2020/4/22 22:18 + **/ +@RestController +@RequestMapping("access") +public class AccessController { + + @Autowired + private AccessService accessService; + + @PostMapping("getstaffoperations") + public Result> getStaffOperations(@LoginUser TokenDto tokenDto, @RequestBody StaffOperationDTO staffOperationDTO) { + //public Result> getStaffOperations(@RequestBody StaffOperationDTO staffOperationDTO) { + String agencyId = staffOperationDTO.getAgencyId(); + String gridId = staffOperationDTO.getGridId(); + String staffId = tokenDto.getUserId(); + Set opeKeys = accessService.listOpeKeysByStaffId(staffId, agencyId, gridId); + return new Result>().ok(opeKeys); + } + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index af24c8b644..f5eebb41b7 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -2,11 +2,16 @@ 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.StaffRoleFormDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; /** * @Description @@ -14,5 +19,20 @@ import org.springframework.web.bind.annotation.PathVariable; */ @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) public interface EpmetUserFeignClient { + /** + * 获取最近一次登录的客户信息 + * + * @param userId + * @return + */ + @GetMapping("/epmetuser/staffagencyvisited/getlatestcustomer/{userId}") + Result getLatestCustomer(@PathVariable("userId") String userId); + /** + * 查询工作人员的角色 + * @return + */ + @PostMapping("/epmetuser/staffrole/staffRoles") + Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO); } + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java new file mode 100644 index 0000000000..facacdb301 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -0,0 +1,25 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.RoleOperationResultDTO; +import com.epmet.feign.fallback.GovAccessFeignClientFallback; +import com.epmet.feign.fallback.GovOrgFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * @Description + * @Author sun + */ +@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) +public interface GovAccessFeignClient { + + @PostMapping("/gov/access/role/operations/{roleId}") + Result> listOperationsByRoleId(@PathVariable("roleId") String roleId); +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 5f551bef80..a74421416f 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -3,10 +3,14 @@ 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.StaffRoleFormDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * @Description * @Author sun @@ -14,4 +18,13 @@ import org.springframework.stereotype.Component; @Component public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { + @Override + public Result getLatestCustomer(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLatestCustomer", userId); + } + + @Override + public Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRolesOfStaff"); + } } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java new file mode 100644 index 0000000000..0fc5df6a94 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java @@ -0,0 +1,28 @@ +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.StaffRoleDTO; +import com.epmet.dto.form.StaffRoleFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.dto.result.RoleOperationResultDTO; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.GovAccessFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Description + * @Author sun + */ +@Component +public class GovAccessFeignClientFallback implements GovAccessFeignClient { + + @Override + public Result> listOperationsByRoleId(String roleId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listOperationsByRoleId"); + } +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/AccessService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/AccessService.java new file mode 100644 index 0000000000..bb213bd94d --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/AccessService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + +import java.util.List; +import java.util.Set; + +/** + * 权限service + * @Author wxz + * @Description + * @Date 2020/4/22 23:29 + **/ +public interface AccessService { + /** + * 根据staffId查询角色Key列表 + * @param staffId + * @return + */ + Set listOpeKeysByStaffId(String staffId, String agencyId, String gridId); +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java new file mode 100644 index 0000000000..c7823cd335 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -0,0 +1,61 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.form.StaffRoleFormDTO; +import com.epmet.dto.result.RoleOperationResultDTO; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.GovAccessFeignClient; +import com.epmet.service.AccessService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@Service +public class AccessServiceImpl implements AccessService { + + @Autowired + private EpmetUserFeignClient userFeignClient; + + @Autowired + private GovAccessFeignClient govAccessFeignClient; + + @Override + public Set listOpeKeysByStaffId(String staffId, String agencyId, String gridId) { + List roleDTOS = new ArrayList<>(); + // 查询机关单位权限 + StaffRoleFormDTO formDTO = new StaffRoleFormDTO(); + formDTO.setStaffId(staffId); + formDTO.setOrgId(agencyId); + Result> agencyResult = userFeignClient.getRolesOfStaff(formDTO); + if (!CollectionUtils.isEmpty(agencyResult.getData())) { + roleDTOS.addAll(agencyResult.getData()); + } + // 查询网格权限 + formDTO.setStaffId(staffId); + formDTO.setOrgId(gridId); + Result> gridResult = userFeignClient.getRolesOfStaff(formDTO); + if (!CollectionUtils.isEmpty(gridResult.getData())) { + roleDTOS.addAll(gridResult.getData()); + } + + // 拼装 + Set opeKeys = new HashSet<>(); + roleDTOS.forEach(roleDto -> { + String roleId = roleDto.getId(); + List roleOperations = govAccessFeignClient.listOperationsByRoleId(roleId).getData(); + roleOperations.forEach(roleOpe -> { + if (roleOpe != null) { + opeKeys.add(roleOpe.getOperationKey()); + } + }); + }); + return opeKeys; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java new file mode 100644 index 0000000000..78905406ba --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class GovStaffRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。 + */ + private String customerId; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色所属体系类型:agency,department,grid + */ + private String orgType; + + /** + * + */ + private Integer delFlag; + + /** + * + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffRoleDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffRoleDTO.java new file mode 100644 index 0000000000..59d649f970 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffRoleDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员-角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class StaffRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 用户ID + */ + private String staffId; + + /** + * 角色ID + */ + private String roleId; + + /** + * 角色所属类型的ID。例如,机关的角色,那该字段就是所属机关的ID;部门的角色,该字段就是所属部门的ID;网格的角色,该字段就是所属网格ID + */ + private String orgId; + + /** + * + */ + private Integer delFlag; + + /** + * + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java new file mode 100644 index 0000000000..ac116b4a4f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class StaffRoleFormDTO { + + @NotBlank(message = "工作人员ID不能为空") + private String staffId; + + /** + * 机构id,可以是agencyId,DeptId,GridId + */ + @NotBlank(message = "工作人员所属组织ID不能为空") + private String orgId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java new file mode 100644 index 0000000000..98aacba35d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -0,0 +1,53 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.form.StaffRoleFormDTO; +import com.epmet.entity.GovStaffRoleEntity; +import com.epmet.service.GovStaffRoleService; +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 java.util.ArrayList; +import java.util.List; + +/** + * @return + * 工作人员相关api + * @Author wxz + * @Description + * @Date 2020/4/22 22:44 + **/ +@RestController +@RequestMapping("staffrole") +public class StaffRoleController { + + @Autowired + private GovStaffRoleService govStaffRoleService; + + /** + * 根据工作人员查询工作人员具有的角色列表 + * @return + */ + @PostMapping("staffRoles") + public Result> getRolesOfStaff(@RequestBody StaffRoleFormDTO staffRoleFormDTO) { + ValidatorUtils.validateEntity(staffRoleFormDTO); + String staffId = staffRoleFormDTO.getStaffId(); + String orgId = staffRoleFormDTO.getOrgId(); + List staffRoleEntities = govStaffRoleService.listRolesByStaffId(staffId, orgId); + List staffRoleDTOS = new ArrayList<>(); + staffRoleEntities.forEach(role -> { + GovStaffRoleDTO dto = new GovStaffRoleDTO(); + BeanUtils.copyProperties(role, dto); + staffRoleDTOS.add(dto); + }); + return new Result>().ok(staffRoleDTOS); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java new file mode 100644 index 0000000000..8967f79733 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovStaffRoleEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Mapper +public interface GovStaffRoleDao extends BaseDao { + + List listRolesByStaffId(@Param("staffId") String staffId, @Param("orgId") String orgId); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java new file mode 100644 index 0000000000..1a69f5a6c2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.StaffRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员-角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Mapper +public interface StaffRoleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java new file mode 100644 index 0000000000..80ee011dcd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-04-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_staff_role") +public class GovStaffRoleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。 + */ + private String customerId; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色所属体系类型:agency,department,grid + */ + private String orgType; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffRoleEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffRoleEntity.java new file mode 100644 index 0000000000..20f828a52d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffRoleEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-04-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_role") +public class StaffRoleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String staffId; + + /** + * 角色ID + */ + private String roleId; + + /** + * 角色所属类型的ID。例如,机关的角色,那该字段就是所属机关的ID;部门的角色,该字段就是所属部门的ID;网格的角色,该字段就是所属网格ID + */ + private String orgId; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GovStaffRoleExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GovStaffRoleExcel.java new file mode 100644 index 0000000000..3448b75a7e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GovStaffRoleExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class GovStaffRoleExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。") + private String customerId; + + @Excel(name = "角色key") + private String roleKey; + + @Excel(name = "角色名称") + private String roleName; + + @Excel(name = "角色所属体系类型:agency,department,grid") + private String orgType; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "") + private Integer revision; + + @Excel(name = "") + private String createdBy; + + @Excel(name = "") + private Date createdTime; + + @Excel(name = "") + private String updatedBy; + + @Excel(name = "") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/StaffRoleExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/StaffRoleExcel.java new file mode 100644 index 0000000000..78def4343b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/StaffRoleExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 工作人员-角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class StaffRoleExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "用户ID") + private String staffId; + + @Excel(name = "角色ID") + private String roleId; + + @Excel(name = "角色所属类型的ID。例如,机关的角色,那该字段就是所属机关的ID;部门的角色,该字段就是所属部门的ID;网格的角色,该字段就是所属网格ID") + private String orgId; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "") + private Integer revision; + + @Excel(name = "") + private String createdBy; + + @Excel(name = "") + private Date createdTime; + + @Excel(name = "") + private String updatedBy; + + @Excel(name = "") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java new file mode 100644 index 0000000000..2ad77b306a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Component +public class GovStaffRoleRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java new file mode 100644 index 0000000000..47714034af --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 工作人员-角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Component +public class StaffRoleRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java new file mode 100644 index 0000000000..942a001921 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.entity.GovStaffRoleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +public interface GovStaffRoleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovStaffRoleDTO + * @author generator + * @date 2020-04-22 + */ + GovStaffRoleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-22 + */ + void save(GovStaffRoleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-22 + */ + void update(GovStaffRoleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-22 + */ + void delete(String[] ids); + + /** + * 根据staffId查询具有的角色列表 + * @param staffId + * @return + */ + List listRolesByStaffId(String staffId, String orgId); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java new file mode 100644 index 0000000000..f5787beaa8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.StaffRoleDTO; +import com.epmet.entity.StaffRoleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作人员-角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +public interface StaffRoleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return StaffRoleDTO + * @author generator + * @date 2020-04-22 + */ + StaffRoleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-22 + */ + void save(StaffRoleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-22 + */ + void update(StaffRoleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-22 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java new file mode 100644 index 0000000000..fac6d94901 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.GovStaffRoleDao; +import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.entity.GovStaffRoleEntity; +import com.epmet.redis.GovStaffRoleRedis; +import com.epmet.service.GovStaffRoleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Service +public class GovStaffRoleServiceImpl extends BaseServiceImpl implements GovStaffRoleService { + + @Autowired + private GovStaffRoleRedis govStaffRoleRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovStaffRoleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovStaffRoleDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GovStaffRoleDTO get(String id) { + GovStaffRoleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovStaffRoleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovStaffRoleDTO dto) { + GovStaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovStaffRoleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovStaffRoleDTO dto) { + GovStaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovStaffRoleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 根据staffId查询具有的角色列表 + * @param staffId + * @return + */ + @Override + public List listRolesByStaffId(String staffId, String orgId) { + return baseDao.listRolesByStaffId(staffId, orgId); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java new file mode 100644 index 0000000000..bf717ba530 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.StaffRoleDao; +import com.epmet.dto.StaffRoleDTO; +import com.epmet.entity.StaffRoleEntity; +import com.epmet.redis.StaffRoleRedis; +import com.epmet.service.StaffRoleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作人员-角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Service +public class StaffRoleServiceImpl extends BaseServiceImpl implements StaffRoleService { + + @Autowired + private StaffRoleRedis staffRoleRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, StaffRoleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, StaffRoleDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public StaffRoleDTO get(String id) { + StaffRoleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, StaffRoleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(StaffRoleDTO dto) { + StaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, StaffRoleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(StaffRoleDTO dto) { + StaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, StaffRoleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml new file mode 100644 index 0000000000..95949edd10 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml new file mode 100644 index 0000000000..79ad9ca489 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From c169baa59f12719081798946b6ff9753b7f4f6fd Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 23 Apr 2020 11:51:16 +0800 Subject: [PATCH 040/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E8=8E=B7=E5=8F=96=E4=B8=8A=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=9A=84=E7=BD=91=E6=A0=BC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/constant/StaffAgencyConstant.java | 12 ++++++ .../controller/StaffAgencyController.java | 18 +++++++++ .../com/epmet/feign/EpmetUserFeignClient.java | 13 +++++++ .../com/epmet/feign/GovOrgFeignClient.java | 14 +++++++ .../EpmetUserFeignClientFallback.java | 8 +++- .../fallback/GovOrgFeignClientFallBack.java | 12 ++++++ .../com/epmet/service/StaffAgencyService.java | 12 ++++++ .../service/impl/StaffAgencyServiceImpl.java | 26 +++++++++++++ .../com/epmet/dto/form/LatestGridFormDTO.java | 28 ++++++++++++++ .../CustomerStaffGridController.java | 18 ++++++++- .../com/epmet/dao/CustomerStaffGridDao.java | 13 ++++++- .../service/CustomerStaffGridService.java | 12 ++++++ .../impl/CustomerStaffGridServiceImpl.java | 14 +++++++ .../resources/mapper/CustomerStaffGridDao.xml | 24 ++++++++++++ .../StaffGridVisitedController.java | 20 +++++++++- .../com/epmet/dao/StaffGridVisitedDao.java | 13 ++++++- .../service/StaffGridVisitedService.java | 12 ++++++ .../impl/StaffGridVisitedServiceImpl.java | 38 +++++++++++++++++++ .../resources/mapper/StaffGridVisitedDao.xml | 16 ++++++++ 19 files changed, 317 insertions(+), 6 deletions(-) create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/constant/StaffAgencyConstant.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/LatestGridFormDTO.java diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/constant/StaffAgencyConstant.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/constant/StaffAgencyConstant.java new file mode 100644 index 0000000000..b6a2591152 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/constant/StaffAgencyConstant.java @@ -0,0 +1,12 @@ +package com.epmet.constant; + +/** + * @Description 机构员工的常量 + * @IntefaceName StaffAgencyConstant + * @Author wangc + * @date 2020.04.23 11:25 + */ +public interface StaffAgencyConstant { + + String QUERY_LATEST_GRID_INFO_FAILED = "查询上一次登录的网格信息失败"; +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java index 83b649e63a..a3856fa2eb 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java @@ -20,11 +20,14 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.service.StaffAgencyService; 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; @@ -64,4 +67,19 @@ public class StaffAgencyController { return staffAgencyService.getLatestCustomer(tokenDTO); } + /** + * @Description 得到工作人员最后一次登录的网格 + * @Param TokenDto -> userId/staffId + * @Param LatestGridFormDTO -> customerId + * @return Result + * @Author wangc + * @Date 2020.04.23 11:16 + **/ + @PostMapping("getlatestgrid") + public Result getLatestGrid(@LoginUser TokenDto tokenDto, @RequestBody LatestGridFormDTO latestGridFormDTO){ + latestGridFormDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(latestGridFormDTO); + return staffAgencyService.getLatestGrid(latestGridFormDTO); + } + } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index af24c8b644..6d8914d357 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -2,11 +2,14 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; /** * @Description @@ -15,4 +18,14 @@ import org.springframework.web.bind.annotation.PathVariable; @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) public interface EpmetUserFeignClient { + /** + * @Description 查询工作人员上次登录的网格 + * @Param customerId ; staffId + * @return Result + * @Author wangc + * @Date 2020.04.23 10:44 + **/ + @PostMapping(value = "/epmetuser/staffgridvisited/getstafflatestgrid") + Result getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO); + } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index f87abc24e4..737988fd0b 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -2,12 +2,15 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -35,4 +38,15 @@ public interface GovOrgFeignClient { */ @GetMapping("/gov/org/customerstaffagency/getlatestcustomer/{userId}") Result getLatestCustomer(@PathVariable("userId") String userId); + + /** + * @Description 查询指定客户下一个用户所在的网格,调用gov-org + * @Param LatestGridFormDTO -> customerId ; staffId + * @return Result + * @Author wangc + * @Date 2020.04.23 10:53 + **/ + @PostMapping(value = "/gov/org/customerstaffgrid/getstaffgrid") + Result getStaffGrid(@RequestBody LatestGridFormDTO latestGridFormDTO); + } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 5f551bef80..e03528d079 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -1,9 +1,11 @@ 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.result.LatestCustomerResultDTO; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -14,4 +16,8 @@ import org.springframework.stereotype.Component; @Component public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { + @Override + public Result getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffLatestGrid",latestGridFormDTO); + } } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 7e7b838d38..3afafce426 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -3,7 +3,9 @@ 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.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -20,4 +22,14 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { public Result> getMyGrids(String userId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getMyGrids", userId); } + + @Override + public Result getLatestCustomer(String userId) { + return null; + } + + @Override + public Result getStaffGrid(LatestGridFormDTO latestGridFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGrid",latestGridFormDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java index 589a0ed64e..3b5f4f6b5c 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java @@ -17,10 +17,13 @@ package com.epmet.service; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -45,4 +48,13 @@ public interface StaffAgencyService { * @return */ Result getLatestCustomer(TokenDto tokenDTO); + + /** + * @Description 得到工作人员最后一次登录的网格 + * @Param LatestGridFormDTO -> staffId ; customerId + * @return Result + * @Author wangc + * @Date 2020.04.23 11:14 + **/ + Result getLatestGrid(LatestGridFormDTO latestGridFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index 1a7a56e39a..92855ecb8b 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -19,11 +19,14 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.StaffAgencyConstant; +import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.StaffAgencyService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -58,5 +61,28 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { return govOrgFeignClient.getLatestCustomer(tokenDTO.getUserId()); } + /** + * @Description 得到工作人员最后一次登录的网格 + * @Param LatestGridFormDTO -> staffId ; customerId + * @return Result + * @Author wangc + * @Date 2020.04.23 11:14 + **/ + @Override + public Result getLatestGrid(LatestGridFormDTO latestGridFormDTO) { + Result latestGridResult = + epmetUserFeignClient.getStaffLatestGrid(latestGridFormDTO); + if(latestGridResult.success() && null != latestGridResult.getData() && StringUtils.isNotBlank(latestGridResult.getData().getGridId())){ + return latestGridResult; + }else{ + Result staffGridResult = + govOrgFeignClient.getStaffGrid(latestGridFormDTO); + if(staffGridResult.success() && null != staffGridResult.getData() && StringUtils.isNotBlank(staffGridResult.getData().getGridId())){ + return staffGridResult; + } + } + return new Result().error(StaffAgencyConstant.QUERY_LATEST_GRID_INFO_FAILED); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/LatestGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/LatestGridFormDTO.java new file mode 100644 index 0000000000..7642a7ae0b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/LatestGridFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author: wangc + * @description: + * @date: Created in 2020-04-22 18:19 + */ +@Data +public class LatestGridFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 客户Id + * */ + @NotBlank(message = "客户Id不能为空") + private String customerId; + + /** + * 工作人员Id + * */ + @NotBlank(message = "工作人员Id不能为空") + private String staffId; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java index ec584efb56..757d7383a7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java @@ -26,6 +26,8 @@ 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.CustomerStaffGridDTO; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.excel.CustomerStaffGridExcel; import com.epmet.service.CustomerStaffGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -37,7 +39,7 @@ import java.util.Map; /** - * 网格人员关系表 + * 网格人员关系表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 @@ -45,7 +47,7 @@ import java.util.Map; @RestController @RequestMapping("customerstaffgrid") public class CustomerStaffGridController { - + @Autowired private CustomerStaffGridService customerStaffGridService; @@ -91,4 +93,16 @@ public class CustomerStaffGridController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffGridExcel.class); } + /** + * @Description 查询指定客户下一个用户所在的网格,调用gov-org + * @Param LatestGridFormDTO -> customerId ; staffId + * @return Result + * @Author wangc + * @Date 2020.04.23 10:53 + **/ + @PostMapping("getstaffgrid") + public Result getStaffGrid(@RequestBody LatestGridFormDTO latestGridFormDTO){ + ValidatorUtils.validateEntity(latestGridFormDTO); + return customerStaffGridService.getStaffGridOrderByGridName(latestGridFormDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java index 01dc0c2721..dc61c9039f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.entity.CustomerStaffGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +31,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerStaffGridDao extends BaseDao { - + + /** + * @Description 查询指定客户下一个用户所在的网格,按照网格名称升序排序,取第一个 + * @Param LatestGridFormDTO -> customerId ; userId + * @return CustomerGridDTO + * @Author wangc + * @Date 2020.04.23 01:09 + **/ + CustomerGridDTO selectStaffGridOrderByGridName(LatestGridFormDTO latestGridFormDTO); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java index a0b273fb76..5a085e3d1d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java @@ -19,7 +19,10 @@ package com.epmet.service; 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.CustomerStaffGridDTO; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.entity.CustomerStaffGridEntity; import java.util.List; @@ -92,4 +95,13 @@ public interface CustomerStaffGridService extends BaseService customerId ; staffId + * @return CustomerGridDTO + * @Author wangc + * @Date 2020.04.23 09:11 + **/ + Result getStaffGridOrderByGridName(LatestGridFormDTO latestGridFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java index 894bb6a888..074ac2f36a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java @@ -23,8 +23,12 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.CustomerStaffGridDao; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.entity.CustomerStaffGridEntity; import com.epmet.redis.CustomerStaffGridRedis; import com.epmet.service.CustomerStaffGridService; @@ -101,4 +105,14 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl getStaffGridOrderByGridName(LatestGridFormDTO latestGridFormDTO) { + CustomerGridDTO grid = baseDao.selectStaffGridOrderByGridName(latestGridFormDTO); + CustomerGridByUserIdResultDTO result = new CustomerGridByUserIdResultDTO(); + result.setGridName(grid.getGridName()); + result.setGridId(grid.getId()); + result.setAgencyId(grid.getPid()); + return new Result().ok(result); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 13dbdb25ce..47a9de4a33 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -17,4 +17,28 @@ + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java index ec34fb21fb..9aad22d45a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java @@ -17,8 +17,14 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.service.StaffGridVisitedService; 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; @@ -35,5 +41,17 @@ public class StaffGridVisitedController { @Autowired private StaffGridVisitedService staffGridVisitedService; - + + /** + * @Description 查询工作人员上次登录的网格 + * @Param LatestGridFormDTO -> customerId ; staffId + * @return Result + * @Author wangc + * @Date 2020.04.23 10:05 + **/ + @PostMapping("getstafflatestgrid") + Result getStaffLatestGrid(@RequestBody LatestGridFormDTO latestGridFormDTO){ + ValidatorUtils.validateEntity(latestGridFormDTO); + return staffGridVisitedService.getStaffLatestGrid(latestGridFormDTO); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java index d905202603..6869f1a5bf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.StaffGridVisitedDTO; +import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.entity.StaffGridVisitedEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +31,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffGridVisitedDao extends BaseDao { - + + /** + * @Description 通过staffId和customerId查询当前用户上一次登录的网格信息 + * @Param LatestGridFormDTO + * @return gridId + * @Author wangc + * @Date 2020.04.23 00:40 + **/ + String selectStaffLatestGrid(LatestGridFormDTO latestGridFormDTO); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java index ce181b1323..d07e4975a2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java @@ -19,7 +19,10 @@ package com.epmet.service; 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.StaffGridVisitedDTO; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.entity.StaffGridVisitedEntity; import java.util.List; @@ -92,4 +95,13 @@ public interface StaffGridVisitedService extends BaseService staffId ; customerId + * @return Result + * @Author wangc + * @Date 2020.04.23 00:28 + **/ + Result getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffGridVisitedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffGridVisitedServiceImpl.java index 758eb2a840..d4e87cd8d9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffGridVisitedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffGridVisitedServiceImpl.java @@ -23,11 +23,21 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.GridVisitedConstant; import com.epmet.dao.StaffGridVisitedDao; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.StaffGridVisitedDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.entity.StaffGridVisitedEntity; +import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.StaffGridVisitedService; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -44,6 +54,12 @@ import java.util.Map; @Service public class StaffGridVisitedServiceImpl extends BaseServiceImpl implements StaffGridVisitedService { + private static final Logger logger = LoggerFactory.getLogger(StaffGridVisitedServiceImpl.class); + + @Autowired + private GovOrgFeignClient govOrgFeignClient; + + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -96,4 +112,26 @@ public class StaffGridVisitedServiceImpl extends BaseServiceImpl getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) { + + CustomerGridByUserIdResultDTO gridResult = new CustomerGridByUserIdResultDTO(); + String gridId = baseDao.selectStaffLatestGrid(latestGridFormDTO); + if(StringUtils.isNotBlank(gridId)){ + CustomerGridFormDTO param = new CustomerGridFormDTO(); + param.setGridId(gridId); + Result gridInfoResult = + govOrgFeignClient.getCustomerGridByGridId(param); + if(gridInfoResult.success() && null != gridInfoResult.getData() && StringUtils.isNotBlank(gridInfoResult.getData().getId())){ + gridResult.setAgencyId(gridInfoResult.getData().getPid()); + gridResult.setGridId(gridId); + gridResult.setGridName(gridInfoResult.getData().getGridName()); + }else{ + logger.warn(GridVisitedConstant.QUERY_EXCEPTION); + } + } + + return new Result().ok(gridResult); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml index 38ce0bff3c..73978e23f3 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml @@ -16,5 +16,21 @@ + + \ No newline at end of file From 49018cbcc9d647b8e5893d7ab898e45ecd78c538 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 23 Apr 2020 12:05:56 +0800 Subject: [PATCH 041/174] =?UTF-8?q?1.StaffRoleController=E5=86=85=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20url=E5=A4=A7=E5=B0=8F=E5=86=99=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/feign/EpmetUserFeignClient.java | 2 +- .../src/main/java/com/epmet/controller/StaffRoleController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index f5eebb41b7..7c8e65c647 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -32,7 +32,7 @@ public interface EpmetUserFeignClient { * 查询工作人员的角色 * @return */ - @PostMapping("/epmetuser/staffrole/staffRoles") + @PostMapping("/epmetuser/staffrole/staffroles") Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 98aacba35d..8e6fcba4ac 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -35,7 +35,7 @@ public class StaffRoleController { * 根据工作人员查询工作人员具有的角色列表 * @return */ - @PostMapping("staffRoles") + @PostMapping("staffroles") public Result> getRolesOfStaff(@RequestBody StaffRoleFormDTO staffRoleFormDTO) { ValidatorUtils.validateEntity(staffRoleFormDTO); String staffId = staffRoleFormDTO.getStaffId(); From b76bbcde6aa0d570db2ad02093dfa726c61a32ef Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Apr 2020 13:34:44 +0800 Subject: [PATCH 042/174] =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=BD=91=E6=A0=BCv1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/EpmetUserFeignClient.java | 16 +++++++-- .../EpmetUserFeignClientFallback.java | 6 +++- .../service/impl/StaffAgencyServiceImpl.java | 15 +++++++- .../dto/form/StaffGridVisitedFormDTO.java | 34 +++++++++++++++++++ .../StaffGridVisitedController.java | 19 ++++++++++- .../service/StaffGridVisitedService.java | 11 ++++++ .../impl/StaffGridVisitedServiceImpl.java | 10 ++++++ 7 files changed, 105 insertions(+), 6 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffGridVisitedFormDTO.java diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index af24c8b644..a4196b9f7d 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -2,11 +2,12 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; /** * @Description @@ -15,4 +16,13 @@ import org.springframework.web.bind.annotation.PathVariable; @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) public interface EpmetUserFeignClient { + /** + * @param staffGridVisitedFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存网格访问记录 + * @Date 2020/4/23 13:27 + **/ + @PostMapping(value = "/epmetuser/staffgridvisited/savestaffgridvisitedrecord", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveStaffGridVisitedRecord(@RequestBody StaffGridVisitedFormDTO staffGridVisitedFormDTO); } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 5f551bef80..161de27c58 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -3,7 +3,7 @@ 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.result.LatestCustomerResultDTO; +import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -14,4 +14,8 @@ import org.springframework.stereotype.Component; @Component public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { + @Override + public Result saveStaffGridVisitedRecord(StaffGridVisitedFormDTO staffGridVisitedFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffGridVisitedRecord", staffGridVisitedFormDTO); + } } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index 575ab2ef4d..dd2243920b 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -18,12 +18,17 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.StaffAgencyService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -36,9 +41,11 @@ import java.util.List; */ @Service public class StaffAgencyServiceImpl implements StaffAgencyService { - + private static Logger logger = LoggerFactory.getLogger(StaffAgencyServiceImpl.class); @Autowired private GovOrgFeignClient govOrgFeignClient; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; /** * @param tokenDTO @@ -60,6 +67,12 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { @Override public Result> switchGrid(SwitchGridFormDTO switchGridFormDTO) { //记录网格访问记录 + StaffGridVisitedFormDTO staffGridVisitedFormDTO = ConvertUtils.sourceToTarget(switchGridFormDTO, StaffGridVisitedFormDTO.class); + Result saveStaffGridVisitedRecord = epmetUserFeignClient.saveStaffGridVisitedRecord(staffGridVisitedFormDTO); + if (!saveStaffGridVisitedRecord.success()) { + logger.error("保存网格访问记录失败"); + return new Result>().error(); + } //查询网格的权限 return new Result<>(); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffGridVisitedFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffGridVisitedFormDTO.java new file mode 100644 index 0000000000..bdf88528a1 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffGridVisitedFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 保存网格访问记录入参 + * @Author yinzuomei + * @Date 2020/4/23 11:01 + */ +@Data +public class StaffGridVisitedFormDTO implements Serializable { + private static final long serialVersionUID = 4932900259489068815L; + /** + * 客户ID + */ + @NotBlank(message = "客户id") + private String customerId; + + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * customer_staff.userId + */ + @NotBlank(message = "staffId不能为空") + private String staffId; +} + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java index ec34fb21fb..ff4a8a00a9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java @@ -17,11 +17,17 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.service.StaffGridVisitedService; 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 javax.validation.Valid; + /** * 工作人员进入网格日志表 @@ -32,8 +38,19 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("staffgridvisited") public class StaffGridVisitedController { - + @Autowired private StaffGridVisitedService staffGridVisitedService; + /** + * @param staffGridVisitedFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 保存网格访问记录 + * @Date 2020/4/23 11:19 + **/ + @PostMapping("savestaffgridvisitedrecord") + public Result saveStaffGridVisitedRecord(@RequestBody @Valid StaffGridVisitedFormDTO staffGridVisitedFormDTO) { + return staffGridVisitedService.saveStaffGridVisitedRecord(staffGridVisitedFormDTO); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java index ce181b1323..86e31b2c3e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java @@ -19,7 +19,9 @@ package com.epmet.service; 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.StaffGridVisitedDTO; +import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.entity.StaffGridVisitedEntity; import java.util.List; @@ -92,4 +94,13 @@ public interface StaffGridVisitedService extends BaseService Date: Thu, 23 Apr 2020 13:39:50 +0800 Subject: [PATCH 043/174] =?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 --- .../java/com/epmet/feign/EpmetUserFeignClient.java | 10 ++++++---- .../com/epmet/service/impl/StaffAgencyServiceImpl.java | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 2e261727b2..287da51fec 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -2,19 +2,21 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.StaffGridVisitedFormDTO; +import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.form.StaffGridVisitedFormDTO; +import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import com.epmet.dto.form.StaffRoleFormDTO; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index 092debf3c6..c95283acbd 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -20,12 +20,16 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.StaffAgencyConstant; +import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.StaffAgencyService; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; From d257127e9c24b28bf46f19b79c7a348ea9725e41 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Apr 2020 14:01:44 +0800 Subject: [PATCH 044/174] =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=BD=91=E6=A0=BCv2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/SwitchGridFormDTO.java | 12 ++++++++++-- .../com/epmet/controller/StaffAgencyController.java | 6 ++++-- .../feign/fallback/GovOrgFeignClientFallBack.java | 5 ----- .../java/com/epmet/service/StaffAgencyService.java | 7 +++---- .../epmet/service/impl/StaffAgencyServiceImpl.java | 12 ++++++++---- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/SwitchGridFormDTO.java b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/SwitchGridFormDTO.java index f9908e24dc..ab0a44d2e6 100644 --- a/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/SwitchGridFormDTO.java +++ b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/SwitchGridFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -14,14 +15,21 @@ public class SwitchGridFormDTO implements Serializable { private static final long serialVersionUID = -2898130727929596798L; /** - * sessionKey + * customerId */ + @NotBlank(message = "customerId不能为空") private String customerId; /** - * sessionKey + * gridId */ + @NotBlank(message = "gridId不能为空") private String gridId; + /** + * staffId从tokenTto获取 + */ + @NotBlank(message = "staffId不能为空") + private String staffId; } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java index a947fa817b..6a9c00fe60 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java @@ -20,9 +20,9 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.service.StaffAgencyService; @@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; import java.util.List; +import java.util.Set; /** * 机关单位信息表 @@ -77,7 +78,8 @@ public class StaffAgencyController { * @Date 2020/4/23 10:34 **/ @PostMapping("switchgrid") - public Result> switchGrid(@LoginUser TokenDto tokenDto, @RequestBody @Valid SwitchGridFormDTO switchGridFormDTO) { + public Result> switchGrid(@LoginUser TokenDto tokenDto, @RequestBody @Valid SwitchGridFormDTO switchGridFormDTO) { + switchGridFormDTO.setStaffId(tokenDto.getUserId()); return staffAgencyService.switchGrid(switchGridFormDTO); } /** diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 832c538376..818a325666 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -23,11 +23,6 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getMyGrids", userId); } - @Override - public Result getLatestCustomer(String userId) { - return null; - } - @Override public Result getStaffGrid(LatestGridFormDTO latestGridFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGrid",latestGridFormDTO); diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java index cc45335509..fb87fd96ec 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java @@ -17,16 +17,15 @@ package com.epmet.service; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; +import java.util.Set; /** * 机关单位信息表 @@ -58,7 +57,7 @@ public interface StaffAgencyService { * @Description 切换网格 * @Date 2020/4/23 10:49 **/ - Result> switchGrid(SwitchGridFormDTO switchGridFormDTO); + Result> switchGrid(SwitchGridFormDTO switchGridFormDTO); /** * @Description 得到工作人员最后一次登录的网格 diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index c95283acbd..1be3e976c2 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; +import com.epmet.service.AccessService; import com.epmet.service.StaffAgencyService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -36,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Set; /** * 机关单位信息表 @@ -49,7 +51,8 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { private GovOrgFeignClient govOrgFeignClient; @Autowired private EpmetUserFeignClient epmetUserFeignClient; - + @Autowired + private AccessService accessService; /** * @param tokenDTO * @return @@ -91,16 +94,17 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { @Override - public Result> switchGrid(SwitchGridFormDTO switchGridFormDTO) { + public Result> switchGrid(SwitchGridFormDTO switchGridFormDTO) { //记录网格访问记录 StaffGridVisitedFormDTO staffGridVisitedFormDTO = ConvertUtils.sourceToTarget(switchGridFormDTO, StaffGridVisitedFormDTO.class); Result saveStaffGridVisitedRecord = epmetUserFeignClient.saveStaffGridVisitedRecord(staffGridVisitedFormDTO); if (!saveStaffGridVisitedRecord.success()) { logger.error("保存网格访问记录失败"); - return new Result>().error(); + return new Result>().error(); } //查询网格的权限 - return new Result<>(); + Set opeKeys = accessService.listOpeKeysByStaffId(switchGridFormDTO.getStaffId(), null, switchGridFormDTO.getGridId()); + return new Result>().ok(opeKeys); } From c76e54c4e50f137dbc8da219f1168bbed3a5f62d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Apr 2020 14:03:58 +0800 Subject: [PATCH 045/174] =?UTF-8?q?oper-crm=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/oper-crm/oper-crm-server/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 79d08ea2cc..35fd9946f8 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -91,7 +91,7 @@ - dev-dev + dev-local true @@ -131,7 +131,7 @@ - + epmet elink@833066 From 6d9458afdf0571c5014fd7f7105f5dd9b1da059f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Apr 2020 14:05:53 +0800 Subject: [PATCH 046/174] =?UTF-8?q?oper-crm=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/oper-crm/oper-crm-server/docker-compose.yml | 2 +- epmet-module/oper-crm/oper-crm-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-crm/oper-crm-server/docker-compose.yml b/epmet-module/oper-crm/oper-crm-server/docker-compose.yml index dfd9895bad..6f2d6efb3d 100644 --- a/epmet-module/oper-crm/oper-crm-server/docker-compose.yml +++ b/epmet-module/oper-crm/oper-crm-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-crm-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-crm-server:0.3.1 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 86edb7b955..14a2d4092f 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet oper-crm From 99c0d0e0cab48e7e30bca2256ebac43b96ca1e50 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 23 Apr 2020 15:04:03 +0800 Subject: [PATCH 047/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=9C=BA=E6=9E=84=E6=A8=A1=E5=9D=97-=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/AddAgencyFormDTO.java | 78 ++++++++++ .../epmet/dto/form/AgencydetailFormDTO.java | 43 ++++++ .../com/epmet/dto/form/EditAgencyFormDTO.java | 48 ++++++ .../epmet/dto/form/RemoveAgencyFormDTO.java | 42 ++++++ .../com/epmet/dto/form/SubAgencyFormDTO.java | 43 ++++++ .../epmet/dto/result/AddAgencyResultDTO.java | 40 +++++ .../dto/result/AgencydetailResultDTO.java | 82 +++++++++++ .../epmet/dto/result/ParentListResultDTO.java | 46 ++++++ .../epmet/dto/result/SubAgencyResultDTO.java | 48 ++++++ .../epmet/dto/result/SubListResultDTO.java | 45 ++++++ .../constant/CustomerAgencyConstant.java | 25 ++++ .../controller/CustomerAgencyController.java | 77 ++++++++-- .../java/com/epmet/dao/CustomerAgencyDao.java | 18 +++ .../epmet/service/CustomerAgencyService.java | 45 +++++- .../impl/CustomerAgencyServiceImpl.java | 138 +++++++++++++++++- .../resources/mapper/CustomerAgencyDao.xml | 22 +++ 16 files changed, 826 insertions(+), 14 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveAgencyFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencydetailResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubAgencyResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java new file mode 100644 index 0000000000..57c2e2939d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 添加组织-接口入参 + * + * @author sun + */ +@Data +public class AddAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 上级机关组织Id(当前机关组织添加下级组织) + */ + @NotBlank(message = "上级机关组织ID不能为空") + private String pid; + + /** + * 机构组织名称 + */ + @NotBlank(message = "组织名称不能为空") + private String agencyName; + + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 地区编码 + */ + private Integer areaCode; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java new file mode 100644 index 0000000000..0f3b999026 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 组织首页-获取组织机构信息接口入参 + * + * @author sun + */ +@Data +public class AgencydetailFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + @NotBlank(message = "机关组织ID不能为空") + private String agencyId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java new file mode 100644 index 0000000000..e4a410120e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 组织名称编辑-接口入参 + * + * @author sun + */ +@Data +public class EditAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + @NotBlank(message = "机关组织ID不能为空") + private String agencyId; + + /** + * 机关组织名称 + */ + @NotBlank(message = "机关组织名称不能为空") + private String agencyName; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveAgencyFormDTO.java new file mode 100644 index 0000000000..5caaec7ea5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveAgencyFormDTO.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 删除组织机关-接口入参 + * + * @author sun + */ +@Data +public class RemoveAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + @NotBlank(message = "机关组织ID不能为空") + private String agencyId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java new file mode 100644 index 0000000000..6cdf21a193 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 组织首页-下级机关列表-接口入参 + * + * @author sun + */ +@Data +public class SubAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + @NotBlank(message = "机关组织ID不能为空") + private String agencyId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java new file mode 100644 index 0000000000..01f072752a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 添加组织-接口返参 + * + * @author sun + */ +@Data +public class AddAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencydetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencydetailResultDTO.java new file mode 100644 index 0000000000..4fed7005d9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencydetailResultDTO.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + + +/** + * 组织首页-获取组织机构信息接口返参 + * + * @author sun + */ +@Data +public class AgencydetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 地区编码 + */ + private Integer areaCode; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 本机关的所有上级机关 + */ + private List parentList; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java new file mode 100644 index 0000000000..73608b1943 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 组织首页-获取组织机构信息接口-本机关的所有上级机关信息 + * + * @author sun + */ +@Data +public class ParentListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String id; + /** + * 机关组织名称 + */ + private String name; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubAgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubAgencyResultDTO.java new file mode 100644 index 0000000000..ea9810c94c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubAgencyResultDTO.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + + +/** + * 组织首页-下级机关列表-接口返参 + * + * @author sun + */ +@Data +public class SubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 下级机关总数 + */ + private Integer subAgencyCount; + + /** + * 下级机关总数 + */ + private List agencyList; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java new file mode 100644 index 0000000000..57ab12c3df --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 组织首页-下级机关列表-查询本机关的直属下一级机关 + * + * @author sun + */ +@Data +public class SubListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId; + /** + * 机关组织名称 + */ + private String agencyName; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java new file mode 100644 index 0000000000..42d40b0199 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java @@ -0,0 +1,25 @@ +package com.epmet.constant; + +/** + * @author sun + * @dscription + */ +public interface CustomerAgencyConstant { + + /** + * 组织名称编辑修改失败 + */ + String UPDATE_EXCEPTION = "组织机构信息更新失败"; + /** + * 添加组织失败 + */ + String SAVE_EXCEPTION = "组织机构新增失败"; + /** + * 不允许删除组织 + */ + String NOT_DEL_AGENCY = "当前组织存在下级组织,不允许删除"; + /** + * 组织删除失败 + */ + String DEL_EXCEPTION = "组织删除失败"; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index a1e5ea58fe..9caad715cc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -26,8 +26,11 @@ 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.CustomerAgencyDTO; -import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AddAgencyResultDTO; +import com.epmet.dto.result.AgencydetailResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; +import com.epmet.dto.result.SubAgencyResultDTO; import com.epmet.excel.CustomerAgencyExcel; import com.epmet.service.CustomerAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -47,24 +50,24 @@ import java.util.Map; @RestController @RequestMapping("customeragency") public class CustomerAgencyController { - + @Autowired private CustomerAgencyService customerAgencyService; @GetMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = customerAgencyService.page(params); return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { CustomerAgencyDTO data = customerAgencyService.get(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody CustomerAgencyDTO dto){ + public Result save(@RequestBody CustomerAgencyDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); customerAgencyService.save(dto); @@ -72,7 +75,7 @@ public class CustomerAgencyController { } @PutMapping - public Result update(@RequestBody CustomerAgencyDTO dto){ + public Result update(@RequestBody CustomerAgencyDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); customerAgencyService.update(dto); @@ -80,7 +83,7 @@ public class CustomerAgencyController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); customerAgencyService.delete(ids); @@ -94,14 +97,70 @@ public class CustomerAgencyController { } /** - * @return com.epmet.commons.tools.utils.Result> * @param staffOrgsFormDTO + * @return com.epmet.commons.tools.utils.Result> * @Author yinzuomei * @Description 登录-获取工作人员所有组织 * @Date 2020/4/20 21:59 **/ @PostMapping("getStaffOrgList") - public Result> getStaffOrgList(@RequestBody StaffOrgFormDTO staffOrgsFormDTO){ + public Result> getStaffOrgList(@RequestBody StaffOrgFormDTO staffOrgsFormDTO) { return customerAgencyService.getStaffOrgList(staffOrgsFormDTO); } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加组织 + */ + @PostMapping("addagency") + public Result addAgency(@RequestBody AddAgencyFormDTO formDTO) { + return customerAgencyService.addAgency(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织名称编辑 + */ + @PostMapping("editagency") + public Result editAgency(@RequestBody EditAgencyFormDTO formDTO) { + return customerAgencyService.editAgency(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除组织机关 + */ + @PostMapping("removeagency") + public Result removeAgency(@RequestBody RemoveAgencyFormDTO formDTO) { + return customerAgencyService.removeAgency(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取组织机构信息 + */ + @PostMapping("agencydetail") + public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) { + return customerAgencyService.agencyDetail(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-下级机关列表 + */ + @PostMapping("subagencylist") + public Result subAgencyList(@RequestBody SubAgencyFormDTO formDTO) { + return customerAgencyService.subAgencyList(formDTO); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 4f85e09091..0dc66e7bdd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -18,7 +18,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ParentListResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; +import com.epmet.dto.result.SubListResultDTO; import com.epmet.entity.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -41,4 +43,20 @@ public interface CustomerAgencyDao extends BaseDao { * @Date 2020/4/20 21:48 **/ List selectStaffOrgList(@Param("customerIdList") List customerIdList); + + /** + * @param listStr + * @return + * @Author sun + * @Description 查询当前机关的所有上级组织信息 + **/ + List selectPAgencyById(@Param("listStr") List listStr); + + /** + * @param pId + * @return + * @Author sun + * @Description 组织首页-下级机关列表 + **/ + List selectSubAgencyById(@Param("pId") String pId); } \ No newline at end of file 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 62892b4576..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 @@ -21,8 +21,11 @@ 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.CustomerAgencyDTO; -import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AddAgencyResultDTO; +import com.epmet.dto.result.AgencydetailResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; +import com.epmet.dto.result.SubAgencyResultDTO; import com.epmet.entity.CustomerAgencyEntity; import java.util.List; @@ -104,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-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 2a2b79a024..4d17f1a674 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -21,21 +21,27 @@ 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.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +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.utils.Result; +import com.epmet.constant.CustomerAgencyConstant; import com.epmet.dao.CustomerAgencyDao; import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.form.StaffOrgFormDTO; -import com.epmet.dto.result.StaffOrgsResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.CustomerAgencyService; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -49,6 +55,7 @@ import java.util.Map; @Service public class CustomerAgencyServiceImpl extends BaseServiceImpl implements CustomerAgencyService { + private static final Logger log = LoggerFactory.getLogger(CustomerAgencyServiceImpl.class); @Autowired private CustomerAgencyRedis customerAgencyRedis; @@ -68,8 +75,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -112,4 +119,127 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl list = baseDao.selectStaffOrgList(staffOrgsFormDTO.getCustomerIdList()); return new Result>().ok(list); } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加组织 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result addAgency(AddAgencyFormDTO formDTO) { + Result result = new Result(); + AddAgencyResultDTO addAgencyResultDTO = new AddAgencyResultDTO(); + //0:属性映射赋值 + CustomerAgencyEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); + entity.setOrganizationName(formDTO.getAgencyName()); + entity.setTotalUser(NumConstant.ZERO); + //1:查询上级机关信息 + CustomerAgencyEntity parentEntity = baseDao.selectById(formDTO.getPid()); + entity.setCustomerId(parentEntity.getCustomerId()); + if (null == parentEntity.getPid()) { + entity.setPids(parentEntity.getId()); + entity.setAllParentName(parentEntity.getOrganizationName()); + } else { + entity.setPids(":" + parentEntity.getId()); + entity.setAllParentName("-" + parentEntity.getOrganizationName()); + } + //2:保存组织信息 + if (baseDao.insert(entity) < NumConstant.ONE) { + log.error(CustomerAgencyConstant.SAVE_EXCEPTION); + throw new RenException(CustomerAgencyConstant.SAVE_EXCEPTION); + } + //3:返回新组织Id + addAgencyResultDTO.setAgencyId(entity.getId()); + return result.ok(addAgencyResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织名称编辑 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result editAgency(EditAgencyFormDTO formDTO) { + Result result = new Result(); + CustomerAgencyEntity entity = new CustomerAgencyEntity(); + entity.setId(formDTO.getAgencyId()); + entity.setOrganizationName(formDTO.getAgencyName()); + if (baseDao.updateById(entity) < NumConstant.ONE) { + log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); + throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除组织机关 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result removeAgency(RemoveAgencyFormDTO formDTO) { + Result result = new Result(); + //1:查询当前机关是否存在所属下级机关,存在下级的不能删除 + List agencyList = baseDao.selectSubAgencyById(formDTO.getAgencyId()); + if (null != agencyList && agencyList.size() > NumConstant.ZERO) { + result.setMsg(CustomerAgencyConstant.NOT_DEL_AGENCY); + return result; + } + //2:删除当前机关组织(逻辑删) + if (baseDao.deleteById(formDTO.getAgencyId()) < NumConstant.ONE) { + log.error(CustomerAgencyConstant.DEL_EXCEPTION); + throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取组织机构信息 + */ + @Override + public Result agencyDetail(AgencydetailFormDTO formDTO) { + AgencydetailResultDTO agencydetailResultDTO = new AgencydetailResultDTO(); + //1:查询本机关详细信息 + CustomerAgencyEntity entity = baseDao.selectById(formDTO.getAgencyId()); + if (null == entity) { + return new Result().ok(agencydetailResultDTO); + } + agencydetailResultDTO = ConvertUtils.sourceToTarget(entity, AgencydetailResultDTO.class); + agencydetailResultDTO.setAgencyId(entity.getId()); + agencydetailResultDTO.setAgencyName(entity.getOrganizationName()); + //2:查询本机关的所有上级机关,按自上而下层级顺序 + if (null == entity.getPids()) { + return new Result().ok(agencydetailResultDTO); + } + List listStr = Arrays.asList(entity.getPids().split(":")); + List parentList = baseDao.selectPAgencyById(listStr); + agencydetailResultDTO.setParentList(parentList); + return new Result().ok(agencydetailResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-下级机关列表 + */ + @Override + public Result subAgencyList(SubAgencyFormDTO formDTO) { + SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO(); + //1:根据当前机关Id查询直属下一级机关列表 + List agencyList = baseDao.selectSubAgencyById(formDTO.getAgencyId()); + subAgencyResultDTO.setAgencyList(agencyList); + //2:统计下一级机关数 + subAgencyResultDTO.setSubAgencyCount(agencyList.size()); + return new Result().ok(subAgencyResultDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 03f2671806..a80b7334c4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -37,4 +37,26 @@ #{customerId} + + + + \ No newline at end of file From 61bec2dc5b250a221c8a23064d0c0b75d2a27d4b Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 23 Apr 2020 15:31:35 +0800 Subject: [PATCH 048/174] =?UTF-8?q?1.=20=E6=96=B0=E5=A2=9E=EF=BC=9A?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=A7=92=E8=89=B2=E4=B8=8B=E7=9A=84=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/StaffRoleFormDTO.java | 22 ++++++++++++++++--- .../epmet/controller/StaffRoleController.java | 19 +++++++++++++--- .../java/com/epmet/dao/GovStaffRoleDao.java | 15 +++++++++++++ .../epmet/service/GovStaffRoleService.java | 8 +++++++ .../service/impl/GovStaffRoleServiceImpl.java | 11 ++++++++++ .../main/resources/mapper/GovStaffRoleDao.xml | 13 +++++++++++ 6 files changed, 82 insertions(+), 6 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java index ac116b4a4f..02ffc22867 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffRoleFormDTO.java @@ -7,12 +7,28 @@ import javax.validation.constraints.NotBlank; @Data public class StaffRoleFormDTO { - @NotBlank(message = "工作人员ID不能为空") + /**===========校验分组开始============*/ + + // 查询工作人员角色列表group + public interface GetRolesOfStaff {} + + // 查询某角色下的人员列表group + public interface GetStaffsInRole {} + + /**===========校验分组结束============*/ + + @NotBlank(message = "工作人员ID不能为空", groups = {GetRolesOfStaff.class}) private String staffId; /** - * 机构id,可以是agencyId,DeptId,GridId + * 组织id,可以是agencyId,DeptId,GridId */ - @NotBlank(message = "工作人员所属组织ID不能为空") + @NotBlank(message = "工作人员所属组织ID不能为空", groups = {GetRolesOfStaff.class, GetStaffsInRole.class}) private String orgId; + + /** + * 角色key + */ + @NotBlank(message = "角色Key不能为空", groups = {GetStaffsInRole.class}) + private String roleKey; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 8e6fcba4ac..73a94b7740 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -3,7 +3,6 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; @@ -32,12 +31,12 @@ public class StaffRoleController { private GovStaffRoleService govStaffRoleService; /** - * 根据工作人员查询工作人员具有的角色列表 + * 查询工作人员具有的角色列表 * @return */ @PostMapping("staffroles") public Result> getRolesOfStaff(@RequestBody StaffRoleFormDTO staffRoleFormDTO) { - ValidatorUtils.validateEntity(staffRoleFormDTO); + ValidatorUtils.validateEntity(staffRoleFormDTO, StaffRoleFormDTO.GetRolesOfStaff.class); String staffId = staffRoleFormDTO.getStaffId(); String orgId = staffRoleFormDTO.getOrgId(); List staffRoleEntities = govStaffRoleService.listRolesByStaffId(staffId, orgId); @@ -50,4 +49,18 @@ public class StaffRoleController { return new Result>().ok(staffRoleDTOS); } + /** + * 查询拥有指定角色的用户列表 + * @param staffRoleFormDTO + * @return + */ + @PostMapping("staffsinrole") + public Result> getStaffsInRole(@RequestBody StaffRoleFormDTO staffRoleFormDTO) { + ValidatorUtils.validateEntity(staffRoleFormDTO, StaffRoleFormDTO.GetStaffsInRole.class); + String roleKey = staffRoleFormDTO.getRoleKey(); + String orgId = staffRoleFormDTO.getOrgId(); + List roleDTOS = govStaffRoleService.listStaffsInRole(roleKey, orgId); + return new Result>().ok(roleDTOS); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java index 8967f79733..fa244dce1c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.GovStaffRoleDTO; import com.epmet.entity.GovStaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -33,5 +34,19 @@ import java.util.List; @Mapper public interface GovStaffRoleDao extends BaseDao { + /** + * 根据staffId查询具有的角色列表 + * @param staffId + * @param orgId + * @return + */ List listRolesByStaffId(@Param("staffId") String staffId, @Param("orgId") String orgId); + + /** + * 查询具有某角色的staff列表 + * @param roleKey + * @param orgId + * @return + */ + List listStaffsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java index 942a001921..8de688b50b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -99,4 +99,12 @@ public interface GovStaffRoleService extends BaseService { * @return */ List listRolesByStaffId(String staffId, String orgId); + + /** + * 查询具有某角色的staff列表 + * @param roleKey + * @param orgId + * @return + */ + List listStaffsInRole(String roleKey, String orgId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index fac6d94901..b0249006aa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -111,4 +111,15 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl listStaffsInRole(String roleKey, String orgId) { + return baseDao.listStaffsByRoleKeyAndOrgId(roleKey, orgId); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 95949edd10..e2b1d6fe7e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -17,6 +17,7 @@ + + + + \ No newline at end of file From 66c36c29911ed71e53f17d963f3c15727de351fe Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Thu, 23 Apr 2020 15:34:04 +0800 Subject: [PATCH 049/174] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/StaffGridListDTO.java | 34 ++++++++++ .../epmet/dto/result/GridDetailResultDTO.java | 68 +++++++++++++++++++ .../com/epmet/controller/GridController.java | 36 ++++++++++ .../java/com/epmet/dao/CustomerGridDao.java | 17 +++++ .../com/epmet/feign/EpmetUserFeignClient.java | 14 ++-- .../EpmetUserFeignClientFallBack.java | 23 +++++++ .../EpmetUserFeignClientFallback.java | 24 ++++--- .../epmet/service/CustomerGridService.java | 8 +++ .../service/impl/CustomerGridServiceImpl.java | 15 ++++ .../main/resources/mapper/CustomerGridDao.xml | 30 ++++++++ .../controller/CustomerStaffController.java | 14 ++++ .../java/com/epmet/dao/CustomerStaffDao.java | 9 +++ .../epmet/service/CustomerStaffService.java | 10 +++ .../impl/CustomerStaffServiceImpl.java | 9 +++ .../resources/mapper/CustomerStaffDao.xml | 18 +++++ 15 files changed, 316 insertions(+), 13 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java new file mode 100644 index 0000000000..dc25ece228 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto; + +import lombok.Data; + +/** + * @Auther zxc + * @Create 2020-04-23 10:38 + */ +@Data +public class StaffGridListDTO { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String staffId; + + /** + * 用户姓名 + */ + private String staffName; + + /** + * 用户头像 + */ + private String staffHeadPhoto; + + /** + * 角色名称 + */ + private String roleName; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java new file mode 100644 index 0000000000..f822ea7773 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.result; + +import com.epmet.dto.StaffGridListDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Auther zxc + * @Create 2020-04-23 10:28 + */ +@Data +public class GridDetailResultDTO implements Serializable { + + private static final long serialVersionUID = -1L; + + /** + * 网格id + */ + private String grid; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置维度 + */ + private String latitude; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构ID(customer_agencys.id) + */ + private String agencyId; + + /** + * 所有上级组织ID + */ + private String pIds; + + /** + * 网格用户信息集合 + */ + private List staffGridList; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java new file mode 100644 index 0000000000..2f2b919b20 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -0,0 +1,36 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.GridDetailResultDTO; +import com.epmet.service.CustomerGridService; +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; + +/** + * @Auther zxc + * @Create 2020-04-23 9:50 + */ +@RestController +@RequestMapping("grid") +public class GridController { + + @Autowired + private CustomerGridService customerGridService; + + @PostMapping("griddetail") + public Result griddetail(@RequestBody CustomerGridFormDTO customerGridFormDTO){ + Result griddetail = customerGridService.griddetail(customerGridFormDTO); + return griddetail; + } + + /*@PostMapping("addgrid") + + @PostMapping("editgrid") + + @PostMapping("deletegrid")*/ + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index edf49d86d1..d387278ec5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -19,10 +19,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridDetailResultDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -69,4 +71,19 @@ public interface CustomerGridDao extends BaseDao { * @Author sun */ List getMyGrids(String userId); + + /** + * 根据gridId获取网格详情 + * @param customerGridFormDTO + * @return + */ + GridDetailResultDTO griddetail(CustomerGridFormDTO customerGridFormDTO); + + /** + * 根据gridId查询uerId + * @param customerGridFormDTO + * @return + */ + List selectUserIdByGridId(CustomerGridFormDTO customerGridFormDTO); + } \ 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 27332bf916..1774a21c15 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 @@ -3,18 +3,21 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; -import com.epmet.feign.fallback.EpmetUserFeignClientFallback; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.StaffGridListDTO; +import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * @author zhaoqifeng * @dscription * @date 2020/3/19 9:32 */ -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class) public interface EpmetUserFeignClient { /** * 根据用户ID获取工作人员基本信息 @@ -27,4 +30,7 @@ public interface EpmetUserFeignClient { @PostMapping(value = "/epmetuser/customerstaff/getstaffinfobyuserid") Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO); + @PostMapping("/epmetuser/customerstaff/selectstaffgridlistbyuserid") + Result> getStaffGridList(@RequestBody List customerStaffGridDTOS); + } 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 new file mode 100644 index 0000000000..029f1a968f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -0,0 +1,23 @@ +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.CustomerStaffGridDTO; +import com.epmet.dto.StaffGridListDTO; +import com.epmet.feign.EpmetUserFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Auther zxc + * @Create 2020-04-23 14:10 + */ +@Component +public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { + @Override + public Result> getStaffGridList(List customerStaffGridDTOS) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS); + } +} 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 df59c03f22..cb70ad18d3 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 @@ -4,20 +4,26 @@ 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.CustomerStaffDTO; -import com.epmet.dto.OperUserDTO; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.StaffGridListDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** - * 用户模块 - * @author zhaoqifeng - * @date 2020/3/19 9:34 + * @Auther zxc + * @Create 2020-04-23 14:10 */ @Component -public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { +public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { + @Override + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByUserId", formDTO); + } - @Override - public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerStaffInfoByUserId", formDTO); - } + @Override + public Result> getStaffGridList(List customerStaffGridDTOS) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 44b206c7c5..5d427e434a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -25,6 +25,7 @@ import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridDetailResultDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -122,4 +123,11 @@ public interface CustomerGridService extends BaseService { * @Author sun */ Result> getMyGrids(String userId); + + /** + * 根据gridId获取网格详情 + * @param customerGridFormDTO + * @return + */ + Result griddetail(CustomerGridFormDTO customerGridFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index f11352265f..da136fb56a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -26,11 +26,15 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerGridDao; import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridDetailResultDTO; import com.epmet.entity.CustomerGridEntity; +import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.CustomerGridRedis; import com.epmet.service.CustomerGridService; import com.epmet.util.ModuleConstant; @@ -55,6 +59,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) { @@ -163,4 +169,13 @@ public class CustomerGridServiceImpl extends BaseServiceImpl>().ok(baseDao.getMyGrids(userId)); } + @Override + public Result griddetail(CustomerGridFormDTO customerGridFormDTO) { + GridDetailResultDTO griddetail = baseDao.griddetail(customerGridFormDTO); + List customerStaffGridDTOS = baseDao.selectUserIdByGridId(customerGridFormDTO); + Result> staffGridList = epmetUserFeignClient.getStaffGridList(customerStaffGridDTOS); + griddetail.setStaffGridList(staffGridList.getData()); + return new Result().ok(griddetail); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 343558b7d7..f748ba157e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -109,4 +109,34 @@ cg.created_time DESC + + + + + + \ 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 6ae1285955..103d4163fc 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 @@ -26,6 +26,9 @@ 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.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.excel.CustomerStaffExcel; import com.epmet.service.CustomerStaffService; @@ -117,6 +120,17 @@ public class CustomerStaffController { return customerStaffService.getCustomerStaffInfo(formDTO); } + /** + * 根据userId查询网格下用户信息 + * @param customerStaffGridDTOS + * @return + */ + @PostMapping(value = "selectstaffgridlistbyuserid") + public Result> selectStaffGridListByUserId(@RequestBody List customerStaffGridDTOS){ + Result> listResult = customerStaffService.selectStaffGridListByUserId(customerStaffGridDTOS); + return listResult; + } + /** * 根据用户ID获取工作人员基本信息 * 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 689af6a49b..14d91f75e9 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 @@ -19,6 +19,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.entity.CustomerStaffEntity; import org.apache.ibatis.annotations.Mapper; @@ -53,4 +55,11 @@ public interface CustomerStaffDao extends BaseDao { CustomerStaffDTO selectListCustomerStaffInfo(CustomerStaffFormDTO formDTO); CustomerStaffDTO selectStaffInfoByUserId(CustomerStaffDTO formDTO); + + /** + * 根据userId查询查询网格下的用户信息 + * @param customerStaffGridDTOS + * @return + */ + List selectStaffGridListByUserId(List customerStaffGridDTOS); } \ No newline at end of file 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 12c2c04c52..3775510742 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 @@ -21,6 +21,9 @@ 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.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.entity.CustomerStaffEntity; @@ -122,4 +125,11 @@ public interface CustomerStaffService extends BaseService { * @date 2020/4/22 10:05 **/ Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO); + + /** + * 根据guidId查询网格下的用户信息 + * @param customerStaffGridDTOS + * @return + */ + Result> selectStaffGridListByUserId(List customerStaffGridDTOS); } \ 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 e0d2c3ac8f..4ac6f5a529 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 @@ -28,6 +28,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserConstant; 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.entity.CustomerStaffEntity; import com.epmet.redis.CustomerStaffRedis; @@ -140,4 +143,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().ok(customerStaffDTO); } + @Override + public Result> selectStaffGridListByUserId(List customerStaffGridDTOS) { + List staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); + return new Result>().ok(staffGridListDTOS); + } + } \ 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 08b3afb984..5385e021db 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 @@ -23,4 +23,22 @@ where cs.USER_ID=#{userId} and cs.DEL_FLAG='0' + + + \ No newline at end of file From aea54666ef2ccb0a15b31c6c1a20cf81a43eb316 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 23 Apr 2020 15:47:38 +0800 Subject: [PATCH 050/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=9C=BA=E5=85=B3=E7=BB=84=E7=BB=87=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/exception/EpmetErrorCode.java | 3 ++- .../main/java/com/epmet/constant/CustomerAgencyConstant.java | 4 ---- .../com/epmet/service/impl/CustomerAgencyServiceImpl.java | 5 +++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 0ddc89d09b..d07777427a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -26,7 +26,8 @@ public enum EpmetErrorCode { MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"), MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), - CANNOT_AUDIT_WARM(8201, "请完善居民信息"); + CANNOT_AUDIT_WARM(8201, "请完善居民信息"), + NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"); private int code; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java index 42d40b0199..3c28f465f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java @@ -14,10 +14,6 @@ public interface CustomerAgencyConstant { * 添加组织失败 */ String SAVE_EXCEPTION = "组织机构新增失败"; - /** - * 不允许删除组织 - */ - String NOT_DEL_AGENCY = "当前组织存在下级组织,不允许删除"; /** * 组织删除失败 */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 4d17f1a674..3bbd8631c0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +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; @@ -41,7 +42,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -188,7 +188,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agencyList = baseDao.selectSubAgencyById(formDTO.getAgencyId()); if (null != agencyList && agencyList.size() > NumConstant.ZERO) { - result.setMsg(CustomerAgencyConstant.NOT_DEL_AGENCY); + result.setCode(EpmetErrorCode.NOT_DEL_AGENCY.getCode()); + result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg()); return result; } //2:删除当前机关组织(逻辑删) From 2b28fcd6a5fac1dd55ceaab76af9a6a66bfbb1ce Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Thu, 23 Apr 2020 15:55:05 +0800 Subject: [PATCH 051/174] =?UTF-8?q?FeignClientFallBack=E6=B7=BB=E5=8A=A0ge?= =?UTF-8?q?tCustomerStaffInfoByUserId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/fallback/EpmetUserFeignClientFallback.java | 1 - .../gov-org/gov-org-server/src/main/resources/bootstrap.yml | 2 +- epmet-user/epmet-user-server/src/main/resources/bootstrap.yml | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) 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 cb70ad18d3..05b26449b3 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 @@ -21,7 +21,6 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByUserId", formDTO); } - @Override public Result> getStaffGridList(List customerStaffGridDTOS) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml index 3d1fddbaef..756bf6874f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-org-server #环境 dev|test|prod profiles: - active: dev + active: dev-local messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 6674d13dfd..96d9187fb7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-user-server #环境 dev|test|prod profiles: - active: dev + active: dev-local messages: encoding: UTF-8 basename: i18n/messages_common From 31882331397e214b46af200b93d029dfd4219185 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Thu, 23 Apr 2020 15:58:29 +0800 Subject: [PATCH 052/174] =?UTF-8?q?FeignClientFallBack=E6=B7=BB=E5=8A=A0ge?= =?UTF-8?q?tCustomerStaffInfoByUserId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-org/gov-org-server/src/main/resources/bootstrap.yml | 2 +- epmet-user/epmet-user-server/src/main/resources/bootstrap.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml index 756bf6874f..3d1fddbaef 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-org-server #环境 dev|test|prod profiles: - active: dev-local + active: dev messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 96d9187fb7..6674d13dfd 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-user-server #环境 dev|test|prod profiles: - active: dev-local + active: dev messages: encoding: UTF-8 basename: i18n/messages_common From 3a4bf0d93e0f56c3154b99dce3cf5f7c0b7ef968 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 23 Apr 2020 16:08:03 +0800 Subject: [PATCH 053/174] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=A7=92=E8=89=B2=E4=B8=8B=E7=9A=84=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EpmetUserFeignClientFallBack.java | 5 ++++ .../EpmetUserFeignClientFallback.java | 28 ------------------- .../epmet/controller/StaffRoleController.java | 11 ++++++-- .../java/com/epmet/dao/GovStaffRoleDao.java | 8 ------ .../main/java/com/epmet/dao/StaffRoleDao.java | 12 +++++++- .../epmet/service/GovStaffRoleService.java | 8 ------ .../com/epmet/service/StaffRoleService.java | 8 ++++++ .../service/impl/GovStaffRoleServiceImpl.java | 12 -------- .../service/impl/StaffRoleServiceImpl.java | 11 ++++++++ .../main/resources/mapper/GovStaffRoleDao.xml | 14 ---------- .../main/resources/mapper/StaffRoleDao.xml | 11 ++++++++ 11 files changed, 54 insertions(+), 74 deletions(-) delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java 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 029f1a968f..05b26449b3 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 @@ -3,6 +3,7 @@ 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.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; import com.epmet.feign.EpmetUserFeignClient; @@ -16,6 +17,10 @@ import java.util.List; */ @Component public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { + @Override + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByUserId", formDTO); + } @Override public Result> getStaffGridList(List customerStaffGridDTOS) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS); 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 deleted file mode 100644 index 05b26449b3..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ /dev/null @@ -1,28 +0,0 @@ -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.CustomerStaffDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; -import com.epmet.feign.EpmetUserFeignClient; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @Auther zxc - * @Create 2020-04-23 14:10 - */ -@Component -public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { - @Override - public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByUserId", formDTO); - } - @Override - public Result> getStaffGridList(List customerStaffGridDTOS) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS); - } -} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 73a94b7740..1c13ea4518 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -3,9 +3,11 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; +import com.epmet.service.StaffRoleService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -30,6 +32,9 @@ public class StaffRoleController { @Autowired private GovStaffRoleService govStaffRoleService; + @Autowired + private StaffRoleService staffRoleService; + /** * 查询工作人员具有的角色列表 * @return @@ -55,12 +60,12 @@ public class StaffRoleController { * @return */ @PostMapping("staffsinrole") - public Result> getStaffsInRole(@RequestBody StaffRoleFormDTO staffRoleFormDTO) { + public Result> getStaffsInRole(@RequestBody StaffRoleFormDTO staffRoleFormDTO) { ValidatorUtils.validateEntity(staffRoleFormDTO, StaffRoleFormDTO.GetStaffsInRole.class); String roleKey = staffRoleFormDTO.getRoleKey(); String orgId = staffRoleFormDTO.getOrgId(); - List roleDTOS = govStaffRoleService.listStaffsInRole(roleKey, orgId); - return new Result>().ok(roleDTOS); + List staffRoleDTOS = staffRoleService.listStaffsInRole(roleKey, orgId); + return new Result>().ok(staffRoleDTOS); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java index fa244dce1c..0e187c2252 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -18,7 +18,6 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.GovStaffRoleDTO; import com.epmet.entity.GovStaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -42,11 +41,4 @@ public interface GovStaffRoleDao extends BaseDao { */ List listRolesByStaffId(@Param("staffId") String staffId, @Param("orgId") String orgId); - /** - * 查询具有某角色的staff列表 - * @param roleKey - * @param orgId - * @return - */ - List listStaffsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 1a69f5a6c2..40d4b47b00 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.StaffRoleDTO; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 工作人员-角色关系表 @@ -29,5 +33,11 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffRoleDao extends BaseDao { - + /** + * 查询具有某角色的staff列表 + * @param roleKey + * @param orgId + * @return + */ + List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java index 8de688b50b..942a001921 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -99,12 +99,4 @@ public interface GovStaffRoleService extends BaseService { * @return */ List listRolesByStaffId(String staffId, String orgId); - - /** - * 查询具有某角色的staff列表 - * @param roleKey - * @param orgId - * @return - */ - List listStaffsInRole(String roleKey, String orgId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index f5787beaa8..7ba2d5e83b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -92,4 +92,12 @@ public interface StaffRoleService extends BaseService { * @date 2020-04-22 */ void delete(String[] ids); + + /** + * 查询具有某角色的staff列表 + * @param roleKey + * @param orgId + * @return + */ + List listStaffsInRole(String roleKey, String orgId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index b0249006aa..28ae555889 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -110,16 +110,4 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl listRolesByStaffId(String staffId, String orgId) { return baseDao.listRolesByStaffId(staffId, orgId); } - - /** - * 查询具有某角色的staff列表 - * @param roleKey - * @param orgId - * @return - */ - @Override - public List listStaffsInRole(String roleKey, String orgId) { - return baseDao.listStaffsByRoleKeyAndOrgId(roleKey, orgId); - } - } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index bf717ba530..ddcd8abe3b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -101,4 +101,15 @@ public class StaffRoleServiceImpl extends BaseServiceImpl listStaffsInRole(String roleKey, String orgId) { + return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index e2b1d6fe7e..8259bfb9a8 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -28,18 +28,4 @@ sr.STAFF_ID = #{staffId} AND sr.ORG_ID = #{orgId} - - - - - \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 79ad9ca489..0cbdc611f6 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -17,4 +17,15 @@ + + \ No newline at end of file From 2aa917d4ad09fd7160505477d8d5c3ed7066f30c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Apr 2020 16:19:52 +0800 Subject: [PATCH 054/174] =?UTF-8?q?gov=20wxcode=E7=99=BB=E5=BD=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/GovLoginController.java | 6 +++--- .../java/com/epmet/dto/form/GovWxmpFormDTO.java | 3 ++- .../epmet/service/impl/GovLoginServiceImpl.java | 1 + .../java/com/epmet/utils/WxMaServiceUtils.java | 7 +++---- .../tools/exception/RenExceptionHandler.java | 15 ++++++++++++--- epmet-gateway/src/main/resources/bootstrap.yml | 4 ++-- .../main/resources/mapper/CustomerStaffDao.xml | 4 ++-- 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java index 886fb67bd0..fbc883c70f 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java @@ -38,7 +38,7 @@ public class GovLoginController { * @Date 2020/4/20 11:22 **/ @PostMapping(value = "/loginwxmp/loginbywxcode") - public Result loginByWxCode(GovWxmpFormDTO formDTO) { + public Result loginByWxCode(@RequestBody GovWxmpFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return govLoginService.loginByWxCode(formDTO); } @@ -64,7 +64,7 @@ public class GovLoginController { * @Date 2020/4/18 21:14 **/ @PostMapping(value = "/loginwxmp/getmyorg") - public Result> getmyorg(StaffOrgsFormDTO formDTO) { + public Result> getmyorg(@RequestBody StaffOrgsFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return govLoginService.getMyOrg(formDTO); } @@ -77,7 +77,7 @@ public class GovLoginController { * @Date 2020/4/20 13:07 **/ @PostMapping(value = "/loginwxmp/enterorg") - public Result enterOrg(GovWxmpEnteOrgFormDTO formDTO) { + public Result enterOrg(@RequestBody GovWxmpEnteOrgFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return govLoginService.enterOrg(formDTO); } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java index 72c43cbfa7..4eb52a4bf7 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; +import java.io.Serializable; /** * @Description 政府端小程序根据wxCode获取上一次登录信息,返回token @@ -10,7 +11,7 @@ import javax.validation.constraints.NotBlank; * @Date 2020/4/20 11:20 */ @Data -public class GovWxmpFormDTO extends LoginCommonFormDTO{ +public class GovWxmpFormDTO extends LoginCommonFormDTO implements Serializable { private static final long serialVersionUID = -207861963128774742L; /** * wxCode 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 2c0300a947..1d06b689fa 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 @@ -109,6 +109,7 @@ public class GovLoginServiceImpl implements GovLoginService { //2、验证码是否正确 String rightSmsCode = captchaRedis.getSmsCode(formDTO.getMobile()); if (!formDTO.getSmsCode().equals(rightSmsCode)) { + logger.error(String.format("验证码错误code[%s],msg[%s]",EpmetErrorCode.MOBILE_CODE_ERROR.getCode(),EpmetErrorCode.MOBILE_CODE_ERROR.getMsg())); return new Result>().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); } //3、查询用户所有的组织信息 diff --git a/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/utils/WxMaServiceUtils.java b/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/utils/WxMaServiceUtils.java index 8d7aaa463d..5122fa505f 100644 --- a/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/utils/WxMaServiceUtils.java +++ b/epmet-commons/epmet-commons-tools-wx-ma/src/main/java/com/epmet/utils/WxMaServiceUtils.java @@ -17,10 +17,10 @@ public class WxMaServiceUtils { @Value("${wx.ma.appId.resi}") private String APPID_RESI; - /*@Value("${wx.ma.appId.gov}") + @Value("${wx.ma.appId.gov}") private String APPID_GOV; - @Value("${wx.ma.appId.oper}") + /*@Value("${wx.ma.appId.oper}") private String APPID_OPER;*/ /** @@ -43,8 +43,7 @@ public class WxMaServiceUtils { * @date 2020/03/13 10:44 */ public final WxMaService govWxMaService() { -// final WxMaService wxMaService = WxMaConfig.getMaService(APPID_GOV); - final WxMaService wxMaService = WxMaConfig.getMaService(APPID_RESI); + final WxMaService wxMaService = WxMaConfig.getMaService(APPID_GOV); return wxMaService; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java index b2936413d2..5a035ffa80 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java @@ -53,7 +53,10 @@ public class RenExceptionHandler { @ExceptionHandler(RenException.class) public Result handleRRException(RenException ex){ logger.error(ExceptionUtils.getErrorStackTrace(ex)); - return new Result().error(); + Result result=new Result().error(); + result.setData(ex.getMsg()); + return result; +// return new Result().error(); } /** @@ -64,7 +67,10 @@ public class RenExceptionHandler { @ExceptionHandler(RuntimeException.class) public Result handleRuntimeException(RuntimeException ex){ logger.error(ExceptionUtils.getErrorStackTrace(ex)); - return new Result().error(); + Result result=new Result().error(); + result.setData(ex.getMessage()); + return result; +// return new Result().error(); } /** @@ -87,7 +93,10 @@ public class RenExceptionHandler { public Result handleException(Exception ex){ logger.error(ExceptionUtils.getErrorStackTrace(ex)); // saveLog(ex); - return new Result().error(); + Result result=new Result().error(); + result.setData(ex.getMessage()); + return result; +// return new Result().error(); } /** diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index d7f1d28a50..64cd74507d 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -293,8 +293,8 @@ epmet: - /resi/mine/** - /resi/group/** - /resi/partymember/** -# - /gov/mine/** -# - /gov/access/** + - /gov/mine/** + - /gov/access/** swaggerUrls: jwt: 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 08b3afb984..f3d3bad1da 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 @@ -7,7 +7,7 @@ @@ -16,7 +16,7 @@ select * from customer_staff cs where cs.MOBILE=#{mobile} and cs.CUSTOMER_ID=#{customerId} - and cs.DEL_FLAG='1' + and cs.DEL_FLAG='0' + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java new file mode 100644 index 0000000000..69a668fc7a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 通用工作人员信息DTO + * @ClassName CommonStaffInfoResultDTO + * @Author wangc + * @date 2020.04.23 16:16 + */ +@Data +public class CommonStaffInfoResultDTO implements Serializable { + private static final long serialVersionUID = 4174593133225057232L; + + /** + * 工作人员用户Id + * */ + private String userId; + + /** + * 工作人员用户头像 + * */ + private String userHeadPhoto; + + /** + * 工作人员用户显示昵称 + * */ + private String userShowName; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java index 5bcfd548cc..4f4d31bdb5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java @@ -15,16 +15,34 @@ import java.util.List; public class UserInfoOnEnterGridResultDTO implements Serializable{ private static final long serialVersionUID = 1L; + /** + * 当前客户Id + * */ private String currentCustomerId; + /** + * 当前网格Id + * */ private String currentGridId; + /** + * 当前网格名称 + * */ private String currentGridName; + /** + * 用户昵称 + * */ private String nickname; + /** + * 用户头像 + * */ private String userHeadPhoto; + /** + * 用户身份列表 + * */ private List userRoleList; } From 2309bc135f12b7dc7538841cceb6e6d4917a1c07 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 23 Apr 2020 17:28:30 +0800 Subject: [PATCH 059/174] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=BB=BAcontrolle?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/AgencyController.java | 100 ++++++++++ .../controller/CustomerAgencyController.java | 61 +----- .../src/main/java/com/epmet/feign/.gitkeep | 0 .../java/com/epmet/service/AgencyService.java | 80 ++++++++ .../epmet/service/CustomerAgencyService.java | 40 ---- .../epmet/service/impl/AgencyServiceImpl.java | 185 ++++++++++++++++++ .../impl/CustomerAgencyServiceImpl.java | 125 ------------ 7 files changed, 366 insertions(+), 225 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/.gitkeep create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java new file mode 100644 index 0000000000..501e6c05bd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AddAgencyResultDTO; +import com.epmet.dto.result.AgencydetailResultDTO; +import com.epmet.dto.result.SubAgencyResultDTO; +import com.epmet.service.AgencyService; +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; + + +/** + * 组织机构 + * + * @author generator generator@elink-cn.com + */ +@RestController +@RequestMapping("agency") +public class AgencyController { + + @Autowired + private AgencyService agencyService; + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加组织 + */ + @PostMapping("addagency") + public Result addAgency(@RequestBody AddAgencyFormDTO formDTO) { + return agencyService.addAgency(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织名称编辑 + */ + @PostMapping("editagency") + public Result editAgency(@RequestBody EditAgencyFormDTO formDTO) { + return agencyService.editAgency(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除组织机关 + */ + @PostMapping("removeagency") + public Result removeAgency(@RequestBody RemoveAgencyFormDTO formDTO) { + return agencyService.removeAgency(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取组织机构信息 + */ + @PostMapping("agencydetail") + public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) { + return agencyService.agencyDetail(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-下级机关列表 + */ + @PostMapping("subagencylist") + public Result subAgencyList(@RequestBody SubAgencyFormDTO formDTO) { + return agencyService.subAgencyList(formDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 9caad715cc..9de0e27f8e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -26,11 +26,8 @@ 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.CustomerAgencyDTO; -import com.epmet.dto.form.*; -import com.epmet.dto.result.AddAgencyResultDTO; -import com.epmet.dto.result.AgencydetailResultDTO; +import com.epmet.dto.form.StaffOrgFormDTO; import com.epmet.dto.result.StaffOrgsResultDTO; -import com.epmet.dto.result.SubAgencyResultDTO; import com.epmet.excel.CustomerAgencyExcel; import com.epmet.service.CustomerAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -107,60 +104,4 @@ public class CustomerAgencyController { public Result> getStaffOrgList(@RequestBody StaffOrgFormDTO staffOrgsFormDTO) { return customerAgencyService.getStaffOrgList(staffOrgsFormDTO); } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 添加组织 - */ - @PostMapping("addagency") - public Result addAgency(@RequestBody AddAgencyFormDTO formDTO) { - return customerAgencyService.addAgency(formDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 组织名称编辑 - */ - @PostMapping("editagency") - public Result editAgency(@RequestBody EditAgencyFormDTO formDTO) { - return customerAgencyService.editAgency(formDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 删除组织机关 - */ - @PostMapping("removeagency") - public Result removeAgency(@RequestBody RemoveAgencyFormDTO formDTO) { - return customerAgencyService.removeAgency(formDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 组织首页-获取组织机构信息 - */ - @PostMapping("agencydetail") - public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) { - return customerAgencyService.agencyDetail(formDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 组织首页-下级机关列表 - */ - @PostMapping("subagencylist") - public Result subAgencyList(@RequestBody SubAgencyFormDTO formDTO) { - return customerAgencyService.subAgencyList(formDTO); - } - } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/.gitkeep b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java new file mode 100644 index 0000000000..3df8e719d4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +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.CustomerAgencyDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AddAgencyResultDTO; +import com.epmet.dto.result.AgencydetailResultDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; +import com.epmet.dto.result.SubAgencyResultDTO; +import com.epmet.entity.CustomerAgencyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 机关单位信息 + * + * @author generator generator@elink-cn.com + */ +public interface AgencyService { + + /** + * @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-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 7076fe6d2d..24a4e17b35 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,44 +107,4 @@ 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-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java new file mode 100644 index 0000000000..c03526f6cd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -0,0 +1,185 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +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.utils.Result; +import com.epmet.constant.CustomerAgencyConstant; +import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.redis.CustomerAgencyRedis; +import com.epmet.service.AgencyService; +import com.epmet.service.CustomerAgencyService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 机关单位信息 + * + * @author generator generator@elink-cn.com + */ +@Service +public class AgencyServiceImpl implements AgencyService { + + private static final Logger log = LoggerFactory.getLogger(AgencyServiceImpl.class); + @Autowired + private CustomerAgencyDao customerAgencyDao; + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加组织 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result addAgency(AddAgencyFormDTO formDTO) { + Result result = new Result(); + AddAgencyResultDTO addAgencyResultDTO = new AddAgencyResultDTO(); + //0:属性映射赋值 + CustomerAgencyEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); + entity.setOrganizationName(formDTO.getAgencyName()); + entity.setTotalUser(NumConstant.ZERO); + //1:查询上级机关信息 + CustomerAgencyEntity parentEntity = customerAgencyDao.selectById(formDTO.getPid()); + entity.setCustomerId(parentEntity.getCustomerId()); + if (null == parentEntity.getPid()) { + entity.setPids(parentEntity.getId()); + entity.setAllParentName(parentEntity.getOrganizationName()); + } else { + entity.setPids(":" + parentEntity.getId()); + entity.setAllParentName("-" + parentEntity.getOrganizationName()); + } + //2:保存组织信息 + if (customerAgencyDao.insert(entity) < NumConstant.ONE) { + log.error(CustomerAgencyConstant.SAVE_EXCEPTION); + throw new RenException(CustomerAgencyConstant.SAVE_EXCEPTION); + } + //3:返回新组织Id + addAgencyResultDTO.setAgencyId(entity.getId()); + return result.ok(addAgencyResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织名称编辑 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result editAgency(EditAgencyFormDTO formDTO) { + Result result = new Result(); + CustomerAgencyEntity entity = new CustomerAgencyEntity(); + entity.setId(formDTO.getAgencyId()); + entity.setOrganizationName(formDTO.getAgencyName()); + if (customerAgencyDao.updateById(entity) < NumConstant.ONE) { + log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); + throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除组织机关 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result removeAgency(RemoveAgencyFormDTO formDTO) { + Result result = new Result(); + //1:查询当前机关是否存在所属下级机关,存在下级的不能删除 + List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId()); + if (null != agencyList && agencyList.size() > NumConstant.ZERO) { + result.setCode(EpmetErrorCode.NOT_DEL_AGENCY.getCode()); + result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg()); + return result; + } + //2:删除当前机关组织(逻辑删) + if (customerAgencyDao.deleteById(formDTO.getAgencyId()) < NumConstant.ONE) { + log.error(CustomerAgencyConstant.DEL_EXCEPTION); + throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取组织机构信息 + */ + @Override + public Result agencyDetail(AgencydetailFormDTO formDTO) { + AgencydetailResultDTO agencydetailResultDTO = new AgencydetailResultDTO(); + //1:查询本机关详细信息 + CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getAgencyId()); + if (null == entity) { + return new Result().ok(agencydetailResultDTO); + } + agencydetailResultDTO = ConvertUtils.sourceToTarget(entity, AgencydetailResultDTO.class); + agencydetailResultDTO.setAgencyId(entity.getId()); + agencydetailResultDTO.setAgencyName(entity.getOrganizationName()); + //2:查询本机关的所有上级机关,按自上而下层级顺序 + if (null == entity.getPids()) { + return new Result().ok(agencydetailResultDTO); + } + List listStr = Arrays.asList(entity.getPids().split(":")); + List parentList = customerAgencyDao.selectPAgencyById(listStr); + agencydetailResultDTO.setParentList(parentList); + return new Result().ok(agencydetailResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-下级机关列表 + */ + @Override + public Result subAgencyList(SubAgencyFormDTO formDTO) { + SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO(); + //1:根据当前机关Id查询直属下一级机关列表 + List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId()); + subAgencyResultDTO.setAgencyList(agencyList); + //2:统计下一级机关数 + subAgencyResultDTO.setSubAgencyCount(agencyList.size()); + return new Result().ok(subAgencyResultDTO); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 3bbd8631c0..c9b963b20d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -55,7 +55,6 @@ import java.util.Map; @Service public class CustomerAgencyServiceImpl extends BaseServiceImpl implements CustomerAgencyService { - private static final Logger log = LoggerFactory.getLogger(CustomerAgencyServiceImpl.class); @Autowired private CustomerAgencyRedis customerAgencyRedis; @@ -119,128 +118,4 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl list = baseDao.selectStaffOrgList(staffOrgsFormDTO.getCustomerIdList()); return new Result>().ok(list); } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 添加组织 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Result addAgency(AddAgencyFormDTO formDTO) { - Result result = new Result(); - AddAgencyResultDTO addAgencyResultDTO = new AddAgencyResultDTO(); - //0:属性映射赋值 - CustomerAgencyEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); - entity.setOrganizationName(formDTO.getAgencyName()); - entity.setTotalUser(NumConstant.ZERO); - //1:查询上级机关信息 - CustomerAgencyEntity parentEntity = baseDao.selectById(formDTO.getPid()); - entity.setCustomerId(parentEntity.getCustomerId()); - if (null == parentEntity.getPid()) { - entity.setPids(parentEntity.getId()); - entity.setAllParentName(parentEntity.getOrganizationName()); - } else { - entity.setPids(":" + parentEntity.getId()); - entity.setAllParentName("-" + parentEntity.getOrganizationName()); - } - //2:保存组织信息 - if (baseDao.insert(entity) < NumConstant.ONE) { - log.error(CustomerAgencyConstant.SAVE_EXCEPTION); - throw new RenException(CustomerAgencyConstant.SAVE_EXCEPTION); - } - //3:返回新组织Id - addAgencyResultDTO.setAgencyId(entity.getId()); - return result.ok(addAgencyResultDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 组织名称编辑 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Result editAgency(EditAgencyFormDTO formDTO) { - Result result = new Result(); - CustomerAgencyEntity entity = new CustomerAgencyEntity(); - entity.setId(formDTO.getAgencyId()); - entity.setOrganizationName(formDTO.getAgencyName()); - if (baseDao.updateById(entity) < NumConstant.ONE) { - log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); - throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); - } - return result; - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 删除组织机关 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Result removeAgency(RemoveAgencyFormDTO formDTO) { - Result result = new Result(); - //1:查询当前机关是否存在所属下级机关,存在下级的不能删除 - List agencyList = baseDao.selectSubAgencyById(formDTO.getAgencyId()); - if (null != agencyList && agencyList.size() > NumConstant.ZERO) { - result.setCode(EpmetErrorCode.NOT_DEL_AGENCY.getCode()); - result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg()); - return result; - } - //2:删除当前机关组织(逻辑删) - if (baseDao.deleteById(formDTO.getAgencyId()) < NumConstant.ONE) { - log.error(CustomerAgencyConstant.DEL_EXCEPTION); - throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); - } - return result; - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 组织首页-获取组织机构信息 - */ - @Override - public Result agencyDetail(AgencydetailFormDTO formDTO) { - AgencydetailResultDTO agencydetailResultDTO = new AgencydetailResultDTO(); - //1:查询本机关详细信息 - CustomerAgencyEntity entity = baseDao.selectById(formDTO.getAgencyId()); - if (null == entity) { - return new Result().ok(agencydetailResultDTO); - } - agencydetailResultDTO = ConvertUtils.sourceToTarget(entity, AgencydetailResultDTO.class); - agencydetailResultDTO.setAgencyId(entity.getId()); - agencydetailResultDTO.setAgencyName(entity.getOrganizationName()); - //2:查询本机关的所有上级机关,按自上而下层级顺序 - if (null == entity.getPids()) { - return new Result().ok(agencydetailResultDTO); - } - List listStr = Arrays.asList(entity.getPids().split(":")); - List parentList = baseDao.selectPAgencyById(listStr); - agencydetailResultDTO.setParentList(parentList); - return new Result().ok(agencydetailResultDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 组织首页-下级机关列表 - */ - @Override - public Result subAgencyList(SubAgencyFormDTO formDTO) { - SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO(); - //1:根据当前机关Id查询直属下一级机关列表 - List agencyList = baseDao.selectSubAgencyById(formDTO.getAgencyId()); - subAgencyResultDTO.setAgencyList(agencyList); - //2:统计下一级机关数 - subAgencyResultDTO.setSubAgencyCount(agencyList.size()); - return new Result().ok(subAgencyResultDTO); - } } \ No newline at end of file From a48ed358b06a590900207b40325130d4d3716121 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Apr 2020 17:31:44 +0800 Subject: [PATCH 060/174] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/GovLoginServiceImpl.java | 8 ++++---- .../epmet/controller/CustomerGridController.java | 2 +- .../main/resources/mapper/CustomerAgencyDao.xml | 14 +++++++------- .../main/resources/mapper/CustomerGridDao.xml | 3 +-- .../java/com/epmet/constant/UserConstant.java | 10 ++++++++++ .../java/com/epmet/dao/CustomerStaffDao.java | 9 +++++++++ .../service/impl/StaffWechatServiceImpl.java | 16 +++++++++++++++- .../main/resources/mapper/CustomerStaffDao.xml | 11 +++++++++++ 8 files changed, 58 insertions(+), 15 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 1d06b689fa..f77b7747ef 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 @@ -193,13 +193,13 @@ public class GovLoginServiceImpl implements GovLoginService { CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); //2、解析微信用户 WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode()); - //3、记录staff_wechat + //3、记录staff_wechat,并记录用户激活状态,激活时间 this.savestaffwechat(customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); - //5、记录登录日志 + //4、记录登录日志 this.saveStaffLoginRecord(formDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); - //1、获取用户token + //5.1、获取用户token String token = this.generateGovWxmpToken(customerStaff.getUserId()); - //2、保存到redis + //5.2、保存到redis this.saveGovTokenDto(formDTO.getAgencyId(), formDTO.getCustomerId(), customerStaff.getUserId(), wxMaJscode2SessionResult, token); UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setToken(token); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 1e565d5b76..6daed0e8a4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -132,7 +132,7 @@ public class CustomerGridController { * @Description 根据userId查询该用户涉及的所有网格列表 * @Author sun */ - @PostMapping("getmygrids/{userId}") + @GetMapping("getmygrids/{userId}") public Result> getMyGrids(@PathVariable("userId") String userId) { return customerGridService.getMyGrids(userId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index a80b7334c4..f6118df149 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -24,15 +24,15 @@ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java index 640d5079ea..16fb79e8fd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java @@ -57,4 +57,14 @@ public interface UserConstant { * 未禁用enable,已禁用diabled */ String DISABLED="disabled"; + + /** + * inactive未激活,active已激活 + */ + String INACTIVE="inactive"; + + /** + * inactive未激活,active已激活 + */ + String ACTIVE="active"; } 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 14d91f75e9..ef1a5955eb 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 @@ -62,4 +62,13 @@ public interface CustomerStaffDao extends BaseDao { * @return */ List selectStaffGridListByUserId(List customerStaffGridDTOS); + + /** + * @return com.epmet.entity.CustomerStaffEntity + * @param userId + * @Author yinzuomei + * @Description 根据staffid查询用户基本信息 + * @Date 2020/4/23 16:46 + **/ + CustomerStaffEntity selectByUserId(String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffWechatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffWechatServiceImpl.java index 04fe972274..b50daab444 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffWechatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffWechatServiceImpl.java @@ -24,18 +24,23 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.UserConstant; +import com.epmet.dao.CustomerStaffDao; import com.epmet.dao.StaffWechatDao; import com.epmet.dto.StaffWechatDTO; import com.epmet.dto.form.StaffWechatFormDTO; +import com.epmet.entity.CustomerStaffEntity; import com.epmet.entity.StaffWechatEntity; import com.epmet.service.StaffWechatService; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Map; @@ -48,7 +53,8 @@ import java.util.Map; @Service public class StaffWechatServiceImpl extends BaseServiceImpl implements StaffWechatService { private Logger logger = LogManager.getLogger(getClass()); - + @Autowired + private CustomerStaffDao customerStaffDao; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -119,6 +125,14 @@ public class StaffWechatServiceImpl extends BaseServiceImpl AND cs.del_flag = 0 + + + \ No newline at end of file From 60435a2c8280b322bddb713eeb88db8589487e3e Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 23 Apr 2020 18:00:55 +0800 Subject: [PATCH 061/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=BB=84=E7=BB=87=E6=9C=BA=E6=9E=84=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/AgencyListFormDTO.java | 43 ++++++++++++++++ .../epmet/dto/result/AgencyListResultDTO.java | 51 +++++++++++++++++++ .../epmet/controller/AgencyController.java | 13 +++++ .../java/com/epmet/dao/CustomerAgencyDao.java | 9 ++++ .../java/com/epmet/service/AgencyService.java | 13 +++-- .../epmet/service/impl/AgencyServiceImpl.java | 12 +++++ .../resources/mapper/CustomerAgencyDao.xml | 11 ++++ 7 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyListFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyListFormDTO.java new file mode 100644 index 0000000000..1a05afb589 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyListFormDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 获取组织列表-接口入参 + * + * @author sun + */ +@Data +public class AgencyListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + @NotBlank(message = "组织机构ID不能为空") + private String agencyId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java new file mode 100644 index 0000000000..9673700fcc --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 获取组织列表-接口返参 + * + * @author sun + */ +@Data +public class AgencyListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId; + + /** + * 机关组织名称 + */ + private String agencyName; + + /** + * 总人数 + */ + private Integer totalUser; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 501e6c05bd..82cd76e7c3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -20,6 +20,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.*; import com.epmet.dto.result.AddAgencyResultDTO; +import com.epmet.dto.result.AgencyListResultDTO; import com.epmet.dto.result.AgencydetailResultDTO; import com.epmet.dto.result.SubAgencyResultDTO; import com.epmet.service.AgencyService; @@ -29,6 +30,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 组织机构 @@ -97,4 +100,14 @@ public class AgencyController { return agencyService.subAgencyList(formDTO); } + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取组织列表 + */ + @PostMapping("agencylist") + public Result> agencyList(@RequestBody AgencyListFormDTO formDTO) { + return agencyService.agencyList(formDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 0dc66e7bdd..8a4c14548b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.AgencyListResultDTO; import com.epmet.dto.result.ParentListResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.SubListResultDTO; @@ -59,4 +60,12 @@ public interface CustomerAgencyDao extends BaseDao { * @Description 组织首页-下级机关列表 **/ List selectSubAgencyById(@Param("pId") String pId); + + /** + * @param pId + * @return + * @Author sun + * @Description 获取组织列表 + **/ + List selectAgencyList(@Param("pId") String pId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index 3df8e719d4..f811f71f80 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -22,10 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.AddAgencyResultDTO; -import com.epmet.dto.result.AgencydetailResultDTO; -import com.epmet.dto.result.StaffOrgsResultDTO; -import com.epmet.dto.result.SubAgencyResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import java.util.List; @@ -77,4 +74,12 @@ public interface AgencyService { * @Description 组织首页-下级机关列表 */ Result subAgencyList(SubAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取组织列表 + */ + Result> agencyList(AgencyListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index c03526f6cd..ae13436d6a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -182,4 +182,16 @@ public class AgencyServiceImpl implements AgencyService { subAgencyResultDTO.setSubAgencyCount(agencyList.size()); return new Result().ok(subAgencyResultDTO); } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取组织列表 + */ + @Override + public Result> agencyList(AgencyListFormDTO formDTO) { + List agencyList = customerAgencyDao.selectAgencyList(formDTO.getAgencyId()); + return new Result>().ok(agencyList); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index a80b7334c4..1740a0c0ea 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -59,4 +59,15 @@ AND pid = #{pId} ORDER BY CREATED_TIME DESC + + \ No newline at end of file From 87f2b17d5a3d9295bb9fbc12725f48b3caa36be9 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 23 Apr 2020 18:04:26 +0800 Subject: [PATCH 062/174] =?UTF-8?q?=E5=88=A0=E9=99=A4gov-org=E4=B8=8B?= =?UTF-8?q?=E7=9A=84feign=E5=AE=9E=E7=8E=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EpmetUserFeignClientFallBack.java | 23 --------------- .../EpmetUserFeignClientFallback.java | 29 ------------------- .../fallback/OperCrmFeignClientFallBack.java | 21 -------------- 3 files changed, 73 deletions(-) delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java 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 deleted file mode 100644 index 029f1a968f..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ /dev/null @@ -1,23 +0,0 @@ -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.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; -import com.epmet.feign.EpmetUserFeignClient; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @Auther zxc - * @Create 2020-04-23 14:10 - */ -@Component -public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { - @Override - public Result> getStaffGridList(List customerStaffGridDTOS) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS); - } -} 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 deleted file mode 100644 index cb70ad18d3..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ /dev/null @@ -1,29 +0,0 @@ -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.CustomerStaffDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; -import com.epmet.feign.EpmetUserFeignClient; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @Auther zxc - * @Create 2020-04-23 14:10 - */ -@Component -public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { - @Override - public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByUserId", formDTO); - } - - @Override - public Result> getStaffGridList(List customerStaffGridDTOS) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS); - } -} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java deleted file mode 100644 index d40619a04c..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java +++ /dev/null @@ -1,21 +0,0 @@ -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.CustomerDTO; -import com.epmet.feign.OperCrmFeignClient; -import org.springframework.stereotype.Component; - -/** - * @author zhaoqifeng - * @dscription - * @date 2020/4/22 10:43 - */ -@Component -public class OperCrmFeignClientFallBack implements OperCrmFeignClient { - @Override - public Result getCustomerInfo(CustomerDTO dto) { - return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerInfo", dto); - } -} From 5b7abe5da256a174d1f6f128ac208188cecb0cec Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 23 Apr 2020 18:06:40 +0800 Subject: [PATCH 063/174] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4gov?= =?UTF-8?q?-org=E4=B8=8B=E7=9A=84feign=E5=AE=9E=E7=8E=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EpmetUserFeignClientFallBack.java | 28 +++++++++++++++++++ .../fallback/OperCrmFeignClientFallBack.java | 21 ++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java 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 e69de29bb2..05b26449b3 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 @@ -0,0 +1,28 @@ +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.CustomerStaffDTO; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.StaffGridListDTO; +import com.epmet.feign.EpmetUserFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Auther zxc + * @Create 2020-04-23 14:10 + */ +@Component +public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { + @Override + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByUserId", formDTO); + } + @Override + public Result> getStaffGridList(List customerStaffGridDTOS) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java new file mode 100644 index 0000000000..d40619a04c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -0,0 +1,21 @@ +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.CustomerDTO; +import com.epmet.feign.OperCrmFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/22 10:43 + */ +@Component +public class OperCrmFeignClientFallBack implements OperCrmFeignClient { + @Override + public Result getCustomerInfo(CustomerDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerInfo", dto); + } +} From fa0410e63335bf63450b1f6343a8f12617454575 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 23 Apr 2020 18:25:42 +0800 Subject: [PATCH 064/174] =?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?= =?UTF-8?q?=E6=8E=A5=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 067/174] =?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 068/174] =?UTF-8?q?gov=E7=AB=AF=E7=82=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?token=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; } From 167facfd7b8ef82e1ee8af42cb7d91e8a20c576b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 24 Apr 2020 10:38:01 +0800 Subject: [PATCH 069/174] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E8=A1=A8=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9=EF=BC=88=E5=9B=BD?= =?UTF-8?q?=E5=AE=B6=E6=94=B9=E4=B8=BA=E5=8C=BA=E5=8E=BF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/CustomerAgencyDTO.java | 10 +++++----- .../java/com/epmet/entity/CustomerAgencyEntity.java | 10 +++++----- .../main/java/com/epmet/excel/CustomerAgencyExcel.java | 6 ++---- .../src/main/resources/db/migration/epmet_gov_org.sql | 4 ++-- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java index d1e6c3f40a..7b9abc9de6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java @@ -112,11 +112,6 @@ public class CustomerAgencyDTO implements Serializable { */ private Integer totalUser; - /** - * 国家 - */ - private String country; - /** * 省份 */ @@ -126,5 +121,10 @@ public class CustomerAgencyDTO implements Serializable { * 城市 */ private String city; + + /** + * 区县 + */ + private String district; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index 84f0e78f1c..5549845d66 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java @@ -82,11 +82,6 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { */ private Integer totalUser; - /** - * 国家 - */ - private String country; - /** * 省份 */ @@ -97,4 +92,9 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { */ private String city; + /** + * 区县 + */ + private String district; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java index 61ea84eb40..346963be94 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java @@ -76,14 +76,12 @@ public class CustomerAgencyExcel { @Excel(name = "总人数") private Integer totalUser; - @Excel(name = "国家") - private String country; - @Excel(name = "省份") private String province; @Excel(name = "城市") private String city; - + @Excel(name = "区县") + private String district; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql index 2dc0bba345..f4d0e47dc7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql @@ -107,7 +107,7 @@ alter table customer_grid add column ORG_ID varchar(64) NOT NULL COMMENT '所属 alter table customer_grid add column MANAGE_DISTRICT varchar(255) DEFAULT "" NOT NULL COMMENT '管辖区域'; alter table customer_grid add column TOTAL_USER INT(11) DEFAULT 0 NOT NULL COMMENT '当前网格总人数'; ALTER TABLE customer_agency ADD ( - COUNTRY VARCHAR (32) DEFAULT NULL COMMENT '国家', PROVINCE VARCHAR (32) DEFAULT NULL COMMENT '省份', - CITY VARCHAR (32) DEFAULT NULL COMMENT '城市' + CITY VARCHAR (32) DEFAULT NULL COMMENT '城市', + DISTRICT VARCHAR (32) DEFAULT NULL COMMENT '区县' ); \ No newline at end of file From 8320ac3028eae7685a95a97779f343dad5097bfa Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 24 Apr 2020 13:53:47 +0800 Subject: [PATCH 070/174] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0DataFilter=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=B7=A5=E5=85=B7=202.=E5=AE=9E=E7=8E=B0=E4=BA=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=BA=A7RBAC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/NewsServiceImpl.java | 2 +- .../src/test/java/com/epmet/TokenGenTest.java | 63 +++++++ .../mybatis/annotation/DataFilter.java | 20 -- .../mybatis/aspect/DataFilterAspect.java | 172 ++++++++++++------ .../mybatis/aspect/DataFilterAspectBak.java | 106 +++++++++++ .../dto/form/StaffPermissionFormDTO.java | 26 +++ .../commons/mybatis/entity/DataScope.java | 9 +- .../mybatis/feign/GovAccessFeignClient.java | 26 +++ .../GovAccessFeignClientFallback.java | 25 +++ .../handler/FieldMetaObjectHandler.java | 8 +- .../interceptor/DataFilterInterceptor.java | 6 + .../interceptor/DataFilterInterceptorBak.java | 100 ++++++++++ .../tools/annotation/RequirePermission.java | 36 ++++ .../commons/tools/aspect/AccessOpeAspect.java | 46 +++++ .../tools/exception/EpmetErrorCode.java | 3 +- .../tools/exception/RenExceptionHandler.java | 4 +- .../tools/security/dto/GovTokenDto.java | 2 +- .../tools/security/user/LoginUserUtil.java | 61 ++++++- epmet-gateway/pom.xml | 8 +- .../com/epmet/filter/FeignRequestFilter.java | 3 +- .../epmet/dto/form/StaffPermCacheFormDTO.java | 15 +- .../epmet/controller/AccessController.java | 15 +- .../java/com/epmet/service/AccessService.java | 10 +- .../epmet/service/impl/AccessServiceImpl.java | 15 +- .../db.migration/epmet_gov_access.sql | 2 +- .../epmet/controller/AccessController.java | 11 +- .../com/epmet/feign/GovAccessFeignClient.java | 18 +- .../GovAccessFeignClientFallback.java | 17 +- .../java/com/epmet/service/AccessService.java | 3 +- .../epmet/service/impl/AccessServiceImpl.java | 16 +- .../epmet/controller/StaffRoleController.java | 1 + .../service/impl/StaffRoleServiceImpl.java | 1 + 32 files changed, 728 insertions(+), 122 deletions(-) create mode 100644 epmet-auth/src/test/java/com/epmet/TokenGenTest.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspectBak.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermissionFormDTO.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptorBak.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/RequirePermission.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/AccessOpeAspect.java diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/NewsServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/NewsServiceImpl.java index 31d7c6c310..220cf7d171 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/NewsServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/NewsServiceImpl.java @@ -31,7 +31,7 @@ public class NewsServiceImpl extends BaseServiceImpl implem * mybatis数据权限演示 */ @Override - @DataFilter(prefix = "AND", isPendingCreator = false) + //@DataFilter(prefix = "AND", isPendingCreator = false) public PageData page(Map params) { paramsToLike(params, "title"); diff --git a/epmet-auth/src/test/java/com/epmet/TokenGenTest.java b/epmet-auth/src/test/java/com/epmet/TokenGenTest.java new file mode 100644 index 0000000000..3368e2d1cf --- /dev/null +++ b/epmet-auth/src/test/java/com/epmet/TokenGenTest.java @@ -0,0 +1,63 @@ +package com.epmet; + +import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.commons.tools.utils.CpUserDetailRedis; +import com.epmet.jwt.JwtTokenProperties; +import com.epmet.jwt.JwtTokenUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.HashMap; +import java.util.Map; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class TokenGenTest { + + @Autowired + private JwtTokenProperties jwtTokenProperties; + + @Autowired + private JwtTokenUtils jwtTokenUtils; + + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + + @Test + public void genToken() { + String staffId = "wxz"; + String tokenStr = generateGovWxmpToken(staffId); + int expire = jwtTokenProperties.getExpire(); + GovTokenDto govTokenDto = new GovTokenDto(); + govTokenDto.setApp(LoginConstant.APP_GOV); + govTokenDto.setClient(LoginConstant.CLIENT_WXMP); + govTokenDto.setUserId(staffId); + govTokenDto.setOpenId(""); + govTokenDto.setSessionKey(""); + govTokenDto.setUnionId(""); + govTokenDto.setToken(tokenStr); + govTokenDto.setUpdateTime(System.currentTimeMillis()); + govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(tokenStr).getTime()); + govTokenDto.setAgencyId("1"); + govTokenDto.setCustomerId("f76def116c9c2dc0269cc17867af122c"); + cpUserDetailRedis.set(govTokenDto, expire); + } + + /** + * @Description 生成token + * @Date 2020/4/18 23:04 + **/ + private String generateGovWxmpToken(String staffId) { + Map map = new HashMap<>(); + map.put("app", LoginConstant.APP_GOV); + map.put("client", LoginConstant.CLIENT_WXMP); + map.put("userId", staffId); + String token = jwtTokenUtils.createToken(map); + return token; + } + +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java index dd1d3aee3b..96b7691f22 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java @@ -25,24 +25,4 @@ public @interface DataFilter { */ String tableAlias() default ""; - /** - * 查询条件前缀,可选值有:[where、and] - */ - String prefix() default ""; - - /** - * 用户ID - */ - String userId() default "creator"; - - /** - * 部门ID - */ - String deptId() default "dept_id"; - - /** - * 是否拼接用户ID - */ - boolean isPendingCreator() default true; - } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java index f322f631f9..14ce3af0a1 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java @@ -8,25 +8,28 @@ package com.epmet.commons.mybatis.aspect; -import cn.hutool.core.collection.CollUtil; -import com.epmet.commons.mybatis.annotation.DataFilter; +import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; import com.epmet.commons.mybatis.entity.DataScope; -import com.epmet.commons.tools.constant.Constant; -import com.epmet.commons.tools.enums.SuperAdminEnum; +import com.epmet.commons.mybatis.feign.GovAccessFeignClient; +import com.epmet.commons.tools.aspect.AccessOpeAspect; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.security.user.SecurityUser; -import com.epmet.commons.tools.security.user.UserDetail; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import java.util.Arrays; import java.util.List; -import java.util.Map; +import java.util.Set; /** * 数据过滤,切面处理类 @@ -37,69 +40,124 @@ import java.util.Map; @Aspect @Component public class DataFilterAspect { - @Pointcut("@annotation(com.epmet.commons.mybatis.annotation.DataFilter)") - public void dataFilterCut() { - } + private static final Logger log = LoggerFactory.getLogger(DataFilterAspect.class); + + @Autowired + private LoginUserUtil loginUserUtil; + + @Autowired + private GovAccessFeignClient govAccessFeignClient; - @Before("dataFilterCut()") + @Before("@annotation(com.epmet.commons.mybatis.annotation.DataFilter)") public void dataFilter(JoinPoint point) { - Object params = point.getArgs()[0]; - if(params != null && params instanceof Map){ - UserDetail user = SecurityUser.getUser(); - - //如果不是超级管理员,则进行数据过滤 - if(user.getSuperAdmin() == SuperAdminEnum.NO.value()){ - Map map = (Map)params; - String sqlFilter = getSqlFilter(user, point); - map.put(Constant.SQL_FILTER, new DataScope(sqlFilter)); - } + // 反射的方式 + //MethodSignature signature = (MethodSignature) point.getSignature(); + //Class[] parameterTypes = signature.getParameterTypes(); + //for (Class parameterType : parameterTypes) { + // if (parameterType == DataScope.class) { + // + // } + //} + + String reqiurePermission = AccessOpeAspect.requirePermissionTl.get(); + // 没有配置所需权限,不做操作,打印提示日志 + if (StringUtils.isBlank(reqiurePermission)) { + log.warn("Api编码需要指定所需权限,请在Api上使用@RequirePermission注解完成所需权限配置"); + return; + } - return ; + // 校验操作权限 + validateOpePermission(reqiurePermission); + + Object[] methodArgs = point.getArgs(); + for (Object methodArg : methodArgs) { + if (methodArg instanceof DataScope) { + ((DataScope) methodArg).setSqlFilter(getSqlFilterSegment()); + return; + } } - throw new RenException(ErrorCode.DATA_SCOPE_PARAMS_ERROR); + //throw new RenException(ErrorCode.DATA_SCOPE_PARAMS_ERROR); } /** - * 获取数据过滤的SQL + * 校验操作权限 */ - private String getSqlFilter(UserDetail user, JoinPoint point){ - MethodSignature signature = (MethodSignature) point.getSignature(); - DataFilter dataFilter = signature.getMethod().getAnnotation(DataFilter.class); - //获取表的别名 - String tableAlias = dataFilter.tableAlias(); - if(StringUtils.isNotBlank(tableAlias)){ - tableAlias += "."; + private void validateOpePermission(String requirePermission) { + StaffPermissionFormDTO staffPermissionFormDTO = new StaffPermissionFormDTO(); + staffPermissionFormDTO.setApp(loginUserUtil.getLoginUserApp()); + staffPermissionFormDTO.setClient(loginUserUtil.getLoginUserClient()); + staffPermissionFormDTO.setStaffId(loginUserUtil.getLoginUserId()); + Result> permissions = govAccessFeignClient.getStaffCurrPermissions(staffPermissionFormDTO); + if (permissions.getCode() != 0) { + // 查询不到权限,记录日志,抛出8000异常 + log.error("调用Access查询权限失败:{}", permissions.getMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } - StringBuilder sqlFilter = new StringBuilder(); - - //查询条件前缀 - String prefix = dataFilter.prefix(); - if(StringUtils.isNotBlank(prefix)){ - sqlFilter.append(" ").append(prefix); + if (!CollectionUtils.isEmpty(permissions.getData()) && StringUtils.isNotBlank(requirePermission) + && permissions.getData().contains(requirePermission)) { + // 权限允许,正常结束 + return; } + // 权限不足抛出异常 + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } - sqlFilter.append(" ("); - - //部门ID列表 - List deptIdList = user.getDeptIdList(); - if(CollUtil.isNotEmpty(deptIdList)){ - sqlFilter.append(tableAlias).append(dataFilter.deptId()); - - sqlFilter.append(" in(").append(StringUtils.join(deptIdList, ",")).append(")"); - } + /** + * 生成过滤sql片段 + * @return + */ + private String getSqlFilterSegment() { + // 根据角色列表查询操作范围列表 - //查询本人数据 - if (dataFilter.isPendingCreator()) { - if(CollUtil.isNotEmpty(deptIdList)){ - sqlFilter.append(" or "); - } - sqlFilter.append(tableAlias).append(dataFilter.userId()).append("=").append(user.getId()); - } - sqlFilter.append(")"); + // 拼接sql语句 - return sqlFilter.toString(); + // TODO + return "dept_id in (1,2,3)"; } + + ///** + // * 获取数据过滤的SQL + // */ + //@Deprecated + //private String getSqlFilter(UserDetail user, JoinPoint point){ + // MethodSignature signature = (MethodSignature) point.getSignature(); + // DataFilter dataFilter = signature.getMethod().getAnnotation(DataFilter.class); + // //获取表的别名 + // String tableAlias = dataFilter.tableAlias(); + // if(StringUtils.isNotBlank(tableAlias)){ + // tableAlias += "."; + // } + // + // StringBuilder sqlFilter = new StringBuilder(); + // + // //查询条件前缀 + // String prefix = dataFilter.prefix(); + // if(StringUtils.isNotBlank(prefix)){ + // sqlFilter.append(" ").append(prefix); + // } + // + // sqlFilter.append(" ("); + // + // //部门ID列表 + // List deptIdList = user.getDeptIdList(); + // if(CollUtil.isNotEmpty(deptIdList)){ + // sqlFilter.append(tableAlias).append(dataFilter.deptId()); + // + // sqlFilter.append(" in(").append(StringUtils.join(deptIdList, ",")).append(")"); + // } + // + // //查询本人数据 + // if (dataFilter.isPendingCreator()) { + // if(CollUtil.isNotEmpty(deptIdList)){ + // sqlFilter.append(" or "); + // } + // sqlFilter.append(tableAlias).append(dataFilter.userId()).append("=").append(user.getId()); + // } + // sqlFilter.append(")"); + // + // return sqlFilter.toString(); + //} } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspectBak.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspectBak.java new file mode 100644 index 0000000000..2c4c532bda --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspectBak.java @@ -0,0 +1,106 @@ +///** +// * Copyright (c) 2018 人人开源 All rights reserved. +// * +// * https://www.renren.io +// * +// * 版权所有,侵权必究! +// */ +// +//package com.epmet.commons.mybatis.aspect; +// +//import cn.hutool.core.collection.CollUtil; +//import com.epmet.commons.mybatis.annotation.DataFilter; +//import com.epmet.commons.mybatis.entity.DataScope; +//import com.epmet.commons.tools.constant.Constant; +//import com.epmet.commons.tools.enums.SuperAdminEnum; +//import com.epmet.commons.tools.exception.ErrorCode; +//import com.epmet.commons.tools.exception.RenException; +//import com.epmet.commons.tools.security.user.SecurityUser; +//import com.epmet.commons.tools.security.user.UserDetail; +//import org.apache.commons.lang3.StringUtils; +//import org.aspectj.lang.JoinPoint; +//import org.aspectj.lang.annotation.Aspect; +//import org.aspectj.lang.annotation.Before; +//import org.aspectj.lang.annotation.Pointcut; +//import org.aspectj.lang.reflect.MethodSignature; +//import org.springframework.stereotype.Component; +// +//import java.util.Arrays; +//import java.util.List; +//import java.util.Map; +// +///** +// * 数据过滤,切面处理类 +// * +// * @author Mark sunlightcs@gmail.com +// * @since 1.0.0 +// */ +//@Aspect +//@Component +//public class DataFilterAspectBak { +// @Pointcut("@annotation(com.epmet.commons.mybatis.annotation.DataFilter)") +// public void dataFilterCut() { +// +// } +// +// @Before("dataFilterCut()") +// public void dataFilter(JoinPoint point) { +// Object params = point.getArgs()[0]; +// if(params != null && params instanceof Map){ +// UserDetail user = SecurityUser.getUser(); +// +// //如果不是超级管理员,则进行数据过滤 +// if(user.getSuperAdmin() == SuperAdminEnum.NO.value()){ +// Map map = (Map)params; +// String sqlFilter = getSqlFilter(user, point); +// map.put(Constant.SQL_FILTER, new DataScope(sqlFilter)); +// } +// +// return ; +// } +// +// throw new RenException(ErrorCode.DATA_SCOPE_PARAMS_ERROR); +// } +// +// /** +// * 获取数据过滤的SQL +// */ +// private String getSqlFilter(UserDetail user, JoinPoint point){ +// MethodSignature signature = (MethodSignature) point.getSignature(); +// DataFilter dataFilter = signature.getMethod().getAnnotation(DataFilter.class); +// //获取表的别名 +// String tableAlias = dataFilter.tableAlias(); +// if(StringUtils.isNotBlank(tableAlias)){ +// tableAlias += "."; +// } +// +// StringBuilder sqlFilter = new StringBuilder(); +// +// //查询条件前缀 +// String prefix = dataFilter.prefix(); +// if(StringUtils.isNotBlank(prefix)){ +// sqlFilter.append(" ").append(prefix); +// } +// +// sqlFilter.append(" ("); +// +// //部门ID列表 +// List deptIdList = user.getDeptIdList(); +// if(CollUtil.isNotEmpty(deptIdList)){ +// sqlFilter.append(tableAlias).append(dataFilter.deptId()); +// +// sqlFilter.append(" in(").append(StringUtils.join(deptIdList, ",")).append(")"); +// } +// +// //查询本人数据 +// if (dataFilter.isPendingCreator()) { +// if(CollUtil.isNotEmpty(deptIdList)){ +// sqlFilter.append(" or "); +// } +// sqlFilter.append(tableAlias).append(dataFilter.userId()).append("=").append(user.getId()); +// } +// sqlFilter.append(")"); +// +// return sqlFilter.toString(); +// } +//} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermissionFormDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermissionFormDTO.java new file mode 100644 index 0000000000..3bc88d6fb1 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermissionFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.commons.mybatis.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.Set; + +@Data +public class StaffPermissionFormDTO { + + /** + * 工作人员 id + */ + private String staffId; + + /** + * 登录头信息app + */ + private String app; + + /** + * 登录头信息client + */ + private String client; + +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/entity/DataScope.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/entity/DataScope.java index 43d3ca1619..59dd035fac 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/entity/DataScope.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/entity/DataScope.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

* https://www.renren.io - * + *

* 版权所有,侵权必究! */ @@ -15,8 +15,13 @@ package com.epmet.commons.mybatis.entity; * @since 1.0.0 */ public class DataScope { + private String sqlFilter; + public static DataScope getDefault() { + return new DataScope(""); + } + public DataScope(String sqlFilter) { this.sqlFilter = sqlFilter; } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java new file mode 100644 index 0000000000..198d996bc9 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java @@ -0,0 +1,26 @@ +package com.epmet.commons.mybatis.feign; + +import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; +import com.epmet.commons.mybatis.feign.fallback.GovAccessFeignClientFallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.Set; + +/** + * @Description + * @Author sun + */ +@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) +public interface GovAccessFeignClient { + + /** + * 查询用户当前权限列表(DataFilterAspect中用到) + * @return + */ + @PostMapping("/gov/access/access/getcurrpermissions") + Result> getStaffCurrPermissions(StaffPermissionFormDTO dto); + +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java new file mode 100644 index 0000000000..3c5ccd599b --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java @@ -0,0 +1,25 @@ +package com.epmet.commons.mybatis.feign.fallback; + +import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; +import com.epmet.commons.mybatis.feign.GovAccessFeignClient; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import org.springframework.stereotype.Component; + +import java.util.Set; + +/** + * 调用政府端权限 + * @Author wxz + * @Description + * @Date 2020/4/24 11:17 + **/ +@Component +public class GovAccessFeignClientFallback implements GovAccessFeignClient { + + @Override + public Result> getStaffCurrPermissions(StaffPermissionFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getStaffCurrPermissions", dto); + } +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java index bd7d0619fd..fcd85b0c0e 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.security.user.SecurityUser; import com.epmet.commons.tools.security.user.UserDetail; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.reflection.MetaObject; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Date; @@ -40,11 +41,14 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { private final static String UPDATER = "updater"; private final static String DEPT_ID = "deptId"; + @Autowired + private LoginUserUtil loginUserUtil; + @Override public void insertFill(MetaObject metaObject) { Date date = new Date(); if (metaObject.getOriginalObject() instanceof BaseEpmetEntity) { - String loginUserId = LoginUserUtil.getLoginUserId(); + String loginUserId = loginUserUtil.getLoginUserId(); // epmet项目新增的 loginUserId = StringUtils.isBlank(loginUserId) ? Constant.APP_USER_FLAG : loginUserId; //Long deptId = user == null ? null : user.getDeptId(); @@ -107,7 +111,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { //更新时间 setFieldValByName(UPDATE_DATE, new Date(), metaObject); } else if (fillEsuaEntity) { - String loginUserId = LoginUserUtil.getLoginUserId(); + String loginUserId = loginUserUtil.getLoginUserId(); String userId = StringUtils.isBlank(loginUserId) ? Constant.APP_USER_FLAG : loginUserId; setFieldValByName(FieldConstant.UPDATED_BY_HUMP, userId, metaObject); setFieldValByName(FieldConstant.UPDATED_TIME_HUMP, new Date(), metaObject); diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java index eea6262cd4..046c012da4 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java @@ -8,6 +8,7 @@ package com.epmet.commons.mybatis.interceptor; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.PluginUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.handlers.AbstractSqlParserHandler; @@ -55,12 +56,17 @@ public class DataFilterInterceptor extends AbstractSqlParserHandler implements I // 判断参数里是否有DataScope对象 DataScope scope = null; if (paramObj instanceof DataScope) { + // 直接传入DataScope,不分页? scope = (DataScope) paramObj; } else if (paramObj instanceof Map) { + // 入参是一个Map for (Object arg : ((Map) paramObj).values()) { if (arg instanceof DataScope) { scope = (DataScope) arg; break; + } else if (arg instanceof QueryWrapper) { + // 通过Mybatis-plus封装的通用方法进行查询 + break; } } } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptorBak.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptorBak.java new file mode 100644 index 0000000000..1a3445f0f5 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptorBak.java @@ -0,0 +1,100 @@ +///** +// * Copyright (c) 2018 人人开源 All rights reserved. +// *

+// * https://www.renren.io +// *

+// * 版权所有,侵权必究! +// */ +// +//package com.epmet.commons.mybatis.interceptor; +// +//import com.baomidou.mybatisplus.core.toolkit.PluginUtils; +//import com.baomidou.mybatisplus.extension.handlers.AbstractSqlParserHandler; +//import com.epmet.commons.mybatis.entity.DataScope; +//import org.apache.ibatis.executor.statement.StatementHandler; +//import org.apache.ibatis.mapping.BoundSql; +//import org.apache.ibatis.mapping.MappedStatement; +//import org.apache.ibatis.mapping.SqlCommandType; +//import org.apache.ibatis.plugin.*; +//import org.apache.ibatis.reflection.MetaObject; +//import org.apache.ibatis.reflection.SystemMetaObject; +// +//import java.sql.Connection; +//import java.util.Map; +//import java.util.Properties; +// +///** +// * 数据过滤 +// * +// * @author Mark sunlightcs@gmail.com +// * @since 1.0.0 +// */ +//@Intercepts({@Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class, Integer.class})}) +//public class DataFilterInterceptorBak extends AbstractSqlParserHandler implements Interceptor { +// +// @Override +// public Object intercept(Invocation invocation) throws Throwable { +// StatementHandler statementHandler = (StatementHandler) PluginUtils.realTarget(invocation.getTarget()); +// MetaObject metaObject = SystemMetaObject.forObject(statementHandler); +// +// // SQL解析 +// this.sqlParser(metaObject); +// +// // 先判断是不是SELECT操作 +// MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement"); +// if (!SqlCommandType.SELECT.equals(mappedStatement.getSqlCommandType())) { +// return invocation.proceed(); +// } +// +// // 针对定义了rowBounds,做为mapper接口方法的参数 +// BoundSql boundSql = (BoundSql) metaObject.getValue("delegate.boundSql"); +// String originalSql = boundSql.getSql(); +// Object paramObj = boundSql.getParameterObject(); +// +// // 判断参数里是否有DataScope对象 +// DataScope scope = null; +// if (paramObj instanceof DataScope) { +// scope = (DataScope) paramObj; +// } else if (paramObj instanceof Map) { +// for (Object arg : ((Map) paramObj).values()) { +// if (arg instanceof DataScope) { +// scope = (DataScope) arg; +// break; +// } +// } +// } +// +// // 不用数据过滤 +// if (scope == null) { +// return invocation.proceed(); +// } +// +// // 拼接新SQL +// String orderBy = "ORDER BY"; +// String groupBy = "GROUP BY"; +// if (originalSql.indexOf(groupBy) > -1) { +// originalSql = originalSql.replace(groupBy, scope.getSqlFilter() + groupBy); +// } else if (originalSql.indexOf(orderBy) > -1) { +// originalSql = originalSql.replace(orderBy, scope.getSqlFilter() + orderBy); +// } else { +// originalSql = originalSql + scope.getSqlFilter(); +// } +// +// // 重写SQL +// metaObject.setValue("delegate.boundSql.sql", originalSql); +// return invocation.proceed(); +// } +// +// @Override +// public Object plugin(Object target) { +// if (target instanceof StatementHandler) { +// return Plugin.wrap(target, this); +// } +// return target; +// } +// +// @Override +// public void setProperties(Properties properties) { +// +// } +//} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/RequirePermission.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/RequirePermission.java new file mode 100644 index 0000000000..3a5fe74459 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/RequirePermission.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 http://www.renren.io + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.epmet.commons.tools.annotation; + +import java.lang.annotation.*; + +/** + * 权限注解 + * @Author wxz + * @Description + * @Date 2020/4/23 16:17 + **/ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface RequirePermission { + + String key() default ""; + + String desc() default ""; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/AccessOpeAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/AccessOpeAspect.java new file mode 100644 index 0000000000..eeeedc6508 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/AccessOpeAspect.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.aspect; + +import com.epmet.commons.tools.annotation.RequirePermission; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.stereotype.Component; + +/** + * 每次请求,过滤Api中配置的权限key出来 + * @Author wxz + * @Description + * @Date 2020/4/23 16:16 + **/ +@Aspect +@Component +public class AccessOpeAspect { + + /** + * 存储所需操作权限的 ThreadLocal + */ + public static final ThreadLocal requirePermissionTl = new ThreadLocal<>(); + + @Before("@annotation(com.epmet.commons.tools.annotation.RequirePermission)") + public void before(JoinPoint point) throws Throwable { + // 取RequirePermission注解 + MethodSignature methodSignature = (MethodSignature) point.getSignature(); + RequirePermission requirePermissionAnno = methodSignature.getMethod().getAnnotation(RequirePermission.class); + String key = requirePermissionAnno.key(); + String desc = requirePermissionAnno.desc(); + System.out.println(key); + System.out.println(desc); + + // 放入ThreadLocal,供DataFilterAspect中使用 + requirePermissionTl.set(key); + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index d07777427a..6fc0a1cbf5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -27,7 +27,8 @@ public enum EpmetErrorCode { MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), CANNOT_AUDIT_WARM(8201, "请完善居民信息"), - NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"); + NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), + REQUIRE_PERMISSION(8203, "没有足够的操作权限"); private int code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java index 5a035ffa80..e49e03d52d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java @@ -44,6 +44,8 @@ public class RenExceptionHandler { private ModuleConfig moduleConfig; @Autowired private LogProducer logProducer; + @Autowired + private LoginUserUtil loginUserUtil; /** * 处理自定义异常 @@ -120,7 +122,7 @@ public class RenExceptionHandler { //登录用户ID - log.setCreator(LoginUserUtil.getLoginUserId()); + log.setCreator(loginUserUtil.getLoginUserId()); //异常信息 log.setErrorInfo(ExceptionUtils.getErrorStackTrace(ex)); 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 bfb7e6dc67..7088bb10a3 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 @@ -67,6 +67,6 @@ public class GovTokenDto extends BaseTokenDto implements Serializable { /** * 功能权限列表,实际上是gov_staff => staff_role => role_operation查询到的operationKey */ - private List permissions; + private Set permissions; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java index 2b249bee22..088a26eb73 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java @@ -1,33 +1,82 @@ package com.epmet.commons.tools.security.user; -import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.utils.HttpContextUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; +import java.util.List; /** * 登录用户相关工具 */ +@Component public class LoginUserUtil { + //@Autowired + //private + /** * 查询登录用户的id * @return */ - public static String getLoginUserId() { + public String getLoginUserId() { HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); if (request == null) { return null; } - String userId = request.getHeader(Constant.USER_KEY); + String userId = request.getHeader(AppClientConstant.USER_ID); if (StringUtils.isBlank(userId)) { return null; } return userId; } + + /** + * 登录用户的App头信息 + * @return + */ + public String getLoginUserApp() { + HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + if (request == null) { + return null; + } + + String app = request.getHeader(AppClientConstant.APP); + if (StringUtils.isBlank(app)) { + return null; + } + return app; + } + + /** + * 获取登录用户client头信息 + * @return + */ + public String getLoginUserClient() { + HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + if (request == null) { + return null; + } + + String client = request.getHeader(AppClientConstant.CLIENT); + if (StringUtils.isBlank(client)) { + return null; + } + return client; + } + + /** + * 获取用户的部门ID列表 + * @return + */ + public List getLoginUserDepartments() { + String loginUserId = getLoginUserId(); + String loginUserApp = getLoginUserApp(); + String loginUserClient = getLoginUserClient(); + // todo + return null; + } } diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 57d6203598..7ccab3e048 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -157,12 +157,12 @@ lb://resi-partymember-server - - lb://gov-access-server + http://127.0.0.1:8099 + - - lb://gov-mine-server + http://127.0.0.1:8098 + diff --git a/epmet-gateway/src/main/java/com/epmet/filter/FeignRequestFilter.java b/epmet-gateway/src/main/java/com/epmet/filter/FeignRequestFilter.java index 1b98025d7c..1da14ce7ef 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/FeignRequestFilter.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/FeignRequestFilter.java @@ -1,5 +1,6 @@ package com.epmet.filter; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.security.dto.BaseTokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; @@ -54,7 +55,7 @@ public class FeignRequestFilter implements GlobalFilter, UserTokenFilter { if (baseTokenDto != null) { ServerHttpRequest build = exchange.getRequest().mutate() - .header(Constant.USER_KEY, new String[]{baseTokenDto.getUserId()}).build(); + .header(AppClientConstant.USER_ID, new String[]{baseTokenDto.getUserId()}).build(); return chain.filter(exchange.mutate().request(build).build()); } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java index b800d6bc1a..56907e52af 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java @@ -3,7 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; -import java.util.List; +import java.util.Set; @Data public class StaffPermCacheFormDTO { @@ -13,27 +13,32 @@ public class StaffPermCacheFormDTO { */ public interface UpdatePermissionCache {} + /** + * 查询当前权限列表 + */ + public interface GetStaffCurrPermissions {} + /** * 工作人员 id */ - @NotBlank(message = "工作人员ID不能为空", groups = {UpdatePermissionCache.class}) + @NotBlank(message = "工作人员ID不能为空", groups = {UpdatePermissionCache.class, GetStaffCurrPermissions.class}) private String staffId; /** * 登录头信息app */ - @NotBlank(message = "登录头信息app不能为空", groups = {UpdatePermissionCache.class}) + @NotBlank(message = "登录头信息app不能为空", groups = {UpdatePermissionCache.class, GetStaffCurrPermissions.class}) private String app; /** * 登录头信息client */ - @NotBlank(message = "登录头信息client不能为空", groups = {UpdatePermissionCache.class}) + @NotBlank(message = "登录头信息client不能为空", groups = {UpdatePermissionCache.class, GetStaffCurrPermissions.class}) private String client; /** * 权限列表 */ - private List permissions; + private Set permissions; } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java index 0f7eaf4920..aa954dc584 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; +import java.util.Set; /** * 权限相关Api @@ -36,8 +36,19 @@ public class AccessController { String staffId = staffPermCacheFormDTO.getStaffId(); String app = staffPermCacheFormDTO.getApp(); String client = staffPermCacheFormDTO.getClient(); - List permissions = staffPermCacheFormDTO.getPermissions(); + Set permissions = staffPermCacheFormDTO.getPermissions(); accessService.updatePermissionCache(staffId, app, client, permissions); return new Result(); } + + /** + * 查询用户当前权限列表(DataFilterAspect中用到) + * @return + */ + @PostMapping("getcurrpermissions") + public Result> getStaffCurrPermissions(@RequestBody StaffPermCacheFormDTO dto) { + ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); + Set permissions = accessService.listStaffCurrPermissions(dto.getApp(), dto.getClient(), dto.getStaffId()); + return new Result>().ok(permissions); + } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java index cbf51355d1..a9e5150db8 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java @@ -1,6 +1,6 @@ package com.epmet.service; -import java.util.List; +import java.util.Set; public interface AccessService { /** @@ -8,5 +8,11 @@ public interface AccessService { * @param staffId * @param permissions */ - void updatePermissionCache(String staffId, String app, String client, List permissions); + void updatePermissionCache(String staffId, String app, String client, Set permissions); + + /** + * 查询用户当前权限列表 + * @return + */ + Set listStaffCurrPermissions(String app, String client, String staffId); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index e391283e94..cd846aa3b8 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -7,8 +7,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; -import java.util.List; +import java.util.HashSet; +import java.util.Set; @Service public class AccessServiceImpl implements AccessService { @@ -24,7 +26,7 @@ public class AccessServiceImpl implements AccessService { * @param permissions */ @Override - public void updatePermissionCache(String staffId, String app, String client, List permissions) { + public void updatePermissionCache(String staffId, String app, String client, Set permissions) { GovTokenDto govTokenDto = cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); if (govTokenDto == null) { logger.warn("更新[{}]用户缓存:Redis中不存在该用户TokenDto缓存信息", staffId); @@ -37,4 +39,13 @@ public class AccessServiceImpl implements AccessService { cpUserDetailRedis.set(govTokenDto, expire); logger.warn("更新[{}]用户缓存成功。", staffId); } + + @Override + public Set listStaffCurrPermissions(String app, String client, String staffId) { + GovTokenDto govTokenDto = cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); + if (govTokenDto == null || CollectionUtils.isEmpty(govTokenDto.getPermissions())) { + return new HashSet<>(); + } + return new HashSet<>(govTokenDto.getPermissions()); + } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql index 67e7a5c7b2..bcc1d74a5d 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql @@ -61,7 +61,7 @@ CREATE TABLE `role_operation` ( CREATE TABLE `role_scope` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', - `PERMISSION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '权限key', + `SCOPE_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围Key', `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java index 9cef45a3b4..173e19243a 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java @@ -29,14 +29,21 @@ public class AccessController { @Autowired private AccessService accessService; + /** + * 查询用户可操作功能列表(包含缓存) + * @param tokenDto + * @param staffOperationDTO + * @return + */ @PostMapping("getstaffoperations") public Result> getStaffOperations(@LoginUser TokenDto tokenDto, @RequestBody StaffOperationDTO staffOperationDTO) { //public Result> getStaffOperations(@RequestBody StaffOperationDTO staffOperationDTO) { String agencyId = staffOperationDTO.getAgencyId(); String gridId = staffOperationDTO.getGridId(); String staffId = tokenDto.getUserId(); - Set opeKeys = accessService.listOpeKeysByStaffId(staffId, agencyId, gridId); + String app = tokenDto.getApp(); + String client = tokenDto.getClient(); + Set opeKeys = accessService.listOpeKeysByStaffId(app, client, staffId,agencyId, gridId); return new Result>().ok(opeKeys); } - } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java index facacdb301..8cb514ad3f 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -2,14 +2,13 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.form.StaffPermCacheFormDTO; import com.epmet.dto.result.RoleOperationResultDTO; import com.epmet.feign.fallback.GovAccessFeignClientFallback; -import com.epmet.feign.fallback.GovOrgFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -20,6 +19,19 @@ import java.util.List; @FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) public interface GovAccessFeignClient { + /** + * 根据角色ID查询角色权限列表 + * @param roleId + * @return + */ @PostMapping("/gov/access/role/operations/{roleId}") Result> listOperationsByRoleId(@PathVariable("roleId") String roleId); + + /** + * 刷新用户权限缓存 + * @param staffPermCacheFormDTO + * @return + */ + @PostMapping("/gov/access/access/updatepermissioncache") + Result updatePermissionCache(@RequestBody StaffPermCacheFormDTO staffPermCacheFormDTO); } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java index 0fc5df6a94..3e9fc8e415 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java @@ -3,14 +3,11 @@ 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.StaffRoleDTO; -import com.epmet.dto.form.StaffRoleFormDTO; -import com.epmet.dto.result.CustomerGridByUserIdResultDTO; -import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.dto.form.StaffPermCacheFormDTO; import com.epmet.dto.result.RoleOperationResultDTO; -import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovAccessFeignClient; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -25,4 +22,14 @@ public class GovAccessFeignClientFallback implements GovAccessFeignClient { public Result> listOperationsByRoleId(String roleId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listOperationsByRoleId"); } + + /** + * 刷新用户权限缓存 + * @param staffPermCacheFormDTO + * @return + */ + @Override + public Result updatePermissionCache(@RequestBody StaffPermCacheFormDTO staffPermCacheFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "updatePermissionCache"); + } } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/AccessService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/AccessService.java index bb213bd94d..9866ea9ffd 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/AccessService.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/AccessService.java @@ -12,8 +12,7 @@ import java.util.Set; public interface AccessService { /** * 根据staffId查询角色Key列表 - * @param staffId * @return */ - Set listOpeKeysByStaffId(String staffId, String agencyId, String gridId); + Set listOpeKeysByStaffId(String app, String client, String staffId, String agencyId, String gridId); } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index c7823cd335..1da258978a 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -1,8 +1,9 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.form.StaffPermCacheFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.dto.result.RoleOperationResultDTO; import com.epmet.feign.EpmetUserFeignClient; @@ -26,8 +27,11 @@ public class AccessServiceImpl implements AccessService { @Autowired private GovAccessFeignClient govAccessFeignClient; + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + @Override - public Set listOpeKeysByStaffId(String staffId, String agencyId, String gridId) { + public Set listOpeKeysByStaffId(String app, String client, String staffId, String agencyId, String gridId) { List roleDTOS = new ArrayList<>(); // 查询机关单位权限 StaffRoleFormDTO formDTO = new StaffRoleFormDTO(); @@ -56,6 +60,14 @@ public class AccessServiceImpl implements AccessService { } }); }); + + // 将最新权限缓存到redis,为了尽量统一操作入口,调用gov-access接口实现 + StaffPermCacheFormDTO staffPermCacheFormDTO = new StaffPermCacheFormDTO(); + staffPermCacheFormDTO.setApp(app); + staffPermCacheFormDTO.setClient(client); + staffPermCacheFormDTO.setStaffId(staffId); + staffPermCacheFormDTO.setPermissions(opeKeys); + govAccessFeignClient.updatePermissionCache(staffPermCacheFormDTO); return opeKeys; } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 1c13ea4518..884db53afd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -60,6 +60,7 @@ public class StaffRoleController { * @return */ @PostMapping("staffsinrole") + //@RequirePermission(key = "org_staff_list") public Result> getStaffsInRole(@RequestBody StaffRoleFormDTO staffRoleFormDTO) { ValidatorUtils.validateEntity(staffRoleFormDTO, StaffRoleFormDTO.GetStaffsInRole.class); String roleKey = staffRoleFormDTO.getRoleKey(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index ddcd8abe3b..739d20e945 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -108,6 +108,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl listStaffsInRole(String roleKey, String orgId) { return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId); } From d5b49c215836dc9b2e38d855934d1d1f464db231 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Fri, 24 Apr 2020 14:09:33 +0800 Subject: [PATCH 071/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E3=80=81=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 1 + .../java/com/epmet/dto/GridStaffCountDTO.java | 21 ++++++ .../main/java/com/epmet/dto/UserIdDTO.java | 21 ++++++ .../com/epmet/dto/form/AddGridFormDTO.java | 31 ++++++++ .../com/epmet/dto/form/DeleteGridFormDTO.java | 30 ++++++++ .../com/epmet/dto/form/EditGridFormDTO.java | 31 ++++++++ .../epmet/dto/result/AddGridResultDTO.java | 21 ++++++ .../com/epmet/controller/GridController.java | 37 +++++++++- .../java/com/epmet/dao/CustomerGridDao.java | 38 ++++++++++ .../com/epmet/feign/EpmetUserFeignClient.java | 5 ++ .../EpmetUserFeignClientFallBack.java | 6 ++ .../epmet/service/CustomerGridService.java | 27 ++++++- .../service/impl/CustomerGridServiceImpl.java | 74 ++++++++++++++++--- .../main/resources/mapper/CustomerGridDao.xml | 56 ++++++++++++++ .../controller/CustomerStaffController.java | 9 ++- .../java/com/epmet/dao/CustomerStaffDao.java | 12 ++- .../epmet/service/CustomerStaffService.java | 9 +++ .../impl/CustomerStaffServiceImpl.java | 15 ++++ .../resources/mapper/CustomerStaffDao.xml | 12 +++ 19 files changed, 436 insertions(+), 20 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/GridStaffCountDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/UserIdDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DeleteGridFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddGridResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 6fc0a1cbf5..01d63ec781 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -25,6 +25,7 @@ public enum EpmetErrorCode { AUTO_CONFIRM_FAILED(8103, "党员注册失败"), MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"), MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), + NOT_DEL_GRID(8106,"该网格存在工作人员,不允许删除"), CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/GridStaffCountDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/GridStaffCountDTO.java new file mode 100644 index 0000000000..fcdbe3ed04 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/GridStaffCountDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-24 9:13 + */ +@Data +public class GridStaffCountDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格下未被禁用的工作人员数量 + */ + private Integer enableCount; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/UserIdDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/UserIdDTO.java new file mode 100644 index 0000000000..65ed41cab6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/UserIdDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-24 9:06 + */ +@Data +public class UserIdDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * userId + */ + private String userId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java new file mode 100644 index 0000000000..95df5fca15 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-23 16:42 + */ +@Data +public class AddGridFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机构id + */ + private String agencyId; + + /** + * 新建网格名称 + */ + private String gridName; + + /** + * 管辖区域 + */ + private String manageDistrict; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DeleteGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DeleteGridFormDTO.java new file mode 100644 index 0000000000..ed266210ba --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DeleteGridFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-23 19:18 + */ +@Data +public class DeleteGridFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 工作人员id + */ + private String staffId; + + /** + * userId + */ + private String userId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java new file mode 100644 index 0000000000..2c5556f7a3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-23 19:12 + */ +@Data +public class EditGridFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * gridId 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 管理区域 + */ + private String manageDistrict; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddGridResultDTO.java new file mode 100644 index 0000000000..eedf5c895a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddGridResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-23 16:45 + */ +@Data +public class AddGridResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * gridId 网格id + */ + private String gridId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index 2f2b919b20..f3b19c5027 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -1,7 +1,13 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AddGridFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.DeleteGridFormDTO; +import com.epmet.dto.form.EditGridFormDTO; +import com.epmet.dto.result.AddGridResultDTO; import com.epmet.dto.result.GridDetailResultDTO; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -21,16 +27,41 @@ public class GridController { @Autowired private CustomerGridService customerGridService; + /** + * 获取网格详情 + * @param customerGridFormDTO + * @return + */ @PostMapping("griddetail") - public Result griddetail(@RequestBody CustomerGridFormDTO customerGridFormDTO){ + public Result gridDetail(@LoginUser TokenDto tokenDto,@RequestBody CustomerGridFormDTO customerGridFormDTO){ Result griddetail = customerGridService.griddetail(customerGridFormDTO); return griddetail; } - /*@PostMapping("addgrid") + /** + * 新建当前机关下的所属网格 + */ + @PostMapping("addgrid") + public Result addGrid(@LoginUser TokenDto tokenDto, @RequestBody AddGridFormDTO addGridFormDTO){ + return customerGridService.addGrid(tokenDto,addGridFormDTO); + } + + /** + * 管理员修改网格信息 + */ @PostMapping("editgrid") + public Result editGrid(@LoginUser TokenDto tokenDto, @RequestBody EditGridFormDTO editGridFormDTO){ + return customerGridService.editGrid(tokenDto,editGridFormDTO); - @PostMapping("deletegrid")*/ + } + + /** + * 删除网格 + */ + @PostMapping("deletegrid") + public Result deleteGrid(@LoginUser TokenDto tokenDto, @RequestBody DeleteGridFormDTO deleteGridFormDTO){ + return customerGridService.deleteGrid(tokenDto,deleteGridFormDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index d387278ec5..d15a7c7032 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -18,15 +18,19 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.DeleteGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.AddGridResultDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.GridDetailResultDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -86,4 +90,38 @@ public interface CustomerGridDao extends BaseDao { */ List selectUserIdByGridId(CustomerGridFormDTO customerGridFormDTO); + /** + * 根据userId查询customerId + * @param userId + * @return + */ + String selectCustomerIdByUserId(@Param("userId") String userId); + + /** + * 根据pid查询pids + * @param pid + * @return + */ + String selectPidsByPid(@Param("pid")String pid); + + /** + * 根据gridName查询gridId + * @param gridName + * @return + */ + String selectGridIdByGridName(@Param("gridName")String gridName); + + /** + * 编辑网格信息 + * @param customerGridDTO + */ + void editGrid(CustomerGridDTO customerGridDTO); + + /** + * 删除网格 + * @param deleteGridFormDTO + */ + void deleteGrid(DeleteGridFormDTO deleteGridFormDTO); + + } \ 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 217d37c0bb..42465e7055 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 @@ -2,6 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.*; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; @@ -9,6 +10,7 @@ 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.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -43,4 +45,7 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/customerstaff/staffsinagency") Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); + @PostMapping(value = "/epmetuser/customerstaff/selectgridstaffcountbyuserid") + Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO); + } 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 a4cf20b805..aa0149a726 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 @@ -3,6 +3,7 @@ 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.*; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; @@ -32,4 +33,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoForHome", fromDTO); } + + @Override + public Result selectGridStaffCountByUserId(UserIdDTO userIdDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectGridStaffCountByUserId", userIdDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 5d427e434a..41390fe5e5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -18,15 +18,18 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AddGridResultDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.GridDetailResultDTO; import com.epmet.entity.CustomerGridEntity; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -130,4 +133,24 @@ public interface CustomerGridService extends BaseService { * @return */ Result griddetail(CustomerGridFormDTO customerGridFormDTO); + + /** + * 新建当前机关下的所属网格 + */ + Result addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO); + + /** + * 修改网格信息 + * @param tokenDto + * @param editGridFormDTO + */ + Result editGrid(TokenDto tokenDto,EditGridFormDTO editGridFormDTO); + + /** + * 删除网格 + * @param tokenDto + * @param deleteGridFormDTO + * @return + */ + Result deleteGrid(TokenDto tokenDto,DeleteGridFormDTO deleteGridFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index da136fb56a..a53a6bac1c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -21,15 +21,17 @@ 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.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerGridDao; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.*; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AddGridResultDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.GridDetailResultDTO; @@ -43,10 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 客户网格表 @@ -169,6 +168,11 @@ public class CustomerGridServiceImpl extends BaseServiceImpl>().ok(baseDao.getMyGrids(userId)); } + /** + * 查询网格详情 + * @param customerGridFormDTO + * @return + */ @Override public Result griddetail(CustomerGridFormDTO customerGridFormDTO) { GridDetailResultDTO griddetail = baseDao.griddetail(customerGridFormDTO); @@ -178,4 +182,56 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(griddetail); } + @Override + @Transactional(rollbackFor = Exception.class) + public Result addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) { + CustomerGridEntity customerGridEntity = new CustomerGridEntity(); + customerGridEntity.setCustomerId(baseDao.selectCustomerIdByUserId(tokenDto.getUserId())); + customerGridEntity.setGridName(addGridFormDTO.getGridName()); + customerGridEntity.setDelFlag("0"); + customerGridEntity.setCreatedBy(tokenDto.getUserId()); + customerGridEntity.setUpdatedBy(tokenDto.getUserId()); + customerGridEntity.setTotalUser(0); + customerGridEntity.setManageDistrict(addGridFormDTO.getManageDistrict()); + customerGridEntity.setPid(addGridFormDTO.getAgencyId()); + customerGridEntity.setPids(baseDao.selectPidsByPid(addGridFormDTO.getAgencyId())); + baseDao.insert(customerGridEntity); + String gridId = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName()); + AddGridResultDTO addGridResultDTO = new AddGridResultDTO(); + addGridResultDTO.setGridId(gridId); + return new Result().ok(addGridResultDTO); + } + + /** + * 修改网格信息 + * @param tokenDto + * @param editGridFormDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result editGrid(TokenDto tokenDto, EditGridFormDTO editGridFormDTO) { + CustomerGridDTO customerGridDTO = new CustomerGridDTO(); + customerGridDTO.setManageDistrict(editGridFormDTO.getManageDistrict()); + customerGridDTO.setGridName(editGridFormDTO.getGridName()); + customerGridDTO.setUpdatedBy(tokenDto.getUserId()); + customerGridDTO.setId(editGridFormDTO.getGridId()); + baseDao.editGrid(customerGridDTO); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result deleteGrid(TokenDto tokenDto,DeleteGridFormDTO deleteGridFormDTO) { + UserIdDTO userIdDTO = new UserIdDTO(); + userIdDTO.setUserId(tokenDto.getUserId()); + deleteGridFormDTO.setUserId(tokenDto.getUserId()); + Result gridStaffCountDTOResult = epmetUserFeignClient.selectGridStaffCountByUserId(userIdDTO); + if (gridStaffCountDTOResult.getData().getEnableCount()==0){ + baseDao.deleteGrid(deleteGridFormDTO); + }else { + return new Result().error(EpmetErrorCode.NOT_DEL_GRID.getCode()); + } + return new Result(); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 574084079e..c7a54db7b9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -138,4 +138,60 @@ AND grid_id = #{gridId} + + + + + + + + + + + + update + customer_grid + set + grid_name = #{gridName}, + manage_district = #{manageDistrict}, + updated_by = #{updatedBy} + where + id = #{id} + + + + + update + customer_grid + set + updated_by = #{userId}, + del_flag = 1 + where + id = #{gridId} + + \ 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 42c39a6022..b3aa12f74a 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 @@ -25,9 +25,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; 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.CustomerStaffDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.*; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; @@ -155,4 +153,9 @@ public class CustomerStaffController { public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { return customerStaffService.getStaffInfoForHome(fromDTO); } + + @PostMapping(value = "selectgridstaffcountbyuserid") + public Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO){ + return customerStaffService.selectGridStaffCountByUserId(userIdDTO); + } } \ 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 b552832c2d..3026894e00 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 @@ -18,14 +18,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.*; 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; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -58,6 +58,12 @@ public interface CustomerStaffDao extends BaseDao { CustomerStaffDTO selectStaffInfoByUserId(CustomerStaffDTO formDTO); + /** + * 根据userId查询网格下未被禁用的人员数量 + * @param userIdDTO + * @return + */ + GridStaffCountDTO selectGridStaffCountByUserId(UserIdDTO userIdDTO); /** * 根据userId查询查询网格下的用户信息 * 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 4a7ceb335f..1fe7ce3442 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 @@ -20,6 +20,8 @@ package com.epmet.service; 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.*; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; @@ -140,4 +142,11 @@ public interface CustomerStaffService extends BaseService { * @return */ Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); + + /** + * 根据userId查询网格下未被禁用的人员数量 + * @param userIdDTO + * @return + */ + Result selectGridStaffCountByUserId(UserIdDTO userIdDTO); } \ 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 560fe0008c..5756cb4fce 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 @@ -27,6 +27,8 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserConstant; import com.epmet.dao.CustomerStaffDao; +import com.epmet.dto.*; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; @@ -156,4 +158,17 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(list); } + /** + * 根据userId查询网格下未被禁用的人员数量 + * @param userIdDTO + * @return + */ + @Override + public Result selectGridStaffCountByUserId(UserIdDTO userIdDTO) { + Result gridStaffCountDTOResult = new Result(); + GridStaffCountDTO gridStaffCountDTO = baseDao.selectGridStaffCountByUserId(userIdDTO); + gridStaffCountDTOResult.setData(gridStaffCountDTO); + return gridStaffCountDTOResult; + } + } \ 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 ab8ad974a5..a98e30cf86 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,18 @@ AND cs.del_flag = 0 + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 8259bfb9a8..14fe8a45ca 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -23,9 +23,20 @@ r.* FROM staff_role sr - INNER JOIN gov_staff_role r ON ( sr.ROLE_ID = r.ID ) + INNER JOIN gov_staff_role r ON ( sr.ROLE_ID = r.ID ) AND r.DEL_FLAG = '0' WHERE sr.STAFF_ID = #{staffId} AND sr.ORG_ID = #{orgId} + AND sr.DEL_FLAG = '0' + + \ No newline at end of file From 97a9c6f1f80ed09198a9157588d6d3a6b9059ccc Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Fri, 24 Apr 2020 15:34:19 +0800 Subject: [PATCH 073/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=B7=BB=E5=8A=A0=E6=80=A7=E5=88=AB=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/StaffGridListDTO.java | 5 ++++ .../controller/DepartmentController.java | 30 +++++++++++++++++++ .../resources/mapper/CustomerStaffDao.xml | 3 +- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java index dc25ece228..263405df0c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java @@ -31,4 +31,9 @@ public class StaffGridListDTO { */ private String roleName; + /** + * 性别 + */ + private String gender; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java new file mode 100644 index 0000000000..9a0a04187b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -0,0 +1,30 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AddDepartmentFormDTO; +import com.epmet.service.CustomerStaffDepartmentService; +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; + +/** + * @Auther zxc + * @Create 2020-04-24 14:48 + */ +@RestController +@RequestMapping(value = "/department") +public class DepartmentController { + + @Autowired + private CustomerStaffDepartmentService customerStaffDepartmentService; + + @PostMapping(value = "adddepartmentstaff") + public Result addDepartmentStaff(@LoginUser TokenDto tokenDto, @RequestBody AddDepartmentFormDTO addDepartmentFormDTO){ + return null; + } + +} 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 0e596339f9..33c42ff406 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 @@ -30,7 +30,8 @@ cs.id AS staffId, cs.real_name AS staffName, cs.head_photo AS staffHeadPhoto, - gsr.role_name AS roleName + gsr.role_name AS roleName, + cs.gender FROM customer_staff cs LEFT JOIN gov_staff_role gsr ON cs.user_id = gsr.id From e359eafb8050097f320b92c7c614c5baf208e331 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 24 Apr 2020 15:47:40 +0800 Subject: [PATCH 074/174] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=92=8CorgId=E6=9F=A5=E8=AF=A2=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=90=8D=E7=A7=B0=EF=BC=8C=E8=A7=92=E8=89=B2?= =?UTF-8?q?key=E7=9A=84=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/GovStaffRoleResultDTO.java | 56 +++++++++++++++++++ .../epmet/controller/StaffRoleController.java | 8 +-- .../main/java/com/epmet/dao/StaffRoleDao.java | 4 +- .../com/epmet/service/StaffRoleService.java | 3 +- .../service/impl/StaffRoleServiceImpl.java | 3 +- .../main/resources/mapper/StaffRoleDao.xml | 5 +- 6 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java new file mode 100644 index 0000000000..6123f16677 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Data +public class GovStaffRoleResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private String roleId; + + /** + * 人员id + */ + private String staffId; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 884db53afd..795b0a34d9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -3,8 +3,8 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.StaffRoleFormDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; @@ -61,12 +61,12 @@ public class StaffRoleController { */ @PostMapping("staffsinrole") //@RequirePermission(key = "org_staff_list") - public Result> getStaffsInRole(@RequestBody StaffRoleFormDTO staffRoleFormDTO) { + public Result> getStaffsInRole(@RequestBody StaffRoleFormDTO staffRoleFormDTO) { ValidatorUtils.validateEntity(staffRoleFormDTO, StaffRoleFormDTO.GetStaffsInRole.class); String roleKey = staffRoleFormDTO.getRoleKey(); String orgId = staffRoleFormDTO.getOrgId(); - List staffRoleDTOS = staffRoleService.listStaffsInRole(roleKey, orgId); - return new Result>().ok(staffRoleDTOS); + List staffRoleDTOS = staffRoleService.listStaffsInRole(roleKey, orgId); + return new Result>().ok(staffRoleDTOS); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 40d4b47b00..309068b1c8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -18,7 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -39,5 +39,5 @@ public interface StaffRoleDao extends BaseDao { * @param orgId * @return */ - List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); + List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index 7ba2d5e83b..f4f15edf0c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.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.StaffRoleDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.entity.StaffRoleEntity; import java.util.List; @@ -99,5 +100,5 @@ public interface StaffRoleService extends BaseService { * @param orgId * @return */ - List listStaffsInRole(String roleKey, String orgId); + List listStaffsInRole(String roleKey, String orgId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 739d20e945..db7d154b22 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.StaffRoleDao; import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.entity.StaffRoleEntity; import com.epmet.redis.StaffRoleRedis; import com.epmet.service.StaffRoleService; @@ -109,7 +110,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl listStaffsInRole(String roleKey, String orgId) { + public List listStaffsInRole(String roleKey, String orgId) { return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId); } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 0cbdc611f6..45937ae7f1 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -18,9 +18,8 @@ - + SELECT sr.STAFF_ID, sr.ROLE_ID, r.ROLE_NAME, r.ROLE_KEY FROM staff_role sr INNER JOIN gov_staff_role r ON ( sr.ROLE_ID = r.ID ) From 2ee793e872b6243e8a5acf2092e89f755c3613f1 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 24 Apr 2020 16:02:39 +0800 Subject: [PATCH 075/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=A8=A1=E5=9D=97=E9=83=A8=E5=88=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 4 +- .../epmet/dto/form/AddDepartmentFormDTO.java | 53 +++++ .../dto/form/DepartmentInAgencyFormDTO.java | 43 ++++ .../epmet/dto/form/DepartmentListFormDTO.java | 43 ++++ .../dto/form/DepartmentdetailFormDTO.java | 43 ++++ .../epmet/dto/form/EditDepartmentFormDTO.java | 54 +++++ .../dto/form/RemoveDepartmentFormDTO.java | 42 ++++ .../dto/result/AddDepartmentResultDTO.java | 40 ++++ .../result/DepartInStaffListResultDTO.java | 60 ++++++ .../dto/result/DepartmentDetailResultDTO.java | 57 +++++ .../result/DepartmentInAgencyResultDTO.java | 47 ++++ .../dto/result/DepartmentListResultDTO.java | 49 +++++ .../constant/CustomerDepartmentConstant.java | 30 +++ .../controller/DepartmentController.java | 110 ++++++++++ .../com/epmet/dao/CustomerDepartmentDao.java | 21 +- .../epmet/dao/CustomerStaffDepartmentDao.java | 6 +- .../com/epmet/feign/EpmetUserFeignClient.java | 11 + .../EpmetUserFeignClientFallBack.java | 8 + .../com/epmet/service/DepartmentService.java | 80 +++++++ .../service/impl/DepartmentServiceImpl.java | 200 ++++++++++++++++++ .../resources/mapper/CustomerAgencyDao.xml | 5 +- .../mapper/CustomerStaffDepartmentDao.xml | 10 + .../dto/form/DepartmentInStaffFormDTO.java | 33 +++ .../com/epmet/constant/UserRoleConstant.java | 6 + .../controller/CustomerStaffController.java | 14 +- .../java/com/epmet/dao/CustomerStaffDao.java | 10 + .../epmet/service/CustomerStaffService.java | 10 + .../impl/CustomerStaffServiceImpl.java | 18 ++ .../resources/mapper/CustomerStaffDao.xml | 17 ++ 29 files changed, 1118 insertions(+), 6 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentInAgencyFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentListFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentdetailFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveDepartmentFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentInAgencyResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerDepartmentConstant.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index d07777427a..fab7dfae57 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -27,7 +27,9 @@ public enum EpmetErrorCode { MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), CANNOT_AUDIT_WARM(8201, "请完善居民信息"), - NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"); + NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), + NOT_DEL_AGENCY_PER(8203, "该机关存在工作人员,不允许删除"), + NOT_DEL_DEPARTMENT(8204, "该部门存在工作人员,不允许删除"); private int code; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java new file mode 100644 index 0000000000..07e5b1f0f4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 添加部门-接口入参 + * + * @author sun + */ +@Data +public class AddDepartmentFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 所属组织机构ID(customer_agency.id) + */ + @NotBlank(message = "组织机构Id不能为空") + private String agencyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentInAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentInAgencyFormDTO.java new file mode 100644 index 0000000000..bb70330a2c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentInAgencyFormDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 组织首页-获取机关下部门列表-接口入参 + * + * @author sun + */ +@Data +public class DepartmentInAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + @NotBlank(message = "组织机构ID不能为空") + private String agencyId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentListFormDTO.java new file mode 100644 index 0000000000..a651dad1c3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentListFormDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 获取部门列表-接口入参 + * + * @author sun + */ +@Data +public class DepartmentListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + @NotBlank(message = "组织机构ID不能为空") + private String agencyId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentdetailFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentdetailFormDTO.java new file mode 100644 index 0000000000..8e01785bf2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentdetailFormDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 获取部门详情-接口入参 + * + * @author sun + */ +@Data +public class DepartmentdetailFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + @NotBlank(message = "部门ID不能为空") + private String departmentId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java new file mode 100644 index 0000000000..949ac45ace --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 部门信息修改-接口入参 + * + * @author sun + */ +@Data +public class EditDepartmentFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + @NotBlank(message = "部门ID不能为空") + private String departmentId; + + /** + * 部门名称 + */ + @NotBlank(message = "部门名称不能为空") + private String departmentName; + + /** + * 部门职责 + */ + @NotBlank(message = "部门职责不能为空") + private String departmentDuty; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveDepartmentFormDTO.java new file mode 100644 index 0000000000..749a157deb --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveDepartmentFormDTO.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 删除部门-接口入参 + * + * @author sun + */ +@Data +public class RemoveDepartmentFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + @NotBlank(message = "部门ID不能为空") + private String departmentId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java new file mode 100644 index 0000000000..b6206d0c6d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 添加部门-接口返参 + * + * @author sun + */ +@Data +public class AddDepartmentResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 新增部门Id + */ + private String departmentId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java new file mode 100644 index 0000000000..e63020a209 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 获取部门详情-部门下工作人员列表 + * + * @author sun + */ +@Data +public class DepartInStaffListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String staffId; + + /** + * 用户姓名 + */ + private String staffName; + + /** + * 用户头像 + */ + private String staffHeadPhoto; + + /** + * 性别 + */ + private Integer gender; + + /** + * 角色名称 + */ + private String roleName; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java new file mode 100644 index 0000000000..d36a4222ee --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 获取部门详情-接口返参 + * + * @author sun + */ +@Data +public class DepartmentDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + /** + * 部门下工作人员列表 + */ + private List staffList; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentInAgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentInAgencyResultDTO.java new file mode 100644 index 0000000000..33880e5c1b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentInAgencyResultDTO.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 组织首页-获取机关下部门列表-接口返参 + * + * @author sun + */ +@Data +public class DepartmentInAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关下总部门数 + */ + private Integer departmentCount; + + /** + * 机关下部门列表 + */ + private List departmentList; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java new file mode 100644 index 0000000000..7fafa0238d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 组织首页-获取机关下部门列表-部门详情数据 + * + * @author sun + */ +@Data +public class DepartmentListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门下总人数 + */ + private Integer totalUser; +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerDepartmentConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerDepartmentConstant.java new file mode 100644 index 0000000000..2a530cba0b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerDepartmentConstant.java @@ -0,0 +1,30 @@ +package com.epmet.constant; + +/** + * @author sun + * @dscription + */ +public interface CustomerDepartmentConstant { + + /** + * 部门信息编辑修改失败 + */ + String UPDATE_EXCEPTION = "部门信息更新失败"; + /** + * 添加部门失败 + */ + String SAVE_EXCEPTION = "添加部门失败"; + /** + * 部门删除失败 + */ + String DEL_EXCEPTION = "删除部门失败"; + /** + * 查询用户基本信息失败 + */ + String SELECT_STAFFINFO_EXCEPTION = "根据用户Id未查询到用户基本信息"; + + /** + * 查询部门人员角色 + */ + String SELECT_ROLE_EXCEPTION = "查询部门人员角色失败"; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java new file mode 100644 index 0000000000..05189cdc57 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.service.DepartmentService; +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 java.util.List; + + +/** + * 部门 + * + * @author sun + */ +@RestController +@RequestMapping("department") +public class DepartmentController { + + @Autowired + private DepartmentService departmentService; + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加部门 + */ + @PostMapping("adddepartment") + public Result addDepartment(@RequestBody AddDepartmentFormDTO formDTO) { + return departmentService.addDepartment(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 部门信息修改 + */ + @PostMapping("editdepartment") + public Result editDepartment(@RequestBody EditDepartmentFormDTO formDTO) { + return departmentService.editDepartment(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除部门 + */ + @PostMapping("removedepartment") + public Result removeDepartment(@RequestBody RemoveDepartmentFormDTO formDTO) { + return departmentService.removeDepartment(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取部门详情 + */ + @PostMapping("departmentdetail") + public Result departmentDetail(@RequestBody DepartmentdetailFormDTO formDTO) { + return departmentService.departmentDetail(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取机关下部门列表 + */ + @PostMapping("departmentinagencylist") + public Result departmentInAgencyList(@RequestBody DepartmentInAgencyFormDTO formDTO) { + return departmentService.departmentInAgencyList(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取机构下部门列表 + */ + @PostMapping("departmentlist") + public Result> departmentList(@RequestBody DepartmentListFormDTO formDTO) { + return departmentService.departmentList(formDTO); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java index bd188f8351..b7569a1396 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java @@ -18,8 +18,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.DepartmentListResultDTO; +import com.epmet.dto.result.SubListResultDTO; import com.epmet.entity.CustomerDepartmentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 客户部门表 @@ -29,5 +34,19 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerDepartmentDao extends BaseDao { - + + /** + * @param agencyId + * @return + * @Author sun + * @Description 根据当前机关Id查询该机关下的直属部门列表,只查询前十条 + **/ + List selectDepartmentListByAgencyId(@Param("agencyId") String agencyId); + /** + * @param agencyId + * @return + * @Author sun + * @Description 根据当前机关Id查询该机关下的直属部门列表 + **/ + List selectDepartmentList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java index 8a79a0dd2e..dfdba500d7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java @@ -20,6 +20,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.CustomerStaffDepartmentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 部门人员关系表 @@ -29,5 +32,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerStaffDepartmentDao extends BaseDao { - + + List selectUserIdByDepartmentId(@Param("departmentId") String departmentId); } \ 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 217d37c0bb..c9e67f87ff 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,7 +5,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.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; @@ -43,4 +45,13 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/customerstaff/staffsinagency") Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); + /** + * @param departmentInStaffFormDTO + * @return + * @Author sun + * @Description 根据客户Id及userId集合查询用户基本信息 + */ + @PostMapping("/epmetuser/customerstaff/getdepartmentstafflist") + Result> getDepartmentStaffList(DepartmentInStaffFormDTO departmentInStaffFormDTO); + } 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 a4cf20b805..dd508f6f12 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,7 +6,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.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -32,4 +34,10 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoForHome", fromDTO); } + + @Override + public Result> getDepartmentStaffList(DepartmentInStaffFormDTO departmentInStaffFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getDepartmentStaffList", departmentInStaffFormDTO); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java new file mode 100644 index 0000000000..48fe029fb0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; + +import java.util.List; + +/** + * 机关单位信息 + * + * @author sun + */ +public interface DepartmentService { + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加部门 + */ + Result addDepartment(AddDepartmentFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 部门信息修改 + */ + Result editDepartment(EditDepartmentFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除部门 + */ + Result removeDepartment(RemoveDepartmentFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取部门详情 + */ + Result departmentDetail(DepartmentdetailFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取机关下部门列表 + */ + Result departmentInAgencyList(DepartmentInAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取机构下部门列表 + */ + Result> departmentList(DepartmentListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java new file mode 100644 index 0000000000..263daff4ac --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -0,0 +1,200 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.CustomerDepartmentConstant; +import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dao.CustomerDepartmentDao; +import com.epmet.dao.CustomerStaffDepartmentDao; +import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.CustomerDepartmentEntity; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.service.DepartmentService; +import com.epmet.util.ModuleConstant; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; + +/** + * 机关单位信息 + * + * @author sun + */ +@Service +public class DepartmentServiceImpl implements DepartmentService { + + private static final Logger log = LoggerFactory.getLogger(DepartmentServiceImpl.class); + @Autowired + private CustomerAgencyDao customerAgencyDao; + @Autowired + private CustomerDepartmentDao customerDepartmentDao; + @Autowired + private CustomerStaffDepartmentDao customerStaffDepartmentDao; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加部门 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result addDepartment(AddDepartmentFormDTO formDTO) { + Result result = new Result(); + AddDepartmentResultDTO addDepartmentResultDTO = new AddDepartmentResultDTO(); + CustomerDepartmentEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerDepartmentEntity.class); + entity.setTotalUser(NumConstant.ZERO); + //1:查询当前组织机构信息,获取客户Id + CustomerAgencyEntity parentEntity = customerAgencyDao.selectById(formDTO.getAgencyId()); + entity.setCustomerId(parentEntity.getCustomerId()); + //2:保存部门信息 + if (customerDepartmentDao.insert(entity) < NumConstant.ONE) { + log.error(CustomerDepartmentConstant.SAVE_EXCEPTION); + throw new RenException(CustomerDepartmentConstant.SAVE_EXCEPTION); + } + //3:返回新部门Id + addDepartmentResultDTO.setDepartmentId(entity.getId()); + return result.ok(addDepartmentResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 部门信息修改 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result editDepartment(EditDepartmentFormDTO formDTO) { + Result result = new Result(); + CustomerDepartmentEntity entity = new CustomerDepartmentEntity(); + entity.setId(formDTO.getDepartmentId()); + entity.setDepartmentName(formDTO.getDepartmentName()); + entity.setDepartmentDuty(formDTO.getDepartmentDuty()); + if (customerDepartmentDao.updateById(entity) < NumConstant.ONE) { + log.error(CustomerDepartmentConstant.UPDATE_EXCEPTION); + throw new RenException(CustomerDepartmentConstant.UPDATE_EXCEPTION); + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除部门 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result removeDepartment(RemoveDepartmentFormDTO formDTO) { + Result result = new Result(); + //1:判断当前部门下是否存在工作人员,不存在的可以删除 + CustomerDepartmentEntity entity = customerDepartmentDao.selectById(formDTO.getDepartmentId()); + if (null != entity && entity.getTotalUser() > NumConstant.ZERO) { + result.setCode(EpmetErrorCode.NOT_DEL_DEPARTMENT.getCode()); + result.setMsg(EpmetErrorCode.NOT_DEL_DEPARTMENT.getMsg()); + return result; + } + //2:删除部门信息(逻辑删) + if (customerDepartmentDao.deleteById(formDTO.getDepartmentId()) < NumConstant.ONE) { + log.error(CustomerDepartmentConstant.DEL_EXCEPTION); + throw new RenException(CustomerDepartmentConstant.DEL_EXCEPTION); + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取部门详情 + */ + @Override + public Result departmentDetail(DepartmentdetailFormDTO formDTO) { + Result result = new Result(); + DepartmentDetailResultDTO departmentDetailResultDTO = new DepartmentDetailResultDTO(); + //1:根据部门Id查询部门详情信息 + CustomerDepartmentEntity entity = customerDepartmentDao.selectById(formDTO.getDepartmentId()); + departmentDetailResultDTO = ConvertUtils.sourceToTarget(entity, DepartmentDetailResultDTO.class); + departmentDetailResultDTO.setDepartmentId(entity.getId()); + //2:查询部门下工作人员的用户Id集合 + List userIdList = customerStaffDepartmentDao.selectUserIdByDepartmentId(formDTO.getDepartmentId()); + if (null == userIdList || userIdList.size() < NumConstant.ONE) { + return result.ok(departmentDetailResultDTO); + } + DepartmentInStaffFormDTO departmentInStaffFormDTO = new DepartmentInStaffFormDTO(); + //部门Id用于查询部门领导角色使用 + departmentInStaffFormDTO.setDepartmentId(formDTO.getDepartmentId()); + departmentInStaffFormDTO.setCustomerId(entity.getCustomerId()); + departmentInStaffFormDTO.setUserIdList(userIdList); + //3:调用epmet_user服务,查询人员基本信息,按姓名对应的拼音升序 + Result> resultList = epmetUserFeignClient.getDepartmentStaffList(departmentInStaffFormDTO); + if (!resultList.success() || null == resultList.getData()) { + log.error(CustomerDepartmentConstant.SELECT_STAFFINFO_EXCEPTION); + throw new RenException(CustomerDepartmentConstant.SELECT_STAFFINFO_EXCEPTION); + } + //部门下所有工作人员基本信息 + List staffList = resultList.getData(); + departmentDetailResultDTO.setStaffList(staffList); + return new Result().ok(departmentDetailResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取机关下部门列表 + */ + @Override + public Result departmentInAgencyList(DepartmentInAgencyFormDTO formDTO) { + DepartmentInAgencyResultDTO departmentInAgencyResultDTO = new DepartmentInAgencyResultDTO(); + //1:根据当前机关Id查询该机关下的直属部门列表 + List departmentList = customerDepartmentDao.selectDepartmentListByAgencyId(formDTO.getAgencyId()); + departmentInAgencyResultDTO.setDepartmentList(departmentList); + //2:统计下一级机关数 + departmentInAgencyResultDTO.setDepartmentCount(departmentList.size()); + return new Result().ok(departmentInAgencyResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取机构下部门列表 + */ + @Override + public Result> departmentList(DepartmentListFormDTO formDTO) { + List departmentList = customerDepartmentDao.selectDepartmentList(formDTO.getAgencyId()); + return new Result>().ok(departmentList); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 50ff491aa3..90b926b729 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -57,7 +57,8 @@ FROM customer_agency WHERE del_flag = '0' AND pid = #{pId} - ORDER BY CREATED_TIME DESC + ORDER BY created_time DESC + LIMIT 10 \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 5ab8b90e9c..86c597d402 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -15,6 +15,16 @@ + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java new file mode 100644 index 0000000000..5810659515 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 根据客户Id和用户Id查询用户基本信息 + * @Author sun + */ +@Data +public class DepartmentInStaffFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 用户Id集合 + */ + private List userIdList; + +} + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java index ce710319bd..48b3e77940 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java @@ -11,4 +11,10 @@ public interface UserRoleConstant { * 角色表对应的是居民角色时grid_id的默认值 */ String DEFAULT_GRID_ID = "all"; + + /** + * 部门领导角色值 + */ + String DEPT_LEADER = "dept_leader"; + } 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 42c39a6022..38fa2fcc45 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 @@ -28,9 +28,10 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; 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.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.excel.CustomerStaffExcel; import com.epmet.service.CustomerStaffService; @@ -155,4 +156,15 @@ public class CustomerStaffController { public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { return customerStaffService.getStaffInfoForHome(fromDTO); } + + /** + * @param fromDTO + * @return + * @Author sun + * @Description 根据客户Id及userId集合查询用户基本信息 + */ + @PostMapping("getdepartmentstafflist") + public Result> getDepartmentStaffList(DepartmentInStaffFormDTO fromDTO) { + return customerStaffService.getDepartmentStaffList(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 b552832c2d..c6c000bf3c 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,7 +22,9 @@ 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.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import org.apache.ibatis.annotations.Mapper; @@ -82,4 +84,12 @@ public interface CustomerStaffDao extends BaseDao { * @Date 2020/4/23 16:46 **/ CustomerStaffEntity selectByUserId(String userId); + + /** + * @param fromDTO + * @return + * @Author sun + * @Description 根据客户Id及userId集合查询用户基本信息 + */ + List selectDepartmentStaffList(DepartmentInStaffFormDTO fromDTO); } \ No newline at end of file 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 4a7ceb335f..1388b741b9 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 @@ -24,7 +24,9 @@ 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.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; @@ -140,4 +142,12 @@ public interface CustomerStaffService extends BaseService { * @return */ Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); + + /** + * @param fromDTO + * @return + * @Author sun + * @Description 根据客户Id及userId集合查询用户基本信息 + */ + Result> getDepartmentStaffList(DepartmentInStaffFormDTO 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 560fe0008c..5d8ef70ba5 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 @@ -22,16 +22,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; 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.utils.Result; import com.epmet.constant.UserConstant; +import com.epmet.constant.UserRoleConstant; import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.DepartmentInStaffFormDTO; +import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import com.epmet.redis.CustomerStaffRedis; @@ -156,4 +162,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(list); } + @Override + public Result> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { + //1:根据userId集合查询人员基本信息 + List list = baseDao.selectDepartmentStaffList(formDTO); + //2:根据部门Id查询部门下是领导角色的用户 + StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); + staffRoleFormDTO.setOrgId(formDTO.getDepartmentId()); + staffRoleFormDTO.setRoleKey(UserRoleConstant.DEPT_LEADER); + + 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 ab8ad974a5..d8d149da1f 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 @@ -79,4 +79,21 @@ cs.DEL_FLAG = '0' AND CS.USER_ID =#{userId} + \ No newline at end of file From bfa6577b539ede7b267a689b35cc8aaff10820d9 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 24 Apr 2020 16:19:56 +0800 Subject: [PATCH 076/174] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 6 ++-- .../controller/DepartmentController.java | 33 +++++-------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index e8c528e2ea..161c9cd9ef 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -29,10 +29,10 @@ public enum EpmetErrorCode { CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), - REQUIRE_PERMISSION(8203, "没有足够的操作权限"), - NOT_DEL_AGENCY(8204, "该机关存在下级机关,不允许删除"), NOT_DEL_AGENCY_PER(8205, "该机关存在工作人员,不允许删除"), - NOT_DEL_DEPARTMENT(8206, "该部门存在工作人员,不允许删除"); + NOT_DEL_DEPARTMENT(8206, "该部门存在工作人员,不允许删除"), + + REQUIRE_PERMISSION(8301, "没有足够的操作权限"); private int code; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java index 9a36b7399a..33a1d7fe87 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -2,13 +2,12 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.AddDepartmentFormDTO; -import com.epmet.service.CustomerStaffDepartmentService; - import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.*; -import com.epmet.dto.result.*; +import com.epmet.dto.result.AddDepartmentResultDTO; +import com.epmet.dto.result.DepartmentDetailResultDTO; +import com.epmet.dto.result.DepartmentInAgencyResultDTO; +import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.service.DepartmentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -16,27 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -/** - * @Auther zxc - * @Create 2020-04-24 14:48 - */ -@RestController -@RequestMapping(value = "/department") -public class DepartmentController { - - @Autowired - private CustomerStaffDepartmentService customerStaffDepartmentService; - - @PostMapping(value = "adddepartmentstaff") - public Result addDepartmentStaff(@LoginUser TokenDto tokenDto, @RequestBody AddDepartmentFormDTO addDepartmentFormDTO){ - return null; - } - -} - import java.util.List; - /** * 部门 * @@ -49,6 +29,11 @@ public class DepartmentController { @Autowired private DepartmentService departmentService; + @PostMapping(value = "adddepartmentstaff") + public Result addDepartmentStaff(@LoginUser TokenDto tokenDto, @RequestBody AddDepartmentFormDTO addDepartmentFormDTO){ + return null; + } + /** * @param formDTO * @return From 93ebde2984365eabe250414e9f016f2e43d30b05 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Fri, 24 Apr 2020 16:27:14 +0800 Subject: [PATCH 077/174] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E4=BA=BA=E5=91=98dto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/AddDepartmentFormDTO.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java index 07e5b1f0f4..1188979f4a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java @@ -1,3 +1,4 @@ +package com.epmet.dto.form; /** * Copyright 2018 人人开源 https://www.renren.io *

@@ -15,12 +16,19 @@ * along with this program. If not, see . */ -package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; + +/** + * 添加部门人员DTO + * @Auther zxc + * @Create 2020-04-24 14:51 +import javax.validation.constraints.NotBlank; +import java.io.Serializable; /** @@ -33,6 +41,16 @@ public class AddDepartmentFormDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + *部门id + */ + private String departmentId; + + /** + * 选中人员id + */ + private List selectedList; + /** * 所属组织机构ID(customer_agency.id) */ From 71bb41f1da6f2079fa854a99ccd74a7126fd8ab3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 24 Apr 2020 16:45:12 +0800 Subject: [PATCH 078/174] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ilResultDTO.java => AgencysResultDTO.java} | 7 +- .../epmet/controller/AgencyController.java | 4 +- .../java/com/epmet/service/AgencyService.java | 12 +- .../epmet/service/CustomerAgencyService.java | 45 +------ .../epmet/service/impl/AgencyServiceImpl.java | 28 ++-- .../impl/CustomerAgencyServiceImpl.java | 124 ------------------ 6 files changed, 19 insertions(+), 201 deletions(-) rename epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/{AgencydetailResultDTO.java => AgencysResultDTO.java} (91%) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencydetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java similarity index 91% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencydetailResultDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index 4fed7005d9..e372d86d8d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencydetailResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -19,18 +19,17 @@ package com.epmet.dto.result; import lombok.Data; -import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.List; /** - * 组织首页-获取组织机构信息接口返参 + * 添加组织-接口返参 * * @author sun */ @Data -public class AgencydetailResultDTO implements Serializable { +public class AgencysResultDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -77,6 +76,4 @@ public class AgencydetailResultDTO implements Serializable { * 本机关的所有上级机关 */ private List parentList; - - } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 82cd76e7c3..b8b8300489 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -21,7 +21,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.*; import com.epmet.dto.result.AddAgencyResultDTO; import com.epmet.dto.result.AgencyListResultDTO; -import com.epmet.dto.result.AgencydetailResultDTO; +import com.epmet.dto.result.AgencysResultDTO; import com.epmet.dto.result.SubAgencyResultDTO; import com.epmet.service.AgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -85,7 +85,7 @@ public class AgencyController { * @Description 组织首页-获取组织机构信息 */ @PostMapping("agencydetail") - public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) { + public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) { return agencyService.agencyDetail(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index f811f71f80..f2edc0c462 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -17,16 +17,14 @@ package com.epmet.service; -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.CustomerAgencyDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.*; -import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.dto.result.AddAgencyResultDTO; +import com.epmet.dto.result.AgencyListResultDTO; +import com.epmet.dto.result.AgencysResultDTO; +import com.epmet.dto.result.SubAgencyResultDTO; import java.util.List; -import java.util.Map; /** * 机关单位信息 @@ -65,7 +63,7 @@ public interface AgencyService { * @Author sun * @Description 组织首页-获取组织机构信息 */ - Result agencyDetail(AgencydetailFormDTO formDTO); + Result agencyDetail(AgencydetailFormDTO formDTO); /** * @param formDTO 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 7076fe6d2d..62892b4576 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 @@ -21,11 +21,8 @@ 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.CustomerAgencyDTO; -import com.epmet.dto.form.*; -import com.epmet.dto.result.AddAgencyResultDTO; -import com.epmet.dto.result.AgencydetailResultDTO; +import com.epmet.dto.form.StaffOrgFormDTO; import com.epmet.dto.result.StaffOrgsResultDTO; -import com.epmet.dto.result.SubAgencyResultDTO; import com.epmet.entity.CustomerAgencyEntity; import java.util.List; @@ -107,44 +104,4 @@ 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-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index ae13436d6a..a71c53e80a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -17,26 +17,17 @@ 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.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; 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.utils.Result; import com.epmet.constant.CustomerAgencyConstant; import com.epmet.dao.CustomerAgencyDao; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; -import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.AgencyService; -import com.epmet.service.CustomerAgencyService; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -45,7 +36,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; -import java.util.Map; /** * 机关单位信息 @@ -146,24 +136,24 @@ public class AgencyServiceImpl implements AgencyService { * @Description 组织首页-获取组织机构信息 */ @Override - public Result agencyDetail(AgencydetailFormDTO formDTO) { - AgencydetailResultDTO agencydetailResultDTO = new AgencydetailResultDTO(); + public Result agencyDetail(AgencydetailFormDTO formDTO) { + AgencysResultDTO agencysResultDTO = new AgencysResultDTO(); //1:查询本机关详细信息 CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getAgencyId()); if (null == entity) { - return new Result().ok(agencydetailResultDTO); + return new Result().ok(agencysResultDTO); } - agencydetailResultDTO = ConvertUtils.sourceToTarget(entity, AgencydetailResultDTO.class); - agencydetailResultDTO.setAgencyId(entity.getId()); - agencydetailResultDTO.setAgencyName(entity.getOrganizationName()); + agencysResultDTO = ConvertUtils.sourceToTarget(entity, AgencysResultDTO.class); + agencysResultDTO.setAgencyId(entity.getId()); + agencysResultDTO.setAgencyName(entity.getOrganizationName()); //2:查询本机关的所有上级机关,按自上而下层级顺序 if (null == entity.getPids()) { - return new Result().ok(agencydetailResultDTO); + return new Result().ok(agencysResultDTO); } List listStr = Arrays.asList(entity.getPids().split(":")); List parentList = customerAgencyDao.selectPAgencyById(listStr); - agencydetailResultDTO.setParentList(parentList); - return new Result().ok(agencydetailResultDTO); + agencysResultDTO.setParentList(parentList); + return new Result().ok(agencysResultDTO); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index eb1d83a8ae..06f83a0d25 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -138,128 +138,4 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl>().ok(list); } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 添加组织 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Result addAgency(AddAgencyFormDTO formDTO) { - Result result = new Result(); - AddAgencyResultDTO addAgencyResultDTO = new AddAgencyResultDTO(); - //0:属性映射赋值 - CustomerAgencyEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); - entity.setOrganizationName(formDTO.getAgencyName()); - entity.setTotalUser(NumConstant.ZERO); - //1:查询上级机关信息 - CustomerAgencyEntity parentEntity = baseDao.selectById(formDTO.getPid()); - entity.setCustomerId(parentEntity.getCustomerId()); - if (null == parentEntity.getPid()) { - entity.setPids(parentEntity.getId()); - entity.setAllParentName(parentEntity.getOrganizationName()); - } else { - entity.setPids(":" + parentEntity.getId()); - entity.setAllParentName("-" + parentEntity.getOrganizationName()); - } - //2:保存组织信息 - if (baseDao.insert(entity) < NumConstant.ONE) { - logger.error(CustomerAgencyConstant.SAVE_EXCEPTION); - throw new RenException(CustomerAgencyConstant.SAVE_EXCEPTION); - } - //3:返回新组织Id - addAgencyResultDTO.setAgencyId(entity.getId()); - return result.ok(addAgencyResultDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 组织名称编辑 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Result editAgency(EditAgencyFormDTO formDTO) { - Result result = new Result(); - CustomerAgencyEntity entity = new CustomerAgencyEntity(); - entity.setId(formDTO.getAgencyId()); - entity.setOrganizationName(formDTO.getAgencyName()); - if (baseDao.updateById(entity) < NumConstant.ONE) { - logger.error(CustomerAgencyConstant.UPDATE_EXCEPTION); - throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); - } - return result; - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 删除组织机关 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Result removeAgency(RemoveAgencyFormDTO formDTO) { - Result result = new Result(); - //1:查询当前机关是否存在所属下级机关,存在下级的不能删除 - List agencyList = baseDao.selectSubAgencyById(formDTO.getAgencyId()); - if (null != agencyList && agencyList.size() > NumConstant.ZERO) { - result.setCode(EpmetErrorCode.NOT_DEL_AGENCY.getCode()); - result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg()); - return result; - } - //2:删除当前机关组织(逻辑删) - if (baseDao.deleteById(formDTO.getAgencyId()) < NumConstant.ONE) { - logger.error(CustomerAgencyConstant.DEL_EXCEPTION); - throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); - } - return result; - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 组织首页-获取组织机构信息 - */ - @Override - public Result agencyDetail(AgencydetailFormDTO formDTO) { - AgencydetailResultDTO agencydetailResultDTO = new AgencydetailResultDTO(); - //1:查询本机关详细信息 - CustomerAgencyEntity entity = baseDao.selectById(formDTO.getAgencyId()); - if (null == entity) { - return new Result().ok(agencydetailResultDTO); - } - agencydetailResultDTO = ConvertUtils.sourceToTarget(entity, AgencydetailResultDTO.class); - agencydetailResultDTO.setAgencyId(entity.getId()); - agencydetailResultDTO.setAgencyName(entity.getOrganizationName()); - //2:查询本机关的所有上级机关,按自上而下层级顺序 - if (null == entity.getPids()) { - return new Result().ok(agencydetailResultDTO); - } - List listStr = Arrays.asList(entity.getPids().split(":")); - List parentList = baseDao.selectPAgencyById(listStr); - agencydetailResultDTO.setParentList(parentList); - return new Result().ok(agencydetailResultDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 组织首页-下级机关列表 - */ - @Override - public Result subAgencyList(SubAgencyFormDTO formDTO) { - SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO(); - //1:根据当前机关Id查询直属下一级机关列表 - List agencyList = baseDao.selectSubAgencyById(formDTO.getAgencyId()); - subAgencyResultDTO.setAgencyList(agencyList); - //2:统计下一级机关数 - subAgencyResultDTO.setSubAgencyCount(agencyList.size()); - return new Result().ok(subAgencyResultDTO); - } } \ No newline at end of file From 75d662aabc233e3f0afa3a9f031e552edb354aa9 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 24 Apr 2020 16:51:22 +0800 Subject: [PATCH 079/174] =?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?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/StaffSubmitFromDTO.java | 8 ++ .../dto/result/StaffDetailResultDTO.java | 3 +- .../com/epmet/controller/StaffController.java | 23 ++--- .../com/epmet/feign/EpmetUserFeignClient.java | 67 +++++++++++++- .../EpmetUserFeignClientFallBack.java | 39 ++++++++ .../java/com/epmet/service/StaffService.java | 5 +- .../epmet/service/impl/StaffServiceImpl.java | 39 +++++--- .../epmet/constant/CustomerStaffConstant.java | 34 +++++++ .../controller/CustomerStaffController.java | 88 +++++++++++++++--- .../main/java/com/epmet/dao/StaffRoleDao.java | 8 ++ .../com/epmet/service/StaffRoleService.java | 6 ++ .../impl/CustomerStaffServiceImpl.java | 89 +++++++++++++++++-- .../service/impl/StaffRoleServiceImpl.java | 6 ++ .../main/resources/mapper/StaffRoleDao.xml | 8 ++ 14 files changed, 381 insertions(+), 42 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/constant/CustomerStaffConstant.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java index 2ac8a066b0..87ffa6f26b 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java @@ -50,4 +50,12 @@ public class StaffSubmitFromDTO implements Serializable { */ @NotBlank(message = "角色不能为空") private List roles; + /** + * 来源app(政府端:gov、居民端:resi、运营端:oper) + */ + private String app; + /** + * 来源client(PC端:web、微信小程序:wxmp) + */ + private String client; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffDetailResultDTO.java index 34a6aa6fb3..c6cf9ea90e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffDetailResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffDetailResultDTO.java @@ -4,6 +4,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Date; import java.util.List; /** @@ -38,7 +39,7 @@ public class StaffDetailResultDTO implements Serializable { /** * 激活时间 */ - private String activeTime; + private Date activeTime; /** * 性别 */ 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 index b8450650aa..6964cffec3 100644 --- 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 @@ -2,6 +2,8 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; @@ -13,6 +15,7 @@ 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.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -34,7 +37,7 @@ public class StaffController { * @return */ @PostMapping("staffsinagency") - public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + public Result getStaffInfoForHome(@RequestBody StaffsInAgencyFromDTO fromDTO) { return staffService.getStaffInfoForHome(fromDTO); } @@ -46,7 +49,7 @@ public class StaffController { * @author zhaoqifeng */ @PostMapping("stafflist") - public Result> getStaffList(StaffsInAgencyFromDTO fromDTO){ + public Result> getStaffList(@RequestBody StaffsInAgencyFromDTO fromDTO){ return staffService.getStaffList(fromDTO); } @@ -58,7 +61,7 @@ public class StaffController { * @return Result */ @PostMapping("rolelist") - public Result addStaffInit(StaffInfoFromDTO fromDTO){ + public Result addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ return staffService.addStaffInit(fromDTO); } @@ -69,7 +72,7 @@ public class StaffController { * @return Result */ @PostMapping("editstaffinit") - public Result editStaffInit(StaffInfoFromDTO fromDTO){ + public Result editStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ return staffService.editStaffInit(fromDTO); } @@ -80,8 +83,8 @@ public class StaffController { * @return Result */ @PostMapping("addstaff") - public Result addStaff(StaffSubmitFromDTO fromDTO){ - return staffService.addStaff(fromDTO); + public Result addStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitFromDTO fromDTO){ + return staffService.addStaff(tokenDto, fromDTO); } /** @@ -91,8 +94,8 @@ public class StaffController { * @return Result */ @PostMapping("editstaff") - public Result editStaff(StaffSubmitFromDTO fromDTO){ - return staffService.editStaff(fromDTO); + public Result editStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitFromDTO fromDTO){ + return staffService.editStaff(tokenDto, fromDTO); } /** @@ -102,7 +105,7 @@ public class StaffController { * @return Result */ @PostMapping("staffdetail") - public Result getStaffDetail(StaffInfoFromDTO fromDTO){ + public Result getStaffDetail(@RequestBody StaffInfoFromDTO fromDTO){ return staffService.getStaffDetail(fromDTO); } @@ -113,7 +116,7 @@ public class StaffController { * @return Result */ @PostMapping("disabledstaff") - public Result disabledStaff(StaffInfoFromDTO fromDTO){ + public Result disabledStaff(@RequestBody StaffInfoFromDTO fromDTO){ return staffService.disabledStaff(fromDTO); } } 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 5ba8ee81f1..98d20c5939 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 @@ -7,9 +7,13 @@ import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.DepartmentInStaffFormDTO; +import com.epmet.dto.form.StaffInfoFromDTO; +import com.epmet.dto.form.StaffSubmitFromDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.result.DepartInStaffListResultDTO; +import com.epmet.dto.result.StaffDetailResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; +import com.epmet.dto.result.StaffInitResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; @@ -34,7 +38,7 @@ public interface EpmetUserFeignClient { * @date 2020/4/22 10:05 **/ @PostMapping(value = "/epmetuser/customerstaff/getstaffinfobyuserid") - Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO); + Result getCustomerStaffInfoByUserId(@RequestBody CustomerStaffDTO formDTO); @PostMapping("/epmetuser/customerstaff/selectstaffgridlistbyuserid") Result> getStaffGridList(@RequestBody List customerStaffGridDTOS); @@ -50,6 +54,67 @@ public interface EpmetUserFeignClient { @PostMapping(value = "/epmetuser/customerstaff/selectgridstaffcountbyuserid") Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO); + /** + * 工作人员列表 + * @param fromDTO + * @return + */ + @PostMapping("/epmetuser/customerstaff/stafflist") + Result> getStaffList(@RequestBody StaffsInAgencyFromDTO fromDTO); + /** + * 人员添加页面初始化 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("/epmetuser/customerstaff/rolelist") + Result addStaffInit(@RequestBody StaffInfoFromDTO fromDTO); + + /** + * 人员编辑页面初始化 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("/epmetuser/customerstaff/editstaffinit") + Result editStaffInit(@RequestBody StaffInfoFromDTO fromDTO); + + /** + * 人员添加 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("/epmetuser/customerstaff/addstaff") + Result addStaff(@RequestBody StaffSubmitFromDTO fromDTO); + + /** + * 人员编辑 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("/epmetuser/customerstaff/editstaff") + Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO); + + /** + * 人员详情 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("/epmetuser/customerstaff/staffdetail") + Result getStaffDetail(@RequestBody StaffInfoFromDTO fromDTO); + + /** + * 人员禁用 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("/epmetuser/customerstaff/disabledstaff") + Result disabledStaff(@RequestBody StaffInfoFromDTO fromDTO); + /** * @param departmentInStaffFormDTO * @return 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 e36abef073..0177e9a6bc 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 @@ -7,10 +7,14 @@ import com.epmet.dto.*; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.StaffInfoFromDTO; +import com.epmet.dto.form.StaffSubmitFromDTO; import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.StaffDetailResultDTO; import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; +import com.epmet.dto.result.StaffInitResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -46,4 +50,39 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getDepartmentStaffList", departmentInStaffFormDTO); } + + @Override + public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "StaffsInAgencyFromDTO", fromDTO); + } + + @Override + public Result addStaffInit(StaffInfoFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaffInit", fromDTO); + } + + @Override + public Result editStaffInit(StaffInfoFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaffInit", fromDTO); + } + + @Override + public Result addStaff(StaffSubmitFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaff", fromDTO); + } + + @Override + public Result editStaff(StaffSubmitFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaff", fromDTO); + } + + @Override + public Result getStaffDetail(StaffInfoFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffDetail", fromDTO); + } + + @Override + public Result disabledStaff(StaffInfoFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "disabledStaff", fromDTO); + } } 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 index ba5f227b95..e11e8edecb 100644 --- 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 @@ -1,5 +1,6 @@ package com.epmet.service; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; @@ -58,7 +59,7 @@ public interface StaffService { * @param fromDTO 参数 * @return Result */ - Result addStaff(StaffSubmitFromDTO fromDTO); + Result addStaff(TokenDto tokenDto, StaffSubmitFromDTO fromDTO); /** * 人员编辑 @@ -66,7 +67,7 @@ public interface StaffService { * @param fromDTO 参数 * @return Result */ - Result editStaff(StaffSubmitFromDTO fromDTO); + Result editStaff(TokenDto tokenDto,StaffSubmitFromDTO fromDTO); /** * 人员详情 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 index 3ef22a3cf6..db4e263508 100644 --- 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 @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffAgencyDTO; import com.epmet.dto.form.StaffInfoFromDTO; @@ -36,6 +37,7 @@ public class StaffServiceImpl implements StaffService { private CustomerAgencyService customerAgencyService; @Autowired private CustomerStaffAgencyService customerStaffAgencyService; + @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { StaffsInAgencyResultDTO resultDTO = new StaffsInAgencyResultDTO(); @@ -51,7 +53,7 @@ public class StaffServiceImpl implements StaffService { List staffIds = customerStaffAgencyList.stream().map(CustomerStaffAgencyDTO::getUserId).collect(Collectors.toList()); fromDTO.setStaffList(staffIds); //获取用户信息 - Result> staffInfoListResult = epmetUserFeignClient.getStaffInfoForHome(fromDTO); + Result> staffInfoListResult = epmetUserFeignClient.getStaffInfoForHome(fromDTO); resultDTO.setStaffList(staffInfoListResult.getData()); return new Result().ok(resultDTO); } @@ -69,37 +71,54 @@ public class StaffServiceImpl implements StaffService { List staffIds = customerStaffAgencyList.stream().map(CustomerStaffAgencyDTO::getUserId).collect(Collectors.toList()); fromDTO.setStaffList(staffIds); //获取用户列表 - Result> staffInfoListResult = epmetUserFeignClient.getStaffInfoForHome(fromDTO); + Result> staffInfoListResult = epmetUserFeignClient.getStaffInfoForHome(fromDTO); return null; } @Override public Result addStaffInit(StaffInfoFromDTO fromDTO) { - return null; + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + return epmetUserFeignClient.addStaffInit(fromDTO); } @Override public Result editStaffInit(StaffInfoFromDTO fromDTO) { - return null; + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + return epmetUserFeignClient.editStaffInit(fromDTO); } @Override - public Result addStaff(StaffSubmitFromDTO fromDTO) { - return null; + public Result addStaff(TokenDto tokenDto, StaffSubmitFromDTO fromDTO) { + fromDTO.setApp(tokenDto.getApp()); + fromDTO.setClient(tokenDto.getClient()); + Result result = epmetUserFeignClient.addStaff(fromDTO); + //机关总人数加一 + if (result.success()) { + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + customerAgencyEntity.setTotalUser(customerAgencyEntity.getTotalUser() + 1); + customerAgencyService.updateById(customerAgencyEntity); + } + return new Result(); } @Override - public Result editStaff(StaffSubmitFromDTO fromDTO) { - return null; + public Result editStaff(TokenDto tokenDto, StaffSubmitFromDTO fromDTO) { + fromDTO.setApp(tokenDto.getApp()); + fromDTO.setClient(tokenDto.getClient()); + return epmetUserFeignClient.editStaff(fromDTO); } @Override public Result getStaffDetail(StaffInfoFromDTO fromDTO) { - return null; + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + return epmetUserFeignClient.getStaffDetail(fromDTO); } @Override public Result disabledStaff(StaffInfoFromDTO fromDTO) { - return null; + return epmetUserFeignClient.disabledStaff(fromDTO); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/CustomerStaffConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/CustomerStaffConstant.java new file mode 100644 index 0000000000..f823247843 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/CustomerStaffConstant.java @@ -0,0 +1,34 @@ +package com.epmet.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/24 15:42 + */ +public interface CustomerStaffConstant { + + /** + * 专职 + */ + String FULL_TIME ="fulltime"; + /** + * 兼职 + */ + String PART_TIME ="parttime"; + /** + * 已激活 + */ + String INACTIVE ="inactive"; + /** + * 未激活 + */ + String ACTIVE ="active"; + /** + * 已禁用 + */ + String DISABLED ="disabled"; + /** + * 未禁用 + */ + String ENABLE ="enable"; +} 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 7daee8f457..f1ed7bd6ba 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 @@ -26,15 +26,11 @@ 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.*; -import com.epmet.dto.form.CustomerGridFormDTO; -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.DepartmentInStaffFormDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.DepartInStaffListResultDTO; +import com.epmet.dto.result.StaffDetailResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; +import com.epmet.dto.result.StaffInitResultDTO; import com.epmet.excel.CustomerStaffExcel; import com.epmet.service.CustomerStaffService; import org.springframework.beans.factory.annotation.Autowired; @@ -145,17 +141,22 @@ public class CustomerStaffController { * @date 2020/4/22 10:05 **/ @PostMapping(value = "getstaffinfobyuserid") - public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + public Result getCustomerStaffInfoByUserId(@RequestBody CustomerStaffDTO formDTO) { return customerStaffService.getCustomerStaffInfoByUserId(formDTO); } + @PostMapping(value = "selectgridstaffcountbyuserid") + public Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO){ + return customerStaffService.selectGridStaffCountByUserId(userIdDTO); + } + /** * 组织首页-工作人员列表 * @param fromDTO * @return */ @PostMapping("staffsinagency") - public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + public Result> getStaffInfoForHome(@RequestBody StaffsInAgencyFromDTO fromDTO) { return customerStaffService.getStaffInfoForHome(fromDTO); } @@ -165,13 +166,74 @@ public class CustomerStaffController { * @return */ @PostMapping("stafflist") - public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { + public Result> getStaffList(@RequestBody StaffsInAgencyFromDTO fromDTO) { return customerStaffService.getStaffList(fromDTO); } - @PostMapping(value = "selectgridstaffcountbyuserid") - public Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO){ - return customerStaffService.selectGridStaffCountByUserId(userIdDTO); + /** + * 人员添加页面初始化 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("rolelist") + public Result addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + return customerStaffService.addStaffInit(fromDTO); + } + + /** + * 人员编辑页面初始化 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("editstaffinit") + public Result editStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + return customerStaffService.editStaffInit(fromDTO); + } + + /** + * 人员添加 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("addstaff") + public Result addStaff(@RequestBody StaffSubmitFromDTO fromDTO){ + return customerStaffService.addStaff(fromDTO); + } + + /** + * 人员编辑 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("editstaff") + public Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO){ + return customerStaffService.editStaff(fromDTO); + } + + /** + * 人员详情 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("staffdetail") + public Result getStaffDetail(@RequestBody StaffInfoFromDTO fromDTO){ + return customerStaffService.getStaffDetail(fromDTO); + } + + /** + * 人员禁用 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("disabledstaff") + public Result disabledStaff(@RequestBody StaffInfoFromDTO fromDTO){ + return customerStaffService.disabledStaff(fromDTO); } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 309068b1c8..f1aaee18e7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -39,5 +39,13 @@ public interface StaffRoleDao extends BaseDao { * @param orgId * @return */ + List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); + + /** + * 删除工作人员权限 + * @param dto + * @return + */ + boolean delStaffRoles(StaffRoleDTO dto); List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index f4f15edf0c..88742d7400 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -101,4 +101,10 @@ public interface StaffRoleService extends BaseService { * @return */ List listStaffsInRole(String roleKey, String orgId); + + /** + * 清空工作人员权限 + * @param dto + */ + void clearStaffRoles(StaffRoleDTO dto); } \ 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 baac7bcde8..7621320bb7 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 @@ -26,6 +26,7 @@ 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.utils.Result; +import com.epmet.constant.CustomerStaffConstant; import com.epmet.constant.UserConstant; import com.epmet.constant.UserRoleConstant; import com.epmet.dao.CustomerStaffDao; @@ -49,9 +50,13 @@ import com.epmet.dto.result.StaffInitResultDTO; import com.epmet.dto.result.StaffRoleResultDTO; import com.epmet.entity.CustomerStaffEntity; import com.epmet.entity.GovStaffRoleEntity; +import com.epmet.entity.StaffRoleEntity; +import com.epmet.entity.UserEntity; import com.epmet.redis.CustomerStaffRedis; import com.epmet.service.CustomerStaffService; import com.epmet.service.GovStaffRoleService; +import com.epmet.service.StaffRoleService; +import com.epmet.service.UserService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -79,7 +84,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -240,23 +248,94 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl { + StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); + staffRoleEntity.setStaffId(userEntity.getId()); + staffRoleEntity.setRoleId(role); + staffRoleEntity.setOrgId(fromDTO.getAgencyId()); + staffRoleService.insert(staffRoleEntity); + }); + + return new Result(); } @Override + @Transactional(rollbackFor = Exception.class) public Result editStaff(StaffSubmitFromDTO fromDTO) { - return null; + CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); + //Customer_Staff表插入数据 + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setId(customerStaffEntity.getId()); + staffEntity.setRealName(fromDTO.getName()); + staffEntity.setMobile(fromDTO.getMobile()); + staffEntity.setGender(fromDTO.getGender()); + staffEntity.setWorkType(fromDTO.getWorkType()); + baseDao.updateById(staffEntity); + + //清空权限关联 + StaffRoleDTO staffRoleDTO = new StaffRoleDTO(); + staffRoleDTO.setStaffId(fromDTO.getStaffId()); + staffRoleDTO.setOrgId(fromDTO.getAgencyId()); + staffRoleService.clearStaffRoles(staffRoleDTO); + //重新添加角色关联 + fromDTO.getRoles().forEach(role -> { + StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); + staffRoleEntity.setStaffId(fromDTO.getStaffId()); + staffRoleEntity.setRoleId(role); + staffRoleEntity.setOrgId(fromDTO.getAgencyId()); + staffRoleService.insert(staffRoleEntity); + }); + return new Result(); } @Override public Result getStaffDetail(StaffInfoFromDTO fromDTO) { - return null; + StaffDetailResultDTO resultDTO = new StaffDetailResultDTO(); + //获取工作人员信息 + CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO); + resultDTO.setStaffId(customerStaffDTO.getUserId()); + resultDTO.setName(customerStaffDTO.getRealName()); + resultDTO.setMobile(customerStaffDTO.getMobile()); + resultDTO.setHeadPhoto(customerStaffDTO.getHeadPhoto()); + resultDTO.setGender(customerStaffDTO.getGender()); + resultDTO.setActiveFlag(customerStaffDTO.getActiveFlag()); + resultDTO.setActiveTime(customerStaffDTO.getActiveTime()); + resultDTO.setEnableFlag(customerStaffDTO.getEnableFlag()); + + //获取工作人员角色 + List staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId()); + List roles = staffRoles.stream().map(GovStaffRoleEntity::getRoleName).collect(Collectors.toList()); + resultDTO.setRoles(roles); + return new Result().ok(resultDTO); } @Override public Result disabledStaff(StaffInfoFromDTO fromDTO) { - return null; + CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setId(customerStaffEntity.getId()); + staffEntity.setEnableFlag(CustomerStaffConstant.DISABLED); + baseDao.updateById(staffEntity); + return new Result(); } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index db7d154b22..0a9d7ce90d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -114,4 +114,10 @@ public class StaffRoleServiceImpl extends BaseServiceImpl + + update + staff_role + set DEL_FLAG = '1' + where STAFF_ID = #{staffId} + and ORG_ID = #{orgId} + and DEL_FLAG = '0' + From f21e3a5a92673a649ffa7441be4cbbeb2cfb653e Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 24 Apr 2020 17:06:31 +0800 Subject: [PATCH 080/174] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E3=80=81=E9=83=A8=E9=97=A8=E5=8F=AF=E9=80=89=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E6=9F=A5=E8=AF=A2=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/CommonGridIdFormDTO.java | 29 ++++++++++++++ .../epmet/dto/form/CustomerGridFormDTO.java | 1 - .../CustomerStaffAgencyController.java | 6 ++- .../com/epmet/controller/GridController.java | 39 +++++++++++++++++++ .../com/epmet/dao/CustomerStaffAgencyDao.java | 13 +++++++ .../com/epmet/feign/EpmetUserFeignClient.java | 11 ++++++ .../EpmetUserFeignClientFallBack.java | 7 ++++ .../service/CustomerStaffAgencyService.java | 11 ++++++ .../service/CustomerStaffGridService.java | 9 ----- .../impl/CustomerStaffAgencyServiceImpl.java | 25 ++++++++++++ .../impl/CustomerStaffGridServiceImpl.java | 14 ------- .../main/resources/mapper/CustomerGridDao.xml | 36 +++++++++-------- .../mapper/CustomerStaffAgencyDao.xml | 31 +++++++++++++++ .../dto/form/CommonUserIdListFormList.java | 26 +++++++++++++ .../dto/result/CommonStaffInfoResultDTO.java | 11 ++++-- .../controller/CustomerStaffController.java | 15 +++++++ .../java/com/epmet/dao/CustomerStaffDao.java | 11 ++++++ .../epmet/service/CustomerStaffService.java | 11 ++++++ .../impl/CustomerStaffServiceImpl.java | 14 +++++++ .../resources/mapper/CustomerStaffDao.xml | 18 +++++++++ 20 files changed, 293 insertions(+), 45 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonGridIdFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormList.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonGridIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonGridIdFormDTO.java new file mode 100644 index 0000000000..936aa4312b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonGridIdFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName CommonGridIdFormDTO + * @Author wangc + * @date 2020.04.24 14:17 + */ +@Data +public class CommonGridIdFormDTO implements Serializable { + private static final long serialVersionUID = 2496019865436084805L; + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空") + private String gridId; + + /** + * 用户Id + * */ + @NotBlank(message = "用户Id不能为空") + private String userId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java index c3c237e83a..c34d3c5870 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java @@ -38,5 +38,4 @@ public class CustomerGridFormDTO implements Serializable { @NotBlank(message = "网格ID不能为空") private String gridId; - } \ No newline at end of file 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..1f6904f416 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 @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -26,6 +28,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.CommonGridIdFormDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.excel.CustomerStaffAgencyExcel; import com.epmet.service.CustomerStaffAgencyService; @@ -103,5 +108,4 @@ public class CustomerStaffAgencyController { public Result getLatestCustomer(@PathVariable("userId") String userId) { 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/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index 2f2b919b20..8367b6fc95 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -1,15 +1,25 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.CommonAgencyIdFormDTO; +import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.GridDetailResultDTO; +import com.epmet.dto.result.GridListInfoResultDTO; import com.epmet.service.CustomerGridService; +import com.epmet.service.CustomerStaffAgencyService; 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 java.util.List; + /** * @Auther zxc * @Create 2020-04-23 9:50 @@ -21,6 +31,8 @@ public class GridController { @Autowired private CustomerGridService customerGridService; + @Autowired + private CustomerStaffAgencyService customerStaffAgencyService; @PostMapping("griddetail") public Result griddetail(@RequestBody CustomerGridFormDTO customerGridFormDTO){ Result griddetail = customerGridService.griddetail(customerGridFormDTO); @@ -33,4 +45,31 @@ public class GridController { @PostMapping("deletegrid")*/ + /** + * @Description 查找指定机构下的网格列表 + * @Param CommonAgencyIdFormDTO -> gridId + * @return Result + * @Author wangc + * @Date 2020.04.23 14:45 + **/ + @PostMapping("gridlist") + public Result gridList(@LoginUser TokenDto tokenDto,@RequestBody CommonAgencyIdFormDTO agencyFormDTO){ + agencyFormDTO.setAgencyId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(agencyFormDTO); + return customerGridService.getGridListByAgency(agencyFormDTO); + } + + /** + * @Description 在给网格添加工作人员时,查询当前机关下没有加入到此网格下的工作人员,禁用的也不能选(不显示) + * @Param CommonGridIdFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.24 14:14 + **/ + @PostMapping("selectablestaffs") + public Result> selectableStaffs(@LoginUser TokenDto tokenDto, @RequestBody CommonGridIdFormDTO gridIdFormDTO){ + gridIdFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(gridIdFormDTO); + return customerStaffAgencyService.getSelectableStaffs(gridIdFormDTO); + } } 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..4691c4ed9b 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 @@ -19,8 +19,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 人员-机关单位关系表 @@ -37,5 +41,14 @@ public interface CustomerStaffAgencyDao extends BaseDao UserId列表 + * @Author wangc + * @Date 2020.04.24 14:01 + **/ + List getSelectableStaffsForGrid(@Param("gridId") String gridId); } \ 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..f17f3e6261 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.CommonUserIdListFormList; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -33,4 +35,13 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/customerstaff/selectstaffgridlistbyuserid") Result> getStaffGridList(@RequestBody List customerStaffGridDTOS); + /** + * @Description 通过userId列表查询未被禁用的用户信息 + * @Param CommonUserIdListFormList :: getUserIdList + * @return Result> + * @Author wangc + * @Date 2020.04.24 15:44 + **/ + @PostMapping("/epmetuser/customerstaff/enabestaffmsglist") + Result> enableStaffMsgList(CommonUserIdListFormList userIdList); } 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..d8940ede62 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.CommonUserIdListFormList; +import com.epmet.dto.result.CommonStaffInfoResultDTO; 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> enableStaffMsgList(CommonUserIdListFormList userIdList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "enableStaffMsgList", userIdList); + } } 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..4f531dc929 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,8 @@ 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.CommonGridIdFormDTO; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; @@ -102,4 +104,13 @@ public interface CustomerStaffAgencyService extends BaseService getLatestCustomer(String userId); + + /** + * @Description 获取添加网格成员的可选人员列表 + * @Param CommonGridIdFormDTO + * @return com.epmet.dto.result.CommonStaffInfoResultDTO[epmet-user-client] + * @Author wangc + * @Date 2020.04.23 16:15 + **/ + Result> getSelectableStaffs(CommonGridIdFormDTO gridIdFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java index 2199eda56d..cf5285b735 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java @@ -106,13 +106,4 @@ public interface CustomerStaffGridService extends BaseService getStaffGridOrderByGridName(LatestGridFormDTO latestGridFormDTO); - - /** - * @Description 获取添加网格成员的可选人员列表 - * @Param CustomerGridFormDTO - * @return com.epmet.dto.result.CommonStaffInfoResultDTO[epmet-user-client] - * @Author wangc - * @Date 2020.04.23 16:15 - **/ - Result> getSelectableStaffs(CustomerGridFormDTO customerGridFormDTO); } \ No newline at end of file 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..df4c0114a5 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 @@ -20,6 +20,7 @@ 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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; @@ -28,6 +29,9 @@ 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.CommonGridIdFormDTO; +import com.epmet.dto.form.CommonUserIdListFormList; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.EpmetUserFeignClient; @@ -39,6 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -133,4 +138,24 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl().ok(resultDTO); } + /** + * @Description 获取添加网格成员的可选人员列表,先在本服务下查询userId,然后调用EpmetUserFeign校验账户是否被禁用,使用EpmetUser服务的DTO作为返回参数 + * @Param CustomerGridFormDTO -> gridId + * @return Result> -> CommonStaffInfoResultDTO [epmet-user-client] + * @Author wangc + * @Date 2020.04.23 16:28 + **/ + @Override + public Result> getSelectableStaffs(CommonGridIdFormDTO customerGridFormDTO) { + //1.去数据库查询是此网格所属机构且不在此网格下的工作人员,这里无法确认是否被禁用 + List userId = baseDao.getSelectableStaffsForGrid(customerGridFormDTO.getGridId()); + //2.去用户服务下拿取用户基本信息,并校验工作人员身份是否被禁用 + if(null != userId && userId.size() >= NumConstant.ONE){ + //直接返回结果 + return epmetUserFeignClient.enableStaffMsgList(new CommonUserIdListFormList(userId)); + + } + return new Result>().ok(new ArrayList<>()); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java index 0f63802be7..4bdf464241 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java @@ -127,18 +127,4 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl().ok(result); } - - /** - * @Description 获取添加网格成员的可选人员列表,先在本服务下查询userId,然后调用EpmetUserFeign校验账户是否被禁用,使用EpmetUser服务的DTO作为返回参数 - * @Param CustomerGridFormDTO -> gridId - * @return Result> -> CommonStaffInfoResultDTO [epmet-user-client] - * @Author wangc - * @Date 2020.04.23 16:28 - **/ - @Override - public Result> getSelectableStaffs(CustomerGridFormDTO customerGridFormDTO) { - - return null; - } - } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index b58526d55f..d0dbc092e2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -141,27 +141,29 @@ \ No newline at end of file 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..77a21938b0 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 @@ -29,4 +29,35 @@ LIMIT 1 + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormList.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormList.java new file mode 100644 index 0000000000..86c49a60c9 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormList.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 通用用户Id列表参数DTO + * @ClassName CommonUserIdListFormList + * @Author wangc + * @date 2020.04.24 15:42 + */ +@Data +@AllArgsConstructor +public class CommonUserIdListFormList implements Serializable{ + private static final long serialVersionUID = -7045691156972928671L; + + /** + * 用户列表 + * */ + @NotBlank(message = "用户列表不能为空") + private List userIdList; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java index 69a668fc7a..f7b7f9b56e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java @@ -17,15 +17,20 @@ public class CommonStaffInfoResultDTO implements Serializable { /** * 工作人员用户Id * */ - private String userId; + private String staffId; /** * 工作人员用户头像 * */ - private String userHeadPhoto; + private String staffHeadPhoto; /** * 工作人员用户显示昵称 * */ - private String userShowName; + private String staffName; + + /** + * 性别 1男2女0未知 + * */ + private Integer gender; } 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..683c7eaeed 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 @@ -28,8 +28,10 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.CommonUserIdListFormList; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.excel.CustomerStaffExcel; import com.epmet.service.CustomerStaffService; import org.springframework.beans.factory.annotation.Autowired; @@ -143,4 +145,17 @@ public class CustomerStaffController { public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { return customerStaffService.getCustomerStaffInfoByUserId(formDTO); } + + /** + * @Description 通过userId列表查询未被禁用的用户信息 + * @Param CommonUserIdListFormList :: getUserIdList + * @return Result> + * @Author wangc + * @Date 2020.04.24 15:44 + **/ + @PostMapping(value = "enabestaffmsglist") + public Result> enableStaffMsgList(@RequestBody CommonUserIdListFormList userIdList){ + ValidatorUtils.validateEntity(userIdList); + return customerStaffService.getEnableStaffMsgList(userIdList); + } } \ 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 14d91f75e9..367fe51ec8 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,8 +22,10 @@ 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.result.CommonStaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -62,4 +64,13 @@ public interface CustomerStaffDao extends BaseDao { * @return */ List selectStaffGridListByUserId(List customerStaffGridDTOS); + + /** + * @Description 根据UserId列表查询用信息,过滤掉被禁用的,包含未激活的 + * @Param List + * @return List + * @Author wangc + * @Date 2020.04.24 15:34 + **/ + List selectEnableStaffMsg(@Param("userIds") List userIds); } \ No newline at end of file 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..05cfa0aed6 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,10 @@ 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.CommonUserIdListFormList; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import java.util.List; @@ -132,4 +134,13 @@ public interface CustomerStaffService extends BaseService { * @return */ Result> selectStaffGridListByUserId(List customerStaffGridDTOS); + + /** + * @Description 通过userId列表查询未被禁用的用户信息 + * @Param CommonUserIdListFormList :: getUserIdList + * @return Result> + * @Author wangc + * @Date 2020.04.24 15:44 + **/ + Result> getEnableStaffMsgList(CommonUserIdListFormList userIdList); } \ 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..2cc9e539c8 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,10 @@ 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.CommonUserIdListFormList; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import com.epmet.redis.CustomerStaffRedis; import com.epmet.service.CustomerStaffService; @@ -149,4 +151,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(staffGridListDTOS); } + /** + * @Description 通过userId列表查询未被禁用的用户信息 + * @Param CommonUserIdListFormList :: getUserIdList + * @return Result> + * @Author wangc + * @Date 2020.04.24 15:44 + **/ + @Override + public Result> getEnableStaffMsgList(CommonUserIdListFormList userIdList) { + return new Result>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList())); + } + } \ 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 2e44e2b582..e13443bd23 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,4 +41,22 @@ AND cs.del_flag = 0 + + + \ No newline at end of file From bc851c793f0476fd72c84578d87a27088012da5f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Apr 2020 17:12:14 +0800 Subject: [PATCH 081/174] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/StaffRoleDao.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index f1aaee18e7..6d65865681 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; @@ -39,7 +40,7 @@ public interface StaffRoleDao extends BaseDao { * @param orgId * @return */ - List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); + List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); /** * 删除工作人员权限 @@ -47,5 +48,5 @@ public interface StaffRoleDao extends BaseDao { * @return */ boolean delStaffRoles(StaffRoleDTO dto); - List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); + } \ No newline at end of file From c49f8d217c02e37b333ca79acaeb51813184bf9a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 24 Apr 2020 17:59:40 +0800 Subject: [PATCH 082/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=A8=A1=E5=9D=97=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/EpmetUserFeignClient.java | 4 -- .../EpmetUserFeignClientFallBack.java | 7 +-- .../impl/CustomerStaffServiceImpl.java | 47 +++++++------------ 3 files changed, 20 insertions(+), 38 deletions(-) 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 98d20c5939..96f51e83ec 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 @@ -3,9 +3,6 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.*; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; @@ -16,7 +13,6 @@ import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.dto.result.StaffInitResultDTO; 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; 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 0177e9a6bc..273b6172d1 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 @@ -4,15 +4,12 @@ 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.*; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; -import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.result.StaffDetailResultDTO; import com.epmet.dto.result.DepartInStaffListResultDTO; +import com.epmet.dto.result.StaffDetailResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.dto.result.StaffInitResultDTO; import com.epmet.feign.EpmetUserFeignClient; 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 7621320bb7..fdd47f560d 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 @@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; 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.utils.Result; @@ -31,23 +30,8 @@ import com.epmet.constant.UserConstant; import com.epmet.constant.UserRoleConstant; import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.*; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.StaffRoleDTO; -import com.epmet.dto.form.CustomerStaffFormDTO; -import com.epmet.dto.form.StaffInfoFromDTO; -import com.epmet.dto.form.StaffSubmitFromDTO; -import com.epmet.dto.form.DepartmentInStaffFormDTO; -import com.epmet.dto.form.StaffRoleFormDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.result.StaffDetailResultDTO; -import com.epmet.dto.result.DepartInStaffListResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; -import com.epmet.dto.result.StaffInitResultDTO; -import com.epmet.dto.result.StaffRoleResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerStaffEntity; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.entity.StaffRoleEntity; @@ -351,16 +335,21 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { - //1:根据userId集合查询人员基本信息 - List list = baseDao.selectDepartmentStaffList(formDTO); - //2:根据部门Id查询部门下是领导角色的用户 - StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); - staffRoleFormDTO.setOrgId(formDTO.getDepartmentId()); - staffRoleFormDTO.setRoleKey(UserRoleConstant.DEPT_LEADER); - - return new Result>().ok(list); - } + @Override + public Result> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { + //1:根据userId集合查询人员基本信息 + List staffList = baseDao.selectDepartmentStaffList(formDTO); + //2:根据部门Id查询部门下是领导角色的用户 + StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); + staffRoleFormDTO.setOrgId(formDTO.getDepartmentId()); + staffRoleFormDTO.setRoleKey(UserRoleConstant.DEPT_LEADER); + List staffRoleDTOS = staffRoleService.listStaffsInRole(UserRoleConstant.DEPT_LEADER, formDTO.getDepartmentId()); + staffRoleDTOS.forEach(roleDto -> { + staffList.stream().filter(staffDto -> + roleDto.getStaffId().equals(staffDto.getStaffId())).findAny().ifPresent(result -> + result.setRoleName(roleDto.getRoleName())); + }); + return new Result>().ok(staffList); + } } \ No newline at end of file From 23939c2cd638cdf0f0c96403615c0f6520c6cc75 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 24 Apr 2020 18:04:50 +0800 Subject: [PATCH 083/174] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=8F=98=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java index 57c2e2939d..7cb0a69b27 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java @@ -62,7 +62,7 @@ public class AddAgencyFormDTO implements Serializable { /** * 国家 */ - private String country; + private String district; /** * 省份 From 15f005e0a7a1b5f349a3b1b3198078775f32bc42 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Fri, 24 Apr 2020 19:35:50 +0800 Subject: [PATCH 084/174] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/CustomerIdDTO.java | 27 ++++++ .../epmet/dto/form/AddDepartmentFormDTO.java | 20 ----- .../dto/form/AddDepartmentStaffFormDTO.java | 31 +++++++ .../controller/DepartmentController.java | 10 ++- .../epmet/dao/CustomerStaffDepartmentDao.java | 7 ++ .../com/epmet/feign/EpmetUserFeignClient.java | 22 +++++ .../EpmetUserFeignClientFallBack.java | 9 ++ .../com/epmet/service/DepartmentService.java | 9 ++ .../service/impl/CustomerGridServiceImpl.java | 1 + .../service/impl/DepartmentServiceImpl.java | 29 +++++++ .../mapper/CustomerStaffDepartmentDao.xml | 10 +++ .../controller/CustomerStaffController.java | 86 ++++--------------- .../java/com/epmet/dao/CustomerStaffDao.java | 12 ++- .../epmet/service/CustomerStaffService.java | 14 +-- .../impl/CustomerStaffServiceImpl.java | 21 +++++ .../resources/mapper/CustomerStaffDao.xml | 16 ++++ 16 files changed, 223 insertions(+), 101 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerIdDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentStaffFormDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerIdDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerIdDTO.java new file mode 100644 index 0000000000..d18a182d1e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerIdDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 根据userId查询customerId 的DTO + * @Auther zxc + * @Create 2020-04-24 15:57 + */ +@Data +public class CustomerIdDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * userId 用户id + */ + private String userId; + + /** + * customerId 客户id + */ + private String customerId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java index 1188979f4a..57680d2ecd 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java @@ -16,20 +16,10 @@ package com.epmet.dto.form; * along with this program. If not, see . */ - import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; -import java.util.List; - -/** - * 添加部门人员DTO - * @Auther zxc - * @Create 2020-04-24 14:51 -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - /** * 添加部门-接口入参 @@ -41,16 +31,6 @@ public class AddDepartmentFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - *部门id - */ - private String departmentId; - - /** - * 选中人员id - */ - private List selectedList; - /** * 所属组织机构ID(customer_agency.id) */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentStaffFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentStaffFormDTO.java new file mode 100644 index 0000000000..96503be98e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentStaffFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 添加部门人员DTO + * @Auther zxc + * @Create 2020-04-24 14:51 + */ +@Data +public class AddDepartmentStaffFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + *部门id + */ + @NotBlank(message = "部门id不能为空") + private String departmentId; + + /** + * 选中人员id + */ + @NotBlank(message = "选中人员不能为空") + private List selectedList; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java index 33a1d7fe87..eba65e1372 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -29,9 +29,15 @@ public class DepartmentController { @Autowired private DepartmentService departmentService; + /** + * 添加部门人员 + * @param tokenDto + * @param addDepartmentStaffFormDTO + * @return + */ @PostMapping(value = "adddepartmentstaff") - public Result addDepartmentStaff(@LoginUser TokenDto tokenDto, @RequestBody AddDepartmentFormDTO addDepartmentFormDTO){ - return null; + public Result addDepartmentStaff(@LoginUser TokenDto tokenDto, @RequestBody AddDepartmentStaffFormDTO addDepartmentStaffFormDTO){ + return departmentService.addDepartmentStaff(tokenDto,addDepartmentStaffFormDTO); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java index dfdba500d7..548684b5e0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java @@ -34,4 +34,11 @@ import java.util.List; public interface CustomerStaffDepartmentDao extends BaseDao { List selectUserIdByDepartmentId(@Param("departmentId") String departmentId); + + /** + * 修改部门人数 + * @param + * @auther zxc + */ + void updateDepartmentStaffCount(@Param("addCount")Integer addCount,@Param("departmentId")String departmentId); } \ 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 96f51e83ec..8eb86517de 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 @@ -3,6 +3,10 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.*; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.AddDepartmentStaffFormDTO; import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; @@ -36,6 +40,11 @@ public interface EpmetUserFeignClient { @PostMapping(value = "/epmetuser/customerstaff/getstaffinfobyuserid") Result getCustomerStaffInfoByUserId(@RequestBody CustomerStaffDTO formDTO); + /** + * 获取网格下人员具体信息(头像、名字...) + * @param customerStaffGridDTOS + * @return + */ @PostMapping("/epmetuser/customerstaff/selectstaffgridlistbyuserid") Result> getStaffGridList(@RequestBody List customerStaffGridDTOS); @@ -47,6 +56,11 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/customerstaff/staffsinagency") Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); + /** + * 获取网格下未禁用的人员数量 + * @param userIdDTO + * @return + */ @PostMapping(value = "/epmetuser/customerstaff/selectgridstaffcountbyuserid") Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO); @@ -120,4 +134,12 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/customerstaff/getdepartmentstafflist") Result> getDepartmentStaffList(DepartmentInStaffFormDTO departmentInStaffFormDTO); + /** + * 根据userId查询customerId + * @param addDepartmentStaffFormDTO + * @auther zxc + */ + @PostMapping("/epmetuser/customerstaff/selectcustomeridbyuserid") + Result> selectCustomerIdByUserId(AddDepartmentStaffFormDTO addDepartmentStaffFormDTO); + } 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 273b6172d1..1284fb622b 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 @@ -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.*; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.AddDepartmentStaffFormDTO; import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; @@ -82,4 +86,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result disabledStaff(StaffInfoFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "disabledStaff", fromDTO); } + @Override + public Result> selectCustomerIdByUserId(AddDepartmentStaffFormDTO addDepartmentStaffFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectCustomerIdByUserId", addDepartmentStaffFormDTO); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java index 48fe029fb0..2d49860de2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java @@ -17,7 +17,9 @@ package com.epmet.service; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerIdDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -77,4 +79,11 @@ public interface DepartmentService { * @Description 获取机构下部门列表 */ Result> departmentList(DepartmentListFormDTO formDTO); + + /** + * 添加部门人员 + * @param addDepartmentStaffFormDTO + * @return + */ + Result addDepartmentStaff(TokenDto tokenDto,AddDepartmentStaffFormDTO addDepartmentStaffFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index a53a6bac1c..075799dfb8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -177,6 +177,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl griddetail(CustomerGridFormDTO customerGridFormDTO) { GridDetailResultDTO griddetail = baseDao.griddetail(customerGridFormDTO); List customerStaffGridDTOS = baseDao.selectUserIdByGridId(customerGridFormDTO); + //获取人员具体信息(头像、名字...) Result> staffGridList = epmetUserFeignClient.getStaffGridList(customerStaffGridDTOS); griddetail.setStaffGridList(staffGridList.getData()); return new Result().ok(griddetail); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java index 263daff4ac..dda0d02ae7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -20,17 +20,20 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerDepartmentConstant; import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerDepartmentDao; import com.epmet.dao.CustomerStaffDepartmentDao; +import com.epmet.dto.CustomerIdDTO; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerDepartmentEntity; +import com.epmet.entity.CustomerStaffDepartmentEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.service.DepartmentService; import com.epmet.util.ModuleConstant; @@ -197,4 +200,30 @@ public class DepartmentServiceImpl implements DepartmentService { List departmentList = customerDepartmentDao.selectDepartmentList(formDTO.getAgencyId()); return new Result>().ok(departmentList); } + + /** + * 添加部门人员 + * @param tokenDto + * @param addDepartmentStaffFormDTO + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result addDepartmentStaff(TokenDto tokenDto,AddDepartmentStaffFormDTO addDepartmentStaffFormDTO) { + CustomerStaffDepartmentEntity customerStaffDepartmentEntity = new CustomerStaffDepartmentEntity(); + Result> listResult = epmetUserFeignClient.selectCustomerIdByUserId(addDepartmentStaffFormDTO); + List data = listResult.getData(); + customerStaffDepartmentEntity.setDepartmentId(addDepartmentStaffFormDTO.getDepartmentId()); + customerStaffDepartmentEntity.setCreatedBy(tokenDto.getUserId()); + customerStaffDepartmentEntity.setUpdatedBy(tokenDto.getUserId()); + customerStaffDepartmentEntity.setDelFlag("0"); + customerStaffDepartmentEntity.setRevision(0); + for (CustomerIdDTO customerIdDTO : data) { + customerStaffDepartmentEntity.setUserId(customerIdDTO.getUserId()); + customerStaffDepartmentEntity.setCustomerId(customerIdDTO.getCustomerId()); + customerStaffDepartmentDao.insert(customerStaffDepartmentEntity); + } + customerStaffDepartmentDao.updateDepartmentStaffCount(data.size(),addDepartmentStaffFormDTO.getDepartmentId()); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 86c597d402..d0d80492b6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -26,5 +26,15 @@ + + + UPDATE + customer_department + SET + total_user = total_user + #{addCount} + WHERE + id = #{departmentId} + + \ 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 f1ed7bd6ba..748252137b 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 @@ -27,6 +27,10 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.*; import com.epmet.dto.form.*; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffDetailResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; @@ -145,18 +149,13 @@ public class CustomerStaffController { return customerStaffService.getCustomerStaffInfoByUserId(formDTO); } - @PostMapping(value = "selectgridstaffcountbyuserid") - public Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO){ - return customerStaffService.selectGridStaffCountByUserId(userIdDTO); - } - /** * 组织首页-工作人员列表 * @param fromDTO * @return */ @PostMapping("staffsinagency") - public Result> getStaffInfoForHome(@RequestBody StaffsInAgencyFromDTO fromDTO) { + public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { return customerStaffService.getStaffInfoForHome(fromDTO); } @@ -166,74 +165,18 @@ public class CustomerStaffController { * @return */ @PostMapping("stafflist") - public Result> getStaffList(@RequestBody StaffsInAgencyFromDTO fromDTO) { + public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { return customerStaffService.getStaffList(fromDTO); } /** - * 人员添加页面初始化 - * - * @param fromDTO 参数 - * @return Result + * 查询网格下未被禁用人员 + * @param userIdDTO + * @auther zxc */ - @PostMapping("rolelist") - public Result addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ - return customerStaffService.addStaffInit(fromDTO); - } - - /** - * 人员编辑页面初始化 - * - * @param fromDTO 参数 - * @return Result - */ - @PostMapping("editstaffinit") - public Result editStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ - return customerStaffService.editStaffInit(fromDTO); - } - - /** - * 人员添加 - * - * @param fromDTO 参数 - * @return Result - */ - @PostMapping("addstaff") - public Result addStaff(@RequestBody StaffSubmitFromDTO fromDTO){ - return customerStaffService.addStaff(fromDTO); - } - - /** - * 人员编辑 - * - * @param fromDTO 参数 - * @return Result - */ - @PostMapping("editstaff") - public Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO){ - return customerStaffService.editStaff(fromDTO); - } - - /** - * 人员详情 - * - * @param fromDTO 参数 - * @return Result - */ - @PostMapping("staffdetail") - public Result getStaffDetail(@RequestBody StaffInfoFromDTO fromDTO){ - return customerStaffService.getStaffDetail(fromDTO); - } - - /** - * 人员禁用 - * - * @param fromDTO 参数 - * @return Result - */ - @PostMapping("disabledstaff") - public Result disabledStaff(@RequestBody StaffInfoFromDTO fromDTO){ - return customerStaffService.disabledStaff(fromDTO); + @PostMapping(value = "selectgridstaffcountbyuserid") + public Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO){ + return customerStaffService.selectGridStaffCountByUserId(userIdDTO); } /** @@ -246,4 +189,9 @@ public class CustomerStaffController { public Result> getDepartmentStaffList(DepartmentInStaffFormDTO fromDTO) { return customerStaffService.getDepartmentStaffList(fromDTO); } + + @PostMapping(value = "selectcustomeridbyuserid") + public Result> selectCustomerIdByUserId(@RequestBody AddDepartmentStaffFormDTO addDepartmentStaffFormDTO){ + return customerStaffService.selectCustomerIdByUserId(addDepartmentStaffFormDTO); + } } \ 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 e74e4b6ce5..6c4cab6dc7 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 @@ -20,10 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.*; -import com.epmet.dto.form.CustomerStaffFormDTO; -import com.epmet.dto.form.StaffInfoFromDTO; -import com.epmet.dto.form.DepartmentInStaffFormDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; @@ -115,4 +112,11 @@ public interface CustomerStaffDao extends BaseDao { * @Description 根据客户Id及userId集合查询用户基本信息 */ List selectDepartmentStaffList(DepartmentInStaffFormDTO fromDTO); + + /** + * + * @param departmentStaffFormDTO + * @auther zxc + */ + List selectCustomerIdByUserId(AddDepartmentStaffFormDTO departmentStaffFormDTO); } \ No newline at end of file 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 a79bafba8b..abd130c21c 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 @@ -21,15 +21,10 @@ 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.*; -import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.*; 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.StaffInfoFromDTO; -import com.epmet.dto.form.StaffSubmitFromDTO; -import com.epmet.dto.form.DepartmentInStaffFormDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.result.StaffDetailResultDTO; import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; @@ -218,4 +213,11 @@ public interface CustomerStaffService extends BaseService { * @Description 根据客户Id及userId集合查询用户基本信息 */ Result> getDepartmentStaffList(DepartmentInStaffFormDTO fromDTO); + + /** + * 根据userId查询customerId + * @param: addDepartmentStaffFormDTO + * @auther: zxc + */ + Result> selectCustomerIdByUserId(AddDepartmentStaffFormDTO addDepartmentStaffFormDTO); } \ 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 fdd47f560d..d3a98772bd 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 @@ -32,6 +32,17 @@ import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.form.*; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.result.StaffDetailResultDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; +import com.epmet.dto.result.StaffInfoResultDTO; +import com.epmet.dto.result.StaffInitResultDTO; +import com.epmet.dto.result.StaffRoleResultDTO; import com.epmet.entity.CustomerStaffEntity; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.entity.StaffRoleEntity; @@ -352,4 +363,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(staffList); } + /** + * + * @param: addDepartmentStaffFormDTO + * @auther: zxc + */ + @Override + public Result> selectCustomerIdByUserId(AddDepartmentStaffFormDTO addDepartmentStaffFormDTO) { + return new Result>().ok(baseDao.selectCustomerIdByUserId(addDepartmentStaffFormDTO)); + } + } \ 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 b2bd97dbd4..d1cfdd797d 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 @@ -145,4 +145,20 @@ ORDER BY CONVERT (real_name USING gbk) ASC + + + \ No newline at end of file From 9f1d40240fb1b59ee03c00fd6bee3e5acb7054bb Mon Sep 17 00:00:00 2001 From: wxz Date: Sat, 25 Apr 2020 14:28:26 +0800 Subject: [PATCH 085/174] =?UTF-8?q?1.=E6=9D=83=E9=99=90=E8=BF=87=E6=BB=A4-?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90=E4=B8=8B=E7=BA=A7=E7=B3=BB?= =?UTF-8?q?=E5=88=97=EF=BC=8C=E9=98=B6=E6=AE=B5=E6=80=A7=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/aspect/DataFilterAspect.java | 232 +++++++++++++++--- .../mybatis/constant/OpeScopeConstant.java | 17 ++ .../mybatis/dto/form/OperationScopeDTO.java | 87 +++++++ .../dto/form/OperationScopeFormDTO.java | 18 ++ .../dto/form/StaffPermCacheResultDTO.java | 25 ++ .../mybatis/feign/GovAccessFeignClient.java | 17 +- .../GovAccessFeignClientFallback.java | 12 +- .../commons/tools/aspect/AccessOpeAspect.java | 2 - .../tools/security/dto/GovTokenDto.java | 23 +- .../java/com/epmet/dto/OperationScopeDTO.java | 81 ++++++ .../main/java/com/epmet/dto/RoleScopeDTO.java | 86 +++++++ .../epmet/dto/form/OperationScopeFormDTO.java | 18 ++ .../epmet/dto/form/StaffPermCacheFormDTO.java | 10 + .../dto/result/StaffPermCacheResultDTO.java | 26 ++ .../epmet/controller/AccessController.java | 49 +++- .../java/com/epmet/dao/OperationScopeDao.java | 45 ++++ .../main/java/com/epmet/dao/RoleScopeDao.java | 33 +++ .../epmet/entity/OperationScopeEntity.java | 51 ++++ .../com/epmet/entity/RoleScopeEntity.java | 56 +++++ .../com/epmet/redis/OperationScopeRedis.java | 47 ++++ .../java/com/epmet/redis/RoleScopeRedis.java | 47 ++++ .../java/com/epmet/service/AccessService.java | 16 +- .../epmet/service/OperationScopeService.java | 95 +++++++ .../com/epmet/service/RoleScopeService.java | 95 +++++++ .../epmet/service/impl/AccessServiceImpl.java | 29 ++- .../impl/OperationScopeServiceImpl.java | 104 ++++++++ .../service/impl/RoleScopeServiceImpl.java | 104 ++++++++ .../db.migration/epmet_gov_access.sql | 3 +- .../resources/mapper/OperationScopeDao.xml | 29 +++ .../main/resources/mapper/RoleScopeDao.xml | 20 ++ .../epmet/controller/AccessController.java | 2 +- .../com/epmet/feign/GovOrgFeignClient.java | 8 + .../fallback/GovOrgFeignClientFallBack.java | 6 + .../epmet/service/impl/AccessServiceImpl.java | 47 +++- .../epmet/controller/AgencyController.java | 25 +- .../java/com/epmet/service/AgencyService.java | 8 + .../epmet/service/impl/AgencyServiceImpl.java | 5 + .../mapper/CustomerStaffDepartmentDao.xml | 2 +- .../java/com/epmet/dto/GovStaffRoleDTO.java | 2 +- .../epmet/controller/StaffRoleController.java | 4 +- .../com/epmet/service/StaffRoleService.java | 3 +- .../service/impl/StaffRoleServiceImpl.java | 4 +- 42 files changed, 1512 insertions(+), 81 deletions(-) create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/OpeScopeConstant.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeDTO.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeFormDTO.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/OperationScopeDTO.java create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleScopeDTO.java create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/OperationScopeFormDTO.java create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDao.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleScopeDao.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/OperationScopeEntity.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleScopeEntity.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperationScopeRedis.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleScopeRedis.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/OperationScopeService.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleScopeService.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/OperationScopeServiceImpl.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleScopeServiceImpl.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleScopeDao.xml diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java index 14ce3af0a1..b9431a6c48 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java @@ -1,19 +1,21 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

* https://www.renren.io - * + *

* 版权所有,侵权必究! */ package com.epmet.commons.mybatis.aspect; +import com.epmet.commons.mybatis.constant.OpeScopeConstant; +import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; +import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.feign.GovAccessFeignClient; import com.epmet.commons.tools.aspect.AccessOpeAspect; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; @@ -27,9 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; -import java.util.Arrays; -import java.util.List; -import java.util.Set; +import java.util.*; /** * 数据过滤,切面处理类 @@ -49,6 +49,8 @@ public class DataFilterAspect { @Autowired private GovAccessFeignClient govAccessFeignClient; + public static final String orgIdPathSpliter = ":"; + @Before("@annotation(com.epmet.commons.mybatis.annotation.DataFilter)") public void dataFilter(JoinPoint point) { // 反射的方式 @@ -60,20 +62,39 @@ public class DataFilterAspect { // } //} - String reqiurePermission = AccessOpeAspect.requirePermissionTl.get(); + String requirePermission = AccessOpeAspect.requirePermissionTl.get(); // 没有配置所需权限,不做操作,打印提示日志 - if (StringUtils.isBlank(reqiurePermission)) { + if (StringUtils.isBlank(requirePermission)) { log.warn("Api编码需要指定所需权限,请在Api上使用@RequirePermission注解完成所需权限配置"); return; } + StaffPermissionFormDTO staffPermissionFormDTO = new StaffPermissionFormDTO(); + staffPermissionFormDTO.setApp(loginUserUtil.getLoginUserApp()); + staffPermissionFormDTO.setClient(loginUserUtil.getLoginUserClient()); + staffPermissionFormDTO.setStaffId(loginUserUtil.getLoginUserId()); + Result result = govAccessFeignClient.getStaffCurrPermissions(staffPermissionFormDTO); + + if (result.getCode() != 0) { + // 查询不到权限,记录日志,抛出8000异常 + log.error("调用Access查询权限失败:{}", result.getMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + + StaffPermCacheResultDTO permCacheResultDTO = result.getData(); + + if (permCacheResultDTO == null || CollectionUtils.isEmpty(permCacheResultDTO.getPermissions())) { + log.error("操作权限不足,查询不到权限"); + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + // 校验操作权限 - validateOpePermission(reqiurePermission); + validateOpePermission(permCacheResultDTO.getPermissions(), requirePermission); Object[] methodArgs = point.getArgs(); for (Object methodArg : methodArgs) { if (methodArg instanceof DataScope) { - ((DataScope) methodArg).setSqlFilter(getSqlFilterSegment()); + ((DataScope) methodArg).setSqlFilter(getSqlFilterSegment(permCacheResultDTO.getRoleIdList(), requirePermission, permCacheResultDTO.getOrgIdPath())); return; } } @@ -84,38 +105,187 @@ public class DataFilterAspect { /** * 校验操作权限 */ - private void validateOpePermission(String requirePermission) { - StaffPermissionFormDTO staffPermissionFormDTO = new StaffPermissionFormDTO(); - staffPermissionFormDTO.setApp(loginUserUtil.getLoginUserApp()); - staffPermissionFormDTO.setClient(loginUserUtil.getLoginUserClient()); - staffPermissionFormDTO.setStaffId(loginUserUtil.getLoginUserId()); - Result> permissions = govAccessFeignClient.getStaffCurrPermissions(staffPermissionFormDTO); - if (permissions.getCode() != 0) { - // 查询不到权限,记录日志,抛出8000异常 - log.error("调用Access查询权限失败:{}", permissions.getMsg()); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + private void validateOpePermission(Set permissions, String reqiurePermission) { + if (!permissions.contains(reqiurePermission)) { + // 权限不足 + log.error("操作权限不足"); + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } - - if (!CollectionUtils.isEmpty(permissions.getData()) && StringUtils.isNotBlank(requirePermission) - && permissions.getData().contains(requirePermission)) { - // 权限允许,正常结束 - return; - } - // 权限不足抛出异常 - throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } /** * 生成过滤sql片段 + * * @return */ - private String getSqlFilterSegment() { + private String getSqlFilterSegment(Set roleIds, String reqiurePermission, String orgIdPath) { // 根据角色列表查询操作范围列表 + // todo 暂停,先模拟数据 + //roleIds.forEach(roleId -> { + // OperationScopeFormDTO osformDto = new OperationScopeFormDTO(); + // osformDto.setRoleId(roleId); + // osformDto.setOperationKey(reqiurePermission); + // Result> result = govAccessFeignClient.getOperationScopesByRoleId(osformDto); + // List scopeDTOS = result.getData(); + //}); + Set scopeDTOS = genScopeDtos(); - // 拼接sql语句 + // 过滤有效范围 + HashSet scopes = filteScopes(scopeDTOS); + + // 取出父组织ID path 和当前组织ID + String pOrgPath = orgIdPath.substring(0, orgIdPath.lastIndexOf(orgIdPathSpliter)); + String currOrgPath = orgIdPath.substring(orgIdPath.lastIndexOf(orgIdPathSpliter) + 1); + StringBuilder sb = new StringBuilder(" AND ("); + getOrgScopeSql(sb, scopes, currOrgPath, pOrgPath); + sb.replace(sb.lastIndexOf("OR"), sb.lastIndexOf("OR") + 3, ""); + sb.append(") "); + // 拼接sql语句 + sb.replace(141,142,""); // TODO - return "dept_id in (1,2,3)"; + return ""; + } + + /** + * 计算范围过滤sql + * @param scopes + * @param currOrg + * @param pOrgPath + * @return + */ + private void getOrgScopeSql(StringBuilder sb,HashSet scopes, String currOrg, String pOrgPath) { + for (String scope : scopes) { + switch (scope) { + case OpeScopeConstant.ORG_CURR: + getAgencyCurrScopedSql(sb, currOrg); + sb.append(" OR "); + break; + case OpeScopeConstant.ORG_CURR_AND_SUB: + getAgencyCurrAndSubScopedSql(sb, pOrgPath); + sb.append(" OR "); + break; + case OpeScopeConstant.ORG_CURR_SUB: + getAgencyCurrSubScopedSql(sb, pOrgPath, currOrg); + sb.append(" OR "); + break; + case OpeScopeConstant.ORG_EQUAL: + // todo 同级 + //sb.append(" OR "); + break; + case OpeScopeConstant.ORG_EQUAL_AND_SUB: + // todo 同级及其子级 + //sb.append(" OR "); + break; + case OpeScopeConstant.ORG_EQUAL_SUB: + // todo 同级的子级 + //sb.append(" OR "); + break; + } + } + } + + /** + * 本身 + * @param sb + * @param orgId + */ + public void getAgencyCurrScopedSql(StringBuilder sb,String orgId) { + sb.append(" ORG_ID = ").append(orgId); + } + + /** + * 本身及子级 + * @param sb + * @param pOrgIdPath + */ + public void getAgencyCurrAndSubScopedSql(StringBuilder sb,String pOrgIdPath) { + sb.append(" ORG_ID_PATH like '").append(pOrgIdPath).append("%'"); + } + + /** + * 子级组织(不含本身) + * @param sb + */ + public void getAgencyCurrSubScopedSql(StringBuilder sb,String pOrgIdPath, String currOrgIdPath) { + sb.append("ORG_ID_PATH like '").append(pOrgIdPath).append(orgIdPathSpliter).append(currOrgIdPath).append("%'"); + } + + /** + * 过滤有效范围 + * + * @param scopeDTOS + * @return + */ + private HashSet filteScopes(Set scopeDTOS) { + HashMap filtedScopes = new HashMap<>(); + + for (OperationScopeDTO scope : scopeDTOS) { + String scopeIndex = scope.getScopeIndex(); + String[] currArr = scopeIndex.split("_"); + if ("0".equals(currArr[1])) { + // 为0,说明没有包含关系,直接放入 + filtedScopes.put(scopeIndex, scope); + continue; + } + + OperationScopeDTO tempScope = filtedScopes.get(currArr[0]); + if (tempScope != null) { + // 已经有ac开头的了 + String tempScopeIndex = tempScope.getScopeIndex(); + if (Integer.valueOf(currArr[1]) < Integer.valueOf(tempScopeIndex.split("_")[1])) { + filtedScopes.put(currArr[0], scope); + } + } else { + filtedScopes.put(currArr[0], scope); + } + } + HashSet scopeStrs = new HashSet<>(); + Set> entries = filtedScopes.entrySet(); + for (Map.Entry entry : entries) { + scopeStrs.add(entry.getValue().getScopeKey()); + } + return scopeStrs; + } + + /** + * 模拟范围数据 + * + * @return + */ + private Set genScopeDtos() { + OperationScopeDTO scopeDTO1 = new OperationScopeDTO(); + scopeDTO1.setScopeKey("org_curr"); + scopeDTO1.setScopeName("本机关"); + scopeDTO1.setScopeIndex("ac_0"); + + OperationScopeDTO scopeDTO2 = new OperationScopeDTO(); + scopeDTO2.setScopeKey("org_curr_and_sub"); + scopeDTO2.setScopeName("本机关及下级"); + scopeDTO2.setScopeIndex("ac_501"); + + OperationScopeDTO scopeDTO3 = new OperationScopeDTO(); + scopeDTO3.setScopeKey("org_curr_sub"); + scopeDTO3.setScopeName("本机关的下级"); + scopeDTO3.setScopeIndex("ac_502"); + + OperationScopeDTO scopeDTO4 = new OperationScopeDTO(); + scopeDTO4.setScopeKey("org_equal_and_sub"); + scopeDTO4.setScopeName("同级机关及下级"); + scopeDTO4.setScopeIndex("ae_601"); + + OperationScopeDTO scopeDTO5 = new OperationScopeDTO(); + scopeDTO5.setScopeKey("org_equal_sub"); + scopeDTO5.setScopeName("同级机关的下级"); + scopeDTO5.setScopeIndex("ae_602"); + + Set scopeDTOS = new HashSet<>(); + scopeDTOS.add(scopeDTO1); + scopeDTOS.add(scopeDTO2); + scopeDTOS.add(scopeDTO3); + scopeDTOS.add(scopeDTO4); + scopeDTOS.add(scopeDTO5); + return scopeDTOS; } ///** diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/OpeScopeConstant.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/OpeScopeConstant.java new file mode 100644 index 0000000000..3d415ffb30 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/OpeScopeConstant.java @@ -0,0 +1,17 @@ +package com.epmet.commons.mybatis.constant; + +public class OpeScopeConstant { + //"同级组织的下级" + public static final String ORG_EQUAL_SUB = "org_equal_sub"; + //"同级组织及下级" + public static final String ORG_EQUAL_AND_SUB = "org_equal_and_sub"; + //"同级组织" + public static final String ORG_EQUAL = "org_equal"; + //"本组织的下级" + public static final String ORG_CURR_SUB = "org_curr_sub"; + //"本组织及下级" + public static final String ORG_CURR_AND_SUB = "org_curr_and_sub"; + //"本组织" + public static final String ORG_CURR = "org_curr"; + +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeDTO.java new file mode 100644 index 0000000000..494cff66b9 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeDTO.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.commons.mybatis.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 权限范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +@Data +public class OperationScopeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 范围key + */ + private String scopeKey; + + /** + * 范围名称 + */ + private String scopeName; + + /** + * 范围序号 + */ + private String scopeIndex; + + /** + * 是否删除,0:未删除,1:已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建者id + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新者id + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeFormDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeFormDTO.java new file mode 100644 index 0000000000..fe5aca825b --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.commons.mybatis.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class OperationScopeFormDTO { + + public interface ListOperationScopeGroup {} + + @NotBlank(message = "角色ID不能为空", groups = {ListOperationScopeGroup.class}) + private String roleId; + + @NotBlank(message = "操作的key不能为空", groups = {ListOperationScopeGroup.class}) + private String operationKey; + +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java new file mode 100644 index 0000000000..6f37ef7033 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.commons.mybatis.dto.form; + +import lombok.Data; + +import java.util.Set; + +@Data +public class StaffPermCacheResultDTO { + + /** + * 权限列表 + */ + private Set permissions; + + /** + * 角色列表 + */ + private Set roleIdList; + + /** + * 机构Id + */ + private String orgIdPath; + +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java index 198d996bc9..4d04adc835 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java @@ -1,12 +1,17 @@ package com.epmet.commons.mybatis.feign; +import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; +import com.epmet.commons.mybatis.dto.form.OperationScopeFormDTO; +import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; import com.epmet.commons.mybatis.feign.fallback.GovAccessFeignClientFallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import java.util.List; import java.util.Set; /** @@ -17,10 +22,18 @@ import java.util.Set; public interface GovAccessFeignClient { /** - * 查询用户当前权限列表(DataFilterAspect中用到) + * 查询用户当前权限列表 * @return */ @PostMapping("/gov/access/access/getcurrpermissions") - Result> getStaffCurrPermissions(StaffPermissionFormDTO dto); + Result getStaffCurrPermissions(StaffPermissionFormDTO dto); + + /** + * 查询角色的操作key对应操作范围列表 + * @param operationScopeFormDTO + * @return + */ + @PostMapping("/gov/access/access/operationscopes") + Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO); } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java index 3c5ccd599b..2f5b9287a1 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java @@ -1,5 +1,8 @@ package com.epmet.commons.mybatis.feign.fallback; +import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; +import com.epmet.commons.mybatis.dto.form.OperationScopeFormDTO; +import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; import com.epmet.commons.mybatis.feign.GovAccessFeignClient; import com.epmet.commons.tools.constant.ServiceConstant; @@ -7,7 +10,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import org.springframework.stereotype.Component; -import java.util.Set; +import java.util.List; /** * 调用政府端权限 @@ -19,7 +22,12 @@ import java.util.Set; public class GovAccessFeignClientFallback implements GovAccessFeignClient { @Override - public Result> getStaffCurrPermissions(StaffPermissionFormDTO dto) { + public Result getStaffCurrPermissions(StaffPermissionFormDTO dto) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getStaffCurrPermissions", dto); } + + @Override + public Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getOperationScopesByRoleId", operationScopeFormDTO); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/AccessOpeAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/AccessOpeAspect.java index eeeedc6508..72070ee6e1 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/AccessOpeAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/AccessOpeAspect.java @@ -37,8 +37,6 @@ public class AccessOpeAspect { RequirePermission requirePermissionAnno = methodSignature.getMethod().getAnnotation(RequirePermission.class); String key = requirePermissionAnno.key(); String desc = requirePermissionAnno.desc(); - System.out.println(key); - System.out.println(desc); // 放入ThreadLocal,供DataFilterAspect中使用 requirePermissionTl.set(key); 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 7088bb10a3..49d6cb15a3 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 @@ -34,6 +34,16 @@ public class GovTokenDto extends BaseTokenDto implements Serializable { */ private String customerId; + /** + * 过期时间戳 + */ + private Long expireTime; + + /** + * 最后一次更新时间 + */ + private long updateTime; + /** * 当前登录的组织id(顶级) */ @@ -55,18 +65,13 @@ public class GovTokenDto extends BaseTokenDto implements Serializable { private List deptIdList; /** - * 过期时间戳 - */ - private Long expireTime; - - /** - * 最后一次更新时间 + * 功能权限列表,实际上是gov_staff => staff_role => role_operation查询到的operationKey */ - private long updateTime; + private Set permissions; /** - * 功能权限列表,实际上是gov_staff => staff_role => role_operation查询到的operationKey + * 角色ID列表 */ - private Set permissions; + private Set roleIdList; } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/OperationScopeDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/OperationScopeDTO.java new file mode 100644 index 0000000000..19e1111e96 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/OperationScopeDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 权限范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +@Data +public class OperationScopeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 范围key + */ + private String scopeKey; + + /** + * 范围名称 + */ + private String scopeName; + + /** + * 是否删除,0:未删除,1:已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建者id + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新者id + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleScopeDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleScopeDTO.java new file mode 100644 index 0000000000..17f8866215 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleScopeDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 角色能操作哪些范围 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +@Data +public class RoleScopeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 角色ID + */ + private String roleId; + + /** + * 操作key + */ + private String operationKey; + + /** + * 范围Key + */ + private String scopeKey; + + /** + * 是否删除,0:未删除,1:已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建者id + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新者id + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/OperationScopeFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/OperationScopeFormDTO.java new file mode 100644 index 0000000000..af992b7d51 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/OperationScopeFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class OperationScopeFormDTO { + + public interface ListOperationScopeGroup {} + + @NotBlank(message = "角色ID不能为空", groups = {ListOperationScopeGroup.class}) + private String roleId; + + @NotBlank(message = "操作的key不能为空", groups = {ListOperationScopeGroup.class}) + private String operationKey; + +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java index 56907e52af..191314af0a 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java @@ -36,9 +36,19 @@ public class StaffPermCacheFormDTO { @NotBlank(message = "登录头信息client不能为空", groups = {UpdatePermissionCache.class, GetStaffCurrPermissions.class}) private String client; + /** + * 组织ID路径 + */ + private String orgIdPath; + /** * 权限列表 */ private Set permissions; + /** + * 角色列表 + */ + private Set roleIdList; + } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java new file mode 100644 index 0000000000..0f6be83e72 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.Set; + +@Data +public class StaffPermCacheResultDTO { + + /** + * 权限列表 + */ + private Set permissions; + + /** + * 角色列表 + */ + private Set roleIdList; + + /** + * 组织ID + */ + private String orgIdPath; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java index aa954dc584..d60f7cb528 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java @@ -1,15 +1,20 @@ package com.epmet.controller; +import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.OperationScopeDTO; +import com.epmet.dto.form.OperationScopeFormDTO; import com.epmet.dto.form.StaffPermCacheFormDTO; +import com.epmet.dto.result.StaffPermCacheResultDTO; +import com.epmet.entity.OperationScopeEntity; import com.epmet.service.AccessService; +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.List; import java.util.Set; /** @@ -37,7 +42,9 @@ public class AccessController { String app = staffPermCacheFormDTO.getApp(); String client = staffPermCacheFormDTO.getClient(); Set permissions = staffPermCacheFormDTO.getPermissions(); - accessService.updatePermissionCache(staffId, app, client, permissions); + Set roleIdList = staffPermCacheFormDTO.getRoleIdList(); + String orgId = staffPermCacheFormDTO.getOrgIdPath(); + accessService.updatePermissionCache(staffId, app, client, permissions, roleIdList, orgId); return new Result(); } @@ -46,9 +53,35 @@ public class AccessController { * @return */ @PostMapping("getcurrpermissions") - public Result> getStaffCurrPermissions(@RequestBody StaffPermCacheFormDTO dto) { + public Result getStaffCurrPermissions(@RequestBody StaffPermCacheFormDTO dto) { ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); - Set permissions = accessService.listStaffCurrPermissions(dto.getApp(), dto.getClient(), dto.getStaffId()); - return new Result>().ok(permissions); + GovTokenDto govTokenDto = accessService.listStaffCurrPermissions(dto.getApp(), dto.getClient(), dto.getStaffId()); + StaffPermCacheResultDTO resultDTO = null; + if (govTokenDto != null) { + resultDTO = new StaffPermCacheResultDTO(); + resultDTO.setPermissions(govTokenDto.getPermissions()); + resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); + resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); + } + return new Result().ok(resultDTO); + } + + /** + * 查询角色的操作key对应操作范围列表(需要入缓存) + * @return + */ + // todo 需要加缓存 + @PostMapping("operationscopes") + public Result> getOperationScopesByRoleId(@RequestBody OperationScopeFormDTO operationScopeFormDTO) { + ValidatorUtils.validateEntity(operationScopeFormDTO, OperationScopeFormDTO.ListOperationScopeGroup.class); + List scopes = accessService.listOperationScopesByRoleId(operationScopeFormDTO.getRoleId(), operationScopeFormDTO.getOperationKey()); + ArrayList scopeDtos = new ArrayList<>(); + scopes.forEach(scope -> { + OperationScopeDTO scopeDTO = new OperationScopeDTO(); + BeanUtils.copyProperties(scope, scopeDTO); + scopeDtos.add(scopeDTO); + }); + + return new Result>().ok(scopeDtos); } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDao.java new file mode 100644 index 0000000000..a944cdd628 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.OperationScopeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.context.annotation.Scope; + +import java.util.List; + +/** + * 权限范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +@Mapper +public interface OperationScopeDao extends BaseDao { + + /** + * 查询角色的操作key对应操作范围列表 + * @param roleId 角色id + * @param operationKey 操作key + * @return + */ + List listOperationScopesByRoleId(@Param("roleId") String roleId, + @Param("operationKey") String operationKey); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleScopeDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleScopeDao.java new file mode 100644 index 0000000000..60982f5528 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleScopeDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.RoleScopeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 角色能操作哪些范围 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +@Mapper +public interface RoleScopeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/OperationScopeEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/OperationScopeEntity.java new file mode 100644 index 0000000000..2fd6b18361 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/OperationScopeEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-04-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("operation_scope") +public class OperationScopeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 范围key + */ + private String scopeKey; + + /** + * 范围名称 + */ + private String scopeName; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleScopeEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleScopeEntity.java new file mode 100644 index 0000000000..2c3c6f21dc --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleScopeEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-04-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("role_scope") +public class RoleScopeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private String roleId; + + /** + * 操作key + */ + private String operationKey; + + /** + * 范围Key + */ + private String scopeKey; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperationScopeRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperationScopeRedis.java new file mode 100644 index 0000000000..3f5a7c6562 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperationScopeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 权限范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +@Component +public class OperationScopeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleScopeRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleScopeRedis.java new file mode 100644 index 0000000000..1198f8651a --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleScopeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色能操作哪些范围 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +@Component +public class RoleScopeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java index a9e5150db8..4355b2714b 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java @@ -1,5 +1,9 @@ package com.epmet.service; +import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.entity.OperationScopeEntity; + +import java.util.List; import java.util.Set; public interface AccessService { @@ -8,11 +12,19 @@ public interface AccessService { * @param staffId * @param permissions */ - void updatePermissionCache(String staffId, String app, String client, Set permissions); + void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath); /** * 查询用户当前权限列表 * @return */ - Set listStaffCurrPermissions(String app, String client, String staffId); + GovTokenDto listStaffCurrPermissions(String app, String client, String staffId); + + /** + * 查询角色的操作key对应操作范围列表 + * @param roleId + * @param operationKey + * @return + */ + List listOperationScopesByRoleId(String roleId, String operationKey); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/OperationScopeService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/OperationScopeService.java new file mode 100644 index 0000000000..cb24b913c0 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/OperationScopeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.OperationScopeDTO; +import com.epmet.entity.OperationScopeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 权限范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +public interface OperationScopeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-24 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-24 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return OperationScopeDTO + * @author generator + * @date 2020-04-24 + */ + OperationScopeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-24 + */ + void save(OperationScopeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-24 + */ + void update(OperationScopeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-24 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleScopeService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleScopeService.java new file mode 100644 index 0000000000..34cdd6e07f --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleScopeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.RoleScopeDTO; +import com.epmet.entity.RoleScopeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色能操作哪些范围 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +public interface RoleScopeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-24 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-24 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return RoleScopeDTO + * @author generator + * @date 2020-04-24 + */ + RoleScopeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-24 + */ + void save(RoleScopeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-24 + */ + void update(RoleScopeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-24 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index cd846aa3b8..95b01a1f0c 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -2,6 +2,8 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; +import com.epmet.dao.OperationScopeDao; +import com.epmet.entity.OperationScopeEntity; import com.epmet.service.AccessService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -10,6 +12,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.HashSet; +import java.util.List; import java.util.Set; @Service @@ -20,19 +23,25 @@ public class AccessServiceImpl implements AccessService { @Autowired private CpUserDetailRedis cpUserDetailRedis; + @Autowired + private OperationScopeDao operationScopeDao; + /** * 更新权限缓存 * @param staffId * @param permissions */ @Override - public void updatePermissionCache(String staffId, String app, String client, Set permissions) { + public void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath) { GovTokenDto govTokenDto = cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); if (govTokenDto == null) { logger.warn("更新[{}]用户缓存:Redis中不存在该用户TokenDto缓存信息", staffId); return ; } + // 将权限,角色列表,和当前组织ID存入TokenDto govTokenDto.setPermissions(permissions); + govTokenDto.setRoleIdList(roleIdList); + govTokenDto.setOrgIdPath(orgIdPath); // 将新的TokenDto更新到redis中 long expire = cpUserDetailRedis.getExpire(app, client, staffId); @@ -41,11 +50,17 @@ public class AccessServiceImpl implements AccessService { } @Override - public Set listStaffCurrPermissions(String app, String client, String staffId) { - GovTokenDto govTokenDto = cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); - if (govTokenDto == null || CollectionUtils.isEmpty(govTokenDto.getPermissions())) { - return new HashSet<>(); - } - return new HashSet<>(govTokenDto.getPermissions()); + public GovTokenDto listStaffCurrPermissions(String app, String client, String staffId) { + return cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); + } + + /** + * 查询角色的操作key对应操作范围列表 + * @param roleId + * @param operationKey + * @return + */ + public List listOperationScopesByRoleId(String roleId, String operationKey) { + return operationScopeDao.listOperationScopesByRoleId(roleId, operationKey); } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/OperationScopeServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/OperationScopeServiceImpl.java new file mode 100644 index 0000000000..fe8f8b4079 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/OperationScopeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.OperationScopeDao; +import com.epmet.dto.OperationScopeDTO; +import com.epmet.entity.OperationScopeEntity; +import com.epmet.redis.OperationScopeRedis; +import com.epmet.service.OperationScopeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 权限范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +@Service +public class OperationScopeServiceImpl extends BaseServiceImpl implements OperationScopeService { + + @Autowired + private OperationScopeRedis operationScopeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, OperationScopeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, OperationScopeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public OperationScopeDTO get(String id) { + OperationScopeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, OperationScopeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(OperationScopeDTO dto) { + OperationScopeEntity entity = ConvertUtils.sourceToTarget(dto, OperationScopeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(OperationScopeDTO dto) { + OperationScopeEntity entity = ConvertUtils.sourceToTarget(dto, OperationScopeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleScopeServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleScopeServiceImpl.java new file mode 100644 index 0000000000..4417549965 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleScopeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.RoleScopeDao; +import com.epmet.dto.RoleScopeDTO; +import com.epmet.entity.RoleScopeEntity; +import com.epmet.redis.RoleScopeRedis; +import com.epmet.service.RoleScopeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 角色能操作哪些范围 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-24 + */ +@Service +public class RoleScopeServiceImpl extends BaseServiceImpl implements RoleScopeService { + + @Autowired + private RoleScopeRedis roleScopeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RoleScopeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RoleScopeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public RoleScopeDTO get(String id) { + RoleScopeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RoleScopeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(RoleScopeDTO dto) { + RoleScopeEntity entity = ConvertUtils.sourceToTarget(dto, RoleScopeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RoleScopeDTO dto) { + RoleScopeEntity entity = ConvertUtils.sourceToTarget(dto, RoleScopeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql index bcc1d74a5d..6bcbc33e76 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql @@ -61,7 +61,8 @@ CREATE TABLE `role_operation` ( CREATE TABLE `role_scope` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', - `SCOPE_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围Key', + `OPERATION_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作Key', + `SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围Key', `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml new file mode 100644 index 0000000000..dd4554f5d8 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleScopeDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleScopeDao.xml new file mode 100644 index 0000000000..fdca928212 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleScopeDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java index 173e19243a..61944d3939 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AccessController.java @@ -30,7 +30,7 @@ public class AccessController { private AccessService accessService; /** - * 查询用户可操作功能列表(包含缓存) + * 查询用户可操作功能列表(同时更新缓存) * @param tokenDto * @param staffOperationDTO * @return diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 737988fd0b..8c03d28764 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; @@ -49,4 +50,11 @@ public interface GovOrgFeignClient { @PostMapping(value = "/gov/org/customerstaffgrid/getstaffgrid") Result getStaffGrid(@RequestBody LatestGridFormDTO latestGridFormDTO); + /** + * 根据Id查询agency + * @param agencyId + * @return + */ + @PostMapping("/gov/org/agency/{agencyId}") + Result getAgencyById(@PathVariable("agencyId") String agencyId); } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 818a325666..128f81bd50 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -3,6 +3,7 @@ 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.CustomerAgencyDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; @@ -28,6 +29,11 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGrid",latestGridFormDTO); } + @Override + public Result getAgencyById(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyById", agencyId); + } + @Override public Result getLatestCustomer(String userId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getLatestCustomer", userId); diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index 1da258978a..d76e2e2f34 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -1,14 +1,20 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.StaffPermCacheFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.dto.result.RoleOperationResultDTO; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovAccessFeignClient; +import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.AccessService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -21,12 +27,17 @@ import java.util.Set; @Service public class AccessServiceImpl implements AccessService { + private static Logger logger = LoggerFactory.getLogger(AccessServiceImpl.class); + @Autowired private EpmetUserFeignClient userFeignClient; @Autowired private GovAccessFeignClient govAccessFeignClient; + @Autowired + private GovOrgFeignClient govOrgFeignClient; + @Autowired private CpUserDetailRedis cpUserDetailRedis; @@ -49,24 +60,46 @@ public class AccessServiceImpl implements AccessService { roleDTOS.addAll(gridResult.getData()); } - // 拼装 + // 拼装操作key列表 Set opeKeys = new HashSet<>(); + // 角色ID列表 + Set roleIds = new HashSet<>(); roleDTOS.forEach(roleDto -> { String roleId = roleDto.getId(); - List roleOperations = govAccessFeignClient.listOperationsByRoleId(roleId).getData(); - roleOperations.forEach(roleOpe -> { - if (roleOpe != null) { - opeKeys.add(roleOpe.getOperationKey()); - } - }); + Result> result = govAccessFeignClient.listOperationsByRoleId(roleId); + if (result.getCode() != 0) { + // 获取operation异常 + logger.error("调用GovAccess,根据RoleId查询Operation列表失败:{}", result.getMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + List roleOperations = result.getData(); + // 角色id + roleIds.add(roleDto.getId()); + if (!CollectionUtils.isEmpty(roleOperations)) { + roleOperations.forEach(roleOpe -> { + if (roleOpe != null) { + opeKeys.add(roleOpe.getOperationKey()); + } + }); + } }); + // 查询该直属机关的orgIdPath + Result agencyById = govOrgFeignClient.getAgencyById(agencyId); + if (agencyById.getCode() != 0 || agencyById.getData() == null) { + logger.error("根据当前机构id[{}]查询pids失败:{}", agencyId, agencyById.getMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + // 将最新权限缓存到redis,为了尽量统一操作入口,调用gov-access接口实现 StaffPermCacheFormDTO staffPermCacheFormDTO = new StaffPermCacheFormDTO(); staffPermCacheFormDTO.setApp(app); staffPermCacheFormDTO.setClient(client); staffPermCacheFormDTO.setStaffId(staffId); staffPermCacheFormDTO.setPermissions(opeKeys); + staffPermCacheFormDTO.setRoleIdList(roleIds); + // 拼接orgIdPath + staffPermCacheFormDTO.setOrgIdPath(String.format("%s:%s", agencyById.getData().getPids(), agencyId)); govAccessFeignClient.updatePermissionCache(staffPermCacheFormDTO); return opeKeys; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index b8b8300489..728e6e03a8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -18,17 +18,17 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.AddAgencyResultDTO; import com.epmet.dto.result.AgencyListResultDTO; import com.epmet.dto.result.AgencysResultDTO; import com.epmet.dto.result.SubAgencyResultDTO; +import com.epmet.entity.CustomerAgencyEntity; import com.epmet.service.AgencyService; +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.List; @@ -110,4 +110,21 @@ public class AgencyController { public Result> agencyList(@RequestBody AgencyListFormDTO formDTO) { return agencyService.agencyList(formDTO); } + + /** + * 根据Id查询agency + * @param agencyId + * @return + */ + @PostMapping("{agencyId}") + public Result getAgencyById(@PathVariable("agencyId") String agencyId) { + CustomerAgencyEntity agency = agencyService.getAgencyById(agencyId); + CustomerAgencyDTO customerAgencyDTO = new CustomerAgencyDTO(); + if (agency != null) { + BeanUtils.copyProperties(agency, customerAgencyDTO); + return new Result().ok(customerAgencyDTO); + } + return new Result(); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index f2edc0c462..d09e56ba05 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -23,6 +23,7 @@ import com.epmet.dto.result.AddAgencyResultDTO; import com.epmet.dto.result.AgencyListResultDTO; import com.epmet.dto.result.AgencysResultDTO; import com.epmet.dto.result.SubAgencyResultDTO; +import com.epmet.entity.CustomerAgencyEntity; import java.util.List; @@ -80,4 +81,11 @@ public interface AgencyService { * @Description 获取组织列表 */ Result> agencyList(AgencyListFormDTO formDTO); + + /** + * 根据Id查询 + * @param agencyId + * @return + */ + CustomerAgencyEntity getAgencyById(String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index a71c53e80a..7177d64d7e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -184,4 +184,9 @@ public class AgencyServiceImpl implements AgencyService { List agencyList = customerAgencyDao.selectAgencyList(formDTO.getAgencyId()); return new Result>().ok(agencyList); } + + @Override + public CustomerAgencyEntity getAgencyById(String agencyId) { + return customerAgencyDao.selectById(agencyId); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index d0d80492b6..eaedaef1a6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -22,7 +22,7 @@ customer_staff_department WHERE del_flag = '0' - AND department_id = #{} + AND department_id = #{departmentId} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java index 78905406ba..9bc2f4c4de 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java @@ -23,7 +23,7 @@ import lombok.Data; /** - * 政府端角色表 + * 政府端角色字典表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-22 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 795b0a34d9..c3fc1b9f24 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -1,5 +1,7 @@ package com.epmet.controller; +import com.epmet.commons.mybatis.entity.DataScope; +import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.GovStaffRoleDTO; @@ -65,7 +67,7 @@ public class StaffRoleController { ValidatorUtils.validateEntity(staffRoleFormDTO, StaffRoleFormDTO.GetStaffsInRole.class); String roleKey = staffRoleFormDTO.getRoleKey(); String orgId = staffRoleFormDTO.getOrgId(); - List staffRoleDTOS = staffRoleService.listStaffsInRole(roleKey, orgId); + List staffRoleDTOS = staffRoleService.listStaffsInRole(roleKey, orgId , DataScope.getDefault()); return new Result>().ok(staffRoleDTOS); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index 88742d7400..9c6af5321e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -17,6 +17,7 @@ package com.epmet.service; +import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.StaffRoleDTO; @@ -100,7 +101,7 @@ public interface StaffRoleService extends BaseService { * @param orgId * @return */ - List listStaffsInRole(String roleKey, String orgId); + List listStaffsInRole(String roleKey, String orgId, DataScope dataScope); /** * 清空工作人员权限 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 0a9d7ce90d..180521ebe3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -19,6 +19,8 @@ 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.annotation.DataFilter; +import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -110,7 +112,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl listStaffsInRole(String roleKey, String orgId) { + public List listStaffsInRole(String roleKey, String orgId, DataScope dataScope) { return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId); } From 4cd81531f8a89ef2d9222f44cd74b77bd4bebe42 Mon Sep 17 00:00:00 2001 From: wxz Date: Sat, 25 Apr 2020 22:30:40 +0800 Subject: [PATCH 086/174] =?UTF-8?q?1.=E5=AE=8C=E6=88=90=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E8=8C=83=E5=9B=B4sql=E8=BF=87=E6=BB=A4=EF=BC=8C=E6=9C=AC?= =?UTF-8?q?=E7=BD=91=E6=A0=BCsql=E8=BF=87=E6=BB=A4=EF=BC=8C=E6=88=91?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=9A=84sql=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/aspect/DataFilterAspect.java | 171 +++++++++++------- .../mybatis/dto/form/OperationScopeDTO.java | 5 + .../dto/form/StaffPermCacheResultDTO.java | 5 + .../mybatis/feign/GovAccessFeignClient.java | 2 +- .../GovAccessFeignClientFallback.java | 4 +- .../interceptor/DataFilterInterceptor.java | 22 ++- .../epmet/commons/tools/redis/RedisKeys.java | 10 + .../dto/result/RoleOpeScopeResultDTO.java | 28 +++ .../dto/result/StaffPermCacheResultDTO.java | 5 + .../epmet/controller/AccessController.java | 18 +- .../java/com/epmet/dao/OperationScopeDao.java | 6 +- .../com/epmet/redis/OperationScopeRedis.java | 47 ----- .../com/epmet/redis/RoleOpeScopeRedis.java | 43 +++++ .../com/epmet/redis/RoleOperationRedis.java | 47 ----- .../java/com/epmet/redis/RoleScopeRedis.java | 47 ----- .../java/com/epmet/service/AccessService.java | 3 +- .../epmet/service/impl/AccessServiceImpl.java | 24 ++- .../impl/OperationScopeServiceImpl.java | 3 - .../impl/RoleOperationServiceImpl.java | 4 - .../service/impl/RoleScopeServiceImpl.java | 4 - .../db.migration/epmet_gov_access.sql | 1 + .../resources/mapper/OperationScopeDao.xml | 10 +- .../com/epmet/feign/GovAccessFeignClient.java | 2 +- 23 files changed, 256 insertions(+), 255 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOpeScopeResultDTO.java delete mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperationScopeRedis.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOpeScopeRedis.java delete mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java delete mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleScopeRedis.java diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java index b9431a6c48..13910a6f3a 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java @@ -8,8 +8,10 @@ package com.epmet.commons.mybatis.aspect; +import com.epmet.commons.mybatis.annotation.DataFilter; import com.epmet.commons.mybatis.constant.OpeScopeConstant; import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; +import com.epmet.commons.mybatis.dto.form.OperationScopeFormDTO; import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; import com.epmet.commons.mybatis.entity.DataScope; @@ -23,6 +25,7 @@ import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -53,15 +56,11 @@ public class DataFilterAspect { @Before("@annotation(com.epmet.commons.mybatis.annotation.DataFilter)") public void dataFilter(JoinPoint point) { - // 反射的方式 - //MethodSignature signature = (MethodSignature) point.getSignature(); - //Class[] parameterTypes = signature.getParameterTypes(); - //for (Class parameterType : parameterTypes) { - // if (parameterType == DataScope.class) { - // - // } - //} + // 通过反射,取到注解属性 + DataFilter dataFilterAnno = ((MethodSignature) point.getSignature()).getMethod().getAnnotation(DataFilter.class); + String tableAlias = dataFilterAnno.tableAlias(); + // 从ThreadLocal中取所需权限 String requirePermission = AccessOpeAspect.requirePermissionTl.get(); // 没有配置所需权限,不做操作,打印提示日志 if (StringUtils.isBlank(requirePermission)) { @@ -69,10 +68,14 @@ public class DataFilterAspect { return; } + String app = loginUserUtil.getLoginUserApp(); + String client = loginUserUtil.getLoginUserClient(); + String userId = loginUserUtil.getLoginUserId(); + StaffPermissionFormDTO staffPermissionFormDTO = new StaffPermissionFormDTO(); - staffPermissionFormDTO.setApp(loginUserUtil.getLoginUserApp()); - staffPermissionFormDTO.setClient(loginUserUtil.getLoginUserClient()); - staffPermissionFormDTO.setStaffId(loginUserUtil.getLoginUserId()); + staffPermissionFormDTO.setApp(app); + staffPermissionFormDTO.setClient(client); + staffPermissionFormDTO.setStaffId(userId); Result result = govAccessFeignClient.getStaffCurrPermissions(staffPermissionFormDTO); if (result.getCode() != 0) { @@ -91,10 +94,17 @@ public class DataFilterAspect { // 校验操作权限 validateOpePermission(permCacheResultDTO.getPermissions(), requirePermission); + // 生成过滤sql Object[] methodArgs = point.getArgs(); for (Object methodArg : methodArgs) { if (methodArg instanceof DataScope) { - ((DataScope) methodArg).setSqlFilter(getSqlFilterSegment(permCacheResultDTO.getRoleIdList(), requirePermission, permCacheResultDTO.getOrgIdPath())); + ((DataScope) methodArg).setSqlFilter(getSqlFilterSegment( + userId, + permCacheResultDTO.getRoleIdList(), + requirePermission, + permCacheResultDTO.getOrgIdPath(), + permCacheResultDTO.getGridId(), + tableAlias)); return; } } @@ -118,56 +128,111 @@ public class DataFilterAspect { * * @return */ - private String getSqlFilterSegment(Set roleIds, String reqiurePermission, String orgIdPath) { + private String getSqlFilterSegment(String userId,Set roleIds, String reqiurePermission, String orgIdPath, String gridId, String tableAlias) { // 根据角色列表查询操作范围列表 - // todo 暂停,先模拟数据 - //roleIds.forEach(roleId -> { - // OperationScopeFormDTO osformDto = new OperationScopeFormDTO(); - // osformDto.setRoleId(roleId); - // osformDto.setOperationKey(reqiurePermission); - // Result> result = govAccessFeignClient.getOperationScopesByRoleId(osformDto); - // List scopeDTOS = result.getData(); - //}); - Set scopeDTOS = genScopeDtos(); - - // 过滤有效范围 + Set scopeDTOS = new HashSet<>(); + roleIds.forEach(roleId -> { + OperationScopeFormDTO osformDto = new OperationScopeFormDTO(); + osformDto.setRoleId(roleId); + osformDto.setOperationKey(reqiurePermission); + Result> result = govAccessFeignClient.getOperationScopesByRoleId(osformDto); + if (result.success()) { + scopeDTOS.addAll(result.getData()); + } + }); + + // 过滤范围 HashSet scopes = filteScopes(scopeDTOS); + if (CollectionUtils.isEmpty(scopes)) { + // 没有范围限制 + return ""; + } + StringBuilder sb = new StringBuilder(); + + // 1.生成sql:组织范围过滤 + genOrgScopeSql(sb, orgIdPath, scopes, tableAlias); + + // 2.生成sql:我发起的 + genIStartedSql(sb, userId, tableAlias); + + // 3.生成sql:本网格的 + genInGrid(sb, gridId, tableAlias); + + //sb.append(")"); + System.out.println("生成的过滤sql:" + sb.toString()); + return sb.toString(); + } + + /** + * 网格sql + * @param sb + * @param gridId + * @param tableAlias + */ + private void genInGrid(StringBuilder sb, String gridId, String tableAlias) { + if (StringUtils.isBlank(tableAlias)) { + sb.append(" OR GRID_ID ='").append(gridId).append("'"); + } else { + sb.append(" OR ").append(tableAlias).append(".GRID_ID ='").append(gridId).append("'"); + } + } + + /** + * sql:我发起的 + * @param userId + */ + private void genIStartedSql(StringBuilder sb, String userId, String tableAlias) { + if (StringUtils.isBlank(tableAlias)) { + sb.append(" OR CREATED_BY ='").append(userId).append("'"); + } else { + sb.append(" OR ").append(tableAlias).append(".CREATED_BY ='").append(userId).append("'"); + } + } + /** + * 计算组织范围过滤sql,整体入口 + * @param sb + * @param orgIdPath + * @param scopes + */ + public void genOrgScopeSql(StringBuilder sb, String orgIdPath, HashSet scopes, String tableAlias) { // 取出父组织ID path 和当前组织ID String pOrgPath = orgIdPath.substring(0, orgIdPath.lastIndexOf(orgIdPathSpliter)); String currOrgPath = orgIdPath.substring(orgIdPath.lastIndexOf(orgIdPathSpliter) + 1); - - StringBuilder sb = new StringBuilder(" AND ("); - getOrgScopeSql(sb, scopes, currOrgPath, pOrgPath); + genOrgScopeSql(sb, scopes, currOrgPath, pOrgPath, tableAlias); sb.replace(sb.lastIndexOf("OR"), sb.lastIndexOf("OR") + 3, ""); - sb.append(") "); - // 拼接sql语句 - sb.replace(141,142,""); - // TODO - return ""; } /** - * 计算范围过滤sql + * 计算组织范围过滤sql * @param scopes * @param currOrg * @param pOrgPath * @return */ - private void getOrgScopeSql(StringBuilder sb,HashSet scopes, String currOrg, String pOrgPath) { + private void genOrgScopeSql(StringBuilder sb,HashSet scopes, String currOrg, String pOrgPath, String tableAlias) { for (String scope : scopes) { switch (scope) { case OpeScopeConstant.ORG_CURR: - getAgencyCurrScopedSql(sb, currOrg); - sb.append(" OR "); + if (StringUtils.isBlank(tableAlias)) { + sb.append(" ORG_ID = '").append(currOrg).append("' OR "); + } else { + sb.append(" ").append(tableAlias).append(".ORG_ID = '").append(currOrg).append("' OR "); + } break; case OpeScopeConstant.ORG_CURR_AND_SUB: - getAgencyCurrAndSubScopedSql(sb, pOrgPath); - sb.append(" OR "); + if (StringUtils.isBlank(tableAlias)) { + sb.append(" ORG_ID_PATH like '").append(pOrgPath).append("%' ").append(" OR "); + } else { + sb.append(" ").append(tableAlias).append(".ORG_ID_PATH like '").append(pOrgPath).append("%' ").append(" OR "); + } break; case OpeScopeConstant.ORG_CURR_SUB: - getAgencyCurrSubScopedSql(sb, pOrgPath, currOrg); - sb.append(" OR "); + if (StringUtils.isBlank(tableAlias)) { + sb.append(" ORG_ID_PATH like '").append(pOrgPath).append(orgIdPathSpliter).append(currOrg).append("%' ").append(" OR "); + } else { + sb.append(" ").append(tableAlias).append(".ORG_ID_PATH like '").append(pOrgPath).append(orgIdPathSpliter).append(currOrg).append("%' ").append(" OR "); + } break; case OpeScopeConstant.ORG_EQUAL: // todo 同级 @@ -185,32 +250,6 @@ public class DataFilterAspect { } } - /** - * 本身 - * @param sb - * @param orgId - */ - public void getAgencyCurrScopedSql(StringBuilder sb,String orgId) { - sb.append(" ORG_ID = ").append(orgId); - } - - /** - * 本身及子级 - * @param sb - * @param pOrgIdPath - */ - public void getAgencyCurrAndSubScopedSql(StringBuilder sb,String pOrgIdPath) { - sb.append(" ORG_ID_PATH like '").append(pOrgIdPath).append("%'"); - } - - /** - * 子级组织(不含本身) - * @param sb - */ - public void getAgencyCurrSubScopedSql(StringBuilder sb,String pOrgIdPath, String currOrgIdPath) { - sb.append("ORG_ID_PATH like '").append(pOrgIdPath).append(orgIdPathSpliter).append(currOrgIdPath).append("%'"); - } - /** * 过滤有效范围 * diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeDTO.java index 494cff66b9..3e65b753d7 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeDTO.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/OperationScopeDTO.java @@ -39,6 +39,11 @@ public class OperationScopeDTO implements Serializable { */ private String id; + /** + * 角色id + */ + private String roleId; + /** * 范围key */ diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java index 6f37ef7033..7775756b38 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java @@ -22,4 +22,9 @@ public class StaffPermCacheResultDTO { */ private String orgIdPath; + /** + * 网格ID + */ + private String gridId; + } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java index 4d04adc835..50b20890e7 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java @@ -34,6 +34,6 @@ public interface GovAccessFeignClient { * @return */ @PostMapping("/gov/access/access/operationscopes") - Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO); + Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO); } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java index 2f5b9287a1..6dfa1b89cc 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java @@ -10,7 +10,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import org.springframework.stereotype.Component; -import java.util.List; +import java.util.Set; /** * 调用政府端权限 @@ -27,7 +27,7 @@ public class GovAccessFeignClientFallback implements GovAccessFeignClient { } @Override - public Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO) { + public Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getOperationScopesByRoleId", operationScopeFormDTO); } } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java index 046c012da4..d26f7525a1 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java @@ -10,9 +10,9 @@ package com.epmet.commons.mybatis.interceptor; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.PluginUtils; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.handlers.AbstractSqlParserHandler; import com.epmet.commons.mybatis.entity.DataScope; +import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.executor.statement.StatementHandler; import org.apache.ibatis.mapping.BoundSql; import org.apache.ibatis.mapping.MappedStatement; @@ -43,10 +43,10 @@ public class DataFilterInterceptor extends AbstractSqlParserHandler implements I this.sqlParser(metaObject); // 先判断是不是SELECT操作 - MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement"); - if (!SqlCommandType.SELECT.equals(mappedStatement.getSqlCommandType())) { - return invocation.proceed(); - } + //MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement"); + //if (!SqlCommandType.SELECT.equals(mappedStatement.getSqlCommandType())) { + // return invocation.proceed(); + //} // 针对定义了rowBounds,做为mapper接口方法的参数 BoundSql boundSql = (BoundSql) metaObject.getValue("delegate.boundSql"); @@ -79,12 +79,18 @@ public class DataFilterInterceptor extends AbstractSqlParserHandler implements I // 拼接新SQL String orderBy = "ORDER BY"; String groupBy = "GROUP BY"; + String sqlFilter = scope.getSqlFilter(); + if (originalSql.indexOf("WHERE") == 0) { + // 不包含where,需要手动拼接上 + sqlFilter = " WHERE ".concat(sqlFilter); + } + if (originalSql.indexOf(groupBy) > -1) { - originalSql = originalSql.replace(groupBy, scope.getSqlFilter() + groupBy); + originalSql = originalSql.replace(groupBy, sqlFilter + groupBy); } else if (originalSql.indexOf(orderBy) > -1) { - originalSql = originalSql.replace(orderBy, scope.getSqlFilter() + orderBy); + originalSql = originalSql.replace(orderBy, sqlFilter + orderBy); } else { - originalSql = originalSql + scope.getSqlFilter(); + originalSql = originalSql.concat(" AND (").concat(scope.getSqlFilter()).concat(")"); } // 重写SQL diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 199e38e235..6598010561 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -207,4 +207,14 @@ public class RedisKeys { public static String getLoginSmsCodeKey(String app, String client, String phone) { return String.format(rootPrefix+"smsCode:login:%s:%s:%s",app,client,phone); } + + /** + * 角色的操作权限对应的可操作范围 + * @param roleId 角色ID + * @param opeKey 操作Key + * @return + */ + public static String getRoleOpeScopesKey(String roleId, String opeKey) { + return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(opeKey); + } } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOpeScopeResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOpeScopeResultDTO.java new file mode 100644 index 0000000000..fbafb374e7 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOpeScopeResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class RoleOpeScopeResultDTO { + + /** + * 角色ID + */ + private String roleId; + + /** + * 范围key + */ + private String scopeKey; + + /** + * 范围名称 + */ + private String scopeName; + + /** + * 范围序号 + */ + private String scopeIndex; + +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java index 0f6be83e72..ce24cf9501 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java @@ -23,4 +23,9 @@ public class StaffPermCacheResultDTO { */ private String orgIdPath; + /** + * 网格ID + */ + private String gridId; + } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java index d60f7cb528..e34df14a06 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.OperationScopeDTO; import com.epmet.dto.form.OperationScopeFormDTO; import com.epmet.dto.form.StaffPermCacheFormDTO; +import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.dto.result.StaffPermCacheResultDTO; import com.epmet.entity.OperationScopeEntity; import com.epmet.service.AccessService; @@ -62,26 +63,19 @@ public class AccessController { resultDTO.setPermissions(govTokenDto.getPermissions()); resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); + resultDTO.setGridId(govTokenDto.getGridId()); } return new Result().ok(resultDTO); } /** - * 查询角色的操作key对应操作范围列表(需要入缓存) + * 查询角色的操作key对应操作范围列表(缓存) * @return */ - // todo 需要加缓存 @PostMapping("operationscopes") - public Result> getOperationScopesByRoleId(@RequestBody OperationScopeFormDTO operationScopeFormDTO) { + public Result> getOperationScopesByRoleId(@RequestBody OperationScopeFormDTO operationScopeFormDTO) { ValidatorUtils.validateEntity(operationScopeFormDTO, OperationScopeFormDTO.ListOperationScopeGroup.class); - List scopes = accessService.listOperationScopesByRoleId(operationScopeFormDTO.getRoleId(), operationScopeFormDTO.getOperationKey()); - ArrayList scopeDtos = new ArrayList<>(); - scopes.forEach(scope -> { - OperationScopeDTO scopeDTO = new OperationScopeDTO(); - BeanUtils.copyProperties(scope, scopeDTO); - scopeDtos.add(scopeDTO); - }); - - return new Result>().ok(scopeDtos); + Set scopes = accessService.listOperationScopesByRoleId(operationScopeFormDTO.getRoleId(), operationScopeFormDTO.getOperationKey()); + return new Result>().ok(scopes); } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDao.java index a944cdd628..4ac02b7f91 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDao.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDao.java @@ -18,12 +18,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.entity.OperationScopeEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.context.annotation.Scope; import java.util.List; +import java.util.Set; /** * 权限范围表 @@ -40,6 +42,6 @@ public interface OperationScopeDao extends BaseDao { * @param operationKey 操作key * @return */ - List listOperationScopesByRoleId(@Param("roleId") String roleId, - @Param("operationKey") String operationKey); + Set listOperationScopesByRoleId(@Param("roleId") String roleId, + @Param("operationKey") String operationKey); } \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperationScopeRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperationScopeRedis.java deleted file mode 100644 index 3f5a7c6562..0000000000 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/OperationScopeRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * 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. - *

- * 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. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 权限范围表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-24 - */ -@Component -public class OperationScopeRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOpeScopeRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOpeScopeRedis.java new file mode 100644 index 0000000000..cd929c692d --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOpeScopeRedis.java @@ -0,0 +1,43 @@ +package com.epmet.redis; + +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.result.RoleOpeScopeResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Set; + +/** + * 角色的操作权限对应的操作范围Redis + */ +@Component +public class RoleOpeScopeRedis { + + @Autowired + private RedisUtils redisUtils; + + /** + * 缓存角色操作范围 + * @param roleId + * @param opeKey + * @param scopes + */ + public void setRoleOpeScopes(String roleId, String opeKey, Set scopes) { + String roleOpeScopesKey = RedisKeys.getRoleOpeScopesKey(roleId, opeKey); + redisUtils.set(roleOpeScopesKey, scopes); + } + + /** + * 查询角色操作范围 + * @param roleId + * @param opeKey + * @return + */ + public Set getRoleOpeScopes(String roleId, String opeKey) { + String roleOpeScopesKey = RedisKeys.getRoleOpeScopesKey(roleId, opeKey); + return (Set)redisUtils.get(roleOpeScopesKey); + } + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java deleted file mode 100644 index d57c02ebde..0000000000 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * 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. - *

- * 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. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 角色能进行那些操作 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-22 - */ -@Component -public class RoleOperationRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleScopeRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleScopeRedis.java deleted file mode 100644 index 1198f8651a..0000000000 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleScopeRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * 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. - *

- * 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. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 角色能操作哪些范围 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-24 - */ -@Component -public class RoleScopeRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java index 4355b2714b..df16e1e9df 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.entity.OperationScopeEntity; import java.util.List; @@ -26,5 +27,5 @@ public interface AccessService { * @param operationKey * @return */ - List listOperationScopesByRoleId(String roleId, String operationKey); + Set listOperationScopesByRoleId(String roleId, String operationKey); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index 95b01a1f0c..34e458ec6a 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -1,9 +1,11 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.dao.OperationScopeDao; -import com.epmet.entity.OperationScopeEntity; +import com.epmet.dto.result.RoleOpeScopeResultDTO; +import com.epmet.redis.RoleOpeScopeRedis; import com.epmet.service.AccessService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -11,8 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.HashSet; -import java.util.List; import java.util.Set; @Service @@ -26,6 +26,9 @@ public class AccessServiceImpl implements AccessService { @Autowired private OperationScopeDao operationScopeDao; + @Autowired + private RoleOpeScopeRedis roleOpeScopeRedis; + /** * 更新权限缓存 * @param staffId @@ -60,7 +63,18 @@ public class AccessServiceImpl implements AccessService { * @param operationKey * @return */ - public List listOperationScopesByRoleId(String roleId, String operationKey) { - return operationScopeDao.listOperationScopesByRoleId(roleId, operationKey); + public Set listOperationScopesByRoleId(String roleId, String operationKey) { + Set roleOpeScopes = roleOpeScopeRedis.getRoleOpeScopes(roleId, operationKey); + if (roleOpeScopes != null) { + return roleOpeScopes; + } + Set scopes = operationScopeDao.listOperationScopesByRoleId(roleId, operationKey); + try { + roleOpeScopeRedis.setRoleOpeScopes(roleId, operationKey, scopes); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error("GovAccess:查询角色的操作范围:缓存范围出错:{}", errorStackTrace); + } + return scopes; } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/OperationScopeServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/OperationScopeServiceImpl.java index fe8f8b4079..e582395fe2 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/OperationScopeServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/OperationScopeServiceImpl.java @@ -26,7 +26,6 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.OperationScopeDao; import com.epmet.dto.OperationScopeDTO; import com.epmet.entity.OperationScopeEntity; -import com.epmet.redis.OperationScopeRedis; import com.epmet.service.OperationScopeService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -46,8 +45,6 @@ import java.util.Map; @Service public class OperationScopeServiceImpl extends BaseServiceImpl implements OperationScopeService { - @Autowired - private OperationScopeRedis operationScopeRedis; @Override public PageData page(Map params) { diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java index bb6d914d2e..a690363b33 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java @@ -27,7 +27,6 @@ import com.epmet.dao.RoleOperationDao; import com.epmet.dto.RoleOperationDTO; import com.epmet.dto.result.RoleOperationResultDTO; import com.epmet.entity.RoleOperationEntity; -import com.epmet.redis.RoleOperationRedis; import com.epmet.service.RoleOperationService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -47,9 +46,6 @@ import java.util.Map; @Service public class RoleOperationServiceImpl extends BaseServiceImpl implements RoleOperationService { - @Autowired - private RoleOperationRedis roleOperationRedis; - @Override public PageData page(Map params) { IPage page = baseDao.selectPage( diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleScopeServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleScopeServiceImpl.java index 4417549965..bff52f8d64 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleScopeServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleScopeServiceImpl.java @@ -26,7 +26,6 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.RoleScopeDao; import com.epmet.dto.RoleScopeDTO; import com.epmet.entity.RoleScopeEntity; -import com.epmet.redis.RoleScopeRedis; import com.epmet.service.RoleScopeService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -46,9 +45,6 @@ import java.util.Map; @Service public class RoleScopeServiceImpl extends BaseServiceImpl implements RoleScopeService { - @Autowired - private RoleScopeRedis roleScopeRedis; - @Override public PageData page(Map params) { IPage page = baseDao.selectPage( diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql index 6bcbc33e76..93d8c2a148 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql @@ -10,6 +10,7 @@ CREATE TABLE `operation_scope` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id', `SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围key', `SCOPE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围名称', + `SCOPE_INDEX` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围序号', `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml index dd4554f5d8..ab6839e941 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml @@ -16,13 +16,13 @@ - + select os.SCOPE_KEY, os.SCOPE_NAME, rs.ROLE_ID, os.SCOPE_INDEX from role_scope rs - inner join operation_scope os - on (rs.SCOPE_KEY = os.SCOPE_KEY) + inner join operation_scope os + on (rs.SCOPE_KEY = os.SCOPE_KEY) where rs.ROLE_ID = #{roleId} - and rs.OPERATION_KEY = #{operationKey} + and rs.OPERATION_KEY = #{operationKey} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java index 8cb514ad3f..b41a5e59ca 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -16,7 +16,7 @@ import java.util.List; * @Description * @Author sun */ -@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) +@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class, url = "localhost:8099") public interface GovAccessFeignClient { /** From 54294a9ed1fb421a45cd21a976914c61992f74f9 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Sun, 26 Apr 2020 09:00:30 +0800 Subject: [PATCH 087/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81=E8=A1=A5=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/CustomerStaffDepartmentDao.java | 7 +++++++ .../mapper/CustomerStaffDepartmentDao.xml | 14 +------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java index dfdba500d7..22ab90c4ba 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java @@ -33,5 +33,12 @@ import java.util.List; @Mapper public interface CustomerStaffDepartmentDao extends BaseDao { + /** + * + * @param departmentId + * @return + * * @Author sun + * @Description 查询部门下工作人员的用户Id集合 + */ List selectUserIdByDepartmentId(@Param("departmentId") String departmentId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 86c597d402..8df91287f1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -3,18 +3,6 @@ - - - - - - - - - - - - From c3ced082931fd17ba98cfad0d1ab425310acf295 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Sun, 26 Apr 2020 09:14:47 +0800 Subject: [PATCH 088/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=B7=BB=E5=8A=A0token=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/AgencyController.java | 14 ++++++++------ .../com/epmet/controller/DepartmentController.java | 12 ++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 728e6e03a8..2ddc8f3c98 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -17,6 +17,8 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +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.*; @@ -52,7 +54,7 @@ public class AgencyController { * @Description 添加组织 */ @PostMapping("addagency") - public Result addAgency(@RequestBody AddAgencyFormDTO formDTO) { + public Result addAgency(@LoginUser TokenDto tokenDTO, @RequestBody AddAgencyFormDTO formDTO) { return agencyService.addAgency(formDTO); } @@ -63,7 +65,7 @@ public class AgencyController { * @Description 组织名称编辑 */ @PostMapping("editagency") - public Result editAgency(@RequestBody EditAgencyFormDTO formDTO) { + public Result editAgency(@LoginUser TokenDto tokenDTO, @RequestBody EditAgencyFormDTO formDTO) { return agencyService.editAgency(formDTO); } @@ -74,7 +76,7 @@ public class AgencyController { * @Description 删除组织机关 */ @PostMapping("removeagency") - public Result removeAgency(@RequestBody RemoveAgencyFormDTO formDTO) { + public Result removeAgency(@LoginUser TokenDto tokenDTO, @RequestBody RemoveAgencyFormDTO formDTO) { return agencyService.removeAgency(formDTO); } @@ -85,7 +87,7 @@ public class AgencyController { * @Description 组织首页-获取组织机构信息 */ @PostMapping("agencydetail") - public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) { + public Result agencyDetail(@LoginUser TokenDto tokenDTO, @RequestBody AgencydetailFormDTO formDTO) { return agencyService.agencyDetail(formDTO); } @@ -96,7 +98,7 @@ public class AgencyController { * @Description 组织首页-下级机关列表 */ @PostMapping("subagencylist") - public Result subAgencyList(@RequestBody SubAgencyFormDTO formDTO) { + public Result subAgencyList(@LoginUser TokenDto tokenDTO, @RequestBody SubAgencyFormDTO formDTO) { return agencyService.subAgencyList(formDTO); } @@ -107,7 +109,7 @@ public class AgencyController { * @Description 获取组织列表 */ @PostMapping("agencylist") - public Result> agencyList(@RequestBody AgencyListFormDTO formDTO) { + public Result> agencyList(@LoginUser TokenDto tokenDTO, @RequestBody AgencyListFormDTO formDTO) { return agencyService.agencyList(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java index eba65e1372..4d627ebaac 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -47,7 +47,7 @@ public class DepartmentController { * @Description 添加部门 */ @PostMapping("adddepartment") - public Result addDepartment(@RequestBody AddDepartmentFormDTO formDTO) { + public Result addDepartment(@LoginUser TokenDto tokenDTO, @RequestBody AddDepartmentFormDTO formDTO) { return departmentService.addDepartment(formDTO); } @@ -58,7 +58,7 @@ public class DepartmentController { * @Description 部门信息修改 */ @PostMapping("editdepartment") - public Result editDepartment(@RequestBody EditDepartmentFormDTO formDTO) { + public Result editDepartment(@LoginUser TokenDto tokenDTO, @RequestBody EditDepartmentFormDTO formDTO) { return departmentService.editDepartment(formDTO); } @@ -69,7 +69,7 @@ public class DepartmentController { * @Description 删除部门 */ @PostMapping("removedepartment") - public Result removeDepartment(@RequestBody RemoveDepartmentFormDTO formDTO) { + public Result removeDepartment(@LoginUser TokenDto tokenDTO, @RequestBody RemoveDepartmentFormDTO formDTO) { return departmentService.removeDepartment(formDTO); } @@ -80,7 +80,7 @@ public class DepartmentController { * @Description 获取部门详情 */ @PostMapping("departmentdetail") - public Result departmentDetail(@RequestBody DepartmentdetailFormDTO formDTO) { + public Result departmentDetail(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentdetailFormDTO formDTO) { return departmentService.departmentDetail(formDTO); } @@ -91,7 +91,7 @@ public class DepartmentController { * @Description 组织首页-获取机关下部门列表 */ @PostMapping("departmentinagencylist") - public Result departmentInAgencyList(@RequestBody DepartmentInAgencyFormDTO formDTO) { + public Result departmentInAgencyList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentInAgencyFormDTO formDTO) { return departmentService.departmentInAgencyList(formDTO); } @@ -102,7 +102,7 @@ public class DepartmentController { * @Description 获取机构下部门列表 */ @PostMapping("departmentlist") - public Result> departmentList(@RequestBody DepartmentListFormDTO formDTO) { + public Result> departmentList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentListFormDTO formDTO) { return departmentService.departmentList(formDTO); } } \ No newline at end of file From 4582b9f3647dc60220422b28c449a320e6aaae4f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Sun, 26 Apr 2020 09:26:29 +0800 Subject: [PATCH 089/174] =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=96=B9=E6=B3=95=E6=B7=BB=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/CustomerStaffServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 d3a98772bd..f5a2d154b1 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 @@ -19,6 +19,7 @@ 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.entity.DataScope; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -354,7 +355,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl staffRoleDTOS = staffRoleService.listStaffsInRole(UserRoleConstant.DEPT_LEADER, formDTO.getDepartmentId()); + List staffRoleDTOS = staffRoleService.listStaffsInRole(UserRoleConstant.DEPT_LEADER, formDTO.getDepartmentId(), DataScope.getDefault()); staffRoleDTOS.forEach(roleDto -> { staffList.stream().filter(staffDto -> roleDto.getStaffId().equals(staffDto.getStaffId())).findAny().ifPresent(result -> From 70853b9aed1e7212c29d727d0538117b9c11b355 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 09:44:06 +0800 Subject: [PATCH 090/174] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/pom.xml | 18 ++++++++---------- epmet-module/pom.xml | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 3dad66dba9..f7e2cbe847 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -154,19 +154,17 @@ - lb://resi-partymember-server - - - http://127.0.0.1:8099 - - - - http://127.0.0.1:8098 - http://127.0.0.1:8096 + http://127.0.0.1:8097 - + + + http://127.0.0.1:8098 + + + http://127.0.0.1:8099 + diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index 48ae687bb5..025ecabf30 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -28,7 +28,6 @@ resi-group resi-partymember gov-grid - gov-access gov-mine From b6cee2916582a68442eeda8907b7d4e8ad28f060 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 09:59:44 +0800 Subject: [PATCH 091/174] =?UTF-8?q?0.3.1=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-admin/epmet-admin-server/docker-compose.yml | 2 +- epmet-admin/epmet-admin-server/pom.xml | 2 +- epmet-auth/docker-compose.yml | 2 +- epmet-auth/pom.xml | 2 +- epmet-gateway/docker-compose.yml | 2 +- epmet-gateway/pom.xml | 2 +- .../epmet-message-server/docker-compose.yml | 2 +- .../epmet-message/epmet-message-server/pom.xml | 2 +- .../gov-access/gov-access-server/Dockerfile | 11 +++++++++++ .../gov-access-server/docker-compose.yml | 15 +++++++++++++++ .../gov-grid/gov-grid-server/docker-compose.yml | 2 +- epmet-module/gov-grid/gov-grid-server/pom.xml | 2 +- epmet-module/gov-mine/gov-mine-server/Dockerfile | 11 +++++++++++ .../gov-mine/gov-mine-server/docker-compose.yml | 15 +++++++++++++++ epmet-module/gov-mine/gov-mine-server/pom.xml | 2 +- .../gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- .../oper-access-server/docker-compose.yml | 2 +- .../oper-access/oper-access-server/pom.xml | 2 +- .../oper-crm/oper-crm-server/docker-compose.yml | 2 +- epmet-module/oper-crm/oper-crm-server/pom.xml | 2 +- .../oper-customize-server/docker-compose.yml | 2 +- .../oper-customize/oper-customize-server/pom.xml | 2 +- .../resi-group-server/docker-compose.yml | 2 +- epmet-module/resi-group/resi-group-server/pom.xml | 2 +- .../resi-guide-server/docker-compose.yml | 2 +- epmet-module/resi-guide/resi-guide-server/pom.xml | 2 +- .../resi-mine/resi-mine-server/docker-compose.yml | 2 +- epmet-module/resi-mine/resi-mine-server/pom.xml | 2 +- .../resi-partymember-server/docker-compose.yml | 2 +- .../resi-partymember-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 33 files changed, 81 insertions(+), 29 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-server/Dockerfile create mode 100644 epmet-module/gov-access/gov-access-server/docker-compose.yml create mode 100644 epmet-module/gov-mine/gov-mine-server/Dockerfile create mode 100644 epmet-module/gov-mine/gov-mine-server/docker-compose.yml diff --git a/epmet-admin/epmet-admin-server/docker-compose.yml b/epmet-admin/epmet-admin-server/docker-compose.yml index de2d42400a..9146d19288 100644 --- a/epmet-admin/epmet-admin-server/docker-compose.yml +++ b/epmet-admin/epmet-admin-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-admin-server: container_name: epmet-admin-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-admin-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-admin-server:0.3.1 ports: - "8082:8082" network_mode: host # 使用现有网络 diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 3e6ea66091..1f80a977de 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet epmet-admin diff --git a/epmet-auth/docker-compose.yml b/epmet-auth/docker-compose.yml index 34a1b75aa1..cb94815239 100644 --- a/epmet-auth/docker-compose.yml +++ b/epmet-auth/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-auth:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-auth:0.3.1 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index d7f65bb65c..cde69ddcea 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet epmet-cloud diff --git a/epmet-gateway/docker-compose.yml b/epmet-gateway/docker-compose.yml index 92f43dd02d..349d73db38 100644 --- a/epmet-gateway/docker-compose.yml +++ b/epmet-gateway/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-gateway:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-gateway:0.3.1 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index f7e2cbe847..dbee124260 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet epmet-cloud diff --git a/epmet-module/epmet-message/epmet-message-server/docker-compose.yml b/epmet-module/epmet-message/epmet-message-server/docker-compose.yml index ae7864d1f1..76db1b8a99 100644 --- a/epmet-module/epmet-message/epmet-message-server/docker-compose.yml +++ b/epmet-module/epmet-message/epmet-message-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-message-server: container_name: epmet-message-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-message-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-message-server:0.3.1 ports: - "8085:8085" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index f54b2636a0..b713085343 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet epmet-message diff --git a/epmet-module/gov-access/gov-access-server/Dockerfile b/epmet-module/gov-access/gov-access-server/Dockerfile new file mode 100644 index 0000000000..af8e62bd87 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8099 + +ENTRYPOINT ["java","-Xms32m","-Xmx200m","-jar","./app.jar"] \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/docker-compose.yml b/epmet-module/gov-access/gov-access-server/docker-compose.yml new file mode 100644 index 0000000000..ab43232d2f --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.7" +services: + gov-access-server: + container_name: gov-access-server-dev + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-access-server:0.3.1 + ports: + - "8099:8099" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-server/docker-compose.yml b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml index add5f80e47..315dd41d48 100644 --- a/epmet-module/gov-grid/gov-grid-server/docker-compose.yml +++ b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-grid-server: container_name: gov-grid-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.1 ports: - "8097:8097" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index 7728630e09..3e692a9b87 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-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"> 4.0.0 - 0.3.0 + 0.3.1 com.epmet gov-grid diff --git a/epmet-module/gov-mine/gov-mine-server/Dockerfile b/epmet-module/gov-mine/gov-mine-server/Dockerfile new file mode 100644 index 0000000000..0bdb6f026f --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8098 + +ENTRYPOINT ["java","-Xms32m","-Xmx200m","-jar","./app.jar"] \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/docker-compose.yml b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml new file mode 100644 index 0000000000..e689dae8a8 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.7" +services: + gov-mine-server: + container_name: gov-mine-server-dev + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-mine-server:0.3.1 + ports: + - "8098:8098" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index b06d8fc331..b05b115c19 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.0 + 0.3.1 com.epmet gov-mine diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index a9dc0ab939..742c97095c 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.1 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index a9bd2b6ba3..47d6620c5f 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet gov-org diff --git a/epmet-module/oper-access/oper-access-server/docker-compose.yml b/epmet-module/oper-access/oper-access-server/docker-compose.yml index 408d95e028..5a1d46a22f 100644 --- a/epmet-module/oper-access/oper-access-server/docker-compose.yml +++ b/epmet-module/oper-access/oper-access-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-access-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-access-server:0.3.1 ports: - "8093:8093" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-access/oper-access-server/pom.xml b/epmet-module/oper-access/oper-access-server/pom.xml index ad0c4c39e2..a66ed82570 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/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"> - 0.3.0 + 0.3.1 oper-access com.epmet diff --git a/epmet-module/oper-crm/oper-crm-server/docker-compose.yml b/epmet-module/oper-crm/oper-crm-server/docker-compose.yml index 6f2d6efb3d..7f764b7352 100644 --- a/epmet-module/oper-crm/oper-crm-server/docker-compose.yml +++ b/epmet-module/oper-crm/oper-crm-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-crm-server:0.3.1 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-crm-server:0.3.2 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 14a2d4092f..fa01ae7bee 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.1 + 0.3.2 com.epmet oper-crm diff --git a/epmet-module/oper-customize/oper-customize-server/docker-compose.yml b/epmet-module/oper-customize/oper-customize-server/docker-compose.yml index f349aa1dab..8ef5e0356c 100644 --- a/epmet-module/oper-customize/oper-customize-server/docker-compose.yml +++ b/epmet-module/oper-customize/oper-customize-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-customize-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/oper-customize-server:0.3.1 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 41fba9d560..63fe24d991 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet oper-customize diff --git a/epmet-module/resi-group/resi-group-server/docker-compose.yml b/epmet-module/resi-group/resi-group-server/docker-compose.yml index 2ce2a5c1c8..71d431ff77 100644 --- a/epmet-module/resi-group/resi-group-server/docker-compose.yml +++ b/epmet-module/resi-group/resi-group-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-group-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-group-server:0.3.1 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 70d3d5a8c4..0b840fc27d 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet resi-group diff --git a/epmet-module/resi-guide/resi-guide-server/docker-compose.yml b/epmet-module/resi-guide/resi-guide-server/docker-compose.yml index 0fc4046b76..732186e463 100644 --- a/epmet-module/resi-guide/resi-guide-server/docker-compose.yml +++ b/epmet-module/resi-guide/resi-guide-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-guide-server: container_name: resi-guide-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-guide-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-guide-server:0.3.1 ports: - "8091:8091" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index 312ad1d2b0..0d31597b1f 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet resi-guide diff --git a/epmet-module/resi-mine/resi-mine-server/docker-compose.yml b/epmet-module/resi-mine/resi-mine-server/docker-compose.yml index 8e86a64717..6c11ddb5a4 100644 --- a/epmet-module/resi-mine/resi-mine-server/docker-compose.yml +++ b/epmet-module/resi-mine/resi-mine-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-mine-server: container_name: resi-mine-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-mine-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-mine-server:0.3.1 ports: - "8094:8094" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 77cc559c92..3a8a7018f2 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet resi-mine diff --git a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml index 19c370d73f..c0884953e7 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.1 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 0ac1f5db89..fe38df5cae 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet resi-partymember diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index c5fd005922..c11bcbe507 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.1 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 761a0299a9..809976a3d5 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet epmet-user From fa5ad036e554891064c0d9be1e23f978fdf51694 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 10:00:36 +0800 Subject: [PATCH 092/174] =?UTF-8?q?0.3.1=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-access/gov-access-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index f71a21d4a0..9fe84d7d5b 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.0 + 0.3.1 gov-access com.epmet From 46d7f7ff76413653eb4133073f09164cc969a76a Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Sun, 26 Apr 2020 10:20:24 +0800 Subject: [PATCH 093/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/CustomerGridDao.java | 9 +++++++++ .../java/com/epmet/feign/EpmetUserFeignClient.java | 2 +- .../feign/fallback/EpmetUserFeignClientFallBack.java | 2 +- .../epmet/service/impl/CustomerGridServiceImpl.java | 5 ++--- .../src/main/resources/mapper/CustomerGridDao.xml | 11 +++++++++++ .../com/epmet/controller/CustomerStaffController.java | 2 +- .../src/main/java/com/epmet/dao/CustomerStaffDao.java | 2 +- .../java/com/epmet/service/CustomerStaffService.java | 2 +- .../epmet/service/impl/CustomerStaffServiceImpl.java | 2 +- .../src/main/resources/mapper/CustomerStaffDao.xml | 7 +++++-- 10 files changed, 33 insertions(+), 11 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index d15a7c7032..a43d3e56ae 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.UserIdDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.DeleteGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; @@ -123,5 +124,13 @@ public interface CustomerGridDao extends BaseDao { */ void deleteGrid(DeleteGridFormDTO deleteGridFormDTO); + /** + * + * @Description 根据gridId查询userId + * @Author zxc + * @CreatedTime 2020/4/26 10:08 + */ + List selectUserIdByGrid(@Param("gridId")String gridId); + } \ 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 8eb86517de..aa12f45ab9 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 @@ -62,7 +62,7 @@ public interface EpmetUserFeignClient { * @return */ @PostMapping(value = "/epmetuser/customerstaff/selectgridstaffcountbyuserid") - Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO); + Result selectGridStaffCountByUserId(@RequestBody List userIdDTO); /** * 工作人员列表 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 1284fb622b..29986d388f 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 @@ -42,7 +42,7 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { } @Override - public Result selectGridStaffCountByUserId(UserIdDTO userIdDTO) { + public Result selectGridStaffCountByUserId(List userIdDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectGridStaffCountByUserId", userIdDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 075799dfb8..00db15a6bd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -223,10 +223,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl userIdDTOS = baseDao.selectUserIdByGrid(deleteGridFormDTO.getGridId()); deleteGridFormDTO.setUserId(tokenDto.getUserId()); - Result gridStaffCountDTOResult = epmetUserFeignClient.selectGridStaffCountByUserId(userIdDTO); + Result gridStaffCountDTOResult = epmetUserFeignClient.selectGridStaffCountByUserId(userIdDTOS); if (gridStaffCountDTOResult.getData().getEnableCount()==0){ baseDao.deleteGrid(deleteGridFormDTO); }else { diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index c7a54db7b9..4ab272a119 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -194,4 +194,15 @@ id = #{gridId} + + + \ 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 748252137b..c499eb62e7 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 @@ -175,7 +175,7 @@ public class CustomerStaffController { * @auther zxc */ @PostMapping(value = "selectgridstaffcountbyuserid") - public Result selectGridStaffCountByUserId(@RequestBody UserIdDTO userIdDTO){ + public Result selectGridStaffCountByUserId(@RequestBody List userIdDTO){ return customerStaffService.selectGridStaffCountByUserId(userIdDTO); } 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 6c4cab6dc7..2b5fe0cb46 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 @@ -62,7 +62,7 @@ public interface CustomerStaffDao extends BaseDao { * @param userIdDTO * @return */ - GridStaffCountDTO selectGridStaffCountByUserId(UserIdDTO userIdDTO); + GridStaffCountDTO selectGridStaffCountByUserId(List userIdDTO); /** * 根据userId查询查询网格下的用户信息 * 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 abd130c21c..92f6779396 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 @@ -204,7 +204,7 @@ public interface CustomerStaffService extends BaseService { * @param userIdDTO * @return */ - Result selectGridStaffCountByUserId(UserIdDTO userIdDTO); + Result selectGridStaffCountByUserId(List userIdDTO); /** * @param fromDTO 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 f5a2d154b1..d6a76ac6f9 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 @@ -340,7 +340,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl selectGridStaffCountByUserId(UserIdDTO userIdDTO) { + public Result selectGridStaffCountByUserId(List userIdDTO) { Result gridStaffCountDTOResult = new Result(); GridStaffCountDTO gridStaffCountDTO = baseDao.selectGridStaffCountByUserId(userIdDTO); gridStaffCountDTOResult.setData(gridStaffCountDTO); 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 d1cfdd797d..9335d663bd 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 @@ -44,13 +44,16 @@ - SELECT count(*) AS enableCount FROM customer_staff WHERE - user_id = #{userId} + user_id in + + #{staff.userId} + AND del_flag = 0 AND enable_flag = 'enable' From 13e8390b90303d9b78929d19c672891a6bb7314e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 11:06:54 +0800 Subject: [PATCH 094/174] govorg,epmetuser0.3.2 --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 742c97095c..4bc945c3b1 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.1 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.2 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 47d6620c5f..d895cad4c0 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.1 + 0.3.2 com.epmet gov-org diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index c11bcbe507..a2cd47e239 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.1 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.2 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 809976a3d5..c3b3082447 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.1 + 0.3.2 com.epmet epmet-user From b85a33b2294e66c0cf87846f24d7d52417eac7ef Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Sun, 26 Apr 2020 13:17:21 +0800 Subject: [PATCH 095/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/exception/EpmetErrorCode.java | 4 +++- .../main/java/com/epmet/dto/form/EditGridFormDTO.java | 5 +++++ .../src/main/java/com/epmet/dao/CustomerGridDao.java | 2 +- .../epmet/service/impl/CustomerGridServiceImpl.java | 10 +++++++++- .../src/main/resources/mapper/CustomerGridDao.xml | 1 + 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 161c9cd9ef..f84dfde45f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -32,7 +32,9 @@ public enum EpmetErrorCode { NOT_DEL_AGENCY_PER(8205, "该机关存在工作人员,不允许删除"), NOT_DEL_DEPARTMENT(8206, "该部门存在工作人员,不允许删除"), - REQUIRE_PERMISSION(8301, "没有足够的操作权限"); + REQUIRE_PERMISSION(8301, "没有足够的操作权限"), + + NOT_ADD_GRID(8401,"您当前的网格名称已存在,请重新修改"); private int code; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java index 2c5556f7a3..b22e5048f9 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java @@ -18,6 +18,11 @@ public class EditGridFormDTO implements Serializable { */ private String gridId; + /** + * pid 当前机关id + */ + private String agencyId; + /** * 网格名称 */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index a43d3e56ae..11fb36a5fc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -110,7 +110,7 @@ public interface CustomerGridDao extends BaseDao { * @param gridName * @return */ - String selectGridIdByGridName(@Param("gridName")String gridName); + String selectGridIdByGridName(@Param("gridName")String gridName,@Param("agencyId")String pid); /** * 编辑网格信息 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 00db15a6bd..f783b6c336 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -186,6 +186,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) { + String checkGridName = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(),addGridFormDTO.getAgencyId()); + if (checkGridName!=null){ + return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode()); + } CustomerGridEntity customerGridEntity = new CustomerGridEntity(); customerGridEntity.setCustomerId(baseDao.selectCustomerIdByUserId(tokenDto.getUserId())); customerGridEntity.setGridName(addGridFormDTO.getGridName()); @@ -197,7 +201,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(addGridResultDTO); @@ -211,6 +215,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl From 1a7d7691393766a7a9ce57dfb72883c32c733242 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 13:27:15 +0800 Subject: [PATCH 096/174] =?UTF-8?q?getMyOrg=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/CustomerAgencyDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 90b926b729..ace0e18f8e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -24,8 +24,8 @@ SELECT - ca.pid AS rootAgencyId, + ca.id AS rootAgencyId, ca.ORGANIZATION_NAME AS rootAgencyName, ca.CUSTOMER_ID AS customerId FROM From 0c87e7363ab8970b0ceec92e359d1d19029d38f8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 13:56:08 +0800 Subject: [PATCH 099/174] =?UTF-8?q?govorg0.3.4=E8=8E=B7=E5=8F=96=E6=88=91?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E7=BB=87=E6=8E=A5=E5=8F=A3=E5=8F=91=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 05add8607c..6b32980276 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.3 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.4 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 320adae369..e7a982744e 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.3 + 0.3.4 com.epmet gov-org From dc4769ffbafda895cd9a5a53a39bcb0fda84b955 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 14:20:06 +0800 Subject: [PATCH 100/174] =?UTF-8?q?-=20/auth/gov/loginwxmp/loginout?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index c62dda3be3..f83c45f2f1 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -300,6 +300,7 @@ epmet: - /resi/guide/stranger/getgridhome - /resi/guide/user/entergrid - /auth/login/logout + - /auth/gov/loginwxmp/loginout - /resi/mine/** - /resi/group/** - /resi/partymember/** From 4d733c7db9cdcbe6fd2228361a040aa2c0ba2056 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 14:20:24 +0800 Subject: [PATCH 101/174] =?UTF-8?q?-=20/auth/gov/loginwxmp/loginout?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/docker-compose.yml | 2 +- epmet-gateway/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-gateway/docker-compose.yml b/epmet-gateway/docker-compose.yml index 349d73db38..4a0582ca7e 100644 --- a/epmet-gateway/docker-compose.yml +++ b/epmet-gateway/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-gateway:0.3.1 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-gateway:0.3.2 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index dbee124260..0455fd3a0b 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.1 + 0.3.2 com.epmet epmet-cloud From add02f02100d44560b2977d05b315df8e014a922 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Sun, 26 Apr 2020 15:10:46 +0800 Subject: [PATCH 102/174] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=B1=BB=E5=9E=8B=E5=8F=98=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/CustomerAgencyDTO.java | 2 +- .../src/main/java/com/epmet/entity/CustomerAgencyEntity.java | 2 +- .../src/main/java/com/epmet/excel/CustomerAgencyExcel.java | 2 +- .../src/main/resources/db/migration/epmet_gov_org.sql | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java index 7b9abc9de6..f7380580b4 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java @@ -75,7 +75,7 @@ public class CustomerAgencyDTO implements Serializable { /** * 地区编码 */ - private Integer areaCode; + private String areaCode; /** * 删除标识 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index 5549845d66..6a669609eb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java @@ -75,7 +75,7 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { /** * 地区编码 */ - private Integer areaCode; + private String areaCode; /** * 总人数 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java index 346963be94..7edffbcc60 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java @@ -53,7 +53,7 @@ public class CustomerAgencyExcel { private String level; @Excel(name = "地区编码") - private Integer areaCode; + private String areaCode; @Excel(name = "删除标识") private String delFlag; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql index f4d0e47dc7..aa68f1c8fa 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql @@ -110,4 +110,6 @@ ALTER TABLE customer_agency ADD ( PROVINCE VARCHAR (32) DEFAULT NULL COMMENT '省份', CITY VARCHAR (32) DEFAULT NULL COMMENT '城市', DISTRICT VARCHAR (32) DEFAULT NULL COMMENT '区县' -); \ No newline at end of file +); + +ALTER TABLE customer_agency MODIFY AREA_CODE VARCHAR(10) NOT NULL; \ No newline at end of file From f9c6972ea5d94fc44f2237d131b682c00301915b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Sun, 26 Apr 2020 15:36:09 +0800 Subject: [PATCH 103/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=87=AA=E6=B5=8B=E7=A8=8B=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/AddAgencyFormDTO.java | 19 ++++++---- .../epmet/dto/form/AddDepartmentFormDTO.java | 2 ++ .../epmet/controller/AgencyController.java | 7 ++++ .../controller/DepartmentController.java | 7 ++++ .../com/epmet/feign/EpmetUserFeignClient.java | 2 +- .../epmet/service/impl/AgencyServiceImpl.java | 23 +++++++++--- .../mapper/CustomerDepartmentDao.xml | 35 +++++++++++-------- .../controller/CustomerStaffController.java | 2 +- 8 files changed, 69 insertions(+), 28 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java index 7cb0a69b27..1e7cd65f80 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java @@ -20,6 +20,7 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -37,7 +38,7 @@ public class AddAgencyFormDTO implements Serializable { * 上级机关组织Id(当前机关组织添加下级组织) */ @NotBlank(message = "上级机关组织ID不能为空") - private String pid; + private String parentAgencyId; /** * 机构组织名称 @@ -52,27 +53,31 @@ public class AddAgencyFormDTO implements Serializable { * 市级: city * 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) */ + @NotBlank(message = "机关级别不能为空") private String level; /** * 地区编码 */ - private Integer areaCode; - - /** - * 国家 - */ - private String district; + @NotBlank(message = "地区编码不能为空") + private String areaCode; /** * 省份 */ + @NotBlank(message = "省级名称不能为空") private String province; /** * 城市 */ + @NotBlank(message = "市级名称不能为空") private String city; + /** + * 区县 + */ + @NotBlank(message = "区县名称不能为空") + private String district; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java index 57680d2ecd..e03ad75034 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java @@ -40,11 +40,13 @@ public class AddDepartmentFormDTO implements Serializable { /** * 部门名称 */ + @NotBlank(message = "部门名称不能为空") private String departmentName; /** * 部门职责 */ + @NotBlank(message = "部门职责不能为空") private String departmentDuty; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 2ddc8f3c98..7f192ee942 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -20,6 +20,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.AddAgencyResultDTO; @@ -55,6 +56,7 @@ public class AgencyController { */ @PostMapping("addagency") public Result addAgency(@LoginUser TokenDto tokenDTO, @RequestBody AddAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return agencyService.addAgency(formDTO); } @@ -66,6 +68,7 @@ public class AgencyController { */ @PostMapping("editagency") public Result editAgency(@LoginUser TokenDto tokenDTO, @RequestBody EditAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return agencyService.editAgency(formDTO); } @@ -77,6 +80,7 @@ public class AgencyController { */ @PostMapping("removeagency") public Result removeAgency(@LoginUser TokenDto tokenDTO, @RequestBody RemoveAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return agencyService.removeAgency(formDTO); } @@ -88,6 +92,7 @@ public class AgencyController { */ @PostMapping("agencydetail") public Result agencyDetail(@LoginUser TokenDto tokenDTO, @RequestBody AgencydetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return agencyService.agencyDetail(formDTO); } @@ -99,6 +104,7 @@ public class AgencyController { */ @PostMapping("subagencylist") public Result subAgencyList(@LoginUser TokenDto tokenDTO, @RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return agencyService.subAgencyList(formDTO); } @@ -110,6 +116,7 @@ public class AgencyController { */ @PostMapping("agencylist") public Result> agencyList(@LoginUser TokenDto tokenDTO, @RequestBody AgencyListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return agencyService.agencyList(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java index 4d627ebaac..b55e48a3e0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; import com.epmet.dto.result.AddDepartmentResultDTO; import com.epmet.dto.result.DepartmentDetailResultDTO; @@ -48,6 +49,7 @@ public class DepartmentController { */ @PostMapping("adddepartment") public Result addDepartment(@LoginUser TokenDto tokenDTO, @RequestBody AddDepartmentFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return departmentService.addDepartment(formDTO); } @@ -59,6 +61,7 @@ public class DepartmentController { */ @PostMapping("editdepartment") public Result editDepartment(@LoginUser TokenDto tokenDTO, @RequestBody EditDepartmentFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return departmentService.editDepartment(formDTO); } @@ -70,6 +73,7 @@ public class DepartmentController { */ @PostMapping("removedepartment") public Result removeDepartment(@LoginUser TokenDto tokenDTO, @RequestBody RemoveDepartmentFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return departmentService.removeDepartment(formDTO); } @@ -81,6 +85,7 @@ public class DepartmentController { */ @PostMapping("departmentdetail") public Result departmentDetail(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentdetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return departmentService.departmentDetail(formDTO); } @@ -92,6 +97,7 @@ public class DepartmentController { */ @PostMapping("departmentinagencylist") public Result departmentInAgencyList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentInAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return departmentService.departmentInAgencyList(formDTO); } @@ -103,6 +109,7 @@ public class DepartmentController { */ @PostMapping("departmentlist") public Result> departmentList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return departmentService.departmentList(formDTO); } } \ 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 aa12f45ab9..1d52e9072d 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 @@ -132,7 +132,7 @@ public interface EpmetUserFeignClient { * @Description 根据客户Id及userId集合查询用户基本信息 */ @PostMapping("/epmetuser/customerstaff/getdepartmentstafflist") - Result> getDepartmentStaffList(DepartmentInStaffFormDTO departmentInStaffFormDTO); + Result> getDepartmentStaffList(@RequestBody DepartmentInStaffFormDTO departmentInStaffFormDTO); /** * 根据userId查询customerId diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 7177d64d7e..f1901d64cf 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.service.AgencyService; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -65,14 +66,19 @@ public class AgencyServiceImpl implements AgencyService { entity.setOrganizationName(formDTO.getAgencyName()); entity.setTotalUser(NumConstant.ZERO); //1:查询上级机关信息 - CustomerAgencyEntity parentEntity = customerAgencyDao.selectById(formDTO.getPid()); + CustomerAgencyEntity parentEntity = customerAgencyDao.selectById(formDTO.getParentAgencyId()); + if (null == parentEntity) { + log.error(CustomerAgencyConstant.SAVE_EXCEPTION); + throw new RenException(CustomerAgencyConstant.SAVE_EXCEPTION); + } + entity.setPid(parentEntity.getId()); entity.setCustomerId(parentEntity.getCustomerId()); - if (null == parentEntity.getPid()) { + if (StringUtils.isBlank(parentEntity.getPid())) { entity.setPids(parentEntity.getId()); entity.setAllParentName(parentEntity.getOrganizationName()); } else { - entity.setPids(":" + parentEntity.getId()); - entity.setAllParentName("-" + parentEntity.getOrganizationName()); + entity.setPids(parentEntity.getPids()+":" + parentEntity.getId()); + entity.setAllParentName(parentEntity.getAllParentName()+"-" + parentEntity.getOrganizationName()); } //2:保存组织信息 if (customerAgencyDao.insert(entity) < NumConstant.ONE) { @@ -121,7 +127,14 @@ public class AgencyServiceImpl implements AgencyService { result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg()); return result; } - //2:删除当前机关组织(逻辑删) + //2:不存在下级机关,本级存在工作人员的不能删除 + CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getAgencyId()); + if (null != entity && entity.getTotalUser() > NumConstant.ZERO) { + result.setCode(EpmetErrorCode.NOT_DEL_AGENCY_PER.getCode()); + result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY_PER.getMsg()); + return result; + } + //3:删除当前机关组织(逻辑删) if (customerAgencyDao.deleteById(formDTO.getAgencyId()) < NumConstant.ONE) { log.error(CustomerAgencyConstant.DEL_EXCEPTION); throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml index 7543fe31f6..932f7f66d3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -3,20 +3,27 @@ - - - - - - - - - - - - - - + + \ 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 c499eb62e7..1ae28a3d14 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 @@ -186,7 +186,7 @@ public class CustomerStaffController { * @Description 根据客户Id及userId集合查询用户基本信息 */ @PostMapping("getdepartmentstafflist") - public Result> getDepartmentStaffList(DepartmentInStaffFormDTO fromDTO) { + public Result> getDepartmentStaffList(@RequestBody DepartmentInStaffFormDTO fromDTO) { return customerStaffService.getDepartmentStaffList(fromDTO); } From 0050dd53b11d966b4b3b64ead71f079ad95d34a7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 15:46:26 +0800 Subject: [PATCH 104/174] =?UTF-8?q?feignurl=E5=8E=BB=E9=99=A4localhost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-mine/gov-mine-server/docker-compose.yml | 2 +- epmet-module/gov-mine/gov-mine-server/pom.xml | 2 +- .../src/main/java/com/epmet/feign/GovAccessFeignClient.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-mine/gov-mine-server/docker-compose.yml b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml index e689dae8a8..0eda346168 100644 --- a/epmet-module/gov-mine/gov-mine-server/docker-compose.yml +++ b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-mine-server: container_name: gov-mine-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-mine-server:0.3.1 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-mine-server:0.3.2 ports: - "8098:8098" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index b05b115c19..98c8c81e93 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.1 + 0.3.2 com.epmet gov-mine diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java index b41a5e59ca..8cb514ad3f 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -16,7 +16,7 @@ import java.util.List; * @Description * @Author sun */ -@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class, url = "localhost:8099") +@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) public interface GovAccessFeignClient { /** From e0a8ccaa18b5ce25f2396e8a83d9bbbe215b0791 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 16:30:26 +0800 Subject: [PATCH 105/174] =?UTF-8?q?govorg,user=E5=8F=91=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 6b32980276..3af181010b 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.4 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.5 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index e7a982744e..f9fad15aba 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.4 + 0.3.5 com.epmet gov-org diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index a2cd47e239..79813cfb88 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.2 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.3 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index c3b3082447..796a577c61 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.2 + 0.3.3 com.epmet epmet-user From 63e16b80d9fa0e958d1c85b929b855bafcc45c52 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Sun, 26 Apr 2020 16:46:46 +0800 Subject: [PATCH 106/174] =?UTF-8?q?=E7=BB=84=E7=BB=87-=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=20bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 6 +- .../epmet/dto/form/StaffSubmitFromDTO.java | 4 ++ .../com/epmet/feign/EpmetUserFeignClient.java | 2 +- .../EpmetUserFeignClientFallBack.java | 2 +- .../epmet/service/impl/StaffServiceImpl.java | 56 ++++++++++++--- .../controller/CustomerStaffController.java | 70 ++++++++++++++++++- .../epmet/service/CustomerStaffService.java | 2 +- .../impl/CustomerStaffServiceImpl.java | 64 +++++++++++------ .../resources/mapper/CustomerStaffDao.xml | 38 ++++++---- 9 files changed, 193 insertions(+), 51 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index f84dfde45f..5dbc9f0cf2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -34,8 +34,10 @@ public enum EpmetErrorCode { REQUIRE_PERMISSION(8301, "没有足够的操作权限"), - NOT_ADD_GRID(8401,"您当前的网格名称已存在,请重新修改"); - + NOT_ADD_GRID(8401,"您当前的网格名称已存在,请重新修改"), + MOBILE_USED(8402,"该手机号已注册"), + STAFF_ADD_FAILED(8403,"人员添加失败"), + STAFF_EDIT_FAILED(8404,"人员编辑失败"); private int code; private String msg; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java index 87ffa6f26b..0f368af813 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java @@ -16,6 +16,10 @@ import java.util.List; @Data public class StaffSubmitFromDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 客户ID + */ + private String customerId; /** * 机关ID */ 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 1d52e9072d..d8a404d782 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 @@ -96,7 +96,7 @@ public interface EpmetUserFeignClient { * @return Result */ @PostMapping("/epmetuser/customerstaff/addstaff") - Result addStaff(@RequestBody StaffSubmitFromDTO fromDTO); + Result addStaff(@RequestBody StaffSubmitFromDTO 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 29986d388f..20255d3962 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 @@ -68,7 +68,7 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { } @Override - public Result addStaff(StaffSubmitFromDTO fromDTO) { + public Result addStaff(StaffSubmitFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaff", fromDTO); } 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 index db4e263508..dcdb8087f7 100644 --- 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 @@ -1,8 +1,10 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; @@ -11,6 +13,7 @@ import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.dto.result.StaffInitResultDTO; 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.service.CustomerAgencyService; @@ -18,7 +21,9 @@ import com.epmet.service.CustomerStaffAgencyService; import com.epmet.service.StaffService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -43,11 +48,17 @@ public class StaffServiceImpl implements StaffService { StaffsInAgencyResultDTO resultDTO = new StaffsInAgencyResultDTO(); //获取机关所在客户ID和人员总数 CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + if (null == customerAgencyEntity) { + resultDTO.setStaffList(new ArrayList<>()); + resultDTO.setStaffCount(0); + return new Result().ok(resultDTO); + } 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); + resultDTO.setStaffList(new ArrayList<>()); + return new Result().ok(resultDTO); } //提取所有userID List staffIds = customerStaffAgencyList.stream().map(CustomerStaffAgencyDTO::getUserId).collect(Collectors.toList()); @@ -62,6 +73,9 @@ public class StaffServiceImpl implements StaffService { public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { //获取机关所在客户ID CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + if (null == customerAgencyEntity) { + return new Result>().ok(new ArrayList<>()); + } fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); List customerStaffAgencyList = customerStaffAgencyService.getCustomerStaffAgencyList(fromDTO).getData(); if (null == customerStaffAgencyList || customerStaffAgencyList.size() == 0) { @@ -71,8 +85,7 @@ public class StaffServiceImpl implements StaffService { List staffIds = customerStaffAgencyList.stream().map(CustomerStaffAgencyDTO::getUserId).collect(Collectors.toList()); fromDTO.setStaffList(staffIds); //获取用户列表 - Result> staffInfoListResult = epmetUserFeignClient.getStaffInfoForHome(fromDTO); - return null; + return epmetUserFeignClient.getStaffList(fromDTO); } @Override @@ -90,24 +103,47 @@ public class StaffServiceImpl implements StaffService { } @Override + @Transactional(rollbackFor = Exception.class) public Result addStaff(TokenDto tokenDto, StaffSubmitFromDTO fromDTO) { + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); fromDTO.setApp(tokenDto.getApp()); fromDTO.setClient(tokenDto.getClient()); - Result result = epmetUserFeignClient.addStaff(fromDTO); - //机关总人数加一 - if (result.success()) { - CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); - customerAgencyEntity.setTotalUser(customerAgencyEntity.getTotalUser() + 1); - customerAgencyService.updateById(customerAgencyEntity); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + Result result = epmetUserFeignClient.addStaff(fromDTO); + + if (!result.success()) { + if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { + return new Result().error(result.getCode(), result.getMsg()); + } + return new Result().error(EpmetErrorCode.STAFF_ADD_FAILED.getCode(), EpmetErrorCode.STAFF_ADD_FAILED.getMsg()); } + //人员机关关系表 + CustomerStaffAgencyEntity customerStaffAgencyEntity = new CustomerStaffAgencyEntity(); + customerStaffAgencyEntity.setCustomerId(customerAgencyEntity.getCustomerId()); + customerStaffAgencyEntity.setUserId(result.getData().getUserId()); + customerStaffAgencyEntity.setAgencyId(customerAgencyEntity.getId()); + customerStaffAgencyService.insert(customerStaffAgencyEntity); + //机关总人数加一 + customerAgencyEntity.setTotalUser(customerAgencyEntity.getTotalUser() + 1); + customerAgencyService.updateById(customerAgencyEntity); return new Result(); } @Override public Result editStaff(TokenDto tokenDto, StaffSubmitFromDTO fromDTO) { + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + fromDTO.setApp(tokenDto.getApp()); fromDTO.setClient(tokenDto.getClient()); - return epmetUserFeignClient.editStaff(fromDTO); + Result result = epmetUserFeignClient.editStaff(fromDTO); + if (!result.success()) { + if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { + return new Result().error(result.getCode(), result.getMsg()); + } + return new Result().error(EpmetErrorCode.STAFF_EDIT_FAILED.getCode(), EpmetErrorCode.STAFF_EDIT_FAILED.getMsg()); + } + return result; } @Override 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 1ae28a3d14..cdc627dcc8 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 @@ -155,7 +155,7 @@ public class CustomerStaffController { * @return */ @PostMapping("staffsinagency") - public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + public Result> getStaffInfoForHome(@RequestBody StaffsInAgencyFromDTO fromDTO) { return customerStaffService.getStaffInfoForHome(fromDTO); } @@ -165,7 +165,7 @@ public class CustomerStaffController { * @return */ @PostMapping("stafflist") - public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { + public Result> getStaffList(@RequestBody StaffsInAgencyFromDTO fromDTO) { return customerStaffService.getStaffList(fromDTO); } @@ -194,4 +194,70 @@ public class CustomerStaffController { public Result> selectCustomerIdByUserId(@RequestBody AddDepartmentStaffFormDTO addDepartmentStaffFormDTO){ return customerStaffService.selectCustomerIdByUserId(addDepartmentStaffFormDTO); } + + /** + * 人员添加页面初始化 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("rolelist") + public Result addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + return customerStaffService.addStaffInit(fromDTO); + } + + /** + * 人员编辑页面初始化 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("editstaffinit") + public Result editStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + return customerStaffService.editStaffInit(fromDTO); + } + + /** + * 人员添加 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("addstaff") + public Result addStaff(@RequestBody StaffSubmitFromDTO fromDTO){ + return customerStaffService.addStaff(fromDTO); + } + + /** + * 人员编辑 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("editstaff") + public Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO){ + return customerStaffService.editStaff(fromDTO); + } + + /** + * 人员详情 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("staffdetail") + public Result getStaffDetail(@RequestBody StaffInfoFromDTO fromDTO){ + return customerStaffService.getStaffDetail(fromDTO); + } + + /** + * 人员禁用 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("disabledstaff") + public Result disabledStaff(@RequestBody StaffInfoFromDTO fromDTO){ + return customerStaffService.disabledStaff(fromDTO); + } } \ No newline at end of file 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 92f6779396..924c85d2f2 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 @@ -173,7 +173,7 @@ public interface CustomerStaffService extends BaseService { * @param fromDTO 参数 * @return Result */ - Result addStaff(StaffSubmitFromDTO fromDTO); + Result addStaff(StaffSubmitFromDTO fromDTO); /** * 人员编辑 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 d6a76ac6f9..799ab62d71 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 @@ -61,6 +61,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -84,6 +85,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -178,12 +180,18 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { List list = baseDao.selectCustomerStaffList(fromDTO); + if (null == list) { + list = new ArrayList<>(); + } return new Result>().ok(list); } @Override public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { List list = baseDao.selectStaffList(fromDTO); + if (null == list) { + list = new ArrayList<>(); + } return new Result>().ok(list); } @@ -194,7 +202,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); if (null == roleList || roleList.size() == 0) { - return new Result().ok(null); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } List staffRoleList = roleList.stream().map(p -> { StaffRoleResultDTO staffRoleResultDTO = new StaffRoleResultDTO(); @@ -245,7 +253,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl addStaff(StaffSubmitFromDTO fromDTO) { + CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); + customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); + customerStaffFormDTO.setMobile(fromDTO.getMobile()); + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); + if (null != customerStaffDTO) { + return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + } //USER表插入数据 UserEntity userEntity = new UserEntity(); userEntity.setFromApp(fromDTO.getApp()); @@ -253,6 +268,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); } @Override @Transactional(rollbackFor = Exception.class) public Result editStaff(StaffSubmitFromDTO fromDTO) { + CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); + customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); + customerStaffFormDTO.setMobile(fromDTO.getMobile()); + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); + if (!fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) { + return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + } + CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); //Customer_Staff表插入数据 CustomerStaffEntity staffEntity = new CustomerStaffEntity(); @@ -334,18 +358,19 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl selectGridStaffCountByUserId(List userIdDTO) { - Result gridStaffCountDTOResult = new Result(); - GridStaffCountDTO gridStaffCountDTO = baseDao.selectGridStaffCountByUserId(userIdDTO); - gridStaffCountDTOResult.setData(gridStaffCountDTO); - return gridStaffCountDTOResult; - } + /** + * 根据userId查询网格下未被禁用的人员数量 + * + * @param userIdDTO + * @return + */ + @Override + public Result selectGridStaffCountByUserId(List userIdDTO) { + Result gridStaffCountDTOResult = new Result(); + GridStaffCountDTO gridStaffCountDTO = baseDao.selectGridStaffCountByUserId(userIdDTO); + gridStaffCountDTOResult.setData(gridStaffCountDTO); + return gridStaffCountDTOResult; + } @Override public Result> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { @@ -364,11 +389,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(staffList); } - /** - * - * @param: addDepartmentStaffFormDTO - * @auther: zxc - */ + /** + * @param: addDepartmentStaffFormDTO + * @auther: zxc + */ @Override public Result> selectCustomerIdByUserId(AddDepartmentStaffFormDTO addDepartmentStaffFormDTO) { return new Result>().ok(baseDao.selectCustomerIdByUserId(addDepartmentStaffFormDTO)); 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 9335d663bd..828aa05c1d 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 @@ -59,29 +59,39 @@ @@ -111,7 +121,7 @@ #{userId} - ORDER BY convert(cs.REAL_NAME using gbk) asc ASC + ORDER BY convert(cs.REAL_NAME using gbk) ASC - SELECT ID AS grdiId, GRID_NAME, TOTAL_USER FROM CUSTOMER_GRID - WHERE + DEL_FLAG = '0' AND PID = #{agencyId} ORDER BY CREATED_TIME DESC - LIMIT 10 + + LIMIT #{pageSize} + + \ No newline at end of file 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 4622c0afe6..5183cf79b6 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 @@ -60,13 +60,40 @@ SELECT grid2.USER_ID FROM - CUSTOMER_STAFF_GRID grid2 + CUSTOMER_STAFF_GRID WHERE - grid2.DEL_FLAG = '0' + DEL_FLAG = '0' AND - grid2.GRID_ID = #{gridId} ) + GRID_ID = #{gridId} ) + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 47a9de4a33..5e4c9bd1a3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -41,4 +41,49 @@ LIMIT 1 + + + + + + insert into customer_staff_grid + ( + id, + user_id, + grid_id, + customer_id, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.userId}, + #{item.gridId}, + #{item.customerId}, + '0', + 0, + #{item.createdBy}, + now(), + #{item.updatedBy}, + now() + ) + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserFormDTO.java new file mode 100644 index 0000000000..9b2eec5757 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 通用的用户Id入参 + * @ClassName CommonUserFormDTO + * @Author wangc + * @date 2020.04.26 10:53 + */ +@Data +public class CommonUserFormDTO implements Serializable{ + private static final long serialVersionUID = -7994579456530273809L; + + /** + * 用户Id + * */ + @NotBlank(message = "用户Id不能为空") + private String userId; + + /** + * 客户Id + * */ + @NotBlank(message = "客户Id不能为空") + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormList.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormDTO.java similarity index 70% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormList.java rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormDTO.java index 86c49a60c9..04c87ac74f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormList.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdListFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -9,13 +10,13 @@ import java.util.List; /** * @Description 通用用户Id列表参数DTO - * @ClassName CommonUserIdListFormList + * @ClassName CommonUserIdListFormDTO * @Author wangc * @date 2020.04.24 15:42 */ @Data @AllArgsConstructor -public class CommonUserIdListFormList implements Serializable{ +public class CommonUserIdListFormDTO implements Serializable{ private static final long serialVersionUID = -7045691156972928671L; /** @@ -23,4 +24,7 @@ public class CommonUserIdListFormList implements Serializable{ * */ @NotBlank(message = "用户列表不能为空") private List userIdList; + + @NotBlank(message = "客户Id不能为空") + private String customerId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffRolesResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffRolesResultDTO.java new file mode 100644 index 0000000000..003a727fac --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffRolesResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 通用的员工角色返参 + * @ClassName StaffRolesResultDTO + * @Author wangc + * @date 2020.04.26 10:29 + */ +@Data +public class StaffRolesResultDTO implements Serializable { + private static final long serialVersionUID = -2049883620062097446L; + + /** + * 员工Id + * */ + private String staffId; + + /** + * 角色列表 + * */ + private List roleList; + + /** + * 是否被禁用 未禁用enable,已禁用disabled + * */ + private String enableFlag; +} 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 159a223021..8a1afe94d0 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 @@ -34,8 +34,6 @@ import com.epmet.dto.result.StaffInitResultDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CommonUserIdListFormList; -import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.excel.CustomerStaffExcel; @@ -256,13 +254,13 @@ public class CustomerStaffController { /** * @Description 通过userId列表查询未被禁用的用户信息 - * @Param CommonUserIdListFormList :: getUserIdList + * @Param CommonUserIdListFormDTO :: getUserIdList * @return Result> * @Author wangc * @Date 2020.04.24 15:44 **/ @PostMapping(value = "enabestaffmsglist") - public Result> enableStaffMsgList(@RequestBody CommonUserIdListFormList userIdList){ + public Result> enableStaffMsgList(@RequestBody CommonUserIdListFormDTO userIdList){ ValidatorUtils.validateEntity(userIdList); return customerStaffService.getEnableStaffMsgList(userIdList); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 795b0a34d9..f246940807 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -3,8 +3,10 @@ package com.epmet.controller; 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.StaffRoleFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; @@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + import java.util.ArrayList; import java.util.List; @@ -69,4 +72,16 @@ public class StaffRoleController { return new Result>().ok(staffRoleDTOS); } + /** + * @Description 查询一个员工在指定客户下的角色 + * @Param CommonUserFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.26 13:06 + **/ + @PostMapping("getcustomerstaffroles") + public Result getCustomerStaffRoles(@RequestBody CommonUserFormDTO commonUserFormDTO){ + ValidatorUtils.validateEntity(commonUserFormDTO); + return staffRoleService.getStaffRoles(commonUserFormDTO); + } } 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 4c381c5280..775cb008df 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 @@ -117,11 +117,6 @@ public interface CustomerStaffDao extends BaseDao { * @Description 根据客户Id及userId集合查询用户基本信息 */ List selectDepartmentStaffList(DepartmentInStaffFormDTO fromDTO); - * 根据userId查询查询网格下的用户信息 - * @param customerStaffGridDTOS - * @return - */ - List selectStaffGridListByUserId(List customerStaffGridDTOS); /** * @Description 根据UserId列表查询用信息,过滤掉被禁用的,包含未激活的 @@ -130,5 +125,5 @@ public interface CustomerStaffDao extends BaseDao { * @Author wangc * @Date 2020.04.24 15:34 **/ - List selectEnableStaffMsg(@Param("userIds") List userIds); + List selectEnableStaffMsg(@Param("userIds") List userIds,@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 6d65865681..42a85a7111 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -19,7 +19,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -49,4 +51,13 @@ public interface StaffRoleDao extends BaseDao { */ boolean delStaffRoles(StaffRoleDTO dto); + /** + * @Description 得到指定客户下的某个用户的全部角色 + * @Param getCustomerId :: getUserId + * @return StaffRolesResultDTO + * @Author wangc + * @Date 2020.04.26 11:01 + **/ + StaffRolesResultDTO getStaffRoles(CommonUserFormDTO commonUserFormDTO); + } \ No newline at end of file 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 b4b692da05..3956c86fc5 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 @@ -25,7 +25,7 @@ import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CommonUserIdListFormList; +import com.epmet.dto.form.CommonUserIdListFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.dto.form.StaffInfoFromDTO; @@ -224,10 +224,10 @@ public interface CustomerStaffService extends BaseService { /** * @Description 通过userId列表查询未被禁用的用户信息 - * @Param CommonUserIdListFormList :: getUserIdList + * @Param CommonUserIdListFormDTO :: getUserIdList * @return Result> * @Author wangc * @Date 2020.04.24 15:44 **/ - Result> getEnableStaffMsgList(CommonUserIdListFormList userIdList); + Result> getEnableStaffMsgList(CommonUserIdListFormDTO userIdList); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index 88742d7400..456a88b720 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -19,8 +19,11 @@ package com.epmet.service; 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.StaffRoleDTO; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.StaffRoleEntity; import java.util.List; @@ -107,4 +110,13 @@ public interface StaffRoleService extends BaseService { * @param dto */ void clearStaffRoles(StaffRoleDTO dto); + + /** + * @Description 得到某一个员工在一个客户下的所有角色 + * @Param CommonUserFormDTO :: getUserId :: getCustomerId + * @return Result + * @Author wangc + * @Date 2020.04.26 10:59 + **/ + Result getStaffRoles(CommonUserFormDTO userParam); } \ 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 ea2fa2536b..459b27acd0 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 @@ -35,8 +35,6 @@ import com.epmet.dto.result.*; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CommonUserIdListFormList; -import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; @@ -361,14 +359,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> * @Author wangc * @Date 2020.04.24 15:44 **/ @Override - public Result> getEnableStaffMsgList(CommonUserIdListFormList userIdList) { - return new Result>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList())); + public Result> getEnableStaffMsgList(CommonUserIdListFormDTO userIdList) { + return new Result>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList(),userIdList.getCustomerId())); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 0a9d7ce90d..c9ca5f516f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -23,9 +23,12 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.StaffRoleDao; import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.StaffRoleEntity; import com.epmet.redis.StaffRoleRedis; import com.epmet.service.StaffRoleService; @@ -120,4 +123,16 @@ public class StaffRoleServiceImpl extends BaseServiceImpl + * @Author wangc + * @Date 2020.04.26 10:59 + **/ + @Override + public Result getStaffRoles(CommonUserFormDTO userParam) { + return new Result().ok(baseDao.getStaffRoles(userParam)); + } + } \ 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 f9c2046406..e65d4e86db 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 @@ -157,6 +157,8 @@ CUSTOMER_STAFF WHERE DEL_FLAG = '0' + AND + CUSTOMER_ID = #{customerId} AND ENABLE_FLAG = 'enable' diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 7ad99146cb..718e47a182 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -35,4 +35,35 @@ r.ROLE_KEY = #{roleKey} AND sr.ORG_ID = #{orgId} + + + + + + + + + + + + + + + + \ No newline at end of file From ab98d22c1f69b4cd3b82f8062d2ee7e816fe3a86 Mon Sep 17 00:00:00 2001 From: wxz Date: Sun, 26 Apr 2020 18:41:47 +0800 Subject: [PATCH 110/174] =?UTF-8?q?1.=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E4=BA=86=E6=9D=83=E9=99=90=E9=83=A8=E5=88=86=EF=BC=8C=E9=99=A4?= =?UTF-8?q?=E4=B8=8A=E7=BA=A7=EF=BC=8C=E5=90=8C=E7=BA=A7=E5=85=B6=E4=BB=96?= =?UTF-8?q?=EF=BC=8C=E6=88=91=E5=8F=82=E4=B8=8E=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../renren/service/DynamicDataSourceTest.java | 96 +++++------ .../com/epmet/feign/GovOrgFeignClient.java | 10 ++ .../fallback/GovOrgFeignClientFallback.java | 6 + .../service/impl/GovLoginServiceImpl.java | 25 ++- .../src/test/java/com/epmet/TokenGenTest.java | 3 + .../mybatis/aspect/DataFilterAspect.java | 156 +++++++++++++----- .../constant/AccessSettingConstant.java | 15 ++ .../dto/form/DepartmentListResultDTO.java | 49 ++++++ .../dto/form/RoleAccessSettingResultDTO.java | 13 ++ .../dto/form/StaffPermCacheResultDTO.java | 5 + .../mybatis/feign/GovAccessFeignClient.java | 15 +- .../mybatis/feign/GovOrgFeignClient.java | 30 ++++ .../GovAccessFeignClientFallback.java | 12 +- .../fallback/GovOrgFeignClientFallback.java | 27 +++ .../interceptor/DataFilterInterceptor.java | 3 + .../epmet/commons/tools/redis/RedisKeys.java | 11 +- .../tools/security/dto/GovTokenDto.java | 2 +- .../epmet/dto/form/StaffPermCacheFormDTO.java | 5 + .../result/RoleAccessSettingResultDTO.java | 14 ++ .../dto/result/StaffPermCacheResultDTO.java | 5 + .../epmet/controller/AccessController.java | 21 ++- .../com/epmet/dao/RoleAccessSettingDao.java | 37 +++++ .../epmet/entity/RoleAccessSettingEntity.java | 65 ++++++++ .../epmet/redis/RoleAccessSettingRedis.java | 37 +++++ .../java/com/epmet/service/AccessService.java | 11 +- .../epmet/service/impl/AccessServiceImpl.java | 38 ++++- .../db.migration/epmet_gov_access.sql | 20 +++ .../resources/mapper/RoleAccessSettingDao.xml | 30 ++++ .../test/govaccess/AccessSettingTest.java | 38 +++++ .../com/epmet/feign/EpmetUserFeignClient.java | 1 + .../com/epmet/feign/GovOrgFeignClient.java | 1 + .../epmet/service/impl/AccessServiceImpl.java | 29 ++-- .../controller/DepartmentController.java | 15 +- .../com/epmet/dao/CustomerDepartmentDao.java | 7 + .../com/epmet/service/DepartmentService.java | 7 + .../service/impl/DepartmentServiceImpl.java | 5 + .../mapper/CustomerDepartmentDao.xml | 7 + .../main/java/com/epmet/dao/StaffRoleDao.java | 5 +- .../com/epmet/feign/GovOrgFeignClient.java | 1 + .../service/impl/StaffRoleServiceImpl.java | 4 +- 40 files changed, 747 insertions(+), 134 deletions(-) create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/AccessSettingConstant.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/DepartmentListResultDTO.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/RoleAccessSettingResultDTO.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovOrgFeignClient.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovOrgFeignClientFallback.java create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleAccessSettingResultDTO.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleAccessSettingDao.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleAccessSettingEntity.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleAccessSettingRedis.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleAccessSettingDao.xml create mode 100644 epmet-module/gov-access/gov-access-server/src/test/java/com/epmet/test/govaccess/AccessSettingTest.java diff --git a/epmet-admin/epmet-admin-server/src/test/java/io/renren/service/DynamicDataSourceTest.java b/epmet-admin/epmet-admin-server/src/test/java/io/renren/service/DynamicDataSourceTest.java index 823c7bb233..22069ffd12 100644 --- a/epmet-admin/epmet-admin-server/src/test/java/io/renren/service/DynamicDataSourceTest.java +++ b/epmet-admin/epmet-admin-server/src/test/java/io/renren/service/DynamicDataSourceTest.java @@ -1,48 +1,48 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * 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. - *

- * 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. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.service; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -/** - * 多数据源测试 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@RunWith(SpringRunner.class) -@SpringBootTest -public class DynamicDataSourceTest { - @Autowired - private DynamicDataSourceTestService dynamicDataSourceTestService; - - @Test - public void test(){ - Long id = 1067246875800000001L; - dynamicDataSourceTestService.selectById(id); - dynamicDataSourceTestService.updateUser(id); - dynamicDataSourceTestService.updateUserBySlave1(id); - dynamicDataSourceTestService.updateUserBySlave2(id); - } - - -} +///** +// * Copyright 2018 人人开源 https://www.renren.io +// *

+// * 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. +// *

+// * 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. +// *

+// * You should have received a copy of the GNU General Public License +// * along with this program. If not, see . +// */ +// +//package com.epmet.service; +// +//import org.junit.Test; +//import org.junit.runner.RunWith; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.springframework.test.context.junit4.SpringRunner; +// +///** +// * 多数据源测试 +// * +// * @author Mark sunlightcs@gmail.com +// * @since 1.0.0 +// */ +//@RunWith(SpringRunner.class) +//@SpringBootTest +//public class DynamicDataSourceTest { +// @Autowired +// private com.epmet.service.DynamicDataSourceTestService dynamicDataSourceTestService; +// +// @Test +// public void test(){ +// Long id = 1067246875800000001L; +// dynamicDataSourceTestService.selectById(id); +// dynamicDataSourceTestService.updateUser(id); +// dynamicDataSourceTestService.updateUserBySlave1(id); +// dynamicDataSourceTestService.updateUserBySlave2(id); +// } +// +// +//} diff --git a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 527db417ef..27c596f0de 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -3,10 +3,12 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import java.util.List; @@ -27,4 +29,12 @@ public interface GovOrgFeignClient { **/ @PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE) Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO); + + /** + * 查询人员部门列表 + * @param staffId + * @return + */ + @PostMapping("/gov/org/department/staff/{staffId}/departmentlist") + Result> getDepartmentListByStaffId(@PathVariable("staffId") String staffId); } diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java index a1ccd0bdf0..0e42e2436f 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java @@ -4,6 +4,7 @@ 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.form.StaffOrgFormDTO; +import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -22,5 +23,10 @@ public class GovOrgFeignClientFallback implements GovOrgFeignClient { public Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffOrgList", staffOrgFormDTO); } + + @Override + public Result> getDepartmentListByStaffId(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDepartmentListByStaffId", staffId); + } } 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 35ce90b25c..6b5fc2914d 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 @@ -3,6 +3,7 @@ package com.epmet.service.impl; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; @@ -12,6 +13,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; @@ -27,11 +29,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * @Description 政府端登录服务 @@ -166,6 +167,22 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); govTokenDto.setAgencyId(staffLatestAgency.getAgencyId()); govTokenDto.setCustomerId(staffLatestAgency.getCustomerId()); + + try { + Result> deptListResult = govOrgFeignClient.getDepartmentListByStaffId(staffLatestAgency.getStaffId()); + if (deptListResult.success()) { + if (!CollectionUtils.isEmpty(deptListResult.getData())) { + Set deptIdLists = deptListResult.getData().stream().map(dept -> dept.getDepartmentId()).collect(Collectors.toSet()); + govTokenDto.setDeptIdList(deptIdLists); + } + } else { + logger.error("登录:查询部门列表,远程调用返回错误:{}", deptListResult.getMsg()); + } + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error("登录:查询部门列表异常:{}", errorStackTrace); + } + cpUserDetailRedis.set(govTokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); } diff --git a/epmet-auth/src/test/java/com/epmet/TokenGenTest.java b/epmet-auth/src/test/java/com/epmet/TokenGenTest.java index 3368e2d1cf..60f7654b22 100644 --- a/epmet-auth/src/test/java/com/epmet/TokenGenTest.java +++ b/epmet-auth/src/test/java/com/epmet/TokenGenTest.java @@ -11,7 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; @RunWith(SpringRunner.class) @@ -43,6 +45,7 @@ public class TokenGenTest { govTokenDto.setUpdateTime(System.currentTimeMillis()); govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(tokenStr).getTime()); govTokenDto.setAgencyId("1"); + govTokenDto.setDeptIdList(new HashSet<>(Arrays.asList("1","2","3"))); govTokenDto.setCustomerId("f76def116c9c2dc0269cc17867af122c"); cpUserDetailRedis.set(govTokenDto, expire); } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java index 13910a6f3a..382e268146 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java @@ -9,13 +9,12 @@ package com.epmet.commons.mybatis.aspect; import com.epmet.commons.mybatis.annotation.DataFilter; +import com.epmet.commons.mybatis.constant.AccessSettingConstant; import com.epmet.commons.mybatis.constant.OpeScopeConstant; -import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; -import com.epmet.commons.mybatis.dto.form.OperationScopeFormDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; +import com.epmet.commons.mybatis.dto.form.*; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.feign.GovAccessFeignClient; +import com.epmet.commons.mybatis.feign.GovOrgFeignClient; import com.epmet.commons.tools.aspect.AccessOpeAspect; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -46,12 +45,20 @@ public class DataFilterAspect { private static final Logger log = LoggerFactory.getLogger(DataFilterAspect.class); + /** + * 线程变量,记录是否已经添加了至少一个过滤条件 + */ + private static final ThreadLocal hasConditions = new ThreadLocal(); + @Autowired private LoginUserUtil loginUserUtil; @Autowired private GovAccessFeignClient govAccessFeignClient; + @Autowired + private GovOrgFeignClient govOrgFeignClient; + public static final String orgIdPathSpliter = ":"; @Before("@annotation(com.epmet.commons.mybatis.annotation.DataFilter)") @@ -94,22 +101,20 @@ public class DataFilterAspect { // 校验操作权限 validateOpePermission(permCacheResultDTO.getPermissions(), requirePermission); + hasConditions.set(false); + // 生成过滤sql + String sqlFilterSegment = getSqlFilterSegment(userId, permCacheResultDTO.getRoleIdList(), requirePermission, + permCacheResultDTO.getOrgIdPath(), permCacheResultDTO.getGridId(), tableAlias, permCacheResultDTO.getDeptIdList()); + + // 填充到Service方法列表中的DataScope对象中 Object[] methodArgs = point.getArgs(); for (Object methodArg : methodArgs) { if (methodArg instanceof DataScope) { - ((DataScope) methodArg).setSqlFilter(getSqlFilterSegment( - userId, - permCacheResultDTO.getRoleIdList(), - requirePermission, - permCacheResultDTO.getOrgIdPath(), - permCacheResultDTO.getGridId(), - tableAlias)); + ((DataScope) methodArg).setSqlFilter(sqlFilterSegment); return; } } - - //throw new RenException(ErrorCode.DATA_SCOPE_PARAMS_ERROR); } /** @@ -128,89 +133,149 @@ public class DataFilterAspect { * * @return */ - private String getSqlFilterSegment(String userId,Set roleIds, String reqiurePermission, String orgIdPath, String gridId, String tableAlias) { - // 根据角色列表查询操作范围列表 - Set scopeDTOS = new HashSet<>(); - roleIds.forEach(roleId -> { - OperationScopeFormDTO osformDto = new OperationScopeFormDTO(); - osformDto.setRoleId(roleId); - osformDto.setOperationKey(reqiurePermission); - Result> result = govAccessFeignClient.getOperationScopesByRoleId(osformDto); - if (result.success()) { - scopeDTOS.addAll(result.getData()); - } - }); + private String getSqlFilterSegment(String userId, Set roleIds, String reqiurePermission, String orgIdPath, + String gridId, String tableAlias, Set deptIds) { - // 过滤范围 - HashSet scopes = filteScopes(scopeDTOS); - if (CollectionUtils.isEmpty(scopes)) { - // 没有范围限制 - return ""; - } StringBuilder sb = new StringBuilder(); + Map accessSettings = listRoleAccessSettings(roleIds); + // 1.生成sql:组织范围过滤 - genOrgScopeSql(sb, orgIdPath, scopes, tableAlias); + genOrgScopeSql(sb, orgIdPath, roleIds, reqiurePermission, tableAlias); // 2.生成sql:我发起的 - genIStartedSql(sb, userId, tableAlias); + String iCreated = accessSettings.get(AccessSettingConstant.I_CREATED_KEY); + if (StringUtils.isNotBlank(iCreated) && AccessSettingConstant.I_CREATED_YES.equals(iCreated)) { + genICreatedSql(sb, userId, tableAlias); + } // 3.生成sql:本网格的 - genInGrid(sb, gridId, tableAlias); + String inGrid = accessSettings.get(AccessSettingConstant.IN_GRID_KEY); + if (StringUtils.isNotBlank(inGrid) && AccessSettingConstant.IN_GRID_YES.equals(inGrid)) { + genInGrid(sb, gridId, tableAlias); + } + + // 4.生成sql:根据部门列表 + String inDept = accessSettings.get(AccessSettingConstant.IN_DEPARTMENT_KEY); + if (StringUtils.isNotBlank(inDept) && AccessSettingConstant.IN_DEPARTMENT_YES.equals(inDept)) { + genDepartmentFilterSql(sb, deptIds); + } - //sb.append(")"); - System.out.println("生成的过滤sql:" + sb.toString()); return sb.toString(); } + /** + * 列出角色对应的权限设置项 + * @param roleIds + * @return + */ + private Map listRoleAccessSettings(Set roleIds) { + Map settings = new HashMap<>(); + roleIds.forEach(roleId -> { + settings.putAll(listRoleAccessSettings(roleId)); + }); + return settings; + } + + private Map listRoleAccessSettings(String roleId) { + Result> result = govAccessFeignClient.listAccessSettings(roleId); + if (result.success()) { + return result.getData(); + } else { + log.error("角色[{}]查询权限配置AccessSettings失败:{}", roleId, result.getMsg()); + } + return new HashMap<>(); + } + /** + * 生成部门过滤sql + * + * @param sb + */ + private void genDepartmentFilterSql(StringBuilder sb, Set deptIdList) { + //Result> deptListResult = govOrgFeignClient.getDepartmentListByStaffId(staffId); + if (CollectionUtils.isEmpty(deptIdList)) { + return; + } + deptIdList.forEach(deptId -> { + sb.append(hasConditions.get() ? " OR " : "").append(" DEPARTMENT_ID = '").append(deptId).append("' "); + }); + hasConditions.set(true); + } + /** * 网格sql + * * @param sb * @param gridId * @param tableAlias */ private void genInGrid(StringBuilder sb, String gridId, String tableAlias) { if (StringUtils.isBlank(tableAlias)) { - sb.append(" OR GRID_ID ='").append(gridId).append("'"); + sb.append(hasConditions.get() ? " OR " : "").append(" GRID_ID ='").append(gridId).append("' "); } else { - sb.append(" OR ").append(tableAlias).append(".GRID_ID ='").append(gridId).append("'"); + sb.append(hasConditions.get() ? " OR " : "").append(tableAlias).append(".GRID_ID ='").append(gridId).append("' "); } + hasConditions.set(true); } /** * sql:我发起的 + * * @param userId */ - private void genIStartedSql(StringBuilder sb, String userId, String tableAlias) { + private void genICreatedSql(StringBuilder sb, String userId, String tableAlias) { if (StringUtils.isBlank(tableAlias)) { - sb.append(" OR CREATED_BY ='").append(userId).append("'"); + sb.append(hasConditions.get() ? " OR " : " ").append(" CREATED_BY ='").append(userId).append("'"); } else { - sb.append(" OR ").append(tableAlias).append(".CREATED_BY ='").append(userId).append("'"); + sb.append(hasConditions.get() ? " OR " : " ").append(tableAlias).append(".CREATED_BY ='").append(userId).append("'"); } + hasConditions.set(true); } /** * 计算组织范围过滤sql,整体入口 + * * @param sb * @param orgIdPath - * @param scopes */ - public void genOrgScopeSql(StringBuilder sb, String orgIdPath, HashSet scopes, String tableAlias) { + public void genOrgScopeSql(StringBuilder sb, String orgIdPath, Set roleIds, String reqiurePermission, String tableAlias) { + + // 根据角色列表查询操作范围列表 + Set scopeDTOS = new HashSet<>(); + roleIds.forEach(roleId -> { + OperationScopeFormDTO osformDto = new OperationScopeFormDTO(); + osformDto.setRoleId(roleId); + osformDto.setOperationKey(reqiurePermission); + Result> result = govAccessFeignClient.getOperationScopesByRoleId(osformDto); + if (result.success()) { + scopeDTOS.addAll(result.getData()); + } + }); + + // 过滤范围 + HashSet scopes = filteScopes(scopeDTOS); + if (CollectionUtils.isEmpty(scopes)) { + // 没有范围限制 + return; + } + // 取出父组织ID path 和当前组织ID String pOrgPath = orgIdPath.substring(0, orgIdPath.lastIndexOf(orgIdPathSpliter)); String currOrgPath = orgIdPath.substring(orgIdPath.lastIndexOf(orgIdPathSpliter) + 1); genOrgScopeSql(sb, scopes, currOrgPath, pOrgPath, tableAlias); sb.replace(sb.lastIndexOf("OR"), sb.lastIndexOf("OR") + 3, ""); + hasConditions.set(true); } /** * 计算组织范围过滤sql + * * @param scopes * @param currOrg * @param pOrgPath * @return */ - private void genOrgScopeSql(StringBuilder sb,HashSet scopes, String currOrg, String pOrgPath, String tableAlias) { + private void genOrgScopeSql(StringBuilder sb, HashSet scopes, String currOrg, String pOrgPath, String tableAlias) { for (String scope : scopes) { switch (scope) { case OpeScopeConstant.ORG_CURR: @@ -261,6 +326,9 @@ public class DataFilterAspect { for (OperationScopeDTO scope : scopeDTOS) { String scopeIndex = scope.getScopeIndex(); + if (StringUtils.isBlank(scopeIndex)) { + continue; + } String[] currArr = scopeIndex.split("_"); if ("0".equals(currArr[1])) { // 为0,说明没有包含关系,直接放入 diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/AccessSettingConstant.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/AccessSettingConstant.java new file mode 100644 index 0000000000..4ccb9a8b41 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/constant/AccessSettingConstant.java @@ -0,0 +1,15 @@ +package com.epmet.commons.mybatis.constant; + +public class AccessSettingConstant { + public static final String I_CREATED_KEY = "I_CREATED"; + public static final String I_CREATED_YES = "YES"; + + public static final String I_PART_KEY = "I_PART"; + public static final String I_PART_YES = "YES"; + + public static final String IN_GRID_KEY = "IN_GRID"; + public static final String IN_GRID_YES = "YES"; + + public static final String IN_DEPARTMENT_KEY = "IN_DEPARTMENT"; + public static final String IN_DEPARTMENT_YES = "YES"; +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/DepartmentListResultDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/DepartmentListResultDTO.java new file mode 100644 index 0000000000..1bf20bae66 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/DepartmentListResultDTO.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.commons.mybatis.dto.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 组织首页-获取机关下部门列表-部门详情数据 + * + * @author sun + */ +@Data +public class DepartmentListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门下总人数 + */ + private Integer totalUser; +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/RoleAccessSettingResultDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/RoleAccessSettingResultDTO.java new file mode 100644 index 0000000000..f4099cfaa1 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/RoleAccessSettingResultDTO.java @@ -0,0 +1,13 @@ +package com.epmet.commons.mybatis.dto.form; + +import lombok.Data; + +@Data +public class RoleAccessSettingResultDTO { + + private String settingKey; + private String id; + private String settingName; + private String roleId; + +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java index 7775756b38..ec090d7aee 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/StaffPermCacheResultDTO.java @@ -17,6 +17,11 @@ public class StaffPermCacheResultDTO { */ private Set roleIdList; + /** + * 部门id列表 + */ + private Set deptIdList; + /** * 机构Id */ diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java index 50b20890e7..354df4950f 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovAccessFeignClient.java @@ -1,23 +1,23 @@ package com.epmet.commons.mybatis.feign; -import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; -import com.epmet.commons.mybatis.dto.form.OperationScopeFormDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; +import com.epmet.commons.mybatis.dto.form.*; import com.epmet.commons.mybatis.feign.fallback.GovAccessFeignClientFallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; 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; import java.util.List; +import java.util.Map; import java.util.Set; /** * @Description * @Author sun */ +//, url = "localhost:8099" @FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) public interface GovAccessFeignClient { @@ -36,4 +36,11 @@ public interface GovAccessFeignClient { @PostMapping("/gov/access/access/operationscopes") Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO); + /** + * 查询角色的权限相关配置 + * @param roleId + * @return + */ + @PostMapping("/gov/access/access/role/{roleId}/accesssettings") + Result> listAccessSettings(@PathVariable("roleId") String roleId); } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovOrgFeignClient.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovOrgFeignClient.java new file mode 100644 index 0000000000..67226cdd0e --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/GovOrgFeignClient.java @@ -0,0 +1,30 @@ +package com.epmet.commons.mybatis.feign; + +import com.epmet.commons.mybatis.dto.form.*; +import com.epmet.commons.mybatis.feign.fallback.GovAccessFeignClientFallback; +import com.epmet.commons.mybatis.feign.fallback.GovOrgFeignClientFallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; +import java.util.Set; + +/** + * @Description + * @Author sun + */ +//, url = "localhost:8092" +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallback.class) +public interface GovOrgFeignClient { + + /** + * 查询人员部门列表 + * @param staffId + * @return + */ + @PostMapping("/gov/org/department/staff/{staffId}/departmentlist") + Result> getDepartmentListByStaffId(@PathVariable("staffId") String staffId); +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java index 6dfa1b89cc..ae74de9483 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovAccessFeignClientFallback.java @@ -1,15 +1,14 @@ package com.epmet.commons.mybatis.feign.fallback; -import com.epmet.commons.mybatis.dto.form.OperationScopeDTO; -import com.epmet.commons.mybatis.dto.form.OperationScopeFormDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermCacheResultDTO; -import com.epmet.commons.mybatis.dto.form.StaffPermissionFormDTO; +import com.epmet.commons.mybatis.dto.form.*; import com.epmet.commons.mybatis.feign.GovAccessFeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import org.springframework.stereotype.Component; +import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -30,4 +29,9 @@ public class GovAccessFeignClientFallback implements GovAccessFeignClient { public Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getOperationScopesByRoleId", operationScopeFormDTO); } + + @Override + public Result> listAccessSettings(String roleId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listAccessSettings", roleId); + } } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovOrgFeignClientFallback.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovOrgFeignClientFallback.java new file mode 100644 index 0000000000..cce3d60309 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/GovOrgFeignClientFallback.java @@ -0,0 +1,27 @@ +package com.epmet.commons.mybatis.feign.fallback; + +import com.epmet.commons.mybatis.dto.form.*; +import com.epmet.commons.mybatis.feign.GovAccessFeignClient; +import com.epmet.commons.mybatis.feign.GovOrgFeignClient; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Set; + +/** + * 调用政府端权限 + * @Author wxz + * @Description + * @Date 2020/4/24 11:17 + **/ +@Component +public class GovOrgFeignClientFallback implements GovOrgFeignClient { + + @Override + public Result> getDepartmentListByStaffId(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getDepartmentListByStaffId", staffId); + } +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java index d26f7525a1..e211c01e4e 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/DataFilterInterceptor.java @@ -80,6 +80,9 @@ public class DataFilterInterceptor extends AbstractSqlParserHandler implements I String orderBy = "ORDER BY"; String groupBy = "GROUP BY"; String sqlFilter = scope.getSqlFilter(); + if (StringUtils.isBlank(sqlFilter)) { + return invocation.proceed(); + } if (originalSql.indexOf("WHERE") == 0) { // 不包含where,需要手动拼接上 sqlFilter = " WHERE ".concat(sqlFilter); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 6598010561..0b6c64d6ef 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -215,6 +215,15 @@ public class RedisKeys { * @return */ public static String getRoleOpeScopesKey(String roleId, String opeKey) { - return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(opeKey); + return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(":").concat(opeKey); + } + + /** + * 角色ID对应的权限配置 + * @param roleId + * @return + */ + public static String getRoleAccessSettingKey(String roleId) { + return rootPrefix.concat("gov:access:role:accesssettings:").concat(roleId); } } 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 49d6cb15a3..de94567fb6 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 @@ -62,7 +62,7 @@ public class GovTokenDto extends BaseTokenDto implements Serializable { /** * 部门id列表 */ - private List deptIdList; + private Set deptIdList; /** * 功能权限列表,实际上是gov_staff => staff_role => role_operation查询到的operationKey diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java index 191314af0a..a35af017c9 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/StaffPermCacheFormDTO.java @@ -51,4 +51,9 @@ public class StaffPermCacheFormDTO { */ private Set roleIdList; + /** + * 当前所在网格id + */ + private String gridId; + } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleAccessSettingResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleAccessSettingResultDTO.java new file mode 100644 index 0000000000..7330f3b425 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleAccessSettingResultDTO.java @@ -0,0 +1,14 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class RoleAccessSettingResultDTO { + + private String settingKey; + private String id; + private String settingName; + private String settingValue; + private String roleId; + +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java index ce24cf9501..d19ed3ff27 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/StaffPermCacheResultDTO.java @@ -18,6 +18,11 @@ public class StaffPermCacheResultDTO { */ private Set roleIdList; + /** + * 部门id列表 + */ + private Set deptIdList; + /** * 组织ID */ diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java index e34df14a06..2f9bdcb567 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.OperationScopeDTO; import com.epmet.dto.form.OperationScopeFormDTO; import com.epmet.dto.form.StaffPermCacheFormDTO; +import com.epmet.dto.result.RoleAccessSettingResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.dto.result.StaffPermCacheResultDTO; import com.epmet.entity.OperationScopeEntity; @@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -32,7 +34,7 @@ public class AccessController { private AccessService accessService; /** - * 更新工作人员权限缓存 + * 更新工作人员权限缓存(前端查询权限时候gov-mine会调用此处) * @param staffPermCacheFormDTO * @return */ @@ -45,12 +47,13 @@ public class AccessController { Set permissions = staffPermCacheFormDTO.getPermissions(); Set roleIdList = staffPermCacheFormDTO.getRoleIdList(); String orgId = staffPermCacheFormDTO.getOrgIdPath(); - accessService.updatePermissionCache(staffId, app, client, permissions, roleIdList, orgId); + String gridId = staffPermCacheFormDTO.getGridId(); + accessService.updatePermissionCache(staffId, app, client, permissions, roleIdList, orgId, gridId); return new Result(); } /** - * 查询用户当前权限列表(DataFilterAspect中用到) + * 从缓存中查询用户当前权限列表(DataFilterAspect中用到) * @return */ @PostMapping("getcurrpermissions") @@ -64,6 +67,7 @@ public class AccessController { resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); resultDTO.setGridId(govTokenDto.getGridId()); + resultDTO.setDeptIdList(govTokenDto.getDeptIdList()); } return new Result().ok(resultDTO); } @@ -78,4 +82,15 @@ public class AccessController { Set scopes = accessService.listOperationScopesByRoleId(operationScopeFormDTO.getRoleId(), operationScopeFormDTO.getOperationKey()); return new Result>().ok(scopes); } + + /** + * 查询角色的权限相关配置 + * @param roleId + * @return + */ + @PostMapping("/role/{roleId}/accesssettings") + public Result> listAccessSettings(@PathVariable("roleId") String roleId) { + Map settings = accessService.listAccessSettings(roleId); + return new Result>().ok(settings); + } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleAccessSettingDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleAccessSettingDao.java new file mode 100644 index 0000000000..42acf285e0 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleAccessSettingDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.RoleAccessSettingResultDTO; +import com.epmet.entity.RoleAccessSettingEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 权限配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-26 + */ +@Mapper +public interface RoleAccessSettingDao extends BaseDao { + + List listRoleAccessSettingsByRoleId(String roleId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleAccessSettingEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleAccessSettingEntity.java new file mode 100644 index 0000000000..bbb8d650bf --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleAccessSettingEntity.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-04-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("role_access_setting") +public class RoleAccessSettingEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 配置KEY + */ + private String settingKey; + + /** + * 配置name + */ + private String settingName; + /** + * 配置值 + */ + private String settingValue; + + /** + * 角色ID + */ + private String roleId; + + /** + * 操作简介 + */ + private String brief; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleAccessSettingRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleAccessSettingRedis.java new file mode 100644 index 0000000000..02efbb9850 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleAccessSettingRedis.java @@ -0,0 +1,37 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.result.RoleAccessSettingResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiConsumer; + +@Component +public class RoleAccessSettingRedis { + + @Autowired + private RedisUtils redisUtils; + + public void set(Map settings, String roleId) { + String roleAccessSettingKey = RedisKeys.getRoleAccessSettingKey(roleId); + redisUtils.hMSet(roleAccessSettingKey, settings); + } + + public Map get(String roleId) { + String roleAccessSettingKey = RedisKeys.getRoleAccessSettingKey(roleId); + Map s = redisUtils.hGetAll(roleAccessSettingKey); + Map settings = new HashMap<>(); + s.forEach((s1, o) -> { + if (o != null) { + settings.put(s1, String.valueOf(o)); + } + }); + return settings; + } + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java index df16e1e9df..dcda2ebe7e 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java @@ -1,10 +1,12 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.dto.result.RoleAccessSettingResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.entity.OperationScopeEntity; import java.util.List; +import java.util.Map; import java.util.Set; public interface AccessService { @@ -13,7 +15,7 @@ public interface AccessService { * @param staffId * @param permissions */ - void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath); + void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath, String gridId); /** * 查询用户当前权限列表 @@ -28,4 +30,11 @@ public interface AccessService { * @return */ Set listOperationScopesByRoleId(String roleId, String operationKey); + + /** + * 查询角色的权限相关配置 + * @param roleId + * @return + */ + Map listAccessSettings(String roleId); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index 34e458ec6a..0249885536 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -4,7 +4,10 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.dao.OperationScopeDao; +import com.epmet.dao.RoleAccessSettingDao; +import com.epmet.dto.result.RoleAccessSettingResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; +import com.epmet.redis.RoleAccessSettingRedis; import com.epmet.redis.RoleOpeScopeRedis; import com.epmet.service.AccessService; import org.slf4j.Logger; @@ -13,7 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.Set; +import java.util.*; @Service public class AccessServiceImpl implements AccessService { @@ -26,16 +29,24 @@ public class AccessServiceImpl implements AccessService { @Autowired private OperationScopeDao operationScopeDao; + @Autowired + private RoleAccessSettingDao roleAccessSettingDao; + @Autowired private RoleOpeScopeRedis roleOpeScopeRedis; + @Autowired + private RoleAccessSettingRedis roleAccessSettingRedis; + + /** * 更新权限缓存 * @param staffId * @param permissions */ @Override - public void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath) { + public void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, + String orgIdPath, String gridId) { GovTokenDto govTokenDto = cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); if (govTokenDto == null) { logger.warn("更新[{}]用户缓存:Redis中不存在该用户TokenDto缓存信息", staffId); @@ -45,6 +56,7 @@ public class AccessServiceImpl implements AccessService { govTokenDto.setPermissions(permissions); govTokenDto.setRoleIdList(roleIdList); govTokenDto.setOrgIdPath(orgIdPath); + govTokenDto.setGridId(gridId); // 将新的TokenDto更新到redis中 long expire = cpUserDetailRedis.getExpire(app, client, staffId); @@ -77,4 +89,26 @@ public class AccessServiceImpl implements AccessService { } return scopes; } + + /** + * 查询角色的权限相关配置 + * @param roleId + * @return + */ + @Override + public Map listAccessSettings(String roleId) { + Map settings = roleAccessSettingRedis.get(roleId); + //if (CollectionUtils.isEmpty(settings)) { + // // 数据库查出来,放入redis一份。此处为权限过滤器用到,存在缓存穿透,所以不采用这种方式。 + // // 改用为:变动setting的时候手动更新缓存的方式 + // List settingsDB = roleAccessSettingDao.listRoleAccessSettingsByRoleId(roleId); + // if (!CollectionUtils.isEmpty(settingsDB)) { + // roleAccessSettingRedis.set(settingsDB, roleId); + // } + //} + if (settings == null) { + settings = new HashMap<>(); + } + return settings; + } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql index 93d8c2a148..62e72134a0 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db.migration/epmet_gov_access.sql @@ -5,6 +5,8 @@ -- SET NAMES utf8mb4; -- #SET FOREIGN_KEY_CHECKS = 0; +CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; + -- DROP TABLE IF EXISTS `permission_scope`; CREATE TABLE `operation_scope` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id', @@ -73,4 +75,22 @@ CREATE TABLE `role_scope` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能操作哪些范围' ROW_FORMAT = Dynamic; +-- 2020.04.26 wxz -- + +CREATE TABLE `role_access_setting` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `SETTING_KEY` varchar(30) NOT NULL COMMENT '配置KEY', + `SETTING_NAME` varchar(30) NOT NULL COMMENT '配置name', + `SETTING_VALUE` varchar(30) NOT NULL COMMENT '配置值', + `ROLE_ID` varchar(64) DEFAULT NULL COMMENT '角色ID', + `BRIEF` varchar(255) DEFAULT NULL COMMENT '操作简介', + `DEL_FLAG` tinyint(1) DEFAULT NULL, + `REVISION` int(10) DEFAULT NULL, + `CREATED_BY` varchar(64) DEFAULT NULL, + `CREATED_TIME` datetime DEFAULT NULL, + `UPDATED_BY` varchar(64) DEFAULT NULL, + `UPDATED_TIME` datetime DEFAULT NULL, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='权限配置' + -- SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleAccessSettingDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleAccessSettingDao.xml new file mode 100644 index 0000000000..cc31938799 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleAccessSettingDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/test/java/com/epmet/test/govaccess/AccessSettingTest.java b/epmet-module/gov-access/gov-access-server/src/test/java/com/epmet/test/govaccess/AccessSettingTest.java new file mode 100644 index 0000000000..6ac8bf1547 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/test/java/com/epmet/test/govaccess/AccessSettingTest.java @@ -0,0 +1,38 @@ +package com.epmet.test.govaccess; + +import com.epmet.dao.RoleAccessSettingDao; +import com.epmet.dto.result.RoleAccessSettingResultDTO; +import com.epmet.redis.RoleAccessSettingRedis; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class AccessSettingTest { + + @Autowired + private RoleAccessSettingDao roleAccessSettingDao; + + @Autowired + private RoleAccessSettingRedis roleAccessSettingRedis; + + @Test + public void addAccessSettings2Redis() { + List settings = roleAccessSettingDao.listRoleAccessSettingsByRoleId("1"); + HashMap objectObjectHashMap = new HashMap<>(); + settings.forEach(s -> { + objectObjectHashMap.put(s.getSettingKey(), s.getSettingValue()); + }); + roleAccessSettingRedis.set(objectObjectHashMap, "1"); + Map map = roleAccessSettingRedis.get("1"); + System.out.println(map); + } + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 287da51fec..eaabe43f49 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -23,6 +23,7 @@ import java.util.List; * @Description * @Author sun */ +//, url = "localhost:8087" @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) public interface EpmetUserFeignClient { /** diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 8c03d28764..45f0647c4b 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -19,6 +19,7 @@ import java.util.List; * @Description * @Author sun */ +//, url = "localhost:8092" @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) public interface GovOrgFeignClient { diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index d76e2e2f34..13340d53e1 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -38,27 +38,25 @@ public class AccessServiceImpl implements AccessService { @Autowired private GovOrgFeignClient govOrgFeignClient; - @Autowired - private CpUserDetailRedis cpUserDetailRedis; - - @Override - public Set listOpeKeysByStaffId(String app, String client, String staffId, String agencyId, String gridId) { + public List queryGovStaffRoles(String staffId, String orgId) { List roleDTOS = new ArrayList<>(); - // 查询机关单位权限 StaffRoleFormDTO formDTO = new StaffRoleFormDTO(); formDTO.setStaffId(staffId); - formDTO.setOrgId(agencyId); - Result> agencyResult = userFeignClient.getRolesOfStaff(formDTO); - if (!CollectionUtils.isEmpty(agencyResult.getData())) { - roleDTOS.addAll(agencyResult.getData()); - } - // 查询网格权限 - formDTO.setStaffId(staffId); - formDTO.setOrgId(gridId); + formDTO.setOrgId(orgId); Result> gridResult = userFeignClient.getRolesOfStaff(formDTO); if (!CollectionUtils.isEmpty(gridResult.getData())) { roleDTOS.addAll(gridResult.getData()); } + return roleDTOS; + } + + @Override + public Set listOpeKeysByStaffId(String app, String client, String staffId, String agencyId, String gridId) { + List roleDTOS = new ArrayList<>(); + // 查询机关单位中的角色 + roleDTOS.addAll(queryGovStaffRoles(staffId, agencyId)); + // 查询网格中的角色 + roleDTOS.addAll(queryGovStaffRoles(staffId, gridId)); // 拼装操作key列表 Set opeKeys = new HashSet<>(); @@ -86,7 +84,7 @@ public class AccessServiceImpl implements AccessService { // 查询该直属机关的orgIdPath Result agencyById = govOrgFeignClient.getAgencyById(agencyId); - if (agencyById.getCode() != 0 || agencyById.getData() == null) { + if (!agencyById.success() || agencyById.getData() == null) { logger.error("根据当前机构id[{}]查询pids失败:{}", agencyId, agencyById.getMsg()); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } @@ -98,6 +96,7 @@ public class AccessServiceImpl implements AccessService { staffPermCacheFormDTO.setStaffId(staffId); staffPermCacheFormDTO.setPermissions(opeKeys); staffPermCacheFormDTO.setRoleIdList(roleIds); + staffPermCacheFormDTO.setGridId(gridId); // 拼接orgIdPath staffPermCacheFormDTO.setOrgIdPath(String.format("%s:%s", agencyById.getData().getPids(), agencyId)); govAccessFeignClient.updatePermissionCache(staffPermCacheFormDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java index b55e48a3e0..c94a102685 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -11,10 +11,7 @@ import com.epmet.dto.result.DepartmentInAgencyResultDTO; import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.service.DepartmentService; 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.List; @@ -112,4 +109,14 @@ public class DepartmentController { ValidatorUtils.validateEntity(formDTO); return departmentService.departmentList(formDTO); } + + /** + * 根据StaffId查询所属部门列表 + * @return + */ + @PostMapping("staff/{staffId}/departmentlist") + public Result> getDepartmentListByStaffId(@PathVariable("staffId") String staffId) { + List deptList = departmentService.listDepartmentListByStaffId(staffId); + return new Result>().ok(deptList); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java index b7569a1396..5ecfdff97f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java @@ -49,4 +49,11 @@ public interface CustomerDepartmentDao extends BaseDao * @Description 根据当前机关Id查询该机关下的直属部门列表 **/ List selectDepartmentList(@Param("agencyId") String agencyId); + + /** + * 根据StaffId查询所属部门列表 + * @param staffId + * @return + */ + List listDepartmentListByStaffId(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java index 2d49860de2..495a285f66 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java @@ -86,4 +86,11 @@ public interface DepartmentService { * @return */ Result addDepartmentStaff(TokenDto tokenDto,AddDepartmentStaffFormDTO addDepartmentStaffFormDTO); + + /** + * 根据StaffId查询所属部门列表 + * @param staffId + * @return + */ + List listDepartmentListByStaffId(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java index dda0d02ae7..2df01f8d3a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -226,4 +226,9 @@ public class DepartmentServiceImpl implements DepartmentService { customerStaffDepartmentDao.updateDepartmentStaffCount(data.size(),addDepartmentStaffFormDTO.getDepartmentId()); return new Result(); } + + @Override + public List listDepartmentListByStaffId(String staffId) { + return customerDepartmentDao.listDepartmentListByStaffId(staffId); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml index 932f7f66d3..e440745e06 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -26,4 +26,11 @@ ORDER BY created_time DESC + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 6d65865681..32ec353dfe 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -18,11 +18,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.springframework.context.annotation.Scope; import java.util.List; @@ -40,7 +42,8 @@ public interface StaffRoleDao extends BaseDao { * @param orgId * @return */ - List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId); + List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId, + @Param("dataScope") DataScope dataScope); /** * 删除工作人员权限 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index acbb5833f7..1f518e6910 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping; * @Author sun * @Date 2020/3/16 */ +//, url = "localhost:8092" @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) public interface GovOrgFeignClient { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 180521ebe3..80e16582d8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -111,9 +111,9 @@ public class StaffRoleServiceImpl extends BaseServiceImpl listStaffsInRole(String roleKey, String orgId, DataScope dataScope) { - return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId); + return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId, dataScope); } @Override From 292a867842c490f05e7927564121e16b7d20231e Mon Sep 17 00:00:00 2001 From: wxz Date: Sun, 26 Apr 2020 18:42:55 +0800 Subject: [PATCH 111/174] =?UTF-8?q?1.=E5=8E=BB=E9=99=A4FeignClient?= =?UTF-8?q?=E7=9A=84url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/feign/GovAccessFeignClient.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java index b41a5e59ca..3124d857fe 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -16,7 +16,8 @@ import java.util.List; * @Description * @Author sun */ -@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class, url = "localhost:8099") +//, url = "localhost:8099" +@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) public interface GovAccessFeignClient { /** From 2d84ce77879fcc122dd78b427622b2fc4008f76c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Sun, 26 Apr 2020 21:15:45 +0800 Subject: [PATCH 112/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF-=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E3=80=81=E9=83=A8=E9=97=A8=E6=A8=A1=E5=9D=97=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/EditAgencyFormDTO.java | 5 ++ .../epmet/dto/result/AgencysResultDTO.java | 10 ++-- .../dto/result/DepartmentDetailResultDTO.java | 5 ++ .../epmet/controller/AgencyController.java | 1 + .../java/com/epmet/dao/CustomerAgencyDao.java | 9 ++++ .../epmet/service/impl/AgencyServiceImpl.java | 52 +++++++++++++++++-- .../service/impl/DepartmentServiceImpl.java | 6 ++- .../resources/mapper/CustomerAgencyDao.xml | 47 +++++++++++------ 8 files changed, 106 insertions(+), 29 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java index e4a410120e..6cc332a6e7 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java @@ -45,4 +45,9 @@ public class EditAgencyFormDTO implements Serializable { @NotBlank(message = "机关组织名称不能为空") private String agencyName; + /** + * token中用户Id + */ + private String userId; + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index e372d86d8d..055fc8d11c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -57,11 +57,6 @@ public class AgencysResultDTO implements Serializable { */ private Integer areaCode; - /** - * 国家 - */ - private String country; - /** * 省份 */ @@ -72,6 +67,11 @@ public class AgencysResultDTO implements Serializable { */ private String city; + /** + * 区县 + */ + private String district; + /** * 本机关的所有上级机关 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java index d36a4222ee..c4b87cc743 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java @@ -33,6 +33,11 @@ public class DepartmentDetailResultDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 组织机构Id + */ + private String agencyId; + /** * 部门Id */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 7f192ee942..6f554aa48c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -68,6 +68,7 @@ public class AgencyController { */ @PostMapping("editagency") public Result editAgency(@LoginUser TokenDto tokenDTO, @RequestBody EditAgencyFormDTO formDTO) { + formDTO.setUserId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(formDTO); return agencyService.editAgency(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 8a4c14548b..ba4bde9b07 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.result.AgencyListResultDTO; import com.epmet.dto.result.ParentListResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; @@ -68,4 +69,12 @@ public interface CustomerAgencyDao extends BaseDao { * @Description 获取组织列表 **/ List selectAgencyList(@Param("pId") String pId); + + /** + * @param customerAgencyDTO + * @return + * @Author sun + * @Description 查询当前组织的所有下级组织列表 + **/ + List selectFindList(CustomerAgencyDTO customerAgencyDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index f1901d64cf..ea5cee6df4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -24,10 +24,12 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.service.AgencyService; +import com.epmet.service.CustomerAgencyService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,8 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.List; +import java.util.*; /** * 机关单位信息 @@ -49,6 +50,8 @@ public class AgencyServiceImpl implements AgencyService { private static final Logger log = LoggerFactory.getLogger(AgencyServiceImpl.class); @Autowired private CustomerAgencyDao customerAgencyDao; + @Autowired + private CustomerAgencyService customerAgencyService; /** * @param formDTO @@ -103,10 +106,46 @@ public class AgencyServiceImpl implements AgencyService { CustomerAgencyEntity entity = new CustomerAgencyEntity(); entity.setId(formDTO.getAgencyId()); entity.setOrganizationName(formDTO.getAgencyName()); + //1:更新当前组织信息 if (customerAgencyDao.updateById(entity) < NumConstant.ONE) { log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); } + //2:查询当前组织的所有下级组织列表(查询pids字段值包含该组织id的数据) + CustomerAgencyDTO agencyDTO = new CustomerAgencyDTO(); + agencyDTO.setPids(formDTO.getAgencyId()); + List agencyList = customerAgencyDao.selectFindList(agencyDTO); + if (null == agencyList || agencyList.size() < NumConstant.ONE) { + return result; + } + //3:循环组织列表,查询每一个组织的所有上级组织重新拼接所有上级名称(allParentName)字段值 + List editList = new ArrayList<>(); + Date date = new Date(); + agencyList.forEach(agency->{ + CustomerAgencyEntity customerAgencyEntity = new CustomerAgencyEntity(); + //3-1:查询当前组织的所有上级组织 + List listStr = Arrays.asList(agency.getPids().split(":")); + List parentList = customerAgencyDao.selectPAgencyById(listStr); + //3-2:重新拼接当前组织的所有上级名称字段值,将组织Id和拼好的值存入集合 + StringBuffer allParentName = new StringBuffer(); + parentList.forEach(parents->{ + if(StringUtils.isBlank(allParentName)){ + allParentName.append(parents.getName()); + }else { + allParentName.append("-").append(parents.getName()); + } + }); + customerAgencyEntity.setId(agency.getId()); + customerAgencyEntity.setAllParentName(allParentName.toString()); + customerAgencyEntity.setUpdatedBy(formDTO.getUserId()); + customerAgencyEntity.setUpdatedTime(date); + editList.add(customerAgencyEntity); + }); + //4:批量更新因一个组织名称变动而引起的其他组织字段值的变动 + if (!customerAgencyService.updateBatchById(editList)) { + log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); + throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); + } return result; } @@ -151,9 +190,11 @@ public class AgencyServiceImpl implements AgencyService { @Override public Result agencyDetail(AgencydetailFormDTO formDTO) { AgencysResultDTO agencysResultDTO = new AgencysResultDTO(); + List parentList = new ArrayList<>(); //1:查询本机关详细信息 CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getAgencyId()); if (null == entity) { + agencysResultDTO.setParentList(parentList); return new Result().ok(agencysResultDTO); } agencysResultDTO = ConvertUtils.sourceToTarget(entity, AgencysResultDTO.class); @@ -161,10 +202,11 @@ public class AgencyServiceImpl implements AgencyService { agencysResultDTO.setAgencyName(entity.getOrganizationName()); //2:查询本机关的所有上级机关,按自上而下层级顺序 if (null == entity.getPids()) { + agencysResultDTO.setParentList(parentList); return new Result().ok(agencysResultDTO); } List listStr = Arrays.asList(entity.getPids().split(":")); - List parentList = customerAgencyDao.selectPAgencyById(listStr); + parentList = customerAgencyDao.selectPAgencyById(listStr); agencysResultDTO.setParentList(parentList); return new Result().ok(agencysResultDTO); } @@ -180,7 +222,7 @@ public class AgencyServiceImpl implements AgencyService { SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO(); //1:根据当前机关Id查询直属下一级机关列表 List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId()); - subAgencyResultDTO.setAgencyList(agencyList); + subAgencyResultDTO.setAgencyList(null == agencyList ? new ArrayList() : agencyList); //2:统计下一级机关数 subAgencyResultDTO.setSubAgencyCount(agencyList.size()); return new Result().ok(subAgencyResultDTO); @@ -195,7 +237,7 @@ public class AgencyServiceImpl implements AgencyService { @Override public Result> agencyList(AgencyListFormDTO formDTO) { List agencyList = customerAgencyDao.selectAgencyList(formDTO.getAgencyId()); - return new Result>().ok(agencyList); + return new Result>().ok(null == agencyList ? new ArrayList() : agencyList); } @Override diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java index 0e2aff6f6b..95e44f7bc1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -48,6 +48,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -162,6 +163,7 @@ public class DepartmentServiceImpl implements DepartmentService { //2:查询部门下工作人员的用户Id集合 List userIdList = customerStaffDepartmentDao.selectUserIdByDepartmentId(formDTO.getDepartmentId()); if (null == userIdList || userIdList.size() < NumConstant.ONE) { + departmentDetailResultDTO.setStaffList(new ArrayList()); return result.ok(departmentDetailResultDTO); } DepartmentInStaffFormDTO departmentInStaffFormDTO = new DepartmentInStaffFormDTO(); @@ -192,7 +194,7 @@ public class DepartmentServiceImpl implements DepartmentService { DepartmentInAgencyResultDTO departmentInAgencyResultDTO = new DepartmentInAgencyResultDTO(); //1:根据当前机关Id查询该机关下的直属部门列表 List departmentList = customerDepartmentDao.selectDepartmentListByAgencyId(formDTO.getAgencyId()); - departmentInAgencyResultDTO.setDepartmentList(departmentList); + departmentInAgencyResultDTO.setDepartmentList(null == departmentList ? new ArrayList() : departmentList); //2:统计下一级机关数 departmentInAgencyResultDTO.setDepartmentCount(departmentList.size()); return new Result().ok(departmentInAgencyResultDTO); @@ -207,7 +209,7 @@ public class DepartmentServiceImpl implements DepartmentService { @Override public Result> departmentList(DepartmentListFormDTO formDTO) { List departmentList = customerDepartmentDao.selectDepartmentList(formDTO.getAgencyId()); - return new Result>().ok(departmentList); + return new Result>().ok((null == departmentList ? new ArrayList() : departmentList)); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index a849c06edf..017ae50451 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -3,23 +3,26 @@ - - - - - - - - - - - - - - - - - + + ca.id AS "id", + ca.customer_id AS "customerId", + ca.pid AS "pid", + ca.pids AS "pids", + ca.all_parent_name AS "allParentName", + ca.organization_name AS "organizationName", + ca.level AS "level", + ca.area_code AS "areaCode", + ca.total_user AS "totalUser", + ca.province AS "province", + ca.city AS "city", + ca.district AS "district", + ca.del_flag AS "delflag", + ca.revision AS "revision", + ca.created_by AS "createdby", + ca.created_time AS "createdtime", + ca.updated_by AS "updatedby", + ca.updated_time AS "updatedtime" + + + \ No newline at end of file From f46d0fbc0b560e533fa2bd4ebc173f1d43b63c34 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Apr 2020 23:54:36 +0800 Subject: [PATCH 113/174] =?UTF-8?q?partymember=5Fconfirm=5Fmanual=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0read=5Fflag,=E5=85=9A=E5=91=98=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=8E=86=E5=8F=B2=E6=8E=A5=E5=8F=A3=E3=80=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BE=85=E5=AE=A1=E6=A0=B8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/AuditedPartyMemberFormDTO.java | 34 +++++++ .../dto/form/AuditingPartyMemberFormDTO.java | 12 +++ .../result/AuditedPartyMemberResultDTO.java | 46 +++++++++ .../result/AuditingPartyMemberResultDTO.java | 47 +++++++++ .../controller/ResiPartyMemberController.java | 19 +++- .../feign/ResiPartymemberFeignClient.java | 34 ++++++- .../ResiPartymemberFeignClientFallBack.java | 14 +++ .../epmet/service/ResiPartyMemberService.java | 15 ++- .../impl/ResiPartyMemberServiceImpl.java | 50 +++++++++- .../epmet/dto/result/GridInfoResultDTO.java | 81 +++++++++++++++ .../controller/CustomerGridController.java | 17 +++- .../epmet/service/CustomerGridService.java | 10 ++ .../service/impl/CustomerGridServiceImpl.java | 53 +++++++++- .../form/ReviewedParyMemberFormDTO.java | 32 ++++++ .../form/UnderReviewParyMemberFormDTO.java | 34 +++++++ .../result/ReviewedParyMemberResultDTO.java | 44 +++++++++ .../UnderReviewParyMemberResultDTO.java | 47 +++++++++ .../epmet/constant/PartyMemberConstant.java | 14 ++- .../modules/feign/GovOrgFeignClient.java | 17 +++- .../fallback/GovOrgFeignClientFallBack.java | 6 ++ .../PartymemberBaseInfoController.java | 28 ++++++ .../dao/PartymemberBaseInfoDao.java | 21 ++++ .../service/PartymemberBaseInfoService.java | 26 ++++- .../impl/PartymemberBaseInfoServiceImpl.java | 98 ++++++++++++++++++- .../partymember/PartymemberBaseInfoDao.xml | 53 ++++++++++ .../src/main/resources/redis/migration/db.sql | 4 +- 26 files changed, 832 insertions(+), 24 deletions(-) create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java new file mode 100644 index 0000000000..fe9dae424c --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 党员认证-审核历史列表入参 + * @Author yinzuomei + * @Date 2020/4/26 23:28 + */ +@Data +public class AuditedPartyMemberFormDTO implements Serializable { + private static final long serialVersionUID = -6698685200715718225L; + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java index b48456f0cb..a05bf1ddb9 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -19,5 +20,16 @@ public class AuditingPartyMemberFormDTO implements Serializable { */ @NotBlank(message = "网格id不能为空") private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; } diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java new file mode 100644 index 0000000000..a5558e101b --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 党员认证-审核历史列表f返参 + * @Author yinzuomei + * @Date 2020/4/26 23:29 + */ +@Data +public class AuditedPartyMemberResultDTO implements Serializable { + private static final long serialVersionUID = 4203582446687799299L; + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * auto_confirm_failed:自动认证失败,rejected :拒绝 + */ + private String status; + + /** + * read已读unread未读 + */ + private String gridFullPath; +} + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java new file mode 100644 index 0000000000..5259b62602 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 党员认证-待审核列表返参 + * @Author yinzuomei + * @Date 2020/4/26 16:08 + */ +@Data +public class AuditingPartyMemberResultDTO implements Serializable { + private static final long serialVersionUID = 5408510275912925158L; + + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String readFlag; + + /** + * read已读unread未读 + */ + private String gridFullPath; +} + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java index 83b2fa05ca..565127f1db 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java @@ -1,7 +1,10 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.result.AuditedPartyMemberResultDTO; +import com.epmet.dto.result.AuditingPartyMemberResultDTO; import com.epmet.service.ResiPartyMemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -9,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @Description 基层治理-党员认证 * @Author yinzuomei @@ -28,9 +33,21 @@ public class ResiPartyMemberController { * @Date 2020/4/26 16:04 **/ @PostMapping("auditing") - public Result auditing(@RequestBody AuditingPartyMemberFormDTO formDTO) { + public Result> auditing(@RequestBody AuditingPartyMemberFormDTO formDTO) { return resiPartyMemberService.auditing(formDTO); } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 党员认证-审核历史列表(审核历史:只包括自动审核失败和拒绝的审核失败:居民未填写补充信息。) + * @Date 2020/4/26 23:31 + **/ + @PostMapping("audited") + public Result> audited(@RequestBody AuditedPartyMemberFormDTO formDTO) { + return resiPartyMemberService.audited(formDTO); + } } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java index eeb8fedf84..8bee3c6646 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java @@ -3,10 +3,15 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.feign.fallback.ResiPartymemberFeignClientFallBack; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import com.epmet.resi.partymember.dto.warmhearted.form.*; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -24,7 +29,7 @@ public interface ResiPartymemberFeignClient { * * @author zhaoqf **/ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/audited") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/audited", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> audited(@RequestBody ResiWarmheartedAuditedFromDTO formDTO); /** @@ -33,7 +38,7 @@ public interface ResiPartymemberFeignClient { * @return void * @author sun */ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/auditing") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/auditing", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> auditing(@RequestBody ResiWarmAuditFormDTO formDTO); /** @@ -42,7 +47,7 @@ public interface ResiPartymemberFeignClient { * @return void * @author sun */ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/approve") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/approve", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result approve(@RequestBody ResiWarmAuditApproveFormDTO formDTO); /** @@ -51,7 +56,7 @@ public interface ResiPartymemberFeignClient { * @return void * @author sun */ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/reject") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/reject", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result reject(@RequestBody ResiWarmAuditRejectFormDTO formDTO); /** @@ -60,7 +65,26 @@ public interface ResiPartymemberFeignClient { * @return void * @author sun */ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/getdetail") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/getdetail", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result getDetail(@RequestBody ResiWarmGetDetailFormDTO formDTO); + /** + * @param underReviewParyMemberFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表 + * @Date 2020/4/26 21:53 + **/ + @PostMapping(value = "resi/partymember/partymemberbaseinfo/auditing", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> auditingPartyMember(@RequestBody UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param reviewedParyMemberFormDTO + * @Author yinzuomei + * @Description 党员认证-审核历史列表查询 + * @Date 2020/4/26 23:38 + **/ + @PostMapping(value = "resi/partymember/partymemberbaseinfo/audited", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> auditedPartyMember(@RequestBody ReviewedParyMemberFormDTO reviewedParyMemberFormDTO); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java index 7d6fea0e70..a5151d6503 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.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.feign.ResiPartymemberFeignClient; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import com.epmet.resi.partymember.dto.warmhearted.form.*; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; @@ -43,4 +47,14 @@ public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignC return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getDetail", formDTO); } + @Override + public Result> auditingPartyMember(UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "auditing", underReviewParyMemberFormDTO); + } + + @Override + public Result> auditedPartyMember(ReviewedParyMemberFormDTO reviewedParyMemberFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "audited", reviewedParyMemberFormDTO); + } + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java index 1a28cd0f2e..f6171b98e1 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java @@ -1,7 +1,12 @@ package com.epmet.service; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.result.AuditedPartyMemberResultDTO; +import com.epmet.dto.result.AuditingPartyMemberResultDTO; + +import java.util.List; /** * @Description 基层治理-党员认证 @@ -16,5 +21,13 @@ public interface ResiPartyMemberService { * @Description 待审核列表 * @Date 2020/4/26 16:04 **/ - Result auditing(AuditingPartyMemberFormDTO formDTO); + Result> auditing(AuditingPartyMemberFormDTO formDTO); + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 党员认证-审核历史列表(审核历史:只包括自动审核失败和拒绝的审核失败:居民未填写补充信息。) + * @Date 2020/4/26 23:32 + **/ + Result> audited(AuditedPartyMemberFormDTO formDTO); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java index 3cacef6577..9809bdcb37 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java @@ -1,12 +1,27 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.result.AuditedPartyMemberResultDTO; +import com.epmet.dto.result.AuditingPartyMemberResultDTO; +import com.epmet.feign.ResiPartymemberFeignClient; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import com.epmet.service.ResiPartyMemberService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + /** * @Description 基层治理-党员认证 * @Author yinzuomei @@ -15,10 +30,41 @@ import org.springframework.stereotype.Service; @Service public class ResiPartyMemberServiceImpl implements ResiPartyMemberService { protected final Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private ResiPartymemberFeignClient resiPartymemberFeignClient; + + @Override + public Result> auditing(AuditingPartyMemberFormDTO formDTO) { + UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO = ConvertUtils.sourceToTarget(formDTO, UnderReviewParyMemberFormDTO.class); + List list = new ArrayList<>(); + Result> result = resiPartymemberFeignClient.auditingPartyMember(underReviewParyMemberFormDTO); + if (!result.success()) { + logger.error(String.format("调用resi-partymember-server模块失败,错误提示%s", result.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if (null == result.getData() || result.getData().isEmpty()) { + logger.info(String.format("网格id[%s],待审核党员列表查询为空", formDTO.getGridId())); + return new Result>().ok(list); + } + list = ConvertUtils.sourceToTarget(result.getData(), AuditingPartyMemberResultDTO.class); + return new Result>().ok(list); + } @Override - public Result auditing(AuditingPartyMemberFormDTO formDTO) { - return null; + public Result> audited(AuditedPartyMemberFormDTO formDTO) { + ReviewedParyMemberFormDTO reviewedParyMemberFormDTO = ConvertUtils.sourceToTarget(formDTO, ReviewedParyMemberFormDTO.class); + List list = new ArrayList<>(); + Result> result = resiPartymemberFeignClient.auditedPartyMember(reviewedParyMemberFormDTO); + if (!result.success()) { + logger.error(String.format("调用resi-partymember-server模块失败,错误提示%s", result.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if (null == result.getData() || result.getData().isEmpty()) { + logger.info(String.format("网格id[%s],待审核党员列表查询为空", formDTO.getGridId())); + return new Result>().ok(list); + } + list = ConvertUtils.sourceToTarget(result.getData(), AuditedPartyMemberResultDTO.class); + return new Result>().ok(list); } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..fff7b43caf --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 网格所属组织基本信息 + * @Author yinzuomei + * @Date 2020/4/26 22:35 + */ +@Data +public class GridInfoResultDTO implements Serializable { + private static final long serialVersionUID = 4360690752084258055L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区组织ID + */ + private String commnuityName; + + /** + * 社区名称 + */ + private String commuityId; + + /** + * 乡(镇、街道)级组织名称 + */ + private String streetName; + + /** + * 乡(镇、街道)级id + */ + private String streetId; + + /** + * 区县级组织id + */ + private String districtId; + + /** + * 区县级组织名称 + */ + private String districtName; + + /** + * 市级组织id + */ + private String cityId; + + /** + * 市级组织名称 + */ + private String cityName; + + /** + * 省级组织id + */ + private String provinceId; + + /** + * 省级组织名称 + */ + private String proviceName; +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index ed7db2c1c7..0154f5bf0c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -23,12 +23,13 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -124,4 +125,16 @@ public class CustomerGridController { CustomerGridDTO data = customerGridService.get(id); return new Result().ok(data); } + + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 22:41 + **/ + @GetMapping("getGridInfo/{gridId}") + public Result getGridInfo(@PathVariable("gridId") String gridId) { + return customerGridService.getGridInfo(gridId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 3da56bc4d2..c03344401f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -24,6 +24,7 @@ import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -113,4 +114,13 @@ public interface CustomerGridService extends BaseService { * @date 2020-03-17 */ Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 22:42 + **/ + Result getGridInfo(String gridId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index ea8bc48c65..dc0f143c30 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -20,18 +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.constant.FieldConstant; 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.CustomerGridDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.entity.CustomerGridEntity; - import com.epmet.redis.CustomerGridRedis; +import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; @@ -55,6 +57,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) { @@ -152,4 +156,49 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(baseDao.getCustomerGridByGridId(customerGridFormDTO)); } + @Override + public Result getGridInfo(String gridId) { + GridInfoResultDTO gridInfoResultDTO=new GridInfoResultDTO(); + CustomerGridDTO customerGridDTO = this.get(gridId); + if(null==customerGridDTO){ + return new Result<>(); + } + gridInfoResultDTO.setCustomerId(customerGridDTO.getCustomerId()); + String pids=customerGridDTO.getPids(); + String[] pidArray = pids.split(":"); + for(String agencyId:pidArray){ + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(agencyId); + if(null!=customerAgencyDTO){ + switch(customerAgencyDTO.getLevel()){ + case "community" : + //社区级 + gridInfoResultDTO.setCommuityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCommnuityName(customerAgencyDTO.getOrganizationName()); + break; + case "street" : + //乡(镇、街道)级 + gridInfoResultDTO.setStreetId(customerAgencyDTO.getId()); + gridInfoResultDTO.setStreetName(customerAgencyDTO.getOrganizationName()); + break; + case "district": + //区县级 + gridInfoResultDTO.setDistrictId(customerAgencyDTO.getId()); + gridInfoResultDTO.setDistrictName(customerAgencyDTO.getOrganizationName()); + break; + case "city": + //市级 + gridInfoResultDTO.setCityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCityName(customerAgencyDTO.getOrganizationName()); + break; + case "province": + //省级 + gridInfoResultDTO.setProvinceId(customerAgencyDTO.getId()); + gridInfoResultDTO.setProviceName(customerAgencyDTO.getOrganizationName()); + break; + } + } + } + return new Result().ok(gridInfoResultDTO); + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java new file mode 100644 index 0000000000..5e67b98be6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; + +/** + * @Description 政府端(小程序)党员认证-审核历史列表入参 + * @Author yinzuomei + * @Date 2020/4/26 23:35 + */ +@Data +public class ReviewedParyMemberFormDTO { + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java new file mode 100644 index 0000000000..a9fc379e2f --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 政府端(小程序端)查询待审核列表入参 + * @Author yinzuomei + * @Date 2020/4/26 17:57 + */ +@Data +public class UnderReviewParyMemberFormDTO implements Serializable { + private static final long serialVersionUID = 1730875402752895514L; + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java new file mode 100644 index 0000000000..c73aeb5f52 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.util.Date; + +/** + * @Description 政府端(小程序)党员认证-审核历史列表返参 + * @Author yinzuomei + * @Date 2020/4/26 23:36 + */ +@Data +public class ReviewedParyMemberResultDTO { + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * auto_confirm_failed:自动认证失败,rejected :拒绝 + */ + private String status; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java new file mode 100644 index 0000000000..baf6df1f52 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 政府端(小程序端)查询待审核列表返参 + * @Author yinzuomei + * @Date 2020/4/26 18:47 + */ +@Data +public class UnderReviewParyMemberResultDTO implements Serializable { + private static final long serialVersionUID = 2890001061547093376L; + + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * read已读unread未读 + */ + private String readFlag; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java index 106ea6c7fa..d73c5178bc 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java @@ -97,15 +97,25 @@ public interface PartyMemberConstant { String UNDER_AUDITTING = "under_auditting"; /** - * 审核状态 通过 + * 审核状态 通过 approved:人工审核通过, */ String APPROVED = "approved"; /** - * 审核状态 未通过 + * 审核状态 未通过rejected :拒绝 */ String REJECTED = "rejected"; + /** + * 自动认证成功 + */ + String AUTO_CONFIRM_SUCCESS="auto_confirm_success"; + + /** + * 自动认证失败 + */ + String AUTO_CONFIRM_FAILED="auto_confirm_failed"; + /** * 网格ID */ diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java index 620bd1feaf..632ef902ed 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java @@ -5,9 +5,11 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.modules.feign.fallback.GovOrgFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -28,8 +30,13 @@ public interface GovOrgFeignClient { @PostMapping("/gov/org/customergrid/getcustomergridbygridid") Result getCustomerGridByGridId(@RequestBody CustomerGridFormDTO customerGridFormDTO); - - - - + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 23:16 + **/ + @GetMapping("/gov/org/customergrid/getGridInfo/{gridId}") + Result queryGridInfo(@PathVariable("gridId") String gridId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java index f1f0195374..c9d63ef62d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.modules.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -25,4 +26,9 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { public Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId",customerGridFormDTO); } + + @Override + public Result queryGridInfo(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo",gridId); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java index 9aecbeedfd..ac20a61f89 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java @@ -28,10 +28,15 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.modules.partymember.excel.PartymemberBaseInfoExcel; import com.epmet.modules.partymember.service.PartymemberBaseInfoService; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -91,4 +96,27 @@ public class PartymemberBaseInfoController { ExcelUtils.exportExcelToTarget(response, null, list, PartymemberBaseInfoExcel.class); } + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表 + * @Date 2020/4/26 20:35 + **/ + @PostMapping("auditing") + public Result> auditing(@RequestBody @Valid UnderReviewParyMemberFormDTO formDTO){ + return partymemberBaseInfoService.auditing(formDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 政府端(小程序端)查询审核历史 + * @Date 2020/4/26 23:40 + **/ + @PostMapping("audited") + public Result> audited(@RequestBody @Valid ReviewedParyMemberFormDTO formDTO){ + return partymemberBaseInfoService.audited(formDTO); + } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java index 7a879e4072..6c614045fb 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java @@ -20,6 +20,10 @@ package com.epmet.modules.partymember.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -57,4 +61,21 @@ public interface PartymemberBaseInfoDao extends BaseDao selectBaseInfoByName(PartymemberInfoDTO param); + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表-根据网格id分页查询待审核党员列表 + * @Date 2020/4/26 20:43 + **/ + List selectListUnderReviewParyMember(UnderReviewParyMemberFormDTO formDTO); + + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表-根据网格id分页查询待审核党员列表 自动审核失败且未填写补充信息的+拒绝的 + * @Date 2020/4/26 23:43 + **/ + List selectListReviewedParyMember(ReviewedParyMemberFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java index f9b379a912..e317427c92 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java @@ -19,16 +19,21 @@ package com.epmet.modules.partymember.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import java.util.List; import java.util.Map; /** - * 党员库基本信息表 + * 党员库基本信息表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-30 @@ -97,8 +102,27 @@ public interface PartymemberBaseInfoService extends BaseService> + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表 + * @Date 2020/4/26 20:36 + **/ + Result> auditing(UnderReviewParyMemberFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 政府端(小程序端)查询审核历史 + * @Date 2020/4/26 23:40 + **/ + Result> audited(ReviewedParyMemberFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java index 8d0381e8a3..72455af8c3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java @@ -21,9 +21,16 @@ 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.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; +import com.epmet.dto.form.UserResiInfoListFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.partymember.dao.PartymemberBaseInfoDao; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.modules.partymember.redis.PartymemberBaseInfoRedis; @@ -31,6 +38,10 @@ import com.epmet.modules.partymember.service.PartymemberBaseInfoService; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import info.debatty.java.stringsimilarity.Levenshtein; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; @@ -39,8 +50,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; import static java.util.stream.Collectors.toList; @@ -55,6 +64,10 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl> auditing(UnderReviewParyMemberFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + List list = baseDao.selectListUnderReviewParyMember(formDTO); + if (null == list || list.isEmpty()) { + return new Result>().ok(new ArrayList<>()); + } + //查询网格信息 + Result gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId()); + String gridFullPath = ""; + if (gridInfoResult.success() && null != gridInfoResult.getData()) { + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName()); + gridFullPath = gridFullPath.replaceAll("--", "").trim(); + } + //查询居民认证信息,获取居民头像 + List userIdList = new ArrayList<>(); + for (UnderReviewParyMemberResultDTO underReviewParyMember : list) { + userIdList.add(underReviewParyMember.getUserId()); + underReviewParyMember.setGridFullPath(gridFullPath); + } + UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); + userResiInfoListFormDTO.setUserIdList(userIdList); + Result> userResiInfoResult = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO); + if (userResiInfoResult.success()) { + for (UnderReviewParyMemberResultDTO underReviewParyMemberInfo : list) { + for (UserResiInfoResultDTO userResiInfo : userResiInfoResult.getData()) { + if (underReviewParyMemberInfo.getUserId().equals(userResiInfo.getUserId())) { + underReviewParyMemberInfo.setUserHeadPhoto(userResiInfo.getHeadPhoto()); + break; + } + } + } + } + return new Result>().ok(list); + } + + + @Override + public Result> audited(ReviewedParyMemberFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + //审核历史:只包括自动审核失败和拒绝的 + //审核失败:居民未填写补充信息。 + List list = baseDao.selectListReviewedParyMember(formDTO); + if (null == list || list.isEmpty()) { + return new Result>().ok(new ArrayList<>()); + } + //查询网格信息 + Result gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId()); + String gridFullPath = ""; + if (gridInfoResult.success() && null != gridInfoResult.getData()) { + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName()); + gridFullPath = gridFullPath.replaceAll("--", "").trim(); + } + //查询居民认证信息,获取居民头像 + List userIdList = new ArrayList<>(); + for (ReviewedParyMemberResultDTO reviewedParyMemberResultDTO : list) { + userIdList.add(reviewedParyMemberResultDTO.getUserId()); + reviewedParyMemberResultDTO.setGridFullPath(gridFullPath); + } + UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); + userResiInfoListFormDTO.setUserIdList(userIdList); + Result> userResiInfoResult = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO); + if (userResiInfoResult.success()) { + for (ReviewedParyMemberResultDTO reviewedParyMember : list) { + for (UserResiInfoResultDTO userResiInfo : userResiInfoResult.getData()) { + if (reviewedParyMember.getUserId().equals(userResiInfo.getUserId())) { + reviewedParyMember.setUserHeadPhoto(userResiInfo.getHeadPhoto()); + break; + } + } + } + } + return new Result>().ok(list); + } + /** * 生成返回结果 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml index eb61f263ec..2f4819d69b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml @@ -54,5 +54,58 @@ AND DEL_FLAG = 0 + + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql index a20663b2ce..ae2431928e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql @@ -4,4 +4,6 @@ ALTER TABLE resi_warmhearted_apply ADD ( MESSAGE_TEXT VARCHAR (500) DEFAULT NULL COMMENT '消息通知内容' ); -- 修改党员认证结果2020-04-26 -alter table partymember_info modify column CONFIRM_RESULT varchar(20) COMMENT '认证结果:auto_confirm_success:自动认证成功,auto_confirm_failed:自动认证失败,approved:人工审核通过,rejected :拒绝)'; \ No newline at end of file +alter table partymember_info modify column CONFIRM_RESULT varchar(20) COMMENT '认证结果:auto_confirm_success:自动认证成功,auto_confirm_failed:自动认证失败,approved:人工审核通过,rejected :拒绝)'; +-- 添加已读未读标志 +ALTER TABLE partymember_confirm_manual ADD ( READ_FLAG VARCHAR ( 20 ) COMMENT '审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)' ); \ No newline at end of file From cda2ef7badcc988ed14cc17caeba5fb0a829c96a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 27 Apr 2020 09:10:48 +0800 Subject: [PATCH 114/174] =?UTF-8?q?=E5=9C=B0=E5=8C=BA=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=94=B1int=E6=94=B9=E4=B8=BAstring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/result/AgencysResultDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index 055fc8d11c..5cf2649ac5 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -55,7 +55,7 @@ public class AgencysResultDTO implements Serializable { /** * 地区编码 */ - private Integer areaCode; + private String areaCode; /** * 省份 From 57f93b0e6afc9c81af30a8bef283109c8a5c1958 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Apr 2020 09:30:43 +0800 Subject: [PATCH 115/174] =?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 --- .../dto/form/AuditedPartyMemberFormDTO.java | 34 +++++++ .../dto/form/AuditingPartyMemberFormDTO.java | 12 +++ .../result/AuditedPartyMemberResultDTO.java | 46 +++++++++ .../result/AuditingPartyMemberResultDTO.java | 47 +++++++++ .../controller/ResiPartyMemberController.java | 19 +++- .../feign/ResiPartymemberFeignClient.java | 34 ++++++- .../ResiPartymemberFeignClientFallBack.java | 14 +++ .../epmet/service/ResiPartyMemberService.java | 15 ++- .../impl/ResiPartyMemberServiceImpl.java | 50 +++++++++- .../epmet/dto/result/GridInfoResultDTO.java | 81 +++++++++++++++ .../controller/CustomerGridController.java | 13 +++ .../epmet/service/CustomerGridService.java | 13 ++- .../service/impl/CustomerGridServiceImpl.java | 52 ++++++++++ .../form/ReviewedParyMemberFormDTO.java | 32 ++++++ .../form/UnderReviewParyMemberFormDTO.java | 34 +++++++ .../result/ReviewedParyMemberResultDTO.java | 44 +++++++++ .../UnderReviewParyMemberResultDTO.java | 47 +++++++++ .../epmet/constant/PartyMemberConstant.java | 14 ++- .../modules/feign/GovOrgFeignClient.java | 17 +++- .../fallback/GovOrgFeignClientFallBack.java | 6 ++ .../PartymemberBaseInfoController.java | 28 ++++++ .../dao/PartymemberBaseInfoDao.java | 21 ++++ .../service/PartymemberBaseInfoService.java | 26 ++++- .../impl/PartymemberBaseInfoServiceImpl.java | 98 ++++++++++++++++++- .../partymember/PartymemberBaseInfoDao.xml | 53 ++++++++++ .../src/main/resources/redis/migration/db.sql | 4 +- 26 files changed, 833 insertions(+), 21 deletions(-) create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java new file mode 100644 index 0000000000..fe9dae424c --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditedPartyMemberFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 党员认证-审核历史列表入参 + * @Author yinzuomei + * @Date 2020/4/26 23:28 + */ +@Data +public class AuditedPartyMemberFormDTO implements Serializable { + private static final long serialVersionUID = -6698685200715718225L; + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java index b48456f0cb..a05bf1ddb9 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/AuditingPartyMemberFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -19,5 +20,16 @@ public class AuditingPartyMemberFormDTO implements Serializable { */ @NotBlank(message = "网格id不能为空") private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; } diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java new file mode 100644 index 0000000000..a5558e101b --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 党员认证-审核历史列表f返参 + * @Author yinzuomei + * @Date 2020/4/26 23:29 + */ +@Data +public class AuditedPartyMemberResultDTO implements Serializable { + private static final long serialVersionUID = 4203582446687799299L; + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * auto_confirm_failed:自动认证失败,rejected :拒绝 + */ + private String status; + + /** + * read已读unread未读 + */ + private String gridFullPath; +} + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java new file mode 100644 index 0000000000..5259b62602 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 党员认证-待审核列表返参 + * @Author yinzuomei + * @Date 2020/4/26 16:08 + */ +@Data +public class AuditingPartyMemberResultDTO implements Serializable { + private static final long serialVersionUID = 5408510275912925158L; + + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String readFlag; + + /** + * read已读unread未读 + */ + private String gridFullPath; +} + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java index 83b2fa05ca..565127f1db 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java @@ -1,7 +1,10 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.result.AuditedPartyMemberResultDTO; +import com.epmet.dto.result.AuditingPartyMemberResultDTO; import com.epmet.service.ResiPartyMemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -9,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @Description 基层治理-党员认证 * @Author yinzuomei @@ -28,9 +33,21 @@ public class ResiPartyMemberController { * @Date 2020/4/26 16:04 **/ @PostMapping("auditing") - public Result auditing(@RequestBody AuditingPartyMemberFormDTO formDTO) { + public Result> auditing(@RequestBody AuditingPartyMemberFormDTO formDTO) { return resiPartyMemberService.auditing(formDTO); } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 党员认证-审核历史列表(审核历史:只包括自动审核失败和拒绝的审核失败:居民未填写补充信息。) + * @Date 2020/4/26 23:31 + **/ + @PostMapping("audited") + public Result> audited(@RequestBody AuditedPartyMemberFormDTO formDTO) { + return resiPartyMemberService.audited(formDTO); + } } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java index eeb8fedf84..8bee3c6646 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java @@ -3,10 +3,15 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.feign.fallback.ResiPartymemberFeignClientFallBack; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import com.epmet.resi.partymember.dto.warmhearted.form.*; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -24,7 +29,7 @@ public interface ResiPartymemberFeignClient { * * @author zhaoqf **/ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/audited") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/audited", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> audited(@RequestBody ResiWarmheartedAuditedFromDTO formDTO); /** @@ -33,7 +38,7 @@ public interface ResiPartymemberFeignClient { * @return void * @author sun */ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/auditing") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/auditing", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> auditing(@RequestBody ResiWarmAuditFormDTO formDTO); /** @@ -42,7 +47,7 @@ public interface ResiPartymemberFeignClient { * @return void * @author sun */ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/approve") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/approve", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result approve(@RequestBody ResiWarmAuditApproveFormDTO formDTO); /** @@ -51,7 +56,7 @@ public interface ResiPartymemberFeignClient { * @return void * @author sun */ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/reject") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/reject", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result reject(@RequestBody ResiWarmAuditRejectFormDTO formDTO); /** @@ -60,7 +65,26 @@ public interface ResiPartymemberFeignClient { * @return void * @author sun */ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/getdetail") + @PostMapping(value = "resi/partymember/resiwarmheartedapply/getdetail", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result getDetail(@RequestBody ResiWarmGetDetailFormDTO formDTO); + /** + * @param underReviewParyMemberFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表 + * @Date 2020/4/26 21:53 + **/ + @PostMapping(value = "resi/partymember/partymemberbaseinfo/auditing", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> auditingPartyMember(@RequestBody UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param reviewedParyMemberFormDTO + * @Author yinzuomei + * @Description 党员认证-审核历史列表查询 + * @Date 2020/4/26 23:38 + **/ + @PostMapping(value = "resi/partymember/partymemberbaseinfo/audited", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> auditedPartyMember(@RequestBody ReviewedParyMemberFormDTO reviewedParyMemberFormDTO); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java index 7d6fea0e70..a5151d6503 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.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.feign.ResiPartymemberFeignClient; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import com.epmet.resi.partymember.dto.warmhearted.form.*; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; @@ -43,4 +47,14 @@ public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignC return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getDetail", formDTO); } + @Override + public Result> auditingPartyMember(UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "auditing", underReviewParyMemberFormDTO); + } + + @Override + public Result> auditedPartyMember(ReviewedParyMemberFormDTO reviewedParyMemberFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "audited", reviewedParyMemberFormDTO); + } + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java index 1a28cd0f2e..f6171b98e1 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java @@ -1,7 +1,12 @@ package com.epmet.service; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.result.AuditedPartyMemberResultDTO; +import com.epmet.dto.result.AuditingPartyMemberResultDTO; + +import java.util.List; /** * @Description 基层治理-党员认证 @@ -16,5 +21,13 @@ public interface ResiPartyMemberService { * @Description 待审核列表 * @Date 2020/4/26 16:04 **/ - Result auditing(AuditingPartyMemberFormDTO formDTO); + Result> auditing(AuditingPartyMemberFormDTO formDTO); + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 党员认证-审核历史列表(审核历史:只包括自动审核失败和拒绝的审核失败:居民未填写补充信息。) + * @Date 2020/4/26 23:32 + **/ + Result> audited(AuditedPartyMemberFormDTO formDTO); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java index 3cacef6577..9809bdcb37 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java @@ -1,12 +1,27 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.result.AuditedPartyMemberResultDTO; +import com.epmet.dto.result.AuditingPartyMemberResultDTO; +import com.epmet.feign.ResiPartymemberFeignClient; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import com.epmet.service.ResiPartyMemberService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + /** * @Description 基层治理-党员认证 * @Author yinzuomei @@ -15,10 +30,41 @@ import org.springframework.stereotype.Service; @Service public class ResiPartyMemberServiceImpl implements ResiPartyMemberService { protected final Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private ResiPartymemberFeignClient resiPartymemberFeignClient; + + @Override + public Result> auditing(AuditingPartyMemberFormDTO formDTO) { + UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO = ConvertUtils.sourceToTarget(formDTO, UnderReviewParyMemberFormDTO.class); + List list = new ArrayList<>(); + Result> result = resiPartymemberFeignClient.auditingPartyMember(underReviewParyMemberFormDTO); + if (!result.success()) { + logger.error(String.format("调用resi-partymember-server模块失败,错误提示%s", result.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if (null == result.getData() || result.getData().isEmpty()) { + logger.info(String.format("网格id[%s],待审核党员列表查询为空", formDTO.getGridId())); + return new Result>().ok(list); + } + list = ConvertUtils.sourceToTarget(result.getData(), AuditingPartyMemberResultDTO.class); + return new Result>().ok(list); + } @Override - public Result auditing(AuditingPartyMemberFormDTO formDTO) { - return null; + public Result> audited(AuditedPartyMemberFormDTO formDTO) { + ReviewedParyMemberFormDTO reviewedParyMemberFormDTO = ConvertUtils.sourceToTarget(formDTO, ReviewedParyMemberFormDTO.class); + List list = new ArrayList<>(); + Result> result = resiPartymemberFeignClient.auditedPartyMember(reviewedParyMemberFormDTO); + if (!result.success()) { + logger.error(String.format("调用resi-partymember-server模块失败,错误提示%s", result.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if (null == result.getData() || result.getData().isEmpty()) { + logger.info(String.format("网格id[%s],待审核党员列表查询为空", formDTO.getGridId())); + return new Result>().ok(list); + } + list = ConvertUtils.sourceToTarget(result.getData(), AuditedPartyMemberResultDTO.class); + return new Result>().ok(list); } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..fff7b43caf --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 网格所属组织基本信息 + * @Author yinzuomei + * @Date 2020/4/26 22:35 + */ +@Data +public class GridInfoResultDTO implements Serializable { + private static final long serialVersionUID = 4360690752084258055L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区组织ID + */ + private String commnuityName; + + /** + * 社区名称 + */ + private String commuityId; + + /** + * 乡(镇、街道)级组织名称 + */ + private String streetName; + + /** + * 乡(镇、街道)级id + */ + private String streetId; + + /** + * 区县级组织id + */ + private String districtId; + + /** + * 区县级组织名称 + */ + private String districtName; + + /** + * 市级组织id + */ + private String cityId; + + /** + * 市级组织名称 + */ + private String cityName; + + /** + * 省级组织id + */ + private String provinceId; + + /** + * 省级组织名称 + */ + private String proviceName; +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 6daed0e8a4..2f6fee3031 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -30,6 +30,7 @@ import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -126,6 +127,18 @@ public class CustomerGridController { return new Result().ok(data); } + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 22:41 + **/ + @GetMapping("getGridInfo/{gridId}") + public Result getGridInfo(@PathVariable("gridId") String gridId) { + return customerGridService.getGridInfo(gridId); + } + /** * @param userId * @return diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 45d3572e74..77006089a4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -28,6 +28,8 @@ import com.epmet.dto.result.AddGridResultDTO; import com.epmet.dto.form.CommonAgencyIdFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; import org.springframework.web.bind.annotation.RequestBody; @@ -120,6 +122,15 @@ public interface CustomerGridService extends BaseService { */ Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 22:42 + **/ + Result getGridInfo(String gridId); + /** * @param userId * @return @@ -163,7 +174,7 @@ public interface CustomerGridService extends BaseService { * @Date 2020.04.23 14:45 **/ Result getGridListByAgency(CommonAgencyIdFormDTO agencyFormDTO); - + /** * @Description 查找指定机构下的全部网格列表 对应接口:/gov/org/grid/allgrids * @Param CommonAgencyIdFormDTO -> agencyId diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 6889e34433..043bb3a5d7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -21,6 +21,7 @@ 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.constant.FieldConstant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; @@ -28,6 +29,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerGridDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; import com.epmet.dto.form.*; @@ -38,9 +40,12 @@ import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.CommonAgencyIdFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.CustomerGridRedis; +import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerStaffGridService; import com.epmet.util.ModuleConstant; @@ -70,6 +75,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(baseDao.getCustomerGridByGridId(customerGridFormDTO)); } + @Override + public Result getGridInfo(String gridId) { + GridInfoResultDTO gridInfoResultDTO=new GridInfoResultDTO(); + CustomerGridDTO customerGridDTO = this.get(gridId); + if(null==customerGridDTO){ + return new Result<>(); + } + gridInfoResultDTO.setCustomerId(customerGridDTO.getCustomerId()); + String pids=customerGridDTO.getPids(); + String[] pidArray = pids.split(":"); + for(String agencyId:pidArray){ + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(agencyId); + if(null!=customerAgencyDTO){ + switch(customerAgencyDTO.getLevel()){ + case "community" : + //社区级 + gridInfoResultDTO.setCommuityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCommnuityName(customerAgencyDTO.getOrganizationName()); + break; + case "street" : + //乡(镇、街道)级 + gridInfoResultDTO.setStreetId(customerAgencyDTO.getId()); + gridInfoResultDTO.setStreetName(customerAgencyDTO.getOrganizationName()); + break; + case "district": + //区县级 + gridInfoResultDTO.setDistrictId(customerAgencyDTO.getId()); + gridInfoResultDTO.setDistrictName(customerAgencyDTO.getOrganizationName()); + break; + case "city": + //市级 + gridInfoResultDTO.setCityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCityName(customerAgencyDTO.getOrganizationName()); + break; + case "province": + //省级 + gridInfoResultDTO.setProvinceId(customerAgencyDTO.getId()); + gridInfoResultDTO.setProviceName(customerAgencyDTO.getOrganizationName()); + break; + } + } + } + return new Result().ok(gridInfoResultDTO); + } + /** * @param userId * @return diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java new file mode 100644 index 0000000000..5e67b98be6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/ReviewedParyMemberFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; + +/** + * @Description 政府端(小程序)党员认证-审核历史列表入参 + * @Author yinzuomei + * @Date 2020/4/26 23:35 + */ +@Data +public class ReviewedParyMemberFormDTO { + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java new file mode 100644 index 0000000000..a9fc379e2f --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/UnderReviewParyMemberFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 政府端(小程序端)查询待审核列表入参 + * @Author yinzuomei + * @Date 2020/4/26 17:57 + */ +@Data +public class UnderReviewParyMemberFormDTO implements Serializable { + private static final long serialVersionUID = 1730875402752895514L; + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 页码 + */ + @Min(1) + private Integer pageNo; + + /** + * 每页显示数量默认20 + */ + private Integer pageSize=20; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java new file mode 100644 index 0000000000..c73aeb5f52 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.util.Date; + +/** + * @Description 政府端(小程序)党员认证-审核历史列表返参 + * @Author yinzuomei + * @Date 2020/4/26 23:36 + */ +@Data +public class ReviewedParyMemberResultDTO { + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * auto_confirm_failed:自动认证失败,rejected :拒绝 + */ + private String status; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java new file mode 100644 index 0000000000..baf6df1f52 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 政府端(小程序端)查询待审核列表返参 + * @Author yinzuomei + * @Date 2020/4/26 18:47 + */ +@Data +public class UnderReviewParyMemberResultDTO implements Serializable { + private static final long serialVersionUID = 2890001061547093376L; + + /** + * 居民id + */ + private String userId; + + /** + * 用户真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * 申请时间 + */ + private Date applyTime; + + /** + * read已读unread未读 + */ + private String readFlag; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java index 106ea6c7fa..d73c5178bc 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java @@ -97,15 +97,25 @@ public interface PartyMemberConstant { String UNDER_AUDITTING = "under_auditting"; /** - * 审核状态 通过 + * 审核状态 通过 approved:人工审核通过, */ String APPROVED = "approved"; /** - * 审核状态 未通过 + * 审核状态 未通过rejected :拒绝 */ String REJECTED = "rejected"; + /** + * 自动认证成功 + */ + String AUTO_CONFIRM_SUCCESS="auto_confirm_success"; + + /** + * 自动认证失败 + */ + String AUTO_CONFIRM_FAILED="auto_confirm_failed"; + /** * 网格ID */ diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java index 620bd1feaf..632ef902ed 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java @@ -5,9 +5,11 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.modules.feign.fallback.GovOrgFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -28,8 +30,13 @@ public interface GovOrgFeignClient { @PostMapping("/gov/org/customergrid/getcustomergridbygridid") Result getCustomerGridByGridId(@RequestBody CustomerGridFormDTO customerGridFormDTO); - - - - + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 23:16 + **/ + @GetMapping("/gov/org/customergrid/getGridInfo/{gridId}") + Result queryGridInfo(@PathVariable("gridId") String gridId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java index f1f0195374..c9d63ef62d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.modules.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -25,4 +26,9 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { public Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId",customerGridFormDTO); } + + @Override + public Result queryGridInfo(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo",gridId); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java index 9aecbeedfd..ac20a61f89 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java @@ -28,10 +28,15 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.modules.partymember.excel.PartymemberBaseInfoExcel; import com.epmet.modules.partymember.service.PartymemberBaseInfoService; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -91,4 +96,27 @@ public class PartymemberBaseInfoController { ExcelUtils.exportExcelToTarget(response, null, list, PartymemberBaseInfoExcel.class); } + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表 + * @Date 2020/4/26 20:35 + **/ + @PostMapping("auditing") + public Result> auditing(@RequestBody @Valid UnderReviewParyMemberFormDTO formDTO){ + return partymemberBaseInfoService.auditing(formDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @Author yinzuomei + * @Description 政府端(小程序端)查询审核历史 + * @Date 2020/4/26 23:40 + **/ + @PostMapping("audited") + public Result> audited(@RequestBody @Valid ReviewedParyMemberFormDTO formDTO){ + return partymemberBaseInfoService.audited(formDTO); + } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java index 7a879e4072..6c614045fb 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java @@ -20,6 +20,10 @@ package com.epmet.modules.partymember.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -57,4 +61,21 @@ public interface PartymemberBaseInfoDao extends BaseDao selectBaseInfoByName(PartymemberInfoDTO param); + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表-根据网格id分页查询待审核党员列表 + * @Date 2020/4/26 20:43 + **/ + List selectListUnderReviewParyMember(UnderReviewParyMemberFormDTO formDTO); + + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表-根据网格id分页查询待审核党员列表 自动审核失败且未填写补充信息的+拒绝的 + * @Date 2020/4/26 23:43 + **/ + List selectListReviewedParyMember(ReviewedParyMemberFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java index f9b379a912..e317427c92 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java @@ -19,16 +19,21 @@ package com.epmet.modules.partymember.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import java.util.List; import java.util.Map; /** - * 党员库基本信息表 + * 党员库基本信息表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-30 @@ -97,8 +102,27 @@ public interface PartymemberBaseInfoService extends BaseService> + * @Author yinzuomei + * @Description 政府端(小程序端)查询待审核列表 + * @Date 2020/4/26 20:36 + **/ + Result> auditing(UnderReviewParyMemberFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 政府端(小程序端)查询审核历史 + * @Date 2020/4/26 23:40 + **/ + Result> audited(ReviewedParyMemberFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java index 8d0381e8a3..72455af8c3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java @@ -21,9 +21,16 @@ 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.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; +import com.epmet.dto.form.UserResiInfoListFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.partymember.dao.PartymemberBaseInfoDao; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.modules.partymember.redis.PartymemberBaseInfoRedis; @@ -31,6 +38,10 @@ import com.epmet.modules.partymember.service.PartymemberBaseInfoService; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import info.debatty.java.stringsimilarity.Levenshtein; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; @@ -39,8 +50,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; import static java.util.stream.Collectors.toList; @@ -55,6 +64,10 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl> auditing(UnderReviewParyMemberFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + List list = baseDao.selectListUnderReviewParyMember(formDTO); + if (null == list || list.isEmpty()) { + return new Result>().ok(new ArrayList<>()); + } + //查询网格信息 + Result gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId()); + String gridFullPath = ""; + if (gridInfoResult.success() && null != gridInfoResult.getData()) { + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName()); + gridFullPath = gridFullPath.replaceAll("--", "").trim(); + } + //查询居民认证信息,获取居民头像 + List userIdList = new ArrayList<>(); + for (UnderReviewParyMemberResultDTO underReviewParyMember : list) { + userIdList.add(underReviewParyMember.getUserId()); + underReviewParyMember.setGridFullPath(gridFullPath); + } + UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); + userResiInfoListFormDTO.setUserIdList(userIdList); + Result> userResiInfoResult = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO); + if (userResiInfoResult.success()) { + for (UnderReviewParyMemberResultDTO underReviewParyMemberInfo : list) { + for (UserResiInfoResultDTO userResiInfo : userResiInfoResult.getData()) { + if (underReviewParyMemberInfo.getUserId().equals(userResiInfo.getUserId())) { + underReviewParyMemberInfo.setUserHeadPhoto(userResiInfo.getHeadPhoto()); + break; + } + } + } + } + return new Result>().ok(list); + } + + + @Override + public Result> audited(ReviewedParyMemberFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + //审核历史:只包括自动审核失败和拒绝的 + //审核失败:居民未填写补充信息。 + List list = baseDao.selectListReviewedParyMember(formDTO); + if (null == list || list.isEmpty()) { + return new Result>().ok(new ArrayList<>()); + } + //查询网格信息 + Result gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId()); + String gridFullPath = ""; + if (gridInfoResult.success() && null != gridInfoResult.getData()) { + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName()); + gridFullPath = gridFullPath.replaceAll("--", "").trim(); + } + //查询居民认证信息,获取居民头像 + List userIdList = new ArrayList<>(); + for (ReviewedParyMemberResultDTO reviewedParyMemberResultDTO : list) { + userIdList.add(reviewedParyMemberResultDTO.getUserId()); + reviewedParyMemberResultDTO.setGridFullPath(gridFullPath); + } + UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); + userResiInfoListFormDTO.setUserIdList(userIdList); + Result> userResiInfoResult = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO); + if (userResiInfoResult.success()) { + for (ReviewedParyMemberResultDTO reviewedParyMember : list) { + for (UserResiInfoResultDTO userResiInfo : userResiInfoResult.getData()) { + if (reviewedParyMember.getUserId().equals(userResiInfo.getUserId())) { + reviewedParyMember.setUserHeadPhoto(userResiInfo.getHeadPhoto()); + break; + } + } + } + } + return new Result>().ok(list); + } + /** * 生成返回结果 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml index eb61f263ec..2f4819d69b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml @@ -54,5 +54,58 @@ AND DEL_FLAG = 0 + + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql index a20663b2ce..ae2431928e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql @@ -4,4 +4,6 @@ ALTER TABLE resi_warmhearted_apply ADD ( MESSAGE_TEXT VARCHAR (500) DEFAULT NULL COMMENT '消息通知内容' ); -- 修改党员认证结果2020-04-26 -alter table partymember_info modify column CONFIRM_RESULT varchar(20) COMMENT '认证结果:auto_confirm_success:自动认证成功,auto_confirm_failed:自动认证失败,approved:人工审核通过,rejected :拒绝)'; \ No newline at end of file +alter table partymember_info modify column CONFIRM_RESULT varchar(20) COMMENT '认证结果:auto_confirm_success:自动认证成功,auto_confirm_failed:自动认证失败,approved:人工审核通过,rejected :拒绝)'; +-- 添加已读未读标志 +ALTER TABLE partymember_confirm_manual ADD ( READ_FLAG VARCHAR ( 20 ) COMMENT '审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)' ); \ No newline at end of file From 9a50e7fc27c219ff6e9339e8fb902492fe49e8bb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Apr 2020 09:38:25 +0800 Subject: [PATCH 116/174] =?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 --- .../epmet/service/CustomerGridService.java | 2 - .../service/impl/CustomerGridServiceImpl.java | 105 ++++++++---------- 2 files changed, 46 insertions(+), 61 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 77006089a4..ee070de1f7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -18,7 +18,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -32,7 +31,6 @@ import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 043bb3a5d7..d6ce45b9a9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -21,27 +21,17 @@ 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.constant.FieldConstant; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerGridDao; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CommonAgencyIdFormDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.CustomerGridRedis; @@ -57,7 +47,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - import java.util.*; import java.util.stream.Collectors; @@ -73,8 +62,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(baseDao.getCustomerGridByGridId(customerGridFormDTO)); } - @Override - public Result getGridInfo(String gridId) { - GridInfoResultDTO gridInfoResultDTO=new GridInfoResultDTO(); - CustomerGridDTO customerGridDTO = this.get(gridId); - if(null==customerGridDTO){ - return new Result<>(); - } - gridInfoResultDTO.setCustomerId(customerGridDTO.getCustomerId()); - String pids=customerGridDTO.getPids(); - String[] pidArray = pids.split(":"); - for(String agencyId:pidArray){ - CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(agencyId); - if(null!=customerAgencyDTO){ - switch(customerAgencyDTO.getLevel()){ - case "community" : - //社区级 - gridInfoResultDTO.setCommuityId(customerAgencyDTO.getId()); - gridInfoResultDTO.setCommnuityName(customerAgencyDTO.getOrganizationName()); - break; - case "street" : - //乡(镇、街道)级 - gridInfoResultDTO.setStreetId(customerAgencyDTO.getId()); - gridInfoResultDTO.setStreetName(customerAgencyDTO.getOrganizationName()); - break; - case "district": - //区县级 - gridInfoResultDTO.setDistrictId(customerAgencyDTO.getId()); - gridInfoResultDTO.setDistrictName(customerAgencyDTO.getOrganizationName()); - break; - case "city": - //市级 - gridInfoResultDTO.setCityId(customerAgencyDTO.getId()); - gridInfoResultDTO.setCityName(customerAgencyDTO.getOrganizationName()); - break; - case "province": - //省级 - gridInfoResultDTO.setProvinceId(customerAgencyDTO.getId()); - gridInfoResultDTO.setProviceName(customerAgencyDTO.getOrganizationName()); - break; - } - } - } - return new Result().ok(gridInfoResultDTO); - } - /** * @param userId * @return @@ -468,4 +410,49 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getGridInfo(String gridId) { + GridInfoResultDTO gridInfoResultDTO=new GridInfoResultDTO(); + CustomerGridDTO customerGridDTO = this.get(gridId); + if(null==customerGridDTO){ + return new Result<>(); + } + gridInfoResultDTO.setCustomerId(customerGridDTO.getCustomerId()); + String pids=customerGridDTO.getPids(); + String[] pidArray = pids.split(":"); + for(String agencyId:pidArray){ + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(agencyId); + if(null!=customerAgencyDTO){ + switch(customerAgencyDTO.getLevel()){ + case "community" : + //社区级 + gridInfoResultDTO.setCommuityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCommnuityName(customerAgencyDTO.getOrganizationName()); + break; + case "street" : + //乡(镇、街道)级 + gridInfoResultDTO.setStreetId(customerAgencyDTO.getId()); + gridInfoResultDTO.setStreetName(customerAgencyDTO.getOrganizationName()); + break; + case "district": + //区县级 + gridInfoResultDTO.setDistrictId(customerAgencyDTO.getId()); + gridInfoResultDTO.setDistrictName(customerAgencyDTO.getOrganizationName()); + break; + case "city": + //市级 + gridInfoResultDTO.setCityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCityName(customerAgencyDTO.getOrganizationName()); + break; + case "province": + //省级 + gridInfoResultDTO.setProvinceId(customerAgencyDTO.getId()); + gridInfoResultDTO.setProviceName(customerAgencyDTO.getOrganizationName()); + break; + } + } + } + return new Result().ok(gridInfoResultDTO); + } + } From 1d8ad538aeab4eb4ee1516b06188519abafc5e2a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 27 Apr 2020 09:47:27 +0800 Subject: [PATCH 117/174] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=A2=AB=E4=BA=BA=E8=A6=86=E7=9B=96=E9=97=AE=E9=A2=98=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E6=89=80=E6=9C=89=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=8F=82?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=87=BA=E7=8E=B0null=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/AddAgencyResultDTO.java | 2 +- .../epmet/dto/result/AddDepartmentResultDTO.java | 2 +- .../com/epmet/dto/result/AgencyListResultDTO.java | 4 ++-- .../com/epmet/dto/result/AgencysResultDTO.java | 14 +++++++------- .../dto/result/DepartInStaffListResultDTO.java | 8 ++++---- .../dto/result/DepartmentDetailResultDTO.java | 8 ++++---- .../epmet/dto/result/DepartmentListResultDTO.java | 4 ++-- .../com/epmet/dto/result/ParentListResultDTO.java | 4 ++-- .../com/epmet/dto/result/SubListResultDTO.java | 4 ++-- .../epmet/controller/CustomerStaffController.java | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java index 01f072752a..bd8d994b8a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddAgencyResultDTO.java @@ -35,6 +35,6 @@ public class AddAgencyResultDTO implements Serializable { /** * 机关组织Id */ - private String agencyId; + private String agencyId = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java index b6206d0c6d..bc450263e5 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java @@ -35,6 +35,6 @@ public class AddDepartmentResultDTO implements Serializable { /** * 新增部门Id */ - private String departmentId; + private String departmentId = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java index 9673700fcc..b1261e2761 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java @@ -35,12 +35,12 @@ public class AgencyListResultDTO implements Serializable { /** * 机关组织Id */ - private String agencyId; + private String agencyId = ""; /** * 机关组织名称 */ - private String agencyName; + private String agencyName = ""; /** * 总人数 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index 5cf2649ac5..4b819ec2b5 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -36,12 +36,12 @@ public class AgencysResultDTO implements Serializable { /** * 机关组织Id */ - private String agencyId; + private String agencyId = ""; /** * 组织名称 */ - private String agencyName; + private String agencyName = ""; /** * 机关级别(社区级:community, @@ -50,27 +50,27 @@ public class AgencysResultDTO implements Serializable { * 市级: city * 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) */ - private String level; + private String level = ""; /** * 地区编码 */ - private String areaCode; + private String areaCode = ""; /** * 省份 */ - private String province; + private String province = ""; /** * 城市 */ - private String city; + private String city = ""; /** * 区县 */ - private String district; + private String district = ""; /** * 本机关的所有上级机关 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java index e63020a209..106fcfcd4c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java @@ -35,17 +35,17 @@ public class DepartInStaffListResultDTO implements Serializable { /** * 用户ID */ - private String staffId; + private String staffId = ""; /** * 用户姓名 */ - private String staffName; + private String staffName = ""; /** * 用户头像 */ - private String staffHeadPhoto; + private String staffHeadPhoto = ""; /** * 性别 @@ -55,6 +55,6 @@ public class DepartInStaffListResultDTO implements Serializable { /** * 角色名称 */ - private String roleName; + private String roleName = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java index c4b87cc743..8d7ab9dff2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java @@ -36,22 +36,22 @@ public class DepartmentDetailResultDTO implements Serializable { /** * 组织机构Id */ - private String agencyId; + private String agencyId = ""; /** * 部门Id */ - private String departmentId; + private String departmentId = ""; /** * 部门名称 */ - private String departmentName; + private String departmentName = ""; /** * 部门职责 */ - private String departmentDuty; + private String departmentDuty = ""; /** * 部门下工作人员列表 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java index 7fafa0238d..3d7a87ec9d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java @@ -35,12 +35,12 @@ public class DepartmentListResultDTO implements Serializable { /** * 部门Id */ - private String departmentId; + private String departmentId = ""; /** * 部门名称 */ - private String departmentName; + private String departmentName = ""; /** * 部门下总人数 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java index 73608b1943..60683bf779 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java @@ -36,11 +36,11 @@ public class ParentListResultDTO implements Serializable { /** * 机关组织Id */ - private String id; + private String id = ""; /** * 机关组织名称 */ - private String name; + private String name = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java index 57ab12c3df..17dc985695 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java @@ -35,11 +35,11 @@ public class SubListResultDTO implements Serializable { /** * 机关组织Id */ - private String agencyId; + private String agencyId = ""; /** * 机关组织名称 */ - private String agencyName; + private String agencyName = ""; } \ 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 8af4a38647..37d59a6225 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 @@ -263,7 +263,7 @@ public class CustomerStaffController { * @Description 根据客户Id及userId集合查询用户基本信息 */ @PostMapping("getdepartmentstafflist") - public Result> getDepartmentStaffList(DepartmentInStaffFormDTO fromDTO) { + public Result> getDepartmentStaffList(@RequestBody DepartmentInStaffFormDTO fromDTO) { return customerStaffService.getDepartmentStaffList(fromDTO); } From 5eda82798190ea0cd01a9d7c3aa669625dddc920 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 27 Apr 2020 10:14:57 +0800 Subject: [PATCH 118/174] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/DepartmentService.java | 1 - .../com/epmet/modules/member/redis/ResiGroupMemberRedis.java | 3 --- 2 files changed, 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java index b2562ef67a..fe941cca10 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java @@ -19,7 +19,6 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerIdDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java index 9285e70f54..4ddcf25a3b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java @@ -17,12 +17,9 @@ package com.epmet.modules.member.redis; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.map.MapUtil; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; import org.apache.commons.lang3.StringUtils; From 207b4cf00c48dee1b22fbd3523f1ef36f8c70863 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Mon, 27 Apr 2020 10:36:02 +0800 Subject: [PATCH 119/174] =?UTF-8?q?=E5=B7=B2=E8=AE=A4=E8=AF=81=E5=85=9A?= =?UTF-8?q?=E5=91=98=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/CertifiedFormDTO.java | 32 +++++++++++++ .../epmet/dto/result/CertifiedResultDTO.java | 42 ++++++++++++++++ .../controller/ResiPartyMemberController.java | 17 +++++++ .../feign/ResiPartymemberFeignClient.java | 12 +++++ .../ResiPartymemberFeignClientFallBack.java | 7 +++ .../epmet/service/ResiPartyMemberService.java | 17 +++++++ .../impl/ResiPartyMemberServiceImpl.java | 18 +++++++ .../form/SelectGridNameByGridIdFormDTO.java | 22 +++++++++ .../SelectGridNameByGridIdResultDTO.java | 27 +++++++++++ .../controller/CustomerGridController.java | 13 +++++ .../java/com/epmet/dao/CustomerGridDao.java | 12 +++++ .../epmet/service/CustomerGridService.java | 11 +++++ .../service/impl/CustomerGridServiceImpl.java | 13 +++++ .../main/resources/mapper/CustomerGridDao.xml | 12 +++++ .../dto/partymember/UserHeadPhotoDTO.java | 21 ++++++++ .../partymember/form/CertifiedFormDTO.java | 32 +++++++++++++ .../result/CertifiedResultDTO.java | 42 ++++++++++++++++ .../modules/feign/EpmetUserFeignClient.java | 10 ++++ .../modules/feign/GovOrgFeignClient.java | 17 ++++++- .../EpmetUserFeignClientFallBack.java | 6 +++ .../fallback/GovOrgFeignClientFallBack.java | 7 +++ .../controller/PartymemberInfoController.java | 13 +++++ .../partymember/dao/PartymemberInfoDao.java | 13 +++++ .../service/PartymemberInfoService.java | 11 +++++ .../impl/PartymemberInfoServiceImpl.java | 36 ++++++++++++++ .../mapper/partymember/PartymemberInfoDao.xml | 15 ++++++ .../java/com/epmet/dto/UserHeadPhotoDTO.java | 26 ++++++++++ .../epmet/dto/result/CertifiedResultDTO.java | 42 ++++++++++++++++ .../controller/UserWechatController.java | 48 +++++++++++++++++++ .../java/com/epmet/dao/UserWechatDao.java | 10 ++++ .../com/epmet/service/UserWechatService.java | 6 +++ .../service/impl/UserWechatServiceImpl.java | 22 +++++++++ .../main/resources/mapper/UserWechatDao.xml | 15 ++++++ 33 files changed, 646 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/CertifiedFormDTO.java create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SelectGridNameByGridIdFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SelectGridNameByGridIdResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/UserHeadPhotoDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/CertifiedFormDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserHeadPhotoDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserWechatController.java diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/CertifiedFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/CertifiedFormDTO.java new file mode 100644 index 0000000000..5cf5b6ae2d --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/CertifiedFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-26 16:31 + * 已认证党员列表 + */ +@Data +public class CertifiedFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 页码 + */ + private Integer pageNo; + + /** + * 每页数量 + */ + private Integer pageSize; + + /** + * 网格id + */ + private String gridId; + +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java new file mode 100644 index 0000000000..f7540d8b0b --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-26 15:45 + * 已认证党员列表 + */ +@Data +public class CertifiedResultDTO implements Serializable { + + private static final long serialVersionUID = -1L; + + /** + * 用户id + */ + private String userId; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * applyTime 申请时间 + */ + private Integer applyTime; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java index 565127f1db..18e000ed9a 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java @@ -1,8 +1,12 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.dto.result.AuditedPartyMemberResultDTO; import com.epmet.dto.result.AuditingPartyMemberResultDTO; import com.epmet.service.ResiPartyMemberService; @@ -48,6 +52,19 @@ public class ResiPartyMemberController { public Result> audited(@RequestBody AuditedPartyMemberFormDTO formDTO) { return resiPartyMemberService.audited(formDTO); } + + /** + * + * @Description 获取已认证党员 + * @param: tokenDto + * @param: certifiedFormDTO + * @Author zxc + * @CreatedTime 2020/4/26 16:18 + */ + @PostMapping(value = "/certified") + public Result> certifiedList(@LoginUser TokenDto tokenDto, @RequestBody CertifiedFormDTO certifiedFormDTO){ + return resiPartyMemberService.certifiedList(certifiedFormDTO); + } } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java index 8bee3c6646..c26f3978e6 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java @@ -2,6 +2,8 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.feign.fallback.ResiPartymemberFeignClientFallBack; import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; @@ -87,4 +89,14 @@ public interface ResiPartymemberFeignClient { **/ @PostMapping(value = "resi/partymember/partymemberbaseinfo/audited", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> auditedPartyMember(@RequestBody ReviewedParyMemberFormDTO reviewedParyMemberFormDTO); + + /** + * 查询已认证党员 + * @Description + * @Author zxc + * @CreatedTime 2020/4/27 10:29 + */ + @PostMapping(value = "/resi/partymember/partymemberinfo/certified") + Result> certified(@RequestBody CertifiedFormDTO certifiedFormDTO); + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java index a5151d6503..81621574bd 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.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.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.feign.ResiPartymemberFeignClient; import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; @@ -57,4 +59,9 @@ public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignC return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "audited", reviewedParyMemberFormDTO); } + @Override + public Result> certified(CertifiedFormDTO certifiedFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "certified", certifiedFormDTO); + } + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java index f6171b98e1..91ae11adb0 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java @@ -1,8 +1,14 @@ package com.epmet.service; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedResultDTO; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; import com.epmet.dto.result.AuditedPartyMemberResultDTO; import com.epmet.dto.result.AuditingPartyMemberResultDTO; @@ -30,4 +36,15 @@ public interface ResiPartyMemberService { * @Date 2020/4/26 23:32 **/ Result> audited(AuditedPartyMemberFormDTO formDTO); + Result auditing(AuditingPartyMemberFormDTO formDTO); + + /** + * + * @Description 获取已认证党员 + * @param: tokenDto + * @param: certifiedFormDTO + * @Author zxc + * @CreatedTime 2020/4/26 16:18 + */ + Result> certifiedList(CertifiedFormDTO certifiedFormDTO); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java index 9809bdcb37..2345960135 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java @@ -6,6 +6,9 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedResultDTO; +import com.epmet.feign.ResiPartymemberFeignClient; import com.epmet.dto.result.AuditedPartyMemberResultDTO; import com.epmet.dto.result.AuditingPartyMemberResultDTO; import com.epmet.feign.ResiPartymemberFeignClient; @@ -19,6 +22,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + import java.util.ArrayList; import java.util.List; @@ -66,5 +71,18 @@ public class ResiPartyMemberServiceImpl implements ResiPartyMemberService { list = ConvertUtils.sourceToTarget(result.getData(), AuditedPartyMemberResultDTO.class); return new Result>().ok(list); } + + /** + * + * @Description 获取已认证党员 + * @param: tokenDto + * @param: certifiedFormDTO + * @Author zxc + * @CreatedTime 2020/4/26 16:18 + */ + @Override + public Result> certifiedList(CertifiedFormDTO certifiedFormDTO) { + return resiPartymemberFeignClient.certified(certifiedFormDTO); + } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SelectGridNameByGridIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SelectGridNameByGridIdFormDTO.java new file mode 100644 index 0000000000..ebee9233e7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SelectGridNameByGridIdFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-27 9:16 + * 根据gridId查询GridNameDTO + */ +@Data +public class SelectGridNameByGridIdFormDTO implements Serializable { + + private static final long serialVersionUID = -1L; + + /** + * 网格id + */ + private String gridId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SelectGridNameByGridIdResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SelectGridNameByGridIdResultDTO.java new file mode 100644 index 0000000000..ed121519a6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SelectGridNameByGridIdResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-27 9:16 + * 根据gridId查询GridNameDTO + */ +@Data +public class SelectGridNameByGridIdResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 2f6fee3031..77e3b82908 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -26,6 +26,8 @@ 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.CustomerGridDTO; +import com.epmet.dto.form.SelectGridNameByGridIdFormDTO; +import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; @@ -127,6 +129,17 @@ public class CustomerGridController { return new Result().ok(data); } + /** + * + * @Description 根据网格id查询网格名称 + * @Author zxc + * @CreatedTime 2020/4/27 9:22 + */ + @PostMapping("selectGridNameByGridId") + public Result selectGridNameByGridId(@RequestBody SelectGridNameByGridIdFormDTO formDTO){ + return customerGridService.selectGridNameByGridId(formDTO); + } + /** * @param gridId * @return com.epmet.commons.tools.utils.Result diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index aa3e8ddf5e..37e60a010a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -18,11 +18,15 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.form.SelectGridNameByGridIdFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.UserIdDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; import com.epmet.dto.form.DeleteGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.AddGridResultDTO; @@ -70,6 +74,14 @@ public interface CustomerGridDao extends BaseDao { CustomerGridDTO getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + /** + * + * @Description 根据网格id查询网格名称 + * @Author zxc + * @CreatedTime 2020/4/27 9:22 + */ + SelectGridNameByGridIdResultDTO selectGridNameByGridId(SelectGridNameByGridIdFormDTO formDTO); + /** * @param userId * @return diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 6001753a03..cb9c9724e2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -27,11 +27,14 @@ import com.epmet.dto.result.AddGridResultDTO; import com.epmet.dto.form.CommonAgencyIdFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.form.SelectGridNameByGridIdFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -121,6 +124,14 @@ public interface CustomerGridService extends BaseService { */ Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + /** + * + * @Description 根据网格id查询网格名称 + * @Author zxc + * @CreatedTime 2020/4/27 9:22 + */ + Result selectGridNameByGridId(SelectGridNameByGridIdFormDTO formDTO); + /** * @param gridId * @return com.epmet.commons.tools.utils.Result diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index cdde922137..b5a83ee724 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -32,7 +32,9 @@ import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.form.SelectGridNameByGridIdFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; @@ -460,4 +462,15 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(gridInfoResultDTO); } + /** + * + * @Description 根据网格id查询网格名称 + * @Author zxc + * @CreatedTime 2020/4/27 9:22 + */ + @Override + public Result selectGridNameByGridId(SelectGridNameByGridIdFormDTO formDTO) { + return new Result().ok(baseDao.selectGridNameByGridId(formDTO)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index ec0712bc8d..7af8c21e98 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -93,6 +93,18 @@ + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserHeadPhotoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserHeadPhotoDTO.java new file mode 100644 index 0000000000..03aa0bff0b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserHeadPhotoDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-26 17:52 + */ +@Data +public class UserHeadPhotoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String userId; + + /** + * 头像地址 + */ + private String userHeadPhoto; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java new file mode 100644 index 0000000000..f7540d8b0b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-26 15:45 + * 已认证党员列表 + */ +@Data +public class CertifiedResultDTO implements Serializable { + + private static final long serialVersionUID = -1L; + + /** + * 用户id + */ + private String userId; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 居民头像 + */ + private String userHeadPhoto; + + /** + * applyTime 申请时间 + */ + private Integer applyTime; + + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserWechatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserWechatController.java new file mode 100644 index 0000000000..d077a55188 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserWechatController.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.UserHeadPhotoDTO; +import com.epmet.dto.result.CertifiedResultDTO; +import com.epmet.service.UserWechatService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 用户微信端关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-26 + */ +@RestController +@RequestMapping("userwechat") +public class UserWechatController { + + @Autowired + private UserWechatService userWechatService; + + @PostMapping(value = "/selectuserheadphotobyuserid") + public Result> selectUserHeadPhotoByUserId(@RequestBody List certifiedResultDTOS){ + return new Result>().ok(userWechatService.selectUserHeadPhotoByUserId(certifiedResultDTOS)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java index d4fecbc78b..6d03a46a9c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java @@ -2,8 +2,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.UserDTO; +import com.epmet.dto.UserHeadPhotoDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.WxLoginUserInfoFormDTO; +import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.entity.UserWechatEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -45,4 +47,12 @@ public interface UserWechatDao extends BaseDao{ * @Date 2020.03.30 17:25 **/ List selectByUserId(@Param("userId")String userId); + + /** + * + * @Description 根据userId查询头像 + * @Author zxc + * @CreatedTime 2020/4/26 18:53 + */ + List selectUserHeadPhotoByUserId(List certifiedResultDTOS); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserWechatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserWechatService.java index 2141cc6f4b..8d6f6cbdb0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserWechatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserWechatService.java @@ -1,8 +1,12 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.entity.UserWechatEntity; +import java.util.List; + /** * @Description * @IntefaceName UserWechatService @@ -11,4 +15,6 @@ import com.epmet.entity.UserWechatEntity; */ public interface UserWechatService extends BaseService { + List selectUserHeadPhotoByUserId(List certifiedResultDTOS); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserWechatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserWechatServiceImpl.java index 6a7c5807d4..3231224271 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserWechatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserWechatServiceImpl.java @@ -3,11 +3,16 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.UserWechatDao; +import com.epmet.dto.UserHeadPhotoDTO; +import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.entity.UserWechatEntity; import com.epmet.service.UserWechatService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import java.io.Serializable; import java.util.Collection; +import java.util.List; /** * @Description @@ -15,6 +20,23 @@ import java.util.Collection; * @Author wangc * @date 2020.03.28 14:42 */ +@Service public class UserWechatServiceImpl extends BaseServiceImpl implements UserWechatService{ + @Autowired + private UserWechatDao userWechatDao; + + @Override + public List selectUserHeadPhotoByUserId(List certifiedResultDTOS) { + List userHeadPhotoDTOS = userWechatDao.selectUserHeadPhotoByUserId(certifiedResultDTOS); + for (CertifiedResultDTO certifiedResultDTO : certifiedResultDTOS) { + for (UserHeadPhotoDTO userHeadPhotoDTO : userHeadPhotoDTOS) { + if (userHeadPhotoDTO.getUserId().equals(certifiedResultDTO.getUserId())){ + certifiedResultDTO.setUserHeadPhoto(userHeadPhotoDTO.getUserHeadPhoto()); + break; + } + } + } + return certifiedResultDTOS; + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml index 08e6a3ad9e..955dca114d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml @@ -64,4 +64,19 @@ USER_ID = #{userId} + + + From fca4a97c48cbf4c6c8dcc15e62932f4b3dda706d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Apr 2020 11:08:39 +0800 Subject: [PATCH 120/174] =?UTF-8?q?=E5=BE=85=E5=AE=A1=E6=A0=B8=E5=85=9A?= =?UTF-8?q?=E5=91=98=E5=88=97=E8=A1=A8=EF=BC=8C=E5=AE=A1=E6=A0=B8=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/AuditedPartyMemberResultDTO.java | 15 +++++++++++ .../result/AuditingPartyMemberResultDTO.java | 15 +++++++++++ .../result/ReviewedParyMemberResultDTO.java | 15 +++++++++++ .../UnderReviewParyMemberResultDTO.java | 15 +++++++++++ .../partymember/PartymemberBaseInfoDao.xml | 27 ++++++++++++++++--- 5 files changed, 83 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java index a5558e101b..96cfa3ffe4 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditedPartyMemberResultDTO.java @@ -42,5 +42,20 @@ public class AuditedPartyMemberResultDTO implements Serializable { * read已读unread未读 */ private String gridFullPath; + + /** + * 党员认证信息表ID + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; } diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java index 5259b62602..b7fa6ff38d 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/AuditingPartyMemberResultDTO.java @@ -43,5 +43,20 @@ public class AuditingPartyMemberResultDTO implements Serializable { * read已读unread未读 */ private String gridFullPath; + + /** + * 党员认证信息表ID + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java index c73aeb5f52..704b9f9b7a 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/ReviewedParyMemberResultDTO.java @@ -40,5 +40,20 @@ public class ReviewedParyMemberResultDTO { * 提交网格:XXX街道-XXX社区-XXX网格 */ private String gridFullPath; + + /** + * 党员认证信息表ID + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java index baf6df1f52..f625e3117c 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/UnderReviewParyMemberResultDTO.java @@ -43,5 +43,20 @@ public class UnderReviewParyMemberResultDTO implements Serializable { * 提交网格:XXX街道-XXX社区-XXX网格 */ private String gridFullPath; + + /** + * 党员认证信息表ID + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml index 2f4819d69b..39e0ee43d4 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml @@ -54,21 +54,27 @@ AND DEL_FLAG = 0 - + \ No newline at end of file From 44415109d57e11ebb10aa275289cfc6893fbe9d3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Apr 2020 13:07:28 +0800 Subject: [PATCH 125/174] =?UTF-8?q?user,govorg=E5=8F=91=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 5e17e279db..25761f4458 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.7 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.8 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 4854e648d9..0b163e1d1a 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.7 + 0.3.8 com.epmet gov-org diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index 12dee46098..2d1edbff2b 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.5 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.6 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index dfa4b9f1c0..c1773add7f 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.5 + 0.3.6 com.epmet epmet-user From 40980527f66e1ee4df73ea96794d732f903529af Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Mon, 27 Apr 2020 13:29:35 +0800 Subject: [PATCH 126/174] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=B7=B2=E8=AE=A4=E8=AF=81=E5=85=9A=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/CertifiedResultDTO.java | 15 +++++++++++++ .../epmet/service/ResiPartyMemberService.java | 3 +-- .../result/CertifiedResultDTO.java | 15 +++++++++++++ .../mapper/partymember/PartymemberInfoDao.xml | 21 ++++++++++++------- .../epmet/dto/result/CertifiedResultDTO.java | 15 +++++++++++++ 5 files changed, 59 insertions(+), 10 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java index f7540d8b0b..db42fbe84d 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java @@ -39,4 +39,19 @@ public class CertifiedResultDTO implements Serializable { */ private String gridFullPath; + /** + * 党员认证信息表id + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java index 7efe7528f3..0d274382e6 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java @@ -1,12 +1,10 @@ package com.epmet.service; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; import com.epmet.dto.form.CertifiedFormDTO; import com.epmet.dto.result.CertifiedResultDTO; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import com.epmet.dto.result.AuditedPartyMemberResultDTO; @@ -36,6 +34,7 @@ public interface ResiPartyMemberService { * @Date 2020/4/26 23:32 **/ Result> audited(AuditedPartyMemberFormDTO formDTO); + /** * * @Description 获取已认证党员 diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedResultDTO.java index 9e5568441b..1c4dddc50c 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedResultDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedResultDTO.java @@ -39,4 +39,19 @@ public class CertifiedResultDTO implements Serializable { */ private String gridFullPath; + /** + * 党员认证信息表id + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index ca2314e514..b30353f09d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -61,16 +61,21 @@ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java index f7540d8b0b..db42fbe84d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java @@ -39,4 +39,19 @@ public class CertifiedResultDTO implements Serializable { */ private String gridFullPath; + /** + * 党员认证信息表id + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; + } From ee5b60c2c7b661fd2b6934427a57b30650852886 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 27 Apr 2020 13:42:57 +0800 Subject: [PATCH 127/174] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9@Datafilter?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=EF=BC=8C=E5=B0=86tableAlias=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=95=B0=E7=BB=84=EF=BC=8C=E9=A2=84=E7=95=99?= =?UTF-8?q?=E5=87=BA=E6=9D=A5=EF=BC=8C=E4=B8=BA=E5=90=8E=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E5=A4=9A=E8=A1=A8=E8=BF=87=E6=BB=A4=E5=81=9A=E5=87=86=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/mybatis/annotation/DataFilter.java | 2 +- .../com/epmet/commons/mybatis/aspect/DataFilterAspect.java | 3 ++- .../src/main/java/com/epmet/dao/StaffRoleDao.java | 3 +++ .../main/java/com/epmet/service/impl/StaffRoleServiceImpl.java | 2 -- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java index 96b7691f22..6947d92619 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java @@ -23,6 +23,6 @@ public @interface DataFilter { /** * 表的别名 */ - String tableAlias() default ""; + String[] tableAliases() default ""; } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java index c9965192cf..a7c5fc1683 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java @@ -71,7 +71,8 @@ public class DataFilterAspect { // 通过反射,取到注解属性 DataFilter dataFilterAnno = ((MethodSignature) point.getSignature()).getMethod().getAnnotation(DataFilter.class); - String tableAlias = dataFilterAnno.tableAlias(); + String[] tableAliases = dataFilterAnno.tableAliases(); + String tableAlias = tableAliases[0]; // 从ThreadLocal中取所需权限 String requirePermission = AccessOpeAspect.requirePermissionTl.get(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 85dae3de67..b943b44be7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -17,6 +17,7 @@ package com.epmet.dao; +import com.epmet.commons.mybatis.annotation.DataFilter; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; @@ -44,6 +45,7 @@ public interface StaffRoleDao extends BaseDao { * @param orgId * @return */ + //@DataFilter(tableAliases = { "sr" }) List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId, @Param("dataScope") DataScope dataScope); @@ -61,6 +63,7 @@ public interface StaffRoleDao extends BaseDao { * @Author wangc * @Date 2020.04.26 11:01 **/ + //@DataFilter(tableAliases = { "role" }) StaffRolesResultDTO getStaffRoles(CommonUserFormDTO commonUserFormDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 0c4365e9fb..f76d6545c5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -114,7 +114,6 @@ public class StaffRoleServiceImpl extends BaseServiceImpl listStaffsInRole(String roleKey, String orgId, DataScope dataScope) { return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId, dataScope); } @@ -133,7 +132,6 @@ public class StaffRoleServiceImpl extends BaseServiceImpl getStaffRoles(CommonUserFormDTO userParam) { return new Result().ok(baseDao.getStaffRoles(userParam)); } From 3f3d7de1d30626f55f5e33e426748d9666d65235 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Mon, 27 Apr 2020 14:21:13 +0800 Subject: [PATCH 128/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/CustomerGridDao.java | 2 +- .../com/epmet/service/impl/CustomerGridServiceImpl.java | 6 +++--- .../src/main/resources/mapper/CustomerGridDao.xml | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 37e60a010a..7e4219012e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -123,7 +123,7 @@ public interface CustomerGridDao extends BaseDao { * @param gridName * @return */ - String selectGridIdByGridName(@Param("gridName")String gridName,@Param("agencyId")String pid); + String selectGridIdByGridName(@Param("gridName")String gridName,@Param("agencyId")String pid,@Param("gridId")String gridId); /** * 编辑网格信息 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index b5a83ee724..cb544cba9f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -202,7 +202,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) { - String checkGridName = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(),addGridFormDTO.getAgencyId()); + String checkGridName = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(),addGridFormDTO.getAgencyId(),null); if (checkGridName!=null){ return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode()); } @@ -217,7 +217,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(addGridResultDTO); @@ -231,7 +231,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl + AND id != #{gridId} + AND del_flag = 0 From 67bf61d20976f603a3acc829336ea424139bb85b Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 27 Apr 2020 15:29:07 +0800 Subject: [PATCH 129/174] =?UTF-8?q?=E6=9F=A5=E6=89=BE=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3Bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/CustomerGridDao.xml | 4 ++-- .../java/com/epmet/dto/form/CommonUserIdListFormDTO.java | 2 +- .../src/main/resources/mapper/CustomerStaffDao.xml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 7af8c21e98..e5873c263f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -233,8 +233,8 @@ SELECT USER_ID AS staffId, - REAL_NAME AS staffName, - HEAD_PHOTO AS staffHeadPhoto , - GENDER + IFNULL(REAL_NAME,"") AS staffName, + IFNULL(HEAD_PHOTO,"") AS staffHeadPhoto , + IFNULL(GENDER,0) AS gender FROM CUSTOMER_STAFF WHERE From 929f7c5e04d33230e2fe69cf274ba8d72f692c7e Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 27 Apr 2020 15:52:21 +0800 Subject: [PATCH 130/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=E5=85=9A?= =?UTF-8?q?=E5=91=98=E8=AE=A4=E8=AF=81=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 1 + epmet-module/gov-grid/gov-grid-server/pom.xml | 2 +- .../controller/ResiPartyMemberController.java | 55 +++++ .../feign/ResiPartymemberFeignClient.java | 45 +++- .../ResiPartymemberFeignClientFallBack.java | 26 ++- .../epmet/service/ResiPartyMemberService.java | 43 ++++ .../impl/ResiPartyMemberServiceImpl.java | 26 ++- .../service/impl/PartyMemberServiceImpl.java | 5 + .../form/AuditingDetailFromDTO.java | 29 +++ .../form/AutoFailedDetailFromDTO.java | 24 ++ .../form/PartyMemberConfirmFromDTO.java | 39 ++++ .../form/RejectedDetailFromDTO.java | 29 +++ .../partymember/result/AdditionalInfoDTO.java | 32 +++ .../result/AuditingDetailResultDTO.java | 65 ++++++ .../result/AutoFailedDetailResultDTO.java | 49 ++++ .../result/RejectedDetailResultDTO.java | 66 ++++++ .../epmet/constant/PartyMemberConstant.java | 12 +- .../PartyMemberConfirmController.java | 53 +++++ .../PartymemberConfirmManualEntity.java | 5 + .../service/PartyMemberConfirmService.java | 38 +++ .../impl/PartyMemberConfirmServiceImpl.java | 217 +++++++++++++++++- .../PartymemberConfirmManualServiceImpl.java | 5 +- .../mapper/partymember/PartymemberInfoDao.xml | 4 +- 23 files changed, 846 insertions(+), 24 deletions(-) create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AuditingDetailFromDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AutoFailedDetailFromDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberConfirmFromDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/RejectedDetailFromDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AdditionalInfoDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AuditingDetailResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AutoFailedDetailResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/RejectedDetailResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 5dbc9f0cf2..948e607ed1 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -26,6 +26,7 @@ public enum EpmetErrorCode { MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"), MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), NOT_DEL_GRID(8106,"该网格存在工作人员,不允许删除"), + ORG_IS_NOT_NULL(8107,"党组织关系不能为空"), CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index 965969714d..a784496cac 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -102,7 +102,7 @@ 0 - 127.0.0.1 + 192.168.1.130 6379 123456 diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java index 18e000ed9a..de92cc128b 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java @@ -9,6 +9,13 @@ import com.epmet.dto.form.CertifiedFormDTO; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.dto.result.AuditedPartyMemberResultDTO; import com.epmet.dto.result.AuditingPartyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.form.AuditingDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.AutoFailedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberConfirmFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.RejectedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.AuditingDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.AutoFailedDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.RejectedDetailResultDTO; import com.epmet.service.ResiPartyMemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -65,6 +72,54 @@ public class ResiPartyMemberController { public Result> certifiedList(@LoginUser TokenDto tokenDto, @RequestBody CertifiedFormDTO certifiedFormDTO){ return resiPartyMemberService.certifiedList(certifiedFormDTO); } + + /** + * 审核党员 + * + * @param fromDTO 参数 + * @return Result + * @author zhaoqifeng + */ + @PostMapping("audit") + public Result manualConfirmResult(@RequestBody PartyMemberConfirmFromDTO fromDTO) { + return resiPartyMemberService.manualConfirmResult(fromDTO); + } + + /** + * 待审核详情 + * + * @param fromDTO 参数 + * @return Result + * @author zhaoqifeng + */ + @PostMapping("auditingdetail") + public Result auditingDetail(@RequestBody AuditingDetailFromDTO fromDTO) { + return resiPartyMemberService.auditingDetail(fromDTO); + } + + /** + * 自动审核失败详情 + * + * @param fromDTO 参数 + * @return Result + * @author zhaoqifeng + */ + @PostMapping("auditingdetail") + public Result autoFailedDetail(@RequestBody AutoFailedDetailFromDTO fromDTO) { + return resiPartyMemberService.autoFailedDetail(fromDTO); + } + + /** + * 拒绝详情 + * + * @param fromDTO 参数 + * @return Result + * @author zhaoqifeng + */ + @PostMapping("rejecteddetail") + public Result rejectedDetail(@RequestBody RejectedDetailFromDTO fromDTO) { + return resiPartyMemberService.rejectedDetail(fromDTO); + } } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java index c26f3978e6..25b586513b 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java @@ -5,10 +5,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.CertifiedFormDTO; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.feign.fallback.ResiPartymemberFeignClientFallBack; -import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; -import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; -import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; -import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.form.*; +import com.epmet.resi.partymember.dto.partymember.result.*; import com.epmet.resi.partymember.dto.warmhearted.form.*; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; @@ -99,4 +97,43 @@ public interface ResiPartymemberFeignClient { @PostMapping(value = "/resi/partymember/partymemberinfo/certified") Result> certified(@RequestBody CertifiedFormDTO certifiedFormDTO); + /** + * 审核党员 + * + * @param fromDTO 参数 + * @return Result + * @author zhaoqifeng + */ + @PostMapping("/resi/partymember/confirm/audit") + Result manualConfirmResult(@RequestBody PartyMemberConfirmFromDTO fromDTO); + + /** + * 待审核详情 + * + * @param fromDTO 参数 + * @return Result + * @author zhaoqifeng + */ + @PostMapping("/resi/partymember/confirm/auditingdetail") + Result auditingDetail(@RequestBody AuditingDetailFromDTO fromDTO); + /** + * 自动审核失败详情 + * + * @param fromDTO 参数 + * @return Result + * @author zhaoqifeng + */ + @PostMapping("/resi/partymember/confirm/auditingdetail") + Result autoFailedDetail(@RequestBody AutoFailedDetailFromDTO fromDTO); + + /** + * 拒绝详情 + * + * @param fromDTO 参数 + * @return Result + * @author zhaoqifeng + */ + @PostMapping("/resi/partymember/confirm/rejecteddetail") + Result rejectedDetail(@RequestBody RejectedDetailFromDTO fromDTO); + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java index 81621574bd..aedb5b3d0e 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java @@ -6,10 +6,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.CertifiedFormDTO; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.feign.ResiPartymemberFeignClient; -import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; -import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; -import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; -import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.form.*; +import com.epmet.resi.partymember.dto.partymember.result.*; import com.epmet.resi.partymember.dto.warmhearted.form.*; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; @@ -64,4 +62,24 @@ public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignC return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "certified", certifiedFormDTO); } + @Override + public Result manualConfirmResult(PartyMemberConfirmFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "manualConfirmResult", fromDTO); + } + + @Override + public Result auditingDetail(AuditingDetailFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "auditingDetail", fromDTO); + } + + @Override + public Result autoFailedDetail(AutoFailedDetailFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "autoFailedDetail", fromDTO); + } + + @Override + public Result rejectedDetail(RejectedDetailFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "rejectedDetail", fromDTO); + } + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java index 0d274382e6..93512bde0e 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java @@ -9,6 +9,13 @@ import com.epmet.dto.result.CertifiedResultDTO; import java.util.List; import com.epmet.dto.result.AuditedPartyMemberResultDTO; import com.epmet.dto.result.AuditingPartyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.form.AuditingDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.AutoFailedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberConfirmFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.RejectedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.AuditingDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.AutoFailedDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.RejectedDetailResultDTO; import java.util.List; @@ -44,4 +51,40 @@ public interface ResiPartyMemberService { * @CreatedTime 2020/4/26 16:18 */ Result> certifiedList(CertifiedFormDTO certifiedFormDTO); + + /** + * 人工审核结果 + * + * @param fromDTO + * @return + * @author zhaoqifeng + */ + Result manualConfirmResult(PartyMemberConfirmFromDTO fromDTO); + + /** + * 待审核详情 + * + * @param fromDTO + * @return + * @author zhaoqifeng + */ + Result auditingDetail(AuditingDetailFromDTO fromDTO); + + /** + * 自动审核失败详情 + * + * @param fromDTO + * @return + * @author zhaoqifeng + */ + Result autoFailedDetail(AutoFailedDetailFromDTO fromDTO); + + /** + * 拒绝详情 + * + * @param fromDTO + * @return + * @author zhaoqifeng + */ + Result rejectedDetail(RejectedDetailFromDTO fromDTO); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java index 2345960135..a97b886619 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java @@ -12,10 +12,8 @@ import com.epmet.feign.ResiPartymemberFeignClient; import com.epmet.dto.result.AuditedPartyMemberResultDTO; import com.epmet.dto.result.AuditingPartyMemberResultDTO; import com.epmet.feign.ResiPartymemberFeignClient; -import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; -import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; -import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; -import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; +import com.epmet.resi.partymember.dto.partymember.form.*; +import com.epmet.resi.partymember.dto.partymember.result.*; import com.epmet.service.ResiPartyMemberService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -84,5 +82,25 @@ public class ResiPartyMemberServiceImpl implements ResiPartyMemberService { public Result> certifiedList(CertifiedFormDTO certifiedFormDTO) { return resiPartymemberFeignClient.certified(certifiedFormDTO); } + + @Override + public Result manualConfirmResult(PartyMemberConfirmFromDTO fromDTO) { + return resiPartymemberFeignClient.manualConfirmResult(fromDTO); + } + + @Override + public Result auditingDetail(AuditingDetailFromDTO fromDTO) { + return resiPartymemberFeignClient.auditingDetail(fromDTO); + } + + @Override + public Result autoFailedDetail(AutoFailedDetailFromDTO fromDTO) { + return resiPartymemberFeignClient.autoFailedDetail(fromDTO); + } + + @Override + public Result rejectedDetail(RejectedDetailFromDTO fromDTO) { + return resiPartymemberFeignClient.rejectedDetail(fromDTO); + } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberServiceImpl.java index eb13aa4bd1..447055431a 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.modules.partymember.service.impl; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.feign.ResiPartymemberFeignClient; @@ -9,6 +10,7 @@ import com.epmet.resi.mine.dto.from.PartyMemberSubmitFromDTO; import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import org.apache.poi.ss.formula.constant.ErrorConstant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -49,6 +51,9 @@ public class PartyMemberServiceImpl implements PartyMemberService { @Override public Result partyMemberInfoExtra(TokenDto tokenDto, PartyMemberSubmitFromDTO fromDTO) { PartymemberInfoDTO partyMemberInfo = fromDTO.getPartyMemberInfo(); + if (null == partyMemberInfo.getExtraOrganization() || partyMemberInfo.getExtraOrganization().isEmpty()) { + return new Result().error(EpmetErrorCode.ORG_IS_NOT_NULL.getCode(), EpmetErrorCode.ORG_IS_NOT_NULL.getMsg()); + } partyMemberInfo.setCustomerId(fromDTO.getCustomerId()); partyMemberInfo.setGridId(fromDTO.getGridId()); partyMemberInfo.setUserId(tokenDto.getUserId()); diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AuditingDetailFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AuditingDetailFromDTO.java new file mode 100644 index 0000000000..387c68772c --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AuditingDetailFromDTO.java @@ -0,0 +1,29 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/27 13:48 + */ +@Data +public class AuditingDetailFromDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 党员认证信息表ID + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AutoFailedDetailFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AutoFailedDetailFromDTO.java new file mode 100644 index 0000000000..f1f438117e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AutoFailedDetailFromDTO.java @@ -0,0 +1,24 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/27 14:48 + */ +@Data +public class AutoFailedDetailFromDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 党员认证信息表ID + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberConfirmFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberConfirmFromDTO.java new file mode 100644 index 0000000000..a530da6850 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberConfirmFromDTO.java @@ -0,0 +1,39 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/10 11:11 + */ +@Data +public class PartyMemberConfirmFromDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 党员认证信息表ID + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; + + /** + * 审核状态 yes,no + */ + private String partyMemberFlag; + + /** + * 审核理由 + */ + private String reason; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/RejectedDetailFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/RejectedDetailFromDTO.java new file mode 100644 index 0000000000..5b8f84da86 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/RejectedDetailFromDTO.java @@ -0,0 +1,29 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/27 15:16 + */ +@Data +public class RejectedDetailFromDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 党员认证信息表ID + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AdditionalInfoDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AdditionalInfoDTO.java new file mode 100644 index 0000000000..b6a981f6d0 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AdditionalInfoDTO.java @@ -0,0 +1,32 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/27 13:52 + */ +@Data +public class AdditionalInfoDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 工作单位或所属街道 + */ + private String extraOrganization; + /** + * 联系人 + */ + private String contactPeople; + /** + * 联系方式 + */ + private String contactMobile; + /** + * 自动审核失败原因 + */ + private List failedReason; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AuditingDetailResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AuditingDetailResultDTO.java new file mode 100644 index 0000000000..a86ee343bb --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AuditingDetailResultDTO.java @@ -0,0 +1,65 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/27 13:50 + */ +@NoArgsConstructor +@Data +public class AuditingDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 党员认证信息ID + */ + private String partyMemberId; + /** + * 党员自动审核ID + */ + private String autoId; + /** + * 党员人工审核ID + */ + private String manualId; + /** + * 居民id + */ + private String userId; + /** + * 真实姓名 + */ + private String realName; + /** + * 联系方式 + */ + private String mobile; + /** + * 身份证号 + */ + private String idCard; + /** + * 提交网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; + /** + * 居民住址 + */ + private String address; + /** + * 提交认证时间 + */ + private Long certifyTime; + + /** + * 补充信息 + */ + private AdditionalInfoDTO additionalInfo; + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AutoFailedDetailResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AutoFailedDetailResultDTO.java new file mode 100644 index 0000000000..7000c5f240 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/AutoFailedDetailResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/27 14:49 + */ +@NoArgsConstructor +@Data +public class AutoFailedDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 居民ID + */ + private String userId; + /** + * 姓名 + */ + private String realName; + /** + * 联系方式 + */ + private String mobile; + /** + * 身份证号 + */ + private String idCard; + /** + * 提交网格 + */ + private String gridFullPath; + /** + * 居住地址 + */ + private String address; + /** + * 提交时间 + */ + private Long certifyTime; + /** + * 自动审核失败原因以逗号隔开 + */ + private String failedReason; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/RejectedDetailResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/RejectedDetailResultDTO.java new file mode 100644 index 0000000000..275490c991 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/RejectedDetailResultDTO.java @@ -0,0 +1,66 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/27 15:17 + */ +@NoArgsConstructor +@Data +public class RejectedDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 居民ID + */ + private String userId; + /** + * 姓名 + */ + private String realName; + /** + * 联系方式 + */ + private String mobile; + /** + * 身份证号 + */ + private String idCard; + /** + * 提交网格XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; + /** + * 居住地址 + */ + private String address; + /** + * 提交认证时间 + */ + private Long certifyTime; + /** + * 拒绝理由 + */ + private String rejectedReason; + /** + * 工作单位/所属街道 + */ + private String extraOrganization; + /** + * 联系人 + */ + private String contactPeople; + /** + * 联系方式 + */ + private String contactMobile; + /** + * 自动审核失败的原因 + */ + private String failedReason; +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java index d73c5178bc..bb0795b43b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java @@ -122,17 +122,17 @@ public interface PartyMemberConstant { String ALL = "all"; /** - * 认证成功 + * 居民端 */ - String CONFIRM_SUCCESS = "0"; + String RESI = "resi"; /** - * 认证失败 + * 未读 */ - String CONFIRM_FAILED = "1"; + String UNREAD = "unread"; /** - * 居民端 + * 已读 */ - String RESI = "resi"; + String READ = "read"; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberConfirmController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberConfirmController.java index 22be95f523..63dde1c984 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberConfirmController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberConfirmController.java @@ -5,7 +5,15 @@ import com.epmet.modules.partymember.service.PartyMemberConfirmService; import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; +import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmManualDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.AuditingDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.AutoFailedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberConfirmFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.RejectedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.AuditingDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.AutoFailedDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.RejectedDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -71,4 +79,49 @@ public class PartyMemberConfirmController { public Result partyMemberInfoExtra(@RequestBody PartymemberInfoDTO partyMemberInfoDTO) { return partyMemberConfirmService.partyMemberInfoExtra(partyMemberInfoDTO); } + + /** + * 审核党员 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("audit") + public Result manualConfirmResult(@RequestBody PartyMemberConfirmFromDTO fromDTO) { + return partyMemberConfirmService.manualConfirmResult(fromDTO); + } + + /** + * 待审核详情 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("auditingdetail") + public Result auditingDetail(@RequestBody AuditingDetailFromDTO fromDTO) { + return partyMemberConfirmService.auditingDetail(fromDTO); + } + + /** + * 自动审核失败详情 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("auditingdetail") + public Result autoFailedDetail(@RequestBody AutoFailedDetailFromDTO fromDTO) { + return partyMemberConfirmService.autoFailedDetail(fromDTO); + } + + /** + * 拒绝详情 + * + * @param fromDTO 参数 + * @return Result + */ + @PostMapping("rejecteddetail") + public Result rejectedDetail(@RequestBody RejectedDetailFromDTO fromDTO) { + return partyMemberConfirmService.rejectedDetail(fromDTO); + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartymemberConfirmManualEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartymemberConfirmManualEntity.java index 8b65fc2930..6be68841fb 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartymemberConfirmManualEntity.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartymemberConfirmManualEntity.java @@ -68,4 +68,9 @@ public class PartymemberConfirmManualEntity extends BaseEpmetEntity { */ private String refuseReason; + /** + * 是否已读 未读:unread 已读:read + */ + private String readFlag; + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java index feee93b3cc..e2644fb607 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java @@ -4,7 +4,15 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; +import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmManualDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.AuditingDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.AutoFailedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberConfirmFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.RejectedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.AuditingDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.AutoFailedDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.RejectedDetailResultDTO; /** * 党员认证 @@ -46,5 +54,35 @@ public interface PartyMemberConfirmService { */ Result partyMemberInfoExtra(PartymemberInfoDTO partyMemberInfoDTO); + /** + * 人工审核结果 + * + * @param fromDTO + * @return + */ + Result manualConfirmResult(PartyMemberConfirmFromDTO fromDTO); + + /** + * 待审核详情 + * + * @param fromDTO + * @return + */ + Result auditingDetail(AuditingDetailFromDTO fromDTO); + /** + * 自动审核失败详情 + * + * @param fromDTO + * @return + */ + Result autoFailedDetail(AutoFailedDetailFromDTO fromDTO); + + /** + * 拒绝详情 + * + * @param fromDTO + * @return + */ + Result rejectedDetail(RejectedDetailFromDTO fromDTO); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 28959478c1..d5e6be5621 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -8,9 +8,11 @@ import com.epmet.constant.PartyMemberConstant; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserRoleDTO; import com.epmet.dto.form.UserResiInfoFormDTO; +import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.feign.EpmetMessageFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.partymember.entity.*; import com.epmet.modules.partymember.redis.PartymemberInfoRedis; import com.epmet.modules.partymember.service.*; @@ -20,12 +22,22 @@ import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmManualDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.AuditingDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.AutoFailedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberConfirmFromDTO; +import com.epmet.resi.partymember.dto.partymember.form.RejectedDetailFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.AdditionalInfoDTO; +import com.epmet.resi.partymember.dto.partymember.result.AuditingDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.AutoFailedDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.RejectedDetailResultDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Date; +import java.util.List; import java.util.Map; /** @@ -56,6 +68,8 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService private PartymemberRegisterRelationService partymemberRegisterRelationService; @Autowired private EpmetMessageFeignClient messageFeignClient; + @Autowired + private GovOrgFeignClient govOrgFeignClient; @Override @Transactional(rollbackFor = Exception.class) @@ -158,7 +172,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, PartyMemberConstant.OPERATE_AUTO_FAILED); //自动认证失败 - partyMemberInfoEntity.setConfirmResult(PartyMemberConstant.CONFIRM_FAILED); + partyMemberInfoEntity.setConfirmResult(PartyMemberConstant.AUTO_CONFIRM_FAILED); if (partyMemberInfoEntity.getId().isEmpty()) { partymemberInfoService.insert(partyMemberInfoEntity); } else { @@ -172,7 +186,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, PartyMemberConstant.OPERATE_AUTO_SUCCESS); //自动认证成功 - partyMemberInfoEntity.setConfirmResult(PartyMemberConstant.CONFIRM_SUCCESS); + partyMemberInfoEntity.setConfirmResult(PartyMemberConstant.AUTO_CONFIRM_SUCCESS); if (partyMemberInfoEntity.getId().isEmpty()) { partymemberInfoService.insert(partyMemberInfoEntity); } else { @@ -242,6 +256,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService manualEntity.setUserId(infoDTO.getUserId()); manualEntity.setPartymemberInfoId(infoDTO.getId()); manualEntity.setAuditStatus(PartyMemberConstant.UNDER_AUDITTING); + manualEntity.setReadFlag(PartyMemberConstant.UNREAD); partymemberConfirmManualService.insert(manualEntity); } @@ -249,6 +264,204 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService return new Result(); } + @Override + public Result manualConfirmResult(PartyMemberConfirmFromDTO fromDTO) { + PartymemberConfirmManualEntity manualEntity = partymemberConfirmManualService.selectById(fromDTO.getManualId()); + PartymemberInfoEntity partyMemberInfoEntity = partymemberInfoService.selectById(fromDTO.getPartyMemberId()); + partyMemberInfoEntity.setId(manualEntity.getPartymemberInfoId()); + partyMemberInfoEntity.setConfirmResult(fromDTO.getPartyMemberFlag()); + + partymemberInfoService.updateById(partyMemberInfoEntity); + + manualEntity.setAuditStatus(fromDTO.getPartyMemberFlag()); + manualEntity.setRefuseReason(fromDTO.getReason()); + partymemberConfirmManualService.updateById(manualEntity); + + if (PartyMemberConstant.APPROVED.equals(fromDTO.getPartyMemberFlag())) { + //添加用户党员角色关系 + UserRoleDTO userRole = new UserRoleDTO(); + userRole.setCustomerId(partyMemberInfoEntity.getCustomerId()); + userRole.setGridId(PartyMemberConstant.ALL); + userRole.setUserId(partyMemberInfoEntity.getUserId()); + userRole.setRoleKey(EpmetRoleKeyConstant.PARTYMEMBER); + userRole.setApp(PartyMemberConstant.RESI); + epmetUserFeignClient.saveUserRole(userRole); + //存入党员注册关系表 用于统计客户网格的认证党员数 + saveRegisterRelation(ConvertUtils.sourceToTarget(partyMemberInfoEntity, + PartymemberInfoDTO.class)); + } + + return new Result(); + } + + @Override + public Result auditingDetail(AuditingDetailFromDTO fromDTO) { + AuditingDetailResultDTO resultDTO = new AuditingDetailResultDTO(); + AdditionalInfoDTO additionalInfoDTO = new AdditionalInfoDTO(); + resultDTO.setPartyMemberId(fromDTO.getPartyMemberId()); + resultDTO.setAutoId(fromDTO.getAutoId()); + resultDTO.setManualId(fromDTO.getManualId()); + + //获取人工审核信息 + PartymemberConfirmManualEntity manualEntity = partymemberConfirmManualService.selectById(fromDTO.getManualId()); + //人工审核信息设为已读 + manualEntity.setReadFlag(PartyMemberConstant.READ); + partymemberConfirmManualService.updateById(manualEntity); + + //获取党员认证信息 + PartymemberInfoEntity partyMemberInfoEntity = partymemberInfoService.selectById(fromDTO.getPartyMemberId()); + resultDTO.setUserId(partyMemberInfoEntity.getUserId()); + resultDTO.setRealName(partyMemberInfoEntity.getSurname() + partyMemberInfoEntity.getName()); + resultDTO.setIdCard(partyMemberInfoEntity.getIdCard()); + resultDTO.setMobile(resultDTO.getMobile()); + resultDTO.setAddress(partyMemberInfoEntity.getStreet() + partyMemberInfoEntity.getEstate() + partyMemberInfoEntity.getBuilding()); + resultDTO.setCertifyTime(manualEntity.getCreatedTime().getTime()); + + //获取党员自动认证信息 + List failedReason = new ArrayList<>(); + + if (null != fromDTO.getAutoId() && !fromDTO.getAutoId().isEmpty()) { + PartymemberConfirmAutoEntity autoEntity = partymemberConfirmAutoService.selectById(fromDTO.getAutoId()); + if (PartyMemberConstant.SAME.equals(autoEntity.getMobileResult())) { + failedReason.add("手机号匹配"); + } else { + failedReason.add("手机号未匹配"); + } + if (PartyMemberConstant.SAME.equals(autoEntity.getIdCardResult())) { + failedReason.add("身份证匹配"); + } else { + failedReason.add("身份证未匹配"); + } + if (PartyMemberConstant.SAME.equals(autoEntity.getNameResult())) { + failedReason.add("姓名匹配"); + } else { + failedReason.add("姓名未匹配"); + } + } else { + failedReason.add("手机号未匹配"); + failedReason.add("身份证未匹配"); + failedReason.add("姓名未匹配"); + } + //补充信息 + additionalInfoDTO.setExtraOrganization(partyMemberInfoEntity.getExtraOrganization()); + additionalInfoDTO.setContactMobile(partyMemberInfoEntity.getExtraCertifierMobile() == null ? "" : partyMemberInfoEntity.getExtraCertifierMobile()); + additionalInfoDTO.setContactPeople(partyMemberInfoEntity.getExtraCertifierName() == null ? "" : partyMemberInfoEntity.getExtraCertifierName()); + additionalInfoDTO.setFailedReason(failedReason); + resultDTO.setAdditionalInfo(additionalInfoDTO); + //查询网格信息 + Result gridInfoResult = govOrgFeignClient.queryGridInfo(partyMemberInfoEntity.getGridId()); + String gridFullPath = ""; + if (gridInfoResult.success() && null != gridInfoResult.getData()) { + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName()); + gridFullPath = gridFullPath.replaceAll("--", "").trim(); + } + resultDTO.setGridFullPath(gridFullPath); + + return new Result().ok(resultDTO); + } + + @Override + public Result autoFailedDetail(AutoFailedDetailFromDTO fromDTO) { + AutoFailedDetailResultDTO resultDTO = new AutoFailedDetailResultDTO(); + //获取党员认证信息 + PartymemberInfoEntity partyMemberInfo = partymemberInfoService.selectById(fromDTO.getPartyMemberId()); + resultDTO.setUserId(partyMemberInfo.getUserId()); + resultDTO.setRealName(partyMemberInfo.getSurname() + partyMemberInfo.getName()); + resultDTO.setIdCard(partyMemberInfo.getIdCard()); + resultDTO.setMobile(resultDTO.getMobile()); + resultDTO.setAddress(partyMemberInfo.getStreet() + partyMemberInfo.getEstate() + partyMemberInfo.getBuilding()); + String failedReason = ""; + if (null != fromDTO.getAutoId() && !fromDTO.getAutoId().isEmpty()) { + PartymemberConfirmAutoEntity autoEntity = partymemberConfirmAutoService.selectById(fromDTO.getAutoId()); + resultDTO.setCertifyTime(autoEntity.getContrastTime().getTime()); + if (PartyMemberConstant.SAME.equals(autoEntity.getMobileResult())) { + failedReason = failedReason + "手机号匹配,"; + } else { + failedReason = failedReason + "手机号未匹配,"; + } + if (PartyMemberConstant.SAME.equals(autoEntity.getIdCardResult())) { + failedReason = failedReason + "身份证匹配,"; + } else { + failedReason = failedReason + "身份证未匹配,"; + } + if (PartyMemberConstant.SAME.equals(autoEntity.getNameResult())) { + failedReason = failedReason + "姓名匹配"; + } else { + failedReason = failedReason + "姓名未匹配"; + } + } else { + failedReason = "手机号未匹配,身份证未匹配,姓名未匹配"; + resultDTO.setCertifyTime(partyMemberInfo.getUpdatedTime().getTime()); + } + resultDTO.setFailedReason(failedReason); + //查询网格信息 + Result gridInfoResult = govOrgFeignClient.queryGridInfo(partyMemberInfo.getGridId()); + String gridFullPath = ""; + if (gridInfoResult.success() && null != gridInfoResult.getData()) { + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName()); + gridFullPath = gridFullPath.replaceAll("--", "").trim(); + } + resultDTO.setGridFullPath(gridFullPath); + + return new Result().ok(resultDTO); + } + + @Override + public Result rejectedDetail(RejectedDetailFromDTO fromDTO) { + RejectedDetailResultDTO resultDTO = new RejectedDetailResultDTO(); + //获取党员认证信息 + PartymemberInfoEntity partyMemberInfo = partymemberInfoService.selectById(fromDTO.getPartyMemberId()); + resultDTO.setUserId(partyMemberInfo.getUserId()); + resultDTO.setRealName(partyMemberInfo.getSurname() + partyMemberInfo.getName()); + resultDTO.setIdCard(partyMemberInfo.getIdCard()); + resultDTO.setMobile(resultDTO.getMobile()); + resultDTO.setAddress(partyMemberInfo.getStreet() + partyMemberInfo.getEstate() + partyMemberInfo.getBuilding()); + resultDTO.setExtraOrganization(partyMemberInfo.getExtraOrganization()); + resultDTO.setContactMobile(partyMemberInfo.getExtraCertifierMobile() == null ? "" : partyMemberInfo.getExtraCertifierMobile()); + resultDTO.setContactPeople(partyMemberInfo.getExtraCertifierName() == null ? "" : partyMemberInfo.getExtraCertifierName()); + String failedReason =""; + if (null != fromDTO.getAutoId() && !fromDTO.getAutoId().isEmpty()) { + PartymemberConfirmAutoEntity autoEntity = partymemberConfirmAutoService.selectById(fromDTO.getAutoId()); + if (PartyMemberConstant.SAME.equals(autoEntity.getMobileResult())) { + failedReason = failedReason + "手机号匹配,"; + } else { + failedReason = failedReason + "手机号未匹配,"; + } + if (PartyMemberConstant.SAME.equals(autoEntity.getIdCardResult())) { + failedReason = failedReason + "身份证匹配,"; + } else { + failedReason = failedReason + "身份证未匹配,"; + } + if (PartyMemberConstant.SAME.equals(autoEntity.getNameResult())) { + failedReason = failedReason + "姓名匹配"; + } else { + failedReason = failedReason + "姓名未匹配"; + } + } else { + failedReason = "手机号未匹配,身份证未匹配,姓名未匹配"; + } + resultDTO.setFailedReason(failedReason); + //获取人工审核信息 + PartymemberConfirmManualEntity manualEntity = partymemberConfirmManualService.selectById(fromDTO.getManualId()); + resultDTO.setCertifyTime(manualEntity.getCreatedTime().getTime()); + resultDTO.setFailedReason(manualEntity.getRefuseReason()); + //查询网格信息 + Result gridInfoResult = govOrgFeignClient.queryGridInfo(partyMemberInfo.getGridId()); + String gridFullPath = ""; + if (gridInfoResult.success() && null != gridInfoResult.getData()) { + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName()); + gridFullPath = gridFullPath.replaceAll("--", "").trim(); + } + resultDTO.setGridFullPath(gridFullPath); + return new Result().ok(resultDTO); + } + /** * 判断是否已注册居民,如果没有则注册居民 * diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java index 926218c9ef..184ed1e49f 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.PartyMemberConstant; import com.epmet.modules.partymember.dao.PartymemberConfirmManualDao; import com.epmet.modules.partymember.entity.PartymemberConfirmManualEntity; import com.epmet.modules.partymember.redis.PartymemberConfirmManualRedis; @@ -104,7 +105,9 @@ public class PartymemberConfirmManualServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(partymemberInfoId), "PARTYMEMBER_INFO_ID", partymemberInfoId); + wrapper.eq(StringUtils.isNotBlank(partymemberInfoId), "PARTYMEMBER_INFO_ID", partymemberInfoId) + .eq("AUDIT_STATUS", PartyMemberConstant.UNDER_AUDITTING); + PartymemberConfirmManualEntity entity = baseDao.selectOne(wrapper); return ConvertUtils.sourceToTarget(entity, PartymemberConfirmManualDTO.class); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index b30353f09d..3e6a3b68d4 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -40,7 +40,7 @@ pi.CUSTOMER_ID = #{customerId} AND pi.GRID_ID = #{gridId} AND pi.USER_ID = #{userId} - AND pi.CONFIRM_RESULT = '1' + AND pi.CONFIRM_RESULT = 'auto_confirm_failed' AND pi.DEL_FLAG = 0 AND ( pcm.AUDIT_STATUS = 'under_auditting' OR pi.ORGANIZATION_TYPE IS NULL ) @@ -54,7 +54,7 @@ WHERE CUSTOMER_ID = #{customerId} AND MOBILE = #{mobile} - AND CONFIRM_RESULT = '0' + AND (CONFIRM_RESULT = 'auto_confirm_success' OR CONFIRM_RESULT = 'approved') AND DEL_FLAG = 0 From 4aa5bc205c35beb4db7160bb63d67b6075335a71 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 27 Apr 2020 15:29:07 +0800 Subject: [PATCH 131/174] =?UTF-8?q?=E6=9F=A5=E6=89=BE=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3Bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/CustomerGridDao.xml | 4 ++-- .../java/com/epmet/dto/form/CommonUserIdListFormDTO.java | 2 +- .../src/main/resources/mapper/CustomerStaffDao.xml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 7af8c21e98..e5873c263f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -233,8 +233,8 @@ SELECT USER_ID AS staffId, - REAL_NAME AS staffName, - HEAD_PHOTO AS staffHeadPhoto , - GENDER + IFNULL(REAL_NAME,"") AS staffName, + IFNULL(HEAD_PHOTO,"") AS staffHeadPhoto , + IFNULL(GENDER,0) AS gender FROM CUSTOMER_STAFF WHERE From 4340e7116c0b39c4bd3f1e05f46958eec13c1138 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 27 Apr 2020 13:42:57 +0800 Subject: [PATCH 132/174] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9@Datafilter?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=EF=BC=8C=E5=B0=86tableAlias=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=95=B0=E7=BB=84=EF=BC=8C=E9=A2=84=E7=95=99?= =?UTF-8?q?=E5=87=BA=E6=9D=A5=EF=BC=8C=E4=B8=BA=E5=90=8E=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E5=A4=9A=E8=A1=A8=E8=BF=87=E6=BB=A4=E5=81=9A=E5=87=86=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/mybatis/annotation/DataFilter.java | 2 +- .../com/epmet/commons/mybatis/aspect/DataFilterAspect.java | 3 ++- .../src/main/java/com/epmet/dao/StaffRoleDao.java | 3 +++ .../main/java/com/epmet/service/impl/StaffRoleServiceImpl.java | 2 -- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java index 96b7691f22..6947d92619 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java @@ -23,6 +23,6 @@ public @interface DataFilter { /** * 表的别名 */ - String tableAlias() default ""; + String[] tableAliases() default ""; } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java index c9965192cf..a7c5fc1683 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java @@ -71,7 +71,8 @@ public class DataFilterAspect { // 通过反射,取到注解属性 DataFilter dataFilterAnno = ((MethodSignature) point.getSignature()).getMethod().getAnnotation(DataFilter.class); - String tableAlias = dataFilterAnno.tableAlias(); + String[] tableAliases = dataFilterAnno.tableAliases(); + String tableAlias = tableAliases[0]; // 从ThreadLocal中取所需权限 String requirePermission = AccessOpeAspect.requirePermissionTl.get(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 85dae3de67..b943b44be7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -17,6 +17,7 @@ package com.epmet.dao; +import com.epmet.commons.mybatis.annotation.DataFilter; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; @@ -44,6 +45,7 @@ public interface StaffRoleDao extends BaseDao { * @param orgId * @return */ + //@DataFilter(tableAliases = { "sr" }) List listStaffIdsByRoleKeyAndOrgId(@Param("roleKey") String roleKey, @Param("orgId") String orgId, @Param("dataScope") DataScope dataScope); @@ -61,6 +63,7 @@ public interface StaffRoleDao extends BaseDao { * @Author wangc * @Date 2020.04.26 11:01 **/ + //@DataFilter(tableAliases = { "role" }) StaffRolesResultDTO getStaffRoles(CommonUserFormDTO commonUserFormDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 0c4365e9fb..f76d6545c5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -114,7 +114,6 @@ public class StaffRoleServiceImpl extends BaseServiceImpl listStaffsInRole(String roleKey, String orgId, DataScope dataScope) { return baseDao.listStaffIdsByRoleKeyAndOrgId(roleKey, orgId, dataScope); } @@ -133,7 +132,6 @@ public class StaffRoleServiceImpl extends BaseServiceImpl getStaffRoles(CommonUserFormDTO userParam) { return new Result().ok(baseDao.getStaffRoles(userParam)); } From a7341b86292a4eefe9e6dd72ebaec02fde3f6dc2 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Mon, 27 Apr 2020 13:29:35 +0800 Subject: [PATCH 133/174] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=B7=B2=E8=AE=A4=E8=AF=81=E5=85=9A=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/CertifiedResultDTO.java | 15 +++++++++++++ .../epmet/service/ResiPartyMemberService.java | 3 +-- .../result/CertifiedResultDTO.java | 15 +++++++++++++ .../mapper/partymember/PartymemberInfoDao.xml | 21 ++++++++++++------- .../epmet/dto/result/CertifiedResultDTO.java | 15 +++++++++++++ 5 files changed, 59 insertions(+), 10 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java index f7540d8b0b..db42fbe84d 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java @@ -39,4 +39,19 @@ public class CertifiedResultDTO implements Serializable { */ private String gridFullPath; + /** + * 党员认证信息表id + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java index 7efe7528f3..0d274382e6 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java @@ -1,12 +1,10 @@ package com.epmet.service; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; import com.epmet.dto.form.CertifiedFormDTO; import com.epmet.dto.result.CertifiedResultDTO; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import com.epmet.dto.result.AuditedPartyMemberResultDTO; @@ -36,6 +34,7 @@ public interface ResiPartyMemberService { * @Date 2020/4/26 23:32 **/ Result> audited(AuditedPartyMemberFormDTO formDTO); + /** * * @Description 获取已认证党员 diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedResultDTO.java index 9e5568441b..1c4dddc50c 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedResultDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedResultDTO.java @@ -39,4 +39,19 @@ public class CertifiedResultDTO implements Serializable { */ private String gridFullPath; + /** + * 党员认证信息表id + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index ca2314e514..b30353f09d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -61,16 +61,21 @@ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java index f7540d8b0b..db42fbe84d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java @@ -39,4 +39,19 @@ public class CertifiedResultDTO implements Serializable { */ private String gridFullPath; + /** + * 党员认证信息表id + */ + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; + } From 59ca5cc03fd0d56fe8ff914867a6395334d87ab6 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Mon, 27 Apr 2020 14:21:13 +0800 Subject: [PATCH 134/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/CustomerGridDao.java | 2 +- .../com/epmet/service/impl/CustomerGridServiceImpl.java | 6 +++--- .../src/main/resources/mapper/CustomerGridDao.xml | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 37e60a010a..7e4219012e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -123,7 +123,7 @@ public interface CustomerGridDao extends BaseDao { * @param gridName * @return */ - String selectGridIdByGridName(@Param("gridName")String gridName,@Param("agencyId")String pid); + String selectGridIdByGridName(@Param("gridName")String gridName,@Param("agencyId")String pid,@Param("gridId")String gridId); /** * 编辑网格信息 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index b5a83ee724..cb544cba9f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -202,7 +202,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) { - String checkGridName = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(),addGridFormDTO.getAgencyId()); + String checkGridName = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(),addGridFormDTO.getAgencyId(),null); if (checkGridName!=null){ return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode()); } @@ -217,7 +217,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(addGridResultDTO); @@ -231,7 +231,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl + AND id != #{gridId} + AND del_flag = 0 From 42757f8d7bec63bb949f597663261a0736d56f8e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Apr 2020 15:52:59 +0800 Subject: [PATCH 135/174] =?UTF-8?q?customer=5Fgrid=E8=A1=A8=E5=88=A0?= =?UTF-8?q?=E9=99=A4org=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/epmet_gov_org.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql index aa68f1c8fa..5e1a40bd0b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql @@ -102,8 +102,8 @@ ALTER TABLE customer_grid MODIFY COLUMN LATITUDE VARCHAR(32) DEFAULT NULL COMME ALTER TABLE customer_grid MODIFY COLUMN AREA_CODE VARCHAR(32) DEFAULT NULL COMMENT '所属地区码(所属组织地区码)'; alter table customer_grid drop column GRID_CODE; alter table customer_grid drop column SORT; +alter table customer_grid drop column ORG_ID; -alter table customer_grid add column ORG_ID varchar(64) NOT NULL COMMENT '所属组织机构ID(customer_organization.id)'; alter table customer_grid add column MANAGE_DISTRICT varchar(255) DEFAULT "" NOT NULL COMMENT '管辖区域'; alter table customer_grid add column TOTAL_USER INT(11) DEFAULT 0 NOT NULL COMMENT '当前网格总人数'; ALTER TABLE customer_agency ADD ( From a5bad0ebc69e499c662596e8e3b0883a410268ee Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 27 Apr 2020 16:05:01 +0800 Subject: [PATCH 136/174] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF-=E7=83=AD?= =?UTF-8?q?=E5=BF=83=E5=B1=85=E6=B0=91=E7=94=B3=E8=AF=B7=E6=8F=90=E4=BA=A4?= =?UTF-8?q?-=E6=B7=BB=E5=8A=A0=E7=BB=99=E5=AF=B9=E5=BA=94=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E9=95=BF=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UserMessageController.java | 12 ++++ .../com/epmet/service/UserMessageService.java | 8 +++ .../service/impl/UserMessageServiceImpl.java | 5 ++ .../dto/result/AgencyAndStaffsResultDTO.java | 47 +++++++++++++ .../epmet/constant/CustomerGridConstant.java | 13 ++++ .../controller/CustomerGridController.java | 17 +++-- .../com/epmet/dao/CustomerStaffGridDao.java | 8 +++ .../epmet/service/CustomerGridService.java | 7 ++ .../service/impl/CustomerGridServiceImpl.java | 33 +++++++--- .../resources/mapper/CustomerStaffGridDao.xml | 35 ++++++---- .../resi-partymember-server/pom.xml | 6 ++ .../constant/ResiWarmheartedConstant.java | 10 +++ .../feign/EpmetMessageFeignClient.java | 12 ++++ .../modules/feign/EpmetUserFeignClient.java | 10 +++ .../modules/feign/GovOrgFeignClient.java | 13 ++-- .../EpmetMessageFeignClientFallback.java | 8 +++ .../EpmetUserFeignClientFallBack.java | 7 ++ .../fallback/GovOrgFeignClientFallBack.java | 7 ++ .../constant/ResiWarmUserMessageConstant.java | 2 +- .../ResiWarmheartedVisitConstant.java | 6 ++ .../impl/ResiWarmheartedApplyServiceImpl.java | 66 ++++++++++++++----- 21 files changed, 284 insertions(+), 48 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyAndStaffsResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java create mode 100644 epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiWarmheartedConstant.java diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java index 3c9a2ba01a..782ab153dd 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.UserMessageDTO; import com.epmet.dto.form.MymessageFormDTO; import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.entity.UserMessageEntity; import com.epmet.excel.UserMessageExcel; import com.epmet.service.UserMessageService; import org.springframework.beans.factory.annotation.Autowired; @@ -132,4 +133,15 @@ public class UserMessageController { public Result> getMyMessageList(@RequestBody MymessageFormDTO params){ return userMessageService.getMyMessageList(params); } + + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 批量插入未读消息 + **/ + @PostMapping("saveusermessagelist") + public Result saveUserMessageList(@RequestBody List msgList) { + return userMessageService.saveUserMessageList(msgList); + } } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java index 1555f73aed..7623d45e0d 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java @@ -127,4 +127,12 @@ public interface UserMessageService extends BaseService { * @return */ Result> getMyMessageList(MymessageFormDTO param); + + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 批量插入未读消息 + **/ + Result saveUserMessageList(List msgList); } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java index 8354b9166c..cdbfe87ead 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java @@ -165,4 +165,9 @@ public class UserMessageServiceImpl extends BaseServiceImpl>().ok(ConvertUtils.sourceToTarget(myMessageList, UserMessageDTO.class)); } + @Override + public Result saveUserMessageList(List msgList) { + insertBatch(msgList); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyAndStaffsResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyAndStaffsResultDTO.java new file mode 100644 index 0000000000..cde61478b9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyAndStaffsResultDTO.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.CustomerStaffGridDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 根据网格ID查询网格信息、查询网格下所有工作人员列表-接口返参 + * + * @author sun + */ +@Data +public class AgencyAndStaffsResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格基本信息 + */ + private CustomerGridDTO customerGridDTO; + /** + * 网格下工作人员列表 + */ + private List staffList; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java new file mode 100644 index 0000000000..fe636fdcc2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java @@ -0,0 +1,13 @@ +package com.epmet.constant; + +/** + * @author sun + * @dscription + */ +public interface CustomerGridConstant { + + /** + * 根据网格Id未查询到网格信息 + */ + String SELECT_EXCEPTION = "根据网格Id未查询到网格信息"; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 77e3b82908..834aa9bd1c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -27,12 +27,9 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.SelectGridNameByGridIdFormDTO; -import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.result.CustomerGridByUserIdResultDTO; -import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -162,4 +159,16 @@ public class CustomerGridController { public Result> getMyGrids(@PathVariable("userId") String userId) { return customerGridService.getMyGrids(userId); } + + /** + * @param gridId + * @return + * @Author sun + * @Description 根据网格id查询所属组织信息、根据网格Id查询网格下所有工作人员列表 + **/ + @PostMapping("getagencyandstaffsbygridid/{gridId}") + public Result getAgencyAndStaffsBygridId(@PathVariable("gridId") String gridId) { + return customerGridService.getAgencyAndStaffsBygridId(gridId); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java index c0e8691363..07d59946ca 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java @@ -65,4 +65,12 @@ public interface CustomerStaffGridDao extends BaseDao { * @Date 2020.04.26 14:57 **/ void insertBatch(List list); + + /** + * @param gridId + * @return + * @Description 根据网格Id查询网格下工作人员列表 + * @Author sun + */ + List selectByGridId(@Param("gridId")String gridId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index cb9c9724e2..76459d1de6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -212,4 +212,11 @@ public interface CustomerGridService extends BaseService { **/ Result addGridStaffs(CommonGridStaffListFromDTO staffListFormDTO); + /** + * @param gridId + * @return + * @Author sun + * @Description 根据网格id查询所属组织信息、根据网格Id查询网格下所有工作人员列表 + **/ + Result getAgencyAndStaffsBygridId(String gridId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index cb544cba9f..c2078c1360 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -23,25 +23,20 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; 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.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.CustomerGridConstant; import com.epmet.dao.CustomerGridDao; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.SelectGridNameByGridIdFormDTO; -import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; -import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerStaffGridService; @@ -473,4 +468,26 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(baseDao.selectGridNameByGridId(formDTO)); } + /** + * @param gridId + * @return + * @Author sun + * @Description 根据网格id查询所属组织信息、根据网格Id查询网格下所有工作人员列表 + **/ + @Override + public Result getAgencyAndStaffsBygridId(String gridId) { + Result result = new Result<>(); + AgencyAndStaffsResultDTO agencyAndStaffsResultDTO = new AgencyAndStaffsResultDTO(); + //1:查询网格基本信息 + CustomerGridEntity gridEntity = baseDao.selectById(gridId); + if (null == gridEntity) { + throw new RenException(CustomerGridConstant.SELECT_EXCEPTION); + } + CustomerGridDTO CustomerGridDTO = ConvertUtils.sourceToTarget(gridEntity, CustomerGridDTO.class); + agencyAndStaffsResultDTO.setCustomerGridDTO(CustomerGridDTO); + //2:查询网格下工作人员列表 + List staffList = customerStaffGridDao.selectByGridId(gridId); + agencyAndStaffsResultDTO.setStaffList(staffList); + return result.ok(agencyAndStaffsResultDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 5e4c9bd1a3..c1721ea685 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -3,19 +3,18 @@ - - - - - - - - - - - - - + + csg.id AS "id", + csg.user_id AS "userId", + csg.grid_id AS "gridId", + csg.customer_id AS "customerId", + csg.del_flag AS "delflag", + csg.revision AS "revision", + csg.created_by AS "createdby", + csg.created_time AS "createdtime", + csg.updated_by AS "updatedby", + csg.updated_time AS "updatedtime" + + + insert into customer_staff_grid diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index ce7eabb912..80a2fd38cf 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -93,6 +93,12 @@ 2.0.0 compile + + com.epmet + epmet-message-server + 0.3.1 + compile + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiWarmheartedConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiWarmheartedConstant.java new file mode 100644 index 0000000000..6945685c92 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiWarmheartedConstant.java @@ -0,0 +1,10 @@ +package com.epmet.constant; + +/** + * @author sun + * @dscription + */ +public interface ResiWarmheartedConstant { + + String SELECT_EXCEPTION = "根据网格Id查询数据失败"; +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java index 50b8cf9bb5..21a57747e2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.modules.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.entity.UserMessageEntity; import com.epmet.modules.feign.fallback.EpmetMessageFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import java.util.List; + /** * @author kamui */ @@ -33,4 +36,13 @@ public interface EpmetMessageFeignClient { @PostMapping(value = "message/usermessage/saveusermessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result saveUserMessage(UserMessageFormDTO formDto); + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 热心居民申请给网格长们发送消息 + **/ + @PostMapping(value = "message/usermessage/saveusermessagelist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveUserMessageList(List msgList); + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java index 7b3b142878..85d810e05e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java @@ -4,9 +4,11 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserRoleDTO; +import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.result.CertifiedResultDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.feign.fallback.EpmetUserFeignClientFallBack; import com.epmet.resi.partymember.dto.partymember.UserHeadPhotoDTO; @@ -69,4 +71,12 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/userwechat/selectuserheadphotobyuserid") Result> selectUserHeadPhotoByUserId(List certifiedResultDTOS); + /** + * 根据机构Id查询机构下是网格长角色的用户 + * @param staffRoleFormDTO + * @return + * @Author sun + */ + @PostMapping("/epmetuser/staffrole/staffsinrole") + Result> getStaffsInRole(@RequestBody StaffRoleFormDTO staffRoleFormDTO); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java index 4615564826..b3cd8ab7aa 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.AgencyAndStaffsResultDTO; import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.modules.feign.fallback.GovOrgFeignClientFallBack; @@ -50,8 +51,12 @@ public interface GovOrgFeignClient { @PostMapping("/gov/org/customergrid/selectGridNameByGridId") Result selectGridNameByGridId(@RequestBody CertifiedFormDTO formDTO); - - - - + /** + * @param gridId + * @return + * @Author sun + * @Description 根据网格id查询所属组织信息、根据网格Id查询网格下所有工作人员列表 + **/ + @PostMapping("/gov/org/customergrid/getagencyandstaffsbygridid/{gridId}") + Result getAgencyAndStaffsBygridId(@PathVariable("gridId") String gridId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java index f588f55781..b356a338b9 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java @@ -4,9 +4,12 @@ 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.form.UserMessageFormDTO; +import com.epmet.entity.UserMessageEntity; import com.epmet.modules.feign.EpmetMessageFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * 消息服务降级 * @author zhaoqifeng @@ -24,4 +27,9 @@ public class EpmetMessageFeignClientFallback implements EpmetMessageFeignClient return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessage", formDto); } + @Override + public Result saveUserMessageList(List msgList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessageList", msgList); + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java index d7844431b9..e9125c16e0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java @@ -5,9 +5,11 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserRoleDTO; +import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.result.CertifiedResultDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -45,4 +47,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result> selectUserHeadPhotoByUserId(List certifiedResultDTOS) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectUserHeadPhotoByUserId", certifiedResultDTOS); } + + @Override + public Result> getStaffsInRole(StaffRoleFormDTO staffRoleFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffsInRole", staffRoleFormDTO); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java index 07775a8fb8..3098308b28 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.AgencyAndStaffsResultDTO; import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.modules.feign.GovOrgFeignClient; @@ -38,4 +39,10 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { public Result selectGridNameByGridId(CertifiedFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridNameByGridId",formDTO); } + + @Override + public Result getAgencyAndStaffsBygridId(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyAndStaffsBygridId",gridId); + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmUserMessageConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmUserMessageConstant.java index dbb6990310..3f85a6d199 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmUserMessageConstant.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmUserMessageConstant.java @@ -9,7 +9,7 @@ public interface ResiWarmUserMessageConstant { /** * 消息标题 */ - String GROUP_TITLE = "您有一条小组消息"; + String GROUP_TITLE = "您有一条热心居民申请消息"; /** * 热心居民提交申请时给网格长发送消息:XX街道-XX先生/女士申请成为热心居民,请审核。 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmheartedVisitConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmheartedVisitConstant.java index 56946307cb..a0c0442d72 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmheartedVisitConstant.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmheartedVisitConstant.java @@ -77,4 +77,10 @@ public interface ResiWarmheartedVisitConstant { String SELECT_EXCEPTION = "根据申请Id未查询到热心居民申请详情信息"; String AUDIT_EXCEPTION = "该申请数据已审核,不能再次审核"; + + /** + * 网格长角色 + */ + String GRID_MANAGER = "grid_manager"; + String SAVE_MSG_EXCEPTION = "发送消息给网格长操作失败"; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java index b78ffa53eb..b3f9018fa0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java @@ -31,13 +31,15 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.ResiWarmheartedConstant; import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.UserRoleDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; -import com.epmet.dto.form.UserResiInfoListFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AgencyAndStaffsResultDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.entity.UserMessageEntity; import com.epmet.modules.feign.EpmetMessageFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; @@ -203,7 +205,10 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl resultAgencyAndStaffs = govOrgFeignClient.getAgencyAndStaffsBygridId(formDTO.getGridId()); + if(!resultAgencyAndStaffs.success()){ + throw new RenException(ResiWarmheartedConstant.SELECT_EXCEPTION); + } + AgencyAndStaffsResultDTO agencyAndStaffsResultDTO = resultAgencyAndStaffs.getData(); + //网格下工作人员列表 + CustomerGridDTO customerGridDTO = agencyAndStaffsResultDTO.getCustomerGridDTO(); + List staffList = agencyAndStaffsResultDTO.getStaffList(); + //2:调用epmet-user服务,根据组织机构Id和网格长角色查询组织机构下所有的网格长StaffId + StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); + staffRoleFormDTO.setOrgId(customerGridDTO.getPid()); + staffRoleFormDTO.setRoleKey(ResiWarmheartedVisitConstant.GRID_MANAGER); + Result> resultList = epmetUserFeignClient.getStaffsInRole(staffRoleFormDTO); + List roleList = resultList.getData(); + //3:遍历找出当前网格的所有网格长并给网格长发消息 + List msgList = new ArrayList<>(); + staffList.forEach(staff->{ + roleList.forEach(role->{ + if(staff.getUserId().equals(role.getStaffId())){ + UserMessageEntity msgEntity = new UserMessageEntity(); + msgEntity.setCustomerId(formDTO.getCustomerId()); + msgEntity.setGridId(formDTO.getGridId()); + msgEntity.setUserId(staff.getUserId()); + msgEntity.setApp(formDTO.getApp()); + msgEntity.setTitle(ResiWarmUserMessageConstant.GROUP_TITLE); + msgEntity.setMessageContent(formDTO.getMessageText()); + msgEntity.setReadFlag(ReadFlagConstant.UN_READ); + msgList.add(msgEntity); + } + }); + }); + if (msgList.size() > NumConstant.ZERO) { + result = epmetMessageFeignClient.saveUserMessageList(msgList); + } + return result; } @Override From 34c3786f41aa01a4a382b8b742773d4f99e06c9c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 27 Apr 2020 16:20:08 +0800 Subject: [PATCH 137/174] =?UTF-8?q?=E4=BF=AE=E6=94=B9Constant=E7=B1=BB?= =?UTF-8?q?=E5=AD=98=E6=94=BE=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiWarmheartedApplyServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java index b3f9018fa0..66dea040aa 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java @@ -31,7 +31,6 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; import com.epmet.constant.ReadFlagConstant; -import com.epmet.constant.ResiWarmheartedConstant; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.UserRoleDTO; @@ -44,6 +43,7 @@ import com.epmet.modules.feign.EpmetMessageFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.warmhearted.constant.ResiWarmUserMessageConstant; +import com.epmet.modules.warmhearted.constant.ResiWarmheartedConstant; import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant; import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao; import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; From a5beb0e2ec050ec84986482a732462c966fe40e9 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Mon, 27 Apr 2020 17:16:56 +0800 Subject: [PATCH 138/174] =?UTF-8?q?=E5=B7=B2=E8=AE=A4=E8=AF=81=E5=85=9A?= =?UTF-8?q?=E5=91=98=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/CertifiedDetailFormDTO.java | 34 ++++++++ .../dto/result/CertifiedDetailResultDTO.java | 72 +++++++++++++++++ .../controller/ResiPartyMemberController.java | 14 ++++ .../feign/ResiPartymemberFeignClient.java | 12 +++ .../ResiPartymemberFeignClientFallBack.java | 7 ++ .../epmet/service/ResiPartyMemberService.java | 15 ++++ .../impl/ResiPartyMemberServiceImpl.java | 16 ++++ .../main/resources/mapper/CustomerGridDao.xml | 2 +- .../form/CertifiedDetailFormDTO.java | 34 ++++++++ .../result/CertifiedDetailResultDTO.java | 77 +++++++++++++++++++ .../modules/feign/EpmetUserFeignClient.java | 12 ++- .../EpmetUserFeignClientFallBack.java | 7 ++ .../controller/PartymemberInfoController.java | 14 ++++ .../partymember/dao/PartymemberInfoDao.java | 11 +++ .../service/PartymemberInfoService.java | 13 ++++ .../impl/PartymemberInfoServiceImpl.java | 31 ++++++++ .../mapper/partymember/PartymemberInfoDao.xml | 23 ++++++ .../dto/form/CreatedTimeByUserIdFormDTO.java | 21 +++++ .../result/CreatedTimeByUserIdResultDTO.java | 21 +++++ .../com/epmet/controller/UserController.java | 13 ++++ .../src/main/java/com/epmet/dao/UserDao.java | 12 +++ .../java/com/epmet/service/UserService.java | 11 +++ .../epmet/service/impl/UserServiceImpl.java | 16 ++++ .../src/main/resources/mapper/UserDao.xml | 11 +++ 24 files changed, 497 insertions(+), 2 deletions(-) create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/CertifiedDetailFormDTO.java create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedDetailResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/CertifiedDetailFormDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedDetailResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CreatedTimeByUserIdFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CreatedTimeByUserIdResultDTO.java diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/CertifiedDetailFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/CertifiedDetailFormDTO.java new file mode 100644 index 0000000000..51dd48ddd8 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/CertifiedDetailFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-27 13:33 + * 已认证党员详情 + */ +@Data +public class CertifiedDetailFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 党员认证信息表ID + */ + @NotBlank(message = "党员认证信息表ID不能为空") + private String partyMemberId; + + /** + * 党员自动审核表ID + */ + private String autoId; + + /** + * 党员人工审核表ID + */ + private String manualId; + +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedDetailResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedDetailResultDTO.java new file mode 100644 index 0000000000..a14c38629e --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedDetailResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-27 13:37 + * 已认证党员详情 + */ +@Data +public class CertifiedDetailResultDTO implements Serializable { + + private static final long serialVersionUID = -1L; + + /** + * 用户id + */ + private String userId; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 联系手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 认证网格:XXX街道-XXX社区-XXX网格 + */ + private String gridFullPath; + + /** + * 认证方式:自动认证auto、人工认证manual + */ + private String certifyType; + + /** + * 认证时间(提交认证的时间) + */ + private Long applyTime; + + /** + * 注册时间(进入本平台的时间) + */ + private Long certifyTime; + + /** + * 工作单位/所处街道 + */ + private String extraOrganization; + + /** + * 证明联系人 + */ + private String contactPeople; + + /** + * 证明联系人手机号 + */ + private String contactMobile; + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java index de92cc128b..5188fbde8e 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java @@ -5,7 +5,9 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.form.CertifiedDetailFormDTO; import com.epmet.dto.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedDetailResultDTO; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.dto.result.AuditedPartyMemberResultDTO; import com.epmet.dto.result.AuditingPartyMemberResultDTO; @@ -73,6 +75,18 @@ public class ResiPartyMemberController { return resiPartyMemberService.certifiedList(certifiedFormDTO); } + /** + * + * @Description 已认证党员详情 + * @param: formDTO + * @Author zxc + * @CreatedTime 2020/4/27 13:54 + */ + @PostMapping(value = "/certifieddetail") + public Result certifiedDetail(@RequestBody CertifiedDetailFormDTO formDTO){ + return new Result().ok(resiPartyMemberService.certifiedDetail(formDTO)); + } + /** * 审核党员 * diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java index 25b586513b..5d8499704e 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java @@ -2,7 +2,9 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CertifiedDetailFormDTO; import com.epmet.dto.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedDetailResultDTO; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.feign.fallback.ResiPartymemberFeignClientFallBack; import com.epmet.resi.partymember.dto.partymember.form.*; @@ -97,6 +99,16 @@ public interface ResiPartymemberFeignClient { @PostMapping(value = "/resi/partymember/partymemberinfo/certified") Result> certified(@RequestBody CertifiedFormDTO certifiedFormDTO); + /** + * + * @Description 已认证党员详情 + * @param: formDTO + * @Author zxc + * @CreatedTime 2020/4/27 15:22 + */ + @PostMapping(value = "/resi/partymember/partymemberinfo/certifieddetail") + Result certifiedDetail(@RequestBody CertifiedDetailFormDTO formDTO); + /** * 审核党员 * diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java index aedb5b3d0e..acab85141f 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java @@ -3,7 +3,9 @@ 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.form.CertifiedDetailFormDTO; import com.epmet.dto.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedDetailResultDTO; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.feign.ResiPartymemberFeignClient; import com.epmet.resi.partymember.dto.partymember.form.*; @@ -62,6 +64,11 @@ public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignC return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "certified", certifiedFormDTO); } + @Override + public Result certifiedDetail(CertifiedDetailFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "certifiedDetail", formDTO); + } + @Override public Result manualConfirmResult(PartyMemberConfirmFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "manualConfirmResult", fromDTO); diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java index 93512bde0e..f0a2bdb58e 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiPartyMemberService.java @@ -1,14 +1,19 @@ package com.epmet.service; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.form.CertifiedDetailFormDTO; import com.epmet.dto.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedDetailResultDTO; import com.epmet.dto.result.CertifiedResultDTO; import java.util.List; import com.epmet.dto.result.AuditedPartyMemberResultDTO; import com.epmet.dto.result.AuditingPartyMemberResultDTO; +import org.springframework.web.bind.annotation.RequestBody; import com.epmet.resi.partymember.dto.partymember.form.AuditingDetailFromDTO; import com.epmet.resi.partymember.dto.partymember.form.AutoFailedDetailFromDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberConfirmFromDTO; @@ -52,6 +57,16 @@ public interface ResiPartyMemberService { */ Result> certifiedList(CertifiedFormDTO certifiedFormDTO); + + /** + * + * @Description 已认证党员详情 + * @param: formDTO + * @Author zxc + * @CreatedTime 2020/4/27 14:23 + */ + CertifiedDetailResultDTO certifiedDetail(CertifiedDetailFormDTO formDTO); + /** * 人工审核结果 * diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java index a97b886619..68482892fb 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java @@ -6,7 +6,9 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.AuditedPartyMemberFormDTO; import com.epmet.dto.form.AuditingPartyMemberFormDTO; +import com.epmet.dto.form.CertifiedDetailFormDTO; import com.epmet.dto.form.CertifiedFormDTO; +import com.epmet.dto.result.CertifiedDetailResultDTO; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.feign.ResiPartymemberFeignClient; import com.epmet.dto.result.AuditedPartyMemberResultDTO; @@ -83,6 +85,20 @@ public class ResiPartyMemberServiceImpl implements ResiPartyMemberService { return resiPartymemberFeignClient.certified(certifiedFormDTO); } + /** + * + * @Description 已认证党员详情 + * @param: formDTO + * @Author zxc + * @CreatedTime 2020/4/27 13:54 + */ + @Override + public CertifiedDetailResultDTO certifiedDetail(CertifiedDetailFormDTO formDTO) { + CertifiedDetailResultDTO partyMemberDetail = resiPartymemberFeignClient.certifiedDetail(formDTO).getData(); + + return partyMemberDetail; + } + @Override public Result manualConfirmResult(PartyMemberConfirmFromDTO fromDTO) { return resiPartymemberFeignClient.manualConfirmResult(fromDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 012d59d276..e6ac610f3c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -93,7 +93,7 @@ - + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CreatedTimeByUserIdFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CreatedTimeByUserIdFormDTO.java new file mode 100644 index 0000000000..409617bc88 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CreatedTimeByUserIdFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-27 16:08 + */ +@Data +public class CreatedTimeByUserIdFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String userId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CreatedTimeByUserIdResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CreatedTimeByUserIdResultDTO.java new file mode 100644 index 0000000000..d86ec53f57 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CreatedTimeByUserIdResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-27 16:08 + */ +@Data +public class CreatedTimeByUserIdResultDTO implements Serializable { + + private static final long serialVersionUID = -1L; + + /** + * 注册时间 (empet_user库下的user表中的 created_time) + */ + private Long registerTime; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index 6081d38fe1..5a310b3a87 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -8,9 +8,11 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; +import com.epmet.dto.form.CreatedTimeByUserIdFormDTO; import com.epmet.dto.form.PasswordLoginUserInfoFormDTO; import com.epmet.dto.form.WxLoginUserInfoFormDTO; import com.epmet.dto.form.WxUserInfoFormDTO; +import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.service.UserService; import org.springframework.beans.factory.annotation.Autowired; @@ -86,4 +88,15 @@ public class UserController { return userService.updateWxUserInfo(wxUserInfoFormDTO); } + /** + * + * @Description 查询用户注册时间 + * @Author zxc + * @CreatedTime 2020/4/27 16:14 + */ + @PostMapping("selectcreatedtimebyuserid") + public Result createdTimeByUserId(@RequestBody CreatedTimeByUserIdFormDTO formDTO){ + return new Result().ok(userService.createdTimeByUserId(formDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java index a015e34805..62a09ab69e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java @@ -1,6 +1,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.CreatedTimeByUserIdFormDTO; +import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.entity.UserEntity; import org.apache.ibatis.annotations.Mapper; @@ -23,4 +25,14 @@ public interface UserDao extends BaseDao { PasswordLoginUserInfoResultDTO selectOperUserByPhone(String phone); + /** + * + * @Description 查询用户注册时间 + * @param: formDTO + * @Author zxc + * @CreatedTime 2020/4/27 16:17 + */ + CreatedTimeByUserIdResultDTO createdTimeByUserId(CreatedTimeByUserIdFormDTO formDTO); + + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java index 09cd2e5bd1..6a9ea0b96a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java @@ -5,9 +5,11 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; +import com.epmet.dto.form.CreatedTimeByUserIdFormDTO; import com.epmet.dto.form.PasswordLoginUserInfoFormDTO; import com.epmet.dto.form.WxLoginUserInfoFormDTO; import com.epmet.dto.form.WxUserInfoFormDTO; +import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.entity.UserEntity; @@ -55,4 +57,13 @@ public interface UserService extends BaseService { * @Description 居民端个人信息-同步用户微信信息 **/ Result updateWxUserInfo(WxUserInfoFormDTO wxUserInfoFormDTO); + + /** + * + * @Description 查询用户注册时间 + * @param: formDTO + * @Author zxc + * @CreatedTime 2020/4/27 16:14 + */ + CreatedTimeByUserIdResultDTO createdTimeByUserId(CreatedTimeByUserIdFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 3d9e344e2a..d20564dadb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -8,9 +8,11 @@ import com.epmet.dao.UserDao; import com.epmet.dao.UserWechatDao; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; +import com.epmet.dto.form.CreatedTimeByUserIdFormDTO; import com.epmet.dto.form.PasswordLoginUserInfoFormDTO; import com.epmet.dto.form.WxLoginUserInfoFormDTO; import com.epmet.dto.form.WxUserInfoFormDTO; +import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.entity.UserEntity; import com.epmet.entity.UserWechatEntity; @@ -109,4 +111,18 @@ public class UserServiceImpl extends BaseServiceImpl implem userWechatDao.updateByUserId(userWechatDTO); return new Result(); } + + /** + * + * @Description 查询用户注册时间 + * @param: formDTO + * @Author zxc + * @CreatedTime 2020/4/27 16:14 + */ + @Override + public CreatedTimeByUserIdResultDTO createdTimeByUserId(CreatedTimeByUserIdFormDTO formDTO) { + CreatedTimeByUserIdResultDTO registerTime = baseDao.createdTimeByUserId(formDTO); + registerTime.setRegisterTime(registerTime.getRegisterTime() * 1000L); + return registerTime; + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml index 34b509b54d..5d34b7878d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml @@ -15,4 +15,15 @@ AND ou.PHONE = #{phone} + + + From d8f9a6a6f786988877701db6869b7d7aa1d76f56 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 27 Apr 2020 17:20:08 +0800 Subject: [PATCH 139/174] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF-=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BC=98=E5=8C=96-=E4=B8=8D=E5=BC=95=E7=94=A8server?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UserMessageController.java | 3 +-- .../com/epmet/service/UserMessageService.java | 2 +- .../service/impl/UserMessageServiceImpl.java | 5 +++-- .../resi-partymember-server/pom.xml | 6 ------ .../feign/EpmetMessageFeignClient.java | 3 +-- .../EpmetMessageFeignClientFallback.java | 3 +-- .../constant/ResiWarmheartedConstant.java | 2 +- .../impl/ResiWarmheartedApplyServiceImpl.java | 21 +++++++++---------- 8 files changed, 18 insertions(+), 27 deletions(-) rename epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/{ => modules/warmhearted}/constant/ResiWarmheartedConstant.java (75%) diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java index 782ab153dd..9f2ca4aea9 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java @@ -28,7 +28,6 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.UserMessageDTO; import com.epmet.dto.form.MymessageFormDTO; import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.entity.UserMessageEntity; import com.epmet.excel.UserMessageExcel; import com.epmet.service.UserMessageService; import org.springframework.beans.factory.annotation.Autowired; @@ -141,7 +140,7 @@ public class UserMessageController { * @Description 批量插入未读消息 **/ @PostMapping("saveusermessagelist") - public Result saveUserMessageList(@RequestBody List msgList) { + public Result saveUserMessageList(@RequestBody List msgList) { return userMessageService.saveUserMessageList(msgList); } } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java index 7623d45e0d..ca08d47299 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java @@ -134,5 +134,5 @@ public interface UserMessageService extends BaseService { * @Author sun * @Description 批量插入未读消息 **/ - Result saveUserMessageList(List msgList); + Result saveUserMessageList(List msgList); } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java index cdbfe87ead..e5f3a2ba9e 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java @@ -166,8 +166,9 @@ public class UserMessageServiceImpl extends BaseServiceImpl msgList) { - insertBatch(msgList); + public Result saveUserMessageList(List msgList) { + List entityList = ConvertUtils.sourceToTarget(msgList, UserMessageEntity.class); + insertBatch(entityList); return new Result(); } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 80a2fd38cf..ce7eabb912 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -93,12 +93,6 @@ 2.0.0 compile - - com.epmet - epmet-message-server - 0.3.1 - compile - diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java index 21a57747e2..087d63bab0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java @@ -3,7 +3,6 @@ package com.epmet.modules.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.entity.UserMessageEntity; import com.epmet.modules.feign.fallback.EpmetMessageFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -43,6 +42,6 @@ public interface EpmetMessageFeignClient { * @Description 热心居民申请给网格长们发送消息 **/ @PostMapping(value = "message/usermessage/saveusermessagelist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - Result saveUserMessageList(List msgList); + Result saveUserMessageList(List msgList); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java index b356a338b9..2b47ff9a9c 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java @@ -4,7 +4,6 @@ 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.form.UserMessageFormDTO; -import com.epmet.entity.UserMessageEntity; import com.epmet.modules.feign.EpmetMessageFeignClient; import org.springframework.stereotype.Component; @@ -28,7 +27,7 @@ public class EpmetMessageFeignClientFallback implements EpmetMessageFeignClient } @Override - public Result saveUserMessageList(List msgList) { + public Result saveUserMessageList(List msgList) { return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessageList", msgList); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiWarmheartedConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmheartedConstant.java similarity index 75% rename from epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiWarmheartedConstant.java rename to epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmheartedConstant.java index 6945685c92..afc576e837 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiWarmheartedConstant.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmheartedConstant.java @@ -1,4 +1,4 @@ -package com.epmet.constant; +package com.epmet.modules.warmhearted.constant; /** * @author sun diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java index 66dea040aa..4eaef1114e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java @@ -38,7 +38,6 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.AgencyAndStaffsResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; -import com.epmet.entity.UserMessageEntity; import com.epmet.modules.feign.EpmetMessageFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; @@ -257,19 +256,19 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl> resultList = epmetUserFeignClient.getStaffsInRole(staffRoleFormDTO); List roleList = resultList.getData(); //3:遍历找出当前网格的所有网格长并给网格长发消息 - List msgList = new ArrayList<>(); + List msgList = new ArrayList<>(); staffList.forEach(staff->{ roleList.forEach(role->{ if(staff.getUserId().equals(role.getStaffId())){ - UserMessageEntity msgEntity = new UserMessageEntity(); - msgEntity.setCustomerId(formDTO.getCustomerId()); - msgEntity.setGridId(formDTO.getGridId()); - msgEntity.setUserId(staff.getUserId()); - msgEntity.setApp(formDTO.getApp()); - msgEntity.setTitle(ResiWarmUserMessageConstant.GROUP_TITLE); - msgEntity.setMessageContent(formDTO.getMessageText()); - msgEntity.setReadFlag(ReadFlagConstant.UN_READ); - msgList.add(msgEntity); + UserMessageFormDTO msgDTO = new UserMessageFormDTO(); + msgDTO.setCustomerId(formDTO.getCustomerId()); + msgDTO.setGridId(formDTO.getGridId()); + msgDTO.setUserId(staff.getUserId()); + msgDTO.setApp(formDTO.getApp()); + msgDTO.setTitle(ResiWarmUserMessageConstant.GROUP_TITLE); + msgDTO.setMessageContent(formDTO.getMessageText()); + msgDTO.setReadFlag(ReadFlagConstant.UN_READ); + msgList.add(msgDTO); } }); }); From c029d692934b0b77bf3bc96456e483cc98a85cea Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 27 Apr 2020 17:45:52 +0800 Subject: [PATCH 140/174] =?UTF-8?q?=E7=BB=84=E7=BB=87-=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=20bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/StaffInfoResultDTO.java | 2 ++ .../java/com/epmet/dto/result/StaffRoleResultDTO.java | 7 ++++++- .../main/java/com/epmet/controller/StaffController.java | 7 ++----- .../main/java/com/epmet/feign/EpmetUserFeignClient.java | 2 +- .../feign/fallback/EpmetUserFeignClientFallBack.java | 2 +- .../src/main/java/com/epmet/service/StaffService.java | 7 ++----- .../java/com/epmet/service/impl/StaffServiceImpl.java | 9 +++------ .../com/epmet/controller/CustomerStaffController.java | 8 ++------ .../java/com/epmet/service/CustomerStaffService.java | 8 ++------ .../com/epmet/service/impl/CustomerStaffServiceImpl.java | 8 +++----- .../src/main/resources/mapper/CustomerStaffDao.xml | 3 ++- 11 files changed, 26 insertions(+), 37 deletions(-) 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 index 2859c1171a..3e6647a9a0 100644 --- 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 @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; import java.io.Serializable; @@ -34,5 +35,6 @@ public class StaffInfoResultDTO implements Serializable { /** * 权限名 */ + @JsonInclude(JsonInclude.Include.NON_NULL) private String roleName; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffRoleResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffRoleResultDTO.java index eea1e50dbe..987cde9e3e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffRoleResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffRoleResultDTO.java @@ -1,6 +1,6 @@ package com.epmet.dto.result; -import lombok.Builder; +import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; import java.io.Serializable; @@ -21,8 +21,13 @@ public class StaffRoleResultDTO implements Serializable { * 角色名称 */ private String roleName; + /** + * true,false专职可选全部 + */ + private String fullTimeOnly; /** * 是否选中(选中的是true) */ + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean selected; } 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 index 6964cffec3..39bb61a691 100644 --- 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 @@ -8,10 +8,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.result.StaffDetailResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; -import com.epmet.dto.result.StaffInitResultDTO; -import com.epmet.dto.result.StaffsInAgencyResultDTO; +import com.epmet.dto.result.*; import com.epmet.service.StaffService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -61,7 +58,7 @@ public class StaffController { * @return Result */ @PostMapping("rolelist") - public Result addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + public Result> addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ return staffService.addStaffInit(fromDTO); } 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 9f9638ae34..6680257b47 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 @@ -83,7 +83,7 @@ public interface EpmetUserFeignClient { * @return Result */ @PostMapping("/epmetuser/customerstaff/rolelist") - Result addStaffInit(@RequestBody StaffInfoFromDTO fromDTO); + Result> addStaffInit(@RequestBody StaffInfoFromDTO 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 639d83d1b5..7765bda523 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 @@ -63,7 +63,7 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { } @Override - public Result addStaffInit(StaffInfoFromDTO fromDTO) { + public Result> addStaffInit(StaffInfoFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaffInit", fromDTO); } 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 index e11e8edecb..09e783e520 100644 --- 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 @@ -5,10 +5,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.result.StaffDetailResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; -import com.epmet.dto.result.StaffInitResultDTO; -import com.epmet.dto.result.StaffsInAgencyResultDTO; +import com.epmet.dto.result.*; import java.util.List; @@ -43,7 +40,7 @@ public interface StaffService { * @param fromDTO 参数 * @return Result */ - Result addStaffInit(StaffInfoFromDTO fromDTO); + Result> addStaffInit(StaffInfoFromDTO fromDTO); /** * 人员编辑页面初始化 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 index dcdb8087f7..3cff5ccff6 100644 --- 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 @@ -8,10 +8,7 @@ import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.result.StaffDetailResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; -import com.epmet.dto.result.StaffInitResultDTO; -import com.epmet.dto.result.StaffsInAgencyResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.EpmetUserFeignClient; @@ -53,7 +50,7 @@ public class StaffServiceImpl implements StaffService { resultDTO.setStaffCount(0); return new Result().ok(resultDTO); } - resultDTO.setStaffCount(customerAgencyEntity.getTotalUser()); + resultDTO.setStaffCount(customerAgencyEntity.getTotalUser() == null ? 0 : customerAgencyEntity.getTotalUser()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); List customerStaffAgencyList = customerStaffAgencyService.getCustomerStaffAgencyList(fromDTO).getData(); if (null == customerStaffAgencyList || customerStaffAgencyList.size() == 0) { @@ -89,7 +86,7 @@ public class StaffServiceImpl implements StaffService { } @Override - public Result addStaffInit(StaffInfoFromDTO fromDTO) { + public Result> addStaffInit(StaffInfoFromDTO fromDTO) { CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); return epmetUserFeignClient.addStaffInit(fromDTO); 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 37d59a6225..bc9166904b 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 @@ -31,15 +31,11 @@ import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.DepartInStaffListResultDTO; -import com.epmet.dto.result.StaffDetailResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; -import com.epmet.dto.result.StaffInitResultDTO; +import com.epmet.dto.result.*; 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.result.CommonStaffInfoResultDTO; import com.epmet.excel.CustomerStaffExcel; import com.epmet.service.CustomerStaffService; import org.springframework.beans.factory.annotation.Autowired; @@ -197,7 +193,7 @@ public class CustomerStaffController { * @return Result */ @PostMapping("rolelist") - public Result addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + public Result> addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ return customerStaffService.addStaffInit(fromDTO); } 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 67a4b279ef..65e4bcdd76 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 @@ -32,11 +32,7 @@ import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.result.StaffDetailResultDTO; -import com.epmet.dto.result.DepartInStaffListResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; -import com.epmet.dto.result.StaffInitResultDTO; -import com.epmet.dto.result.CommonStaffInfoResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerStaffEntity; import java.util.List; @@ -165,7 +161,7 @@ public interface CustomerStaffService extends BaseService { * @param fromDTO 参数 * @return Result */ - Result addStaffInit(StaffInfoFromDTO fromDTO); + Result> addStaffInit(StaffInfoFromDTO fromDTO); /** * 人员编辑页面初始化 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 28e22a28f7..eba870a094 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 @@ -201,13 +201,12 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl addStaffInit(StaffInfoFromDTO fromDTO) { - StaffInitResultDTO resultDTO = new StaffInitResultDTO(); + public Result> addStaffInit(StaffInfoFromDTO fromDTO) { GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); if (null == roleList || roleList.size() == 0) { - return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } List staffRoleList = roleList.stream().map(p -> { StaffRoleResultDTO staffRoleResultDTO = new StaffRoleResultDTO(); @@ -215,8 +214,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().ok(resultDTO); + return new Result>().ok(staffRoleList); } @Override 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 f322594f33..a0acecdc79 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 @@ -64,7 +64,7 @@ cs.GENDER AS "gender", IFNULL( cs.HEAD_PHOTO, "" ) AS "staffHeadPhoto", cs.ENABLE_FLAG AS "enableFlag", - role.ROLE_NAME AS "roleName" + IFNULL( role.ROLE_NAME, "" ) AS "roleName" FROM customer_staff cs LEFT JOIN ( @@ -85,6 +85,7 @@ WHERE cs.DEL_FLAG = '0' AND cs.CUSTOMER_ID = #{customerId} + AND cs.ENABLE_FLAG = 'enable' AND cs.USER_ID IN #{userId} From 3fabcbfa329034845b064dfc92c1eb2510f9f1a6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Apr 2020 18:03:03 +0800 Subject: [PATCH 141/174] =?UTF-8?q?message=E3=80=81user=E3=80=81grid?= =?UTF-8?q?=E3=80=81org=E3=80=81resigroup=E3=80=81resipartymember=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-message/epmet-message-server/docker-compose.yml | 2 +- epmet-module/epmet-message/epmet-message-server/pom.xml | 2 +- epmet-module/gov-grid/gov-grid-server/docker-compose.yml | 2 +- epmet-module/gov-grid/gov-grid-server/pom.xml | 2 +- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- epmet-module/resi-group/resi-group-server/docker-compose.yml | 2 +- epmet-module/resi-group/resi-group-server/pom.xml | 2 +- .../resi-partymember/resi-partymember-server/docker-compose.yml | 2 +- epmet-module/resi-partymember/resi-partymember-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/epmet-module/epmet-message/epmet-message-server/docker-compose.yml b/epmet-module/epmet-message/epmet-message-server/docker-compose.yml index 76db1b8a99..4acd697b6a 100644 --- a/epmet-module/epmet-message/epmet-message-server/docker-compose.yml +++ b/epmet-module/epmet-message/epmet-message-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-message-server: container_name: epmet-message-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-message-server:0.3.1 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-message-server:0.3.2 ports: - "8085:8085" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index b713085343..46bb33b442 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.1 + 0.3.2 com.epmet epmet-message diff --git a/epmet-module/gov-grid/gov-grid-server/docker-compose.yml b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml index 3dd48a1e3b..5f40c06efc 100644 --- a/epmet-module/gov-grid/gov-grid-server/docker-compose.yml +++ b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-grid-server: container_name: gov-grid-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.3 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.4 ports: - "8097:8097" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index a784496cac..eb06fbbca2 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-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"> 4.0.0 - 0.3.3 + 0.3.4 com.epmet gov-grid diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 25761f4458..566bd36622 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.8 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.9 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 0b163e1d1a..abe230bea2 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.8 + 0.3.9 com.epmet gov-org diff --git a/epmet-module/resi-group/resi-group-server/docker-compose.yml b/epmet-module/resi-group/resi-group-server/docker-compose.yml index 4dcf9c6a7e..687b044179 100644 --- a/epmet-module/resi-group/resi-group-server/docker-compose.yml +++ b/epmet-module/resi-group/resi-group-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-group-server:0.3.2 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-group-server:0.3.3 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index fb3332aeb1..b246579931 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.2 + 0.3.3 com.epmet resi-group diff --git a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml index 99851f497e..537e65d4f2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.2 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.3 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index ce7eabb912..4105f82ebd 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.2 + 0.3.3 com.epmet resi-partymember diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index 2d1edbff2b..9f0a4bfaf7 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.6 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.7 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index c1773add7f..b45cc78623 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.6 + 0.3.7 com.epmet epmet-user From fadbd9d73b67fd497fde08d034ab42315030df1e Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 27 Apr 2020 18:07:55 +0800 Subject: [PATCH 142/174] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=E5=85=9A?= =?UTF-8?q?=E5=91=98=E8=AE=A4=E8=AF=81=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/ResiPartyMemberController.java | 2 +- .../main/java/com/epmet/feign/ResiPartymemberFeignClient.java | 2 +- .../partymember/controller/PartyMemberConfirmController.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java index 5188fbde8e..86b3380ce0 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java @@ -118,7 +118,7 @@ public class ResiPartyMemberController { * @return Result * @author zhaoqifeng */ - @PostMapping("auditingdetail") + @PostMapping("autofaileddetail") public Result autoFailedDetail(@RequestBody AutoFailedDetailFromDTO fromDTO) { return resiPartyMemberService.autoFailedDetail(fromDTO); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java index 5d8499704e..c5be8fc73a 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java @@ -135,7 +135,7 @@ public interface ResiPartymemberFeignClient { * @return Result * @author zhaoqifeng */ - @PostMapping("/resi/partymember/confirm/auditingdetail") + @PostMapping("/resi/partymember/confirm/autofaileddetail") Result autoFailedDetail(@RequestBody AutoFailedDetailFromDTO fromDTO); /** diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberConfirmController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberConfirmController.java index 63dde1c984..58d4d2edc2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberConfirmController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyMemberConfirmController.java @@ -108,7 +108,7 @@ public class PartyMemberConfirmController { * @param fromDTO 参数 * @return Result */ - @PostMapping("auditingdetail") + @PostMapping("autofaileddetail") public Result autoFailedDetail(@RequestBody AutoFailedDetailFromDTO fromDTO) { return partyMemberConfirmService.autoFailedDetail(fromDTO); } From 903f99b35c93b24f38493c5e14af9cfc12edb910 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 27 Apr 2020 18:21:08 +0800 Subject: [PATCH 143/174] =?UTF-8?q?gov/org//staff/rolelist=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=AF=B9=E8=B1=A1=E4=B8=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0fulltimeonly=E5=AD=97=E6=AE=B5=E4=B8=94=E7=94=B1sort?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/RoleInfoResultDTO.java | 32 +++++++++++++++++++ .../epmet/dto/result/StaffRoleResultDTO.java | 2 +- .../com/epmet/controller/StaffController.java | 2 +- .../epmet/dao/CustomerStaffDepartmentDao.java | 10 ++++++ .../com/epmet/dao/CustomerStaffGridDao.java | 9 ++++++ .../com/epmet/feign/EpmetUserFeignClient.java | 2 +- .../EpmetUserFeignClientFallBack.java | 2 +- .../java/com/epmet/service/StaffService.java | 2 +- .../service/impl/CustomerGridServiceImpl.java | 18 ++++++++--- .../service/impl/DepartmentServiceImpl.java | 3 +- .../epmet/service/impl/StaffServiceImpl.java | 2 +- .../java/com/epmet/util/ModuleConstant.java | 5 +++ .../mapper/CustomerStaffDepartmentDao.xml | 20 +++++++++++- .../resources/mapper/CustomerStaffGridDao.xml | 22 ++++++++++++- .../java/com/epmet/dto/GovStaffRoleDTO.java | 10 ++++++ .../controller/CustomerStaffController.java | 2 +- .../com/epmet/entity/GovStaffRoleEntity.java | 10 ++++++ .../epmet/service/CustomerStaffService.java | 2 +- .../impl/CustomerStaffServiceImpl.java | 19 +++++++---- .../resources/db/migration/epmet_user.sql | 9 +++++- .../main/resources/mapper/GovStaffRoleDao.xml | 1 + 21 files changed, 161 insertions(+), 23 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java new file mode 100644 index 0000000000..c2378a87a5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName RoleInfoResultDTO + * @Author wangc + * @date 2020.04.27 17:46 + */ +@Data +public class RoleInfoResultDTO implements Serializable{ + private static final long serialVersionUID = 8792889063740125006L; + + /** + * 角色ID + */ + private String roleId; + /** + * 角色名称 + */ + private String roleName; + + /** + * FULL_TIME_ONLY + * */ + @JsonInclude(JsonInclude.Include.NON_NULL) + private Boolean fullTimeOnly = false; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffRoleResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffRoleResultDTO.java index 987cde9e3e..9d596bca43 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffRoleResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffRoleResultDTO.java @@ -24,7 +24,7 @@ public class StaffRoleResultDTO implements Serializable { /** * true,false专职可选全部 */ - private String fullTimeOnly; + private Boolean fullTimeOnly; /** * 是否选中(选中的是true) */ 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 index 39bb61a691..9f9109a7ba 100644 --- 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 @@ -58,7 +58,7 @@ public class StaffController { * @return Result */ @PostMapping("rolelist") - public Result> addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + public Result> addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ return staffService.addStaffInit(fromDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java index 2f103d1daf..0c6fc36a4b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerStaffDepartmentDTO; import com.epmet.entity.CustomerStaffDepartmentEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -48,4 +49,13 @@ public interface CustomerStaffDepartmentDao extends BaseDao { * @Date 2020.04.26 14:57 **/ void insertBatch(List list); + + /** + * @Description 根据员工Id和网格Id修改网格工作人员信息 + * @Param CustomerStaffGridDTO + * @return + * @Author wangc + * @Date 2020.04.27 16:43 + **/ + void updateByStaffIdAndGridId(CustomerStaffGridDTO staffGridDTO); } \ 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 6680257b47..e66536b9ef 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 @@ -83,7 +83,7 @@ public interface EpmetUserFeignClient { * @return Result */ @PostMapping("/epmetuser/customerstaff/rolelist") - Result> addStaffInit(@RequestBody StaffInfoFromDTO fromDTO); + Result> addStaffInit(@RequestBody StaffInfoFromDTO 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 7765bda523..f0f56a90c0 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 @@ -63,7 +63,7 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { } @Override - public Result> addStaffInit(StaffInfoFromDTO fromDTO) { + public Result> addStaffInit(StaffInfoFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaffInit", fromDTO); } 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 index 09e783e520..fc4a17f93d 100644 --- 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 @@ -40,7 +40,7 @@ public interface StaffService { * @param fromDTO 参数 * @return Result */ - Result> addStaffInit(StaffInfoFromDTO fromDTO); + Result> addStaffInit(StaffInfoFromDTO fromDTO); /** * 人员编辑页面初始化 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index b5a83ee724..4e4af80612 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -297,6 +297,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl authResult = authenticateManager(staffInfoFormDTO.getGridId(),staffInfoFormDTO.getUserId()); @@ -308,7 +309,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl authResult = authenticateManager(staffListFormDTO.getGridId(),staffListFormDTO.getUserId()); @@ -338,13 +342,17 @@ public class CustomerGridServiceImpl extends BaseServiceImpl staffIds = new HashSet<>(staffListFormDTO.getSelectedList()); staffIds.removeAll(existedStaffIds); + if(staffIds.size() <= NumConstant.ZERO){ + log.error(ModuleConstant.NO_APPROPRIATE_STAFF_TO_ADD); + return new Result(); + } //3.校验人员是否被禁用 Result> staffsFeignResult = epmetUserFeignClient.enableStaffMsgList(new CommonUserIdListFormDTO( new ArrayList<>(staffIds), authResult.getData().getCustomerId() )); - if(staffsFeignResult.success() && null != staffsFeignResult.getData() && staffsFeignResult.getData().size() > 0){ + if(staffsFeignResult.success() && null != staffsFeignResult.getData() && staffsFeignResult.getData().size() > NumConstant.ZERO){ //4.添加 List validStaffIds = staffsFeignResult.getData() @@ -352,7 +360,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl staffs2Insert = new LinkedList<>(); - for(String id : validStaffIds){ + validStaffIds.forEach(id -> { CustomerStaffGridDTO staff2Insert = new CustomerStaffGridDTO(); staff2Insert.setUserId(id); staff2Insert.setGridId(staffListFormDTO.getGridId()); @@ -360,9 +368,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> addStaffInit(StaffInfoFromDTO fromDTO) { + public Result> addStaffInit(StaffInfoFromDTO fromDTO) { CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); return epmetUserFeignClient.addStaffInit(fromDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java index 345909e3ec..7cfdbed0a1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -51,4 +51,9 @@ public interface ModuleConstant { * 找不到相关部门信息 * */ String DEPT_INFO_NOT_FOUND = "找不到相关部门信息"; + + /** + * 没有可添加的人员 + * */ + String NO_APPROPRIATE_STAFF_TO_ADD = "没有可添加的人员(可能原因:选中人员已在网格内),终止操作。"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 6f13998784..09271d9e95 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -24,5 +24,23 @@ id = #{departmentId} - + + + UPDATE CUSTOMER_STAFF_DEPARTMENT + + + DEL_FLAG = #{delFlag}, + + + UPDATED_BY = #{updatedBy}, + + UPDATED_DATE = NOW() + + WHERE + DEL_FLAG = '0' + AND + DEPARTMENT_ID = #{departmentId} + AND + USER_ID = #{userId} + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 5e4c9bd1a3..882c0132f7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -49,7 +49,7 @@ CUSTOMER_STAFF_GRID WHERE DEL_FLAG = '0' - AND GRID_ID = #{gird} + AND GRID_ID = #{gridId} #{userId} @@ -86,4 +86,24 @@ ) + + + + UPDATE CUSTOMER_STAFF_GRID + + + DEL_FLAG = #{delFlag}, + + + UPDATED_BY = #{updatedBy}, + + UPDATED_TIME = NOW() + + WHERE + USER_ID = #{userId} + AND + GRID_ID = #{gridId} + AND + DEL_FLAG = 0 + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java index 9bc2f4c4de..7021efac58 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GovStaffRoleDTO.java @@ -58,6 +58,16 @@ public class GovStaffRoleDTO implements Serializable { */ private String orgType; + /** + * 是否只有全职 + * */ + private Boolean fullTimeOnly; + + /** + * 排序 + * */ + private Integer sort; + /** * */ 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 bc9166904b..b4f863d253 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 @@ -193,7 +193,7 @@ public class CustomerStaffController { * @return Result */ @PostMapping("rolelist") - public Result> addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + public Result> addStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ return customerStaffService.addStaffInit(fromDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java index 80ee011dcd..6950c65256 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java @@ -58,4 +58,14 @@ public class GovStaffRoleEntity extends BaseEpmetEntity { */ private String orgType; + /** + * 是否只有全职 + * */ + private Boolean fullTimeOnly; + + /** + * 排序 + * */ + private Integer sort; + } 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 65e4bcdd76..21b2a2b1a9 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 @@ -161,7 +161,7 @@ public interface CustomerStaffService extends BaseService { * @param fromDTO 参数 * @return Result */ - Result> addStaffInit(StaffInfoFromDTO fromDTO); + Result> addStaffInit(StaffInfoFromDTO fromDTO); /** * 人员编辑页面初始化 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 eba870a094..c7049bfaf8 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 @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -201,20 +202,22 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> addStaffInit(StaffInfoFromDTO fromDTO) { + public Result> addStaffInit(StaffInfoFromDTO fromDTO) { GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); + if (null == roleList || roleList.size() == 0) { - return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } - List staffRoleList = roleList.stream().map(p -> { - StaffRoleResultDTO staffRoleResultDTO = new StaffRoleResultDTO(); + List staffRoleList = roleList.stream().map(p -> { + RoleInfoResultDTO staffRoleResultDTO = new RoleInfoResultDTO(); staffRoleResultDTO.setRoleId(p.getId()); staffRoleResultDTO.setRoleName(p.getRoleName()); + staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); return staffRoleResultDTO; }).collect(Collectors.toList()); - return new Result>().ok(staffRoleList); + return new Result>().ok(staffRoleList); } @Override @@ -410,7 +413,11 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> getEnableStaffMsgList(CommonUserIdListFormDTO userIdList) { - return new Result>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList(),userIdList.getCustomerId())); + if (userIdList.getUserIdList().size() <= NumConstant.ZERO) { + return new Result>().ok(new ArrayList<>()); + } + + return new Result>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList(),userIdList.getCustomerId())); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql index 4ff85ae479..da3753e9c6 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql @@ -143,4 +143,11 @@ INSERT INTO `gov_staff_role_template` VALUES ('8', 'grid_member', '网格员', N -- --2020-04-26 ALTER TABLE customer_staff MODIFY COLUMN `EMAIL` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱' ; -ALTER TABLE customer_staff MODIFY COLUMN `ADDRESS` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址'; \ No newline at end of file +ALTER TABLE customer_staff MODIFY COLUMN `ADDRESS` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址'; + + +-- --2020-04-27 +ALTER TABLE GOV_STAFF_ROLE ADD ( + FULL_TIME_ONLY tinyint(1) DEFAULT NULL COMMENT '是否只有全职 1对应true 0对应false', + SORT INT DEFAULT NULL COMMENT '排序' +); \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 14fe8a45ca..e5c4449733 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -38,5 +38,6 @@ DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND ORG_TYPE = 'agency' + ORDER BY SORT ASC \ No newline at end of file From 3713ce9300266007b00aa7ed19ec5296f7f062f4 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Mon, 27 Apr 2020 18:33:56 +0800 Subject: [PATCH 144/174] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=AF=AB=E7=A7=92=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/result/CertifiedResultDTO.java | 2 +- .../partymember/service/impl/PartymemberInfoServiceImpl.java | 3 +++ .../src/main/java/com/epmet/dto/result/CertifiedResultDTO.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java index db42fbe84d..ca3e6fd8c1 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java @@ -32,7 +32,7 @@ public class CertifiedResultDTO implements Serializable { /** * applyTime 申请时间 */ - private Integer applyTime; + private Long applyTime; /** * 提交网格:XXX街道-XXX社区-XXX网格 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java index 6fd860c6c2..741f2c505b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java @@ -144,6 +144,9 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl certified(CertifiedFormDTO certifiedFormDTO) { certifiedFormDTO.setPageNo(certifiedFormDTO.getPageNo() - NumConstant.ONE); List certifiedResultDTOS = partyMemberInfoDao.selectCertifiedList(certifiedFormDTO); + for (CertifiedResultDTO certifiedResultDTO : certifiedResultDTOS) { + certifiedResultDTO.setApplyTime(certifiedResultDTO.getApplyTime()*1000L); + } if (certifiedResultDTOS.size()==0){ return new ArrayList<>(); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java index db42fbe84d..ca3e6fd8c1 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertifiedResultDTO.java @@ -32,7 +32,7 @@ public class CertifiedResultDTO implements Serializable { /** * applyTime 申请时间 */ - private Integer applyTime; + private Long applyTime; /** * 提交网格:XXX街道-XXX社区-XXX网格 From 4d9ec910771a8f09b3b77612158d66d45ff64058 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 09:23:16 +0800 Subject: [PATCH 145/174] =?UTF-8?q?user=E3=80=81govgrid=E3=80=81govorg?= =?UTF-8?q?=E3=80=81resipartymember=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-grid/gov-grid-server/docker-compose.yml | 2 +- epmet-module/gov-grid/gov-grid-server/pom.xml | 2 +- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- .../resi-partymember/resi-partymember-server/docker-compose.yml | 2 +- epmet-module/resi-partymember/resi-partymember-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-server/docker-compose.yml b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml index 5f40c06efc..298855f42a 100644 --- a/epmet-module/gov-grid/gov-grid-server/docker-compose.yml +++ b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-grid-server: container_name: gov-grid-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.4 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.5 ports: - "8097:8097" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index eb06fbbca2..2fba18c767 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-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"> 4.0.0 - 0.3.4 + 0.3.5 com.epmet gov-grid diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 566bd36622..1e52769fd4 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.9 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.10 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index abe230bea2..dd2bd83b35 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.9 + 0.3.10 com.epmet gov-org diff --git a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml index 537e65d4f2..301889b368 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.3 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.4 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 4105f82ebd..4fef6fe526 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.3 + 0.3.4 com.epmet resi-partymember diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index 9f0a4bfaf7..87cf4c15ed 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.7 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.8 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index b45cc78623..bb50a92b8d 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.7 + 0.3.8 com.epmet epmet-user From 0dab31832735cd81e528589100797db2c2debeac Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 28 Apr 2020 09:56:05 +0800 Subject: [PATCH 146/174] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98=E6=8E=A5=E5=8F=A3=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0requestMapping?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/DepartmentController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java index 0e2058eeb7..c521ddc15d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -134,6 +134,7 @@ public class DepartmentController { * @Author wangc * @Date 2020.04.26 17:09 **/ + @PostMapping("removestaff") public Result removeStaff(@LoginUser TokenDto tokenDto,@RequestBody CommonDepartmentStaffInfoFormDTO departmentStaffInfoFormDTO){ departmentStaffInfoFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(departmentStaffInfoFormDTO); From f12cb631f65a5743d841910a1c456aaf32d5e47e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 10:00:03 +0800 Subject: [PATCH 147/174] =?UTF-8?q?gov-org0.3.11=E5=8F=91=E5=B8=83?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E4=B8=80=E5=87=BA=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98=E6=8E=A5=E5=8F=A3404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 1e52769fd4..07bee51e25 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.10 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.11 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index dd2bd83b35..332f02a372 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.10 + 0.3.11 com.epmet gov-org From 3b8e986e2efbc5c55b27d0125c3d1e18eca02f71 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 28 Apr 2020 10:23:15 +0800 Subject: [PATCH 148/174] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E7=A6=81=E7=94=A8=E8=87=AA=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/exception/EpmetErrorCode.java | 3 ++- .../src/main/java/com/epmet/controller/StaffController.java | 4 ++-- .../src/main/java/com/epmet/service/StaffService.java | 2 +- .../main/java/com/epmet/service/impl/StaffServiceImpl.java | 5 ++++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 948e607ed1..38e7eeeae5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -38,7 +38,8 @@ public enum EpmetErrorCode { NOT_ADD_GRID(8401,"您当前的网格名称已存在,请重新修改"), MOBILE_USED(8402,"该手机号已注册"), STAFF_ADD_FAILED(8403,"人员添加失败"), - STAFF_EDIT_FAILED(8404,"人员编辑失败"); + STAFF_EDIT_FAILED(8404,"人员编辑失败"), + CANNOT_DISABLE_YOURSELF(8405,"您不能禁用自己"),; private int code; private String msg; 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 index 9f9109a7ba..79da9b903b 100644 --- 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 @@ -113,7 +113,7 @@ public class StaffController { * @return Result */ @PostMapping("disabledstaff") - public Result disabledStaff(@RequestBody StaffInfoFromDTO fromDTO){ - return staffService.disabledStaff(fromDTO); + public Result disabledStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffInfoFromDTO fromDTO){ + return staffService.disabledStaff(tokenDto, fromDTO); } } 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 index fc4a17f93d..5f36f85c12 100644 --- 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 @@ -80,6 +80,6 @@ public interface StaffService { * @param fromDTO 参数 * @return Result */ - Result disabledStaff(StaffInfoFromDTO fromDTO); + Result disabledStaff(TokenDto tokenDto, StaffInfoFromDTO fromDTO); } 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 index d9d57bd34a..6db7038395 100644 --- 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 @@ -151,7 +151,10 @@ public class StaffServiceImpl implements StaffService { } @Override - public Result disabledStaff(StaffInfoFromDTO fromDTO) { + public Result disabledStaff(TokenDto tokenDto, StaffInfoFromDTO fromDTO) { + if (tokenDto.getUserId().equals(fromDTO.getStaffId())) { + return new Result().error(EpmetErrorCode.CANNOT_DISABLE_YOURSELF.getCode(), EpmetErrorCode.CANNOT_DISABLE_YOURSELF.getMsg()); + } return epmetUserFeignClient.disabledStaff(fromDTO); } } From 32d8f9ee8419b6f78ae6aa71a48da16c3dabb2e2 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 28 Apr 2020 10:24:03 +0800 Subject: [PATCH 149/174] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E4=B8=8B=E4=BA=BA=E5=91=98=E8=A7=92=E8=89=B2=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E7=BB=84=E7=BB=87Id,=E4=B8=8D=E8=83=BD=E7=94=A8=E9=83=A8?= =?UTF-8?q?=E9=97=A8Id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/DepartmentServiceImpl.java | 1 + .../java/com/epmet/dto/form/DepartmentInStaffFormDTO.java | 5 +++++ .../com/epmet/service/impl/CustomerStaffServiceImpl.java | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java index 15cde80e98..07dcc028ee 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -168,6 +168,7 @@ public class DepartmentServiceImpl implements DepartmentService { } DepartmentInStaffFormDTO departmentInStaffFormDTO = new DepartmentInStaffFormDTO(); //部门Id用于查询部门领导角色使用 + departmentInStaffFormDTO.setAgencyId(entity.getAgencyId()); departmentInStaffFormDTO.setDepartmentId(formDTO.getDepartmentId()); departmentInStaffFormDTO.setCustomerId(entity.getCustomerId()); departmentInStaffFormDTO.setUserIdList(userIdList); diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java index 5810659515..bad1e30b62 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java @@ -14,6 +14,11 @@ public class DepartmentInStaffFormDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 组织Id + */ + private String agencyId; + /** * 部门Id */ 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 c7049bfaf8..7b7603b823 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 @@ -382,9 +382,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { //1:根据userId集合查询人员基本信息 List staffList = baseDao.selectDepartmentStaffList(formDTO); - //2:根据部门Id查询部门下是领导角色的用户 + //2:根据组织Id查询部门下是领导角色的用户 StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); - staffRoleFormDTO.setOrgId(formDTO.getDepartmentId()); + staffRoleFormDTO.setOrgId(formDTO.getAgencyId()); staffRoleFormDTO.setRoleKey(UserRoleConstant.DEPT_LEADER); List staffRoleDTOS = staffRoleService.listStaffsInRole(UserRoleConstant.DEPT_LEADER, formDTO.getDepartmentId(), DataScope.getDefault()); staffRoleDTOS.forEach(roleDto -> { From 9bbc18a1091fddbb42257101676ffcb4794ee31d Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 28 Apr 2020 10:27:35 +0800 Subject: [PATCH 150/174] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=EF=BC=9A=E9=83=A8?= =?UTF-8?q?=E5=88=86sql=E8=AF=AD=E5=8F=A5=E6=B2=A1=E6=9C=89=E5=8A=A0del=5F?= =?UTF-8?q?flag=3D0=E7=9A=84=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/OperationScopeDao.xml | 2 ++ .../src/main/resources/mapper/RoleOperationDao.xml | 2 ++ .../src/main/resources/mapper/GovStaffRoleDao.xml | 1 + .../src/main/resources/mapper/StaffRoleDao.xml | 2 ++ 4 files changed, 7 insertions(+) diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml index ab6839e941..8b07df685d 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml @@ -23,6 +23,8 @@ on (rs.SCOPE_KEY = os.SCOPE_KEY) where rs.ROLE_ID = #{roleId} and rs.OPERATION_KEY = #{operationKey} + and rs.DEL_FLAG = '0' + and os.DEL_FLAG = '0' diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDao.xml index 0845fc5202..ebde0d7c2c 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDao.xml @@ -27,6 +27,8 @@ INNER JOIN operation o ON ( ro.OPERATION_KEY = o.OPERATION_KEY ) WHERE ro.ROLE_ID = #{roleId} + and ro.DEL_FLAG = '0' + and o.DEL_FLAG = '0' diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index e5c4449733..d3de570592 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -28,6 +28,7 @@ sr.STAFF_ID = #{staffId} AND sr.ORG_ID = #{orgId} AND sr.DEL_FLAG = '0' + AND r.DEL_FLAG = '0' From 7e3b2b5e71244bbcfe4d6c9436ede8beb8387ca1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 10:39:05 +0800 Subject: [PATCH 151/174] =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/StaffAgencyController.java | 4 +++- .../controller/PartymemberBaseInfoController.java | 6 ++++-- .../com/epmet/controller/StaffGridVisitedController.java | 3 ++- .../java/com/epmet/controller/UserInvitationController.java | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java index 67ace77271..3c77f93e23 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java @@ -77,10 +77,12 @@ public class StaffAgencyController { * @Date 2020/4/23 10:34 **/ @PostMapping("switchgrid") - public Result switchGrid(@LoginUser TokenDto tokenDto, @RequestBody @Valid SwitchGridFormDTO switchGridFormDTO) { + public Result switchGrid(@LoginUser TokenDto tokenDto, @RequestBody SwitchGridFormDTO switchGridFormDTO) { switchGridFormDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(switchGridFormDTO); return staffAgencyService.switchGrid(switchGridFormDTO); } + /** * @Description 得到工作人员最后一次登录的网格 * @Param TokenDto -> userId/staffId diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java index ac20a61f89..438594f0b3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java @@ -104,7 +104,8 @@ public class PartymemberBaseInfoController { * @Date 2020/4/26 20:35 **/ @PostMapping("auditing") - public Result> auditing(@RequestBody @Valid UnderReviewParyMemberFormDTO formDTO){ + public Result> auditing(@RequestBody UnderReviewParyMemberFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); return partymemberBaseInfoService.auditing(formDTO); } @@ -116,7 +117,8 @@ public class PartymemberBaseInfoController { * @Date 2020/4/26 23:40 **/ @PostMapping("audited") - public Result> audited(@RequestBody @Valid ReviewedParyMemberFormDTO formDTO){ + public Result> audited(@RequestBody ReviewedParyMemberFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); return partymemberBaseInfoService.audited(formDTO); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java index 2e8dc01c3f..c79e3439b2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java @@ -67,7 +67,8 @@ public class StaffGridVisitedController { * @Date 2020/4/23 11:19 **/ @PostMapping("savestaffgridvisitedrecord") - public Result saveStaffGridVisitedRecord(@RequestBody @Valid StaffGridVisitedFormDTO staffGridVisitedFormDTO) { + public Result saveStaffGridVisitedRecord(@RequestBody StaffGridVisitedFormDTO staffGridVisitedFormDTO) { + ValidatorUtils.validateEntity(staffGridVisitedFormDTO); return staffGridVisitedService.saveStaffGridVisitedRecord(staffGridVisitedFormDTO); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserInvitationController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserInvitationController.java index 6832021461..fc268ac8dd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserInvitationController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserInvitationController.java @@ -101,7 +101,8 @@ public class UserInvitationController { * @Date 2020/4/10 0:28 **/ @PostMapping("saveuserinvitation") - public Result saveUserInvitation(@RequestBody @Valid UserInvitationFormDTO formDTO) { + public Result saveUserInvitation(@RequestBody UserInvitationFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); return userInvitationService.saveUserInvitation(formDTO); } } From e8e7f7fb61611a42a39d475334b126af0dbab8c4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 10:43:59 +0800 Subject: [PATCH 152/174] user0.3.9,govaccess0.3.3govorg0.3.12 --- epmet-module/gov-access/gov-access-server/docker-compose.yml | 2 +- epmet-module/gov-access/gov-access-server/pom.xml | 2 +- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/docker-compose.yml b/epmet-module/gov-access/gov-access-server/docker-compose.yml index f1c533a20a..e2706f9e46 100644 --- a/epmet-module/gov-access/gov-access-server/docker-compose.yml +++ b/epmet-module/gov-access/gov-access-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-access-server:0.3.2 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-access-server:0.3.3 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index 24753aa657..83f0c96850 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.2 + 0.3.3 gov-access com.epmet diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 07bee51e25..cdb77c2ee5 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.11 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.12 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 332f02a372..a4aea16adc 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.11 + 0.3.12 com.epmet gov-org diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index 87cf4c15ed..7b1d0cd557 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.8 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.9 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index bb50a92b8d..fae8e31141 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.8 + 0.3.9 com.epmet epmet-user From 7fbcc358e1495bdc8f890dc46afbc197331413d4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 11:03:07 +0800 Subject: [PATCH 153/174] =?UTF-8?q?gov-mine0.3.4=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=A0=A1=E9=AA=8Cbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-mine/gov-mine-server/docker-compose.yml | 2 +- epmet-module/gov-mine/gov-mine-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-mine/gov-mine-server/docker-compose.yml b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml index 6c379a0909..d04661f1bf 100644 --- a/epmet-module/gov-mine/gov-mine-server/docker-compose.yml +++ b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-mine-server: container_name: gov-mine-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-mine-server:0.3.3 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-mine-server:0.3.4 ports: - "8098:8098" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index 0983f49074..46cafb3e14 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.3 + 0.3.4 com.epmet gov-mine From 4ddb3bb61b22faa7cbd76af89147f199123a0b0a Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 28 Apr 2020 11:09:55 +0800 Subject: [PATCH 154/174] CustomerStaff --- .../src/main/resources/mapper/CustomerStaffDepartmentDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 09271d9e95..7702cf9aa0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -34,7 +34,7 @@ UPDATED_BY = #{updatedBy}, - UPDATED_DATE = NOW() + UPDATED_TIME = NOW() WHERE DEL_FLAG = '0' From 834f0495043525e6d3c2fb08e6b0414973154e9c Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 28 Apr 2020 11:18:26 +0800 Subject: [PATCH 155/174] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=AE=A4=E8=AF=81bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PartyMemberConfirmServiceImpl.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index d5e6be5621..50658337d2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -217,8 +217,8 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService //将自动认证结果存入党员认证自动审核表 if (confirmAutoDTO != null) { PartymemberConfirmAutoDTO partymemberConfirmAutoDTO = - partymemberConfirmAutoService.getInfoByPartyMemberInfoId(partyMemberInfoEntity.getPartymemberVisitId()); - confirmAutoDTO.setPartymemberInfoId(partyMemberInfoEntity.getPartymemberVisitId()); + partymemberConfirmAutoService.getInfoByPartyMemberInfoId(partyMemberInfoEntity.getId()); + confirmAutoDTO.setPartymemberInfoId(partyMemberInfoEntity.getId()); if (null == partymemberConfirmAutoDTO) { partymemberConfirmAutoService.insert(ConvertUtils.sourceToTarget(confirmAutoDTO, PartymemberConfirmAutoEntity.class)); @@ -313,7 +313,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService resultDTO.setUserId(partyMemberInfoEntity.getUserId()); resultDTO.setRealName(partyMemberInfoEntity.getSurname() + partyMemberInfoEntity.getName()); resultDTO.setIdCard(partyMemberInfoEntity.getIdCard()); - resultDTO.setMobile(resultDTO.getMobile()); + resultDTO.setMobile(partyMemberInfoEntity.getMobile()); resultDTO.setAddress(partyMemberInfoEntity.getStreet() + partyMemberInfoEntity.getEstate() + partyMemberInfoEntity.getBuilding()); resultDTO.setCertifyTime(manualEntity.getCreatedTime().getTime()); @@ -352,9 +352,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService Result gridInfoResult = govOrgFeignClient.queryGridInfo(partyMemberInfoEntity.getGridId()); String gridFullPath = ""; if (gridInfoResult.success() && null != gridInfoResult.getData()) { - gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), - gridInfoResult.getData().getCommnuityName(), - gridInfoResult.getData().getGridName()); + gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName() == null?"":gridInfoResult.getData().getStreetName(), + gridInfoResult.getData().getCommnuityName() == null?"":gridInfoResult.getData().getCommnuityName(), + gridInfoResult.getData().getGridName() == null?"":gridInfoResult.getData().getGridName()); gridFullPath = gridFullPath.replaceAll("--", "").trim(); } resultDTO.setGridFullPath(gridFullPath); @@ -370,7 +370,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService resultDTO.setUserId(partyMemberInfo.getUserId()); resultDTO.setRealName(partyMemberInfo.getSurname() + partyMemberInfo.getName()); resultDTO.setIdCard(partyMemberInfo.getIdCard()); - resultDTO.setMobile(resultDTO.getMobile()); + resultDTO.setMobile(partyMemberInfo.getMobile()); resultDTO.setAddress(partyMemberInfo.getStreet() + partyMemberInfo.getEstate() + partyMemberInfo.getBuilding()); String failedReason = ""; if (null != fromDTO.getAutoId() && !fromDTO.getAutoId().isEmpty()) { @@ -418,7 +418,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService resultDTO.setUserId(partyMemberInfo.getUserId()); resultDTO.setRealName(partyMemberInfo.getSurname() + partyMemberInfo.getName()); resultDTO.setIdCard(partyMemberInfo.getIdCard()); - resultDTO.setMobile(resultDTO.getMobile()); + resultDTO.setMobile(partyMemberInfo.getMobile()); resultDTO.setAddress(partyMemberInfo.getStreet() + partyMemberInfo.getEstate() + partyMemberInfo.getBuilding()); resultDTO.setExtraOrganization(partyMemberInfo.getExtraOrganization()); resultDTO.setContactMobile(partyMemberInfo.getExtraCertifierMobile() == null ? "" : partyMemberInfo.getExtraCertifierMobile()); @@ -448,7 +448,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService //获取人工审核信息 PartymemberConfirmManualEntity manualEntity = partymemberConfirmManualService.selectById(fromDTO.getManualId()); resultDTO.setCertifyTime(manualEntity.getCreatedTime().getTime()); - resultDTO.setFailedReason(manualEntity.getRefuseReason()); + resultDTO.setRejectedReason(manualEntity.getRefuseReason()); //查询网格信息 Result gridInfoResult = govOrgFeignClient.queryGridInfo(partyMemberInfo.getGridId()); String gridFullPath = ""; From 9ce29f508ddc9af6ffdd416477f06ad45b2bf0d5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 11:19:42 +0800 Subject: [PATCH 156/174] =?UTF-8?q?listStaffIdsByRoleKeyAndOrgId=20sql?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/StaffRoleDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index b70e0e318b..6cbb4c047d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -34,7 +34,7 @@ WHERE r.ROLE_KEY = #{roleKey} AND sr.ORG_ID = #{orgId} - AND r.DEL_FLAG = '0' + AND sr.DEL_FLAG = '0' AND r.DEL_FLAG = '0' From 083c491201eadfc3fdaaccb7ed48a2d93ba0dec8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 12:12:13 +0800 Subject: [PATCH 157/174] =?UTF-8?q?gov-org,epmet-user,resi-partymember?= =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- .../resi-partymember/resi-partymember-server/docker-compose.yml | 2 +- epmet-module/resi-partymember/resi-partymember-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index cdb77c2ee5..2d5597aff1 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.12 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.13 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index a4aea16adc..ae9ab17cc0 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.12 + 0.3.13 com.epmet gov-org diff --git a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml index 301889b368..793ece847d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.4 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/resi-partymember-server:0.3.5 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 4fef6fe526..a367d99068 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.4 + 0.3.5 com.epmet resi-partymember diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index 7b1d0cd557..93223d30d9 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.9 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.10 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index fae8e31141..3d55d78963 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.9 + 0.3.10 com.epmet epmet-user From 436277fe393826282050927fb859fa23d0a1f120 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 12:24:19 +0800 Subject: [PATCH 158/174] =?UTF-8?q?gov-org,epmet-user,=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 2d5597aff1..3a5bc41f3f 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.13 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.14 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index ae9ab17cc0..985b652f16 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.13 + 0.3.14 com.epmet gov-org diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index 93223d30d9..c00e274b12 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.10 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.11 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 3d55d78963..e4122c1109 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.10 + 0.3.11 com.epmet epmet-user From d9e4bff1f850f656c8b940de47961bee94080e3d Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Tue, 28 Apr 2020 12:27:53 +0800 Subject: [PATCH 159/174] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/AddDepartmentStaffFormDTO.java | 2 +- .../com/epmet/dao/CustomerDepartmentDao.java | 9 +++++++++ .../service/impl/DepartmentServiceImpl.java | 18 +++++++----------- .../resources/mapper/CustomerDepartmentDao.xml | 11 +++++++++++ .../main/resources/mapper/CustomerStaffDao.xml | 6 +++--- 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentStaffFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentStaffFormDTO.java index 96503be98e..cc23e60a92 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentStaffFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentStaffFormDTO.java @@ -26,6 +26,6 @@ public class AddDepartmentStaffFormDTO implements Serializable { * 选中人员id */ @NotBlank(message = "选中人员不能为空") - private List selectedList; + private List selectedList; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java index 5ecfdff97f..300ea8bf8e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerIdDTO; import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.dto.result.SubListResultDTO; import com.epmet.entity.CustomerDepartmentEntity; @@ -56,4 +57,12 @@ public interface CustomerDepartmentDao extends BaseDao * @return */ List listDepartmentListByStaffId(@Param("staffId") String staffId); + + /** + * @Description 根据departmentId查询customerId + * @param departmentId + * @author zxc + * @date 2020/4/28 12:26 + */ + CustomerIdDTO selectCustomerIdByDepartmentId(@Param("departmentId") String departmentId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java index 07dcc028ee..3e8dbaf9d1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -222,20 +222,16 @@ public class DepartmentServiceImpl implements DepartmentService { @Override @Transactional(rollbackFor = Exception.class) public Result addDepartmentStaff(TokenDto tokenDto,AddDepartmentStaffFormDTO addDepartmentStaffFormDTO) { - CustomerStaffDepartmentEntity customerStaffDepartmentEntity = new CustomerStaffDepartmentEntity(); - Result> listResult = epmetUserFeignClient.selectCustomerIdByUserId(addDepartmentStaffFormDTO); - List data = listResult.getData(); - customerStaffDepartmentEntity.setDepartmentId(addDepartmentStaffFormDTO.getDepartmentId()); - customerStaffDepartmentEntity.setCreatedBy(tokenDto.getUserId()); - customerStaffDepartmentEntity.setUpdatedBy(tokenDto.getUserId()); - customerStaffDepartmentEntity.setDelFlag("0"); - customerStaffDepartmentEntity.setRevision(0); - for (CustomerIdDTO customerIdDTO : data) { - customerStaffDepartmentEntity.setUserId(customerIdDTO.getUserId()); + + CustomerIdDTO customerIdDTO = customerDepartmentDao.selectCustomerIdByDepartmentId(addDepartmentStaffFormDTO.getDepartmentId()); + for (String userId : addDepartmentStaffFormDTO.getSelectedList()) { + CustomerStaffDepartmentEntity customerStaffDepartmentEntity = new CustomerStaffDepartmentEntity(); + customerStaffDepartmentEntity.setDepartmentId(addDepartmentStaffFormDTO.getDepartmentId()); customerStaffDepartmentEntity.setCustomerId(customerIdDTO.getCustomerId()); + customerStaffDepartmentEntity.setUserId(userId); customerStaffDepartmentDao.insert(customerStaffDepartmentEntity); } - customerStaffDepartmentDao.updateDepartmentStaffCount(data.size(),addDepartmentStaffFormDTO.getDepartmentId()); + customerStaffDepartmentDao.updateDepartmentStaffCount(addDepartmentStaffFormDTO.getSelectedList().size(),addDepartmentStaffFormDTO.getDepartmentId()); return new Result(); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml index e440745e06..aab4ce8f67 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -33,4 +33,15 @@ inner join customer_department cd on (csd.DEPARTMENT_ID = cd.ID) where csd.USER_ID = #{staffId} + + + \ 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 a0acecdc79..d947006ad0 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 @@ -27,10 +27,10 @@ - - SELECT - user_id + csg.user_id AS userId, + cg.pid FROM - customer_staff_grid + customer_staff_grid csg + LEFT JOIN customer_grid cg ON cg.id = csg.grid_id WHERE - del_flag = 0 - AND grid_id = #{gridId} + csg.del_flag = 0 + AND csg.grid_id = #{gridId} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java index 48b3e77940..878bc9ce5f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java @@ -17,4 +17,39 @@ public interface UserRoleConstant { */ String DEPT_LEADER = "dept_leader"; + /** + * 单位领导 + */ + String AGENCY_LEADER = "agency_leader"; + + /** + * 党建负责人 + */ + String PARTY_PRINCIPALS = "party_principals"; + + /** + * 管理员 + */ + String MANAGER = "manager"; + + /** + * 工作人员 + */ + String STAFF = "staff"; + + /** + * 网格长 + */ + String GRID_MANAGER = "grid_manager"; + + /** + * 网格党建指导员 + */ + String GRID_PARTY_DIRECTOR = "grid_party_director"; + + /** + * 网格员 + */ + String GRID_MEMBER = "grid_member"; + } 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 b4f863d253..27fb54d1fe 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 @@ -132,7 +132,7 @@ public class CustomerStaffController { * @return */ @PostMapping(value = "selectstaffgridlistbyuserid") - public Result> selectStaffGridListByUserId(@RequestBody List customerStaffGridDTOS){ + public Result> selectStaffGridListByUserId(@RequestBody List customerStaffGridDTOS){ Result> listResult = customerStaffService.selectStaffGridListByUserId(customerStaffGridDTOS); return listResult; } 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 7936c026c8..99fbc84718 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 @@ -71,7 +71,7 @@ public interface CustomerStaffDao extends BaseDao { * @param customerStaffGridDTOS * @return */ - List selectStaffGridListByUserId(List customerStaffGridDTOS); + List selectStaffGridListByUserId(List customerStaffGridDTOS); /** * 根据用户ID列表获取用户信息 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 21b2a2b1a9..3acfbd9671 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 @@ -139,7 +139,7 @@ public interface CustomerStaffService extends BaseService { * @param customerStaffGridDTOS * @return */ - Result> selectStaffGridListByUserId(List customerStaffGridDTOS); + Result> selectStaffGridListByUserId(List customerStaffGridDTOS); /** * 组织首页-工作人员列表 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 7b7603b823..7a2b47f19d 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 @@ -178,8 +178,20 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> selectStaffGridListByUserId(List customerStaffGridDTOS) { + public Result> selectStaffGridListByUserId(List customerStaffGridDTOS) { + List gridManager = staffRoleService.listStaffsInRole(UserRoleConstant.GRID_MANAGER, customerStaffGridDTOS.get(0).getPid(), DataScope.getDefault()); List staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); + for (GovStaffRoleResultDTO govStaffRoleResultDTO : gridManager) { + if (govStaffRoleResultDTO.getRoleKey()==UserRoleConstant.GRID_MANAGER){ + for (StaffGridListDTO staffGridListDTO : staffGridListDTOS) { + if (staffGridListDTO.getStaffId()==govStaffRoleResultDTO.getStaffId()){ + staffGridListDTO.setRoleName(govStaffRoleResultDTO.getRoleName()); + break; + } + break; + } + } + } return new Result>().ok(staffGridListDTOS); } From 70a0dfb8e97607b6f0a801bee672a7397df26d34 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Tue, 28 Apr 2020 13:34:31 +0800 Subject: [PATCH 164/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E8=AF=A6=E6=83=85rol?= =?UTF-8?q?eName=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/CustomerStaffServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7a2b47f19d..8f67616f69 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 @@ -186,11 +186,11 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(staffGridListDTOS); } From ced4f92c217c66092817fce05f553d554c1ff4ea Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 13:41:49 +0800 Subject: [PATCH 165/174] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=AF=A6=E6=83=85fullTimeOnly=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/CustomerStaffServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 fd97dd9962..c0251e42d1 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 @@ -243,6 +243,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl Date: Tue, 28 Apr 2020 13:43:21 +0800 Subject: [PATCH 166/174] =?UTF-8?q?user=E3=80=81govorg=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 85de004d8c..d127efeca4 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.15 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.16 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 94abb9e071..75b486e2d0 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.15 + 0.3.16 com.epmet gov-org diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index df7a239cc4..b53a91a5c7 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.12 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.13 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 1fb461120b..87f4006260 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.12 + 0.3.13 com.epmet epmet-user From f92db0e58694833cc5b7669caf6353fd407c9239 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Tue, 28 Apr 2020 13:48:34 +0800 Subject: [PATCH 167/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E8=AF=A6=E6=83=85rol?= =?UTF-8?q?eName=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/CustomerStaffServiceImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 8f67616f69..fb865b5e68 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 @@ -182,15 +182,13 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl gridManager = staffRoleService.listStaffsInRole(UserRoleConstant.GRID_MANAGER, customerStaffGridDTOS.get(0).getPid(), DataScope.getDefault()); List staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); for (GovStaffRoleResultDTO govStaffRoleResultDTO : gridManager) { - if (govStaffRoleResultDTO.getRoleKey()==UserRoleConstant.GRID_MANAGER){ + if (govStaffRoleResultDTO.getRoleKey().equals(UserRoleConstant.GRID_MANAGER)){ for (StaffGridListDTO staffGridListDTO : staffGridListDTOS) { - if (staffGridListDTO.getStaffId()==govStaffRoleResultDTO.getStaffId()){ + if (staffGridListDTO.getStaffId().equals(govStaffRoleResultDTO.getStaffId())){ staffGridListDTO.setRoleName(govStaffRoleResultDTO.getRoleName()); } - break; } } - break; } return new Result>().ok(staffGridListDTOS); } From 4c91dd51aa8b64c98dcdc7bd5a683db105ab9bec Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Tue, 28 Apr 2020 14:14:18 +0800 Subject: [PATCH 168/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/CustomerGridServiceImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 2c6090dc9e..a580d9381e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -243,12 +243,16 @@ public class CustomerGridServiceImpl extends BaseServiceImpl userIdDTOS = baseDao.selectUserIdByGrid(deleteGridFormDTO.getGridId()); - deleteGridFormDTO.setUserId(tokenDto.getUserId()); - Result gridStaffCountDTOResult = epmetUserFeignClient.selectGridStaffCountByUserId(userIdDTOS); - if (gridStaffCountDTOResult.getData().getEnableCount()==0){ + if (userIdDTOS.size()==0){ baseDao.deleteGrid(deleteGridFormDTO); }else { - return new Result().error(EpmetErrorCode.NOT_DEL_GRID.getCode()); + deleteGridFormDTO.setUserId(tokenDto.getUserId()); + Result gridStaffCountDTOResult = epmetUserFeignClient.selectGridStaffCountByUserId(userIdDTOS); + if (gridStaffCountDTOResult.getData().getEnableCount() == 0) { + baseDao.deleteGrid(deleteGridFormDTO); + } else { + return new Result().error(EpmetErrorCode.NOT_DEL_GRID.getCode()); + } } return new Result(); } From bc3f757afa0675c95e18739a26dcb1b3e0791e81 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 14:18:37 +0800 Subject: [PATCH 169/174] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=BD=91=E6=A0=BCbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- epmet-user/epmet-user-server/docker-compose.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index d127efeca4..4a6d34b1d1 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.16 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.17 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 75b486e2d0..e3f3e7d605 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.16 + 0.3.17 com.epmet gov-org diff --git a/epmet-user/epmet-user-server/docker-compose.yml b/epmet-user/epmet-user-server/docker-compose.yml index b53a91a5c7..5d54ef6e2d 100644 --- a/epmet-user/epmet-user-server/docker-compose.yml +++ b/epmet-user/epmet-user-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.13 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-user-server:0.3.14 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 87f4006260..24a650f429 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.13 + 0.3.14 com.epmet epmet-user From 5a1191aecfdfe907753335d9d6243d0edc045a87 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Tue, 28 Apr 2020 14:31:05 +0800 Subject: [PATCH 170/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/CustomerGridServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index a580d9381e..59ee2c4bfe 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -243,10 +243,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl userIdDTOS = baseDao.selectUserIdByGrid(deleteGridFormDTO.getGridId()); + deleteGridFormDTO.setUserId(tokenDto.getUserId()); if (userIdDTOS.size()==0){ baseDao.deleteGrid(deleteGridFormDTO); }else { - deleteGridFormDTO.setUserId(tokenDto.getUserId()); Result gridStaffCountDTOResult = epmetUserFeignClient.selectGridStaffCountByUserId(userIdDTOS); if (gridStaffCountDTOResult.getData().getEnableCount() == 0) { baseDao.deleteGrid(deleteGridFormDTO); From b9c793aabbb92042cd5c9c9fb83b93e368a75087 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 14:37:18 +0800 Subject: [PATCH 171/174] =?UTF-8?q?gov=20org=E5=88=A0=E9=99=A4=E7=BD=91?= =?UTF-8?q?=E6=A0=BCbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/docker-compose.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml index 4a6d34b1d1..1c3d05d4a4 100644 --- a/epmet-module/gov-org/gov-org-server/docker-compose.yml +++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.17 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.18 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index e3f3e7d605..990b4e3355 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.17 + 0.3.18 com.epmet gov-org From 7b2103111d0b9a502af918b73ba013ccba640add Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 28 Apr 2020 16:00:10 +0800 Subject: [PATCH 172/174] =?UTF-8?q?=E5=BE=85=E5=AE=A1=E6=A0=B8=E5=85=9A?= =?UTF-8?q?=E5=91=98=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partymember/PartymemberBaseInfoDao.xml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml index 39e0ee43d4..809493652a 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml @@ -67,14 +67,11 @@ pcm.id as manualId FROM partymember_info pi - LEFT JOIN partymember_confirm_manual pcm ON ( pi.id = pcm.PARTYMEMBER_INFO_ID ) - LEFT JOIN partymember_confirm_auto pca ON(pi.id=pca.PARTYMEMBER_INFO_ID) + LEFT JOIN partymember_confirm_manual pcm ON ( pi.id = pcm.PARTYMEMBER_INFO_ID AND pcm.DEL_FLAG = '0'and pcm.AUDIT_STATUS='under_auditting') + LEFT JOIN partymember_confirm_auto pca ON(pi.id=pca.PARTYMEMBER_INFO_ID AND pca.del_flag='0') WHERE pi.DEL_FLAG = '0' - AND pcm.DEL_FLAG = '0' - AND pca.del_flag='0' AND pi.CONFIRM_RESULT = 'auto_confirm_failed' - and pcm.AUDIT_STATUS='under_auditting' AND pi.EXTRA_ORGANIZATION IS NOT NULL AND pi.GRID_ID = #{gridId} ORDER BY @@ -95,10 +92,9 @@ '' as manualId FROM partymember_info pi - LEFT JOIN partymember_confirm_auto pca ON(pi.id=pca.PARTYMEMBER_INFO_ID) + LEFT JOIN partymember_confirm_auto pca ON(pi.id=pca.PARTYMEMBER_INFO_ID AND pca.del_flag='0') WHERE pi.DEL_FLAG = '0' - AND pca.del_flag='0' AND pi.CONFIRM_RESULT ='auto_confirm_failed' AND (pi.EXTRA_ORGANIZATION is null or trim(pi.EXTRA_ORGANIZATION)='') AND pi.GRID_ID = #{gridId} @@ -113,14 +109,11 @@ pcm.id as manualId FROM partymember_info pi - LEFT JOIN partymember_confirm_manual pcm ON ( pi.id = pcm.PARTYMEMBER_INFO_ID ) - LEFT JOIN partymember_confirm_auto pca ON(pi.id=pca.PARTYMEMBER_INFO_ID) + LEFT JOIN partymember_confirm_manual pcm ON ( pi.id = pcm.PARTYMEMBER_INFO_ID AND pcm.del_flag='0' and pcm.AUDIT_STATUS='rejected') + LEFT JOIN partymember_confirm_auto pca ON(pi.id=pca.PARTYMEMBER_INFO_ID AND pca.del_flag='0') WHERE pi.DEL_FLAG = '0' - AND pcm.del_flag='0' - AND pca.del_flag='0' AND pi.CONFIRM_RESULT ='rejected' - and pcm.AUDIT_STATUS='rejected' AND pi.EXTRA_ORGANIZATION IS NOT NULL AND pi.GRID_ID = #{gridId} ORDER BY From a8c4f77272eddd66641e13ad950b9138da706863 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Tue, 28 Apr 2020 16:33:02 +0800 Subject: [PATCH 173/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=EF=BC=9A=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=8C=BA=E7=BC=96=E7=A0=81?= =?UTF-8?q?=20=E5=B7=B2=E8=AE=A4=E8=AF=81=E5=85=9A=E5=91=98=E8=AF=A6?= =?UTF-8?q?=E6=83=85=EF=BC=9A=E6=B7=BB=E5=8A=A0address=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/CertifiedDetailResultDTO.java | 5 +++++ .../java/com/epmet/dao/CustomerAgencyDao.java | 8 ++++++++ .../service/impl/CustomerGridServiceImpl.java | 16 ++++++++++------ .../main/resources/mapper/CustomerAgencyDao.xml | 11 +++++++++++ .../result/CertifiedDetailResultDTO.java | 5 +++++ .../mapper/partymember/PartymemberInfoDao.xml | 3 ++- 6 files changed, 41 insertions(+), 7 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedDetailResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedDetailResultDTO.java index a14c38629e..41ee82265b 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedDetailResultDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/CertifiedDetailResultDTO.java @@ -69,4 +69,9 @@ public class CertifiedDetailResultDTO implements Serializable { */ private String contactMobile; + /** + * 居住地址 + */ + private String address; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index ba4bde9b07..21c535f730 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -77,4 +77,12 @@ public interface CustomerAgencyDao extends BaseDao { * @Description 查询当前组织的所有下级组织列表 **/ List selectFindList(CustomerAgencyDTO customerAgencyDTO); + + /** + * @Description 根据agencyId查询地区编码 + * @param agencyId 所属机关id + * @author zxc + * @date 2020/4/28 15:50 + */ + String selectAreaCodeByAgencyId(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 59ee2c4bfe..38a3c8691e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerGridConstant; +import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerGridDao; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; @@ -71,6 +72,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) { @@ -197,21 +200,22 @@ public class CustomerGridServiceImpl extends BaseServiceImpl addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) { + //查询是否重名 String checkGridName = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(),addGridFormDTO.getAgencyId(),null); if (checkGridName!=null){ return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode()); } + //查询地区编码 + String areaCode = customerAgencyDao.selectAreaCodeByAgencyId(addGridFormDTO.getAgencyId()); CustomerGridEntity customerGridEntity = new CustomerGridEntity(); - customerGridEntity.setCustomerId(baseDao.selectCustomerIdByUserId(tokenDto.getUserId())); + customerGridEntity.setAreaCode(areaCode); + customerGridEntity.setCustomerId(baseDao.selectCustomerIdByUserId(tokenDto.getUserId()));//查询customerId customerGridEntity.setGridName(addGridFormDTO.getGridName()); - customerGridEntity.setDelFlag("0"); - customerGridEntity.setCreatedBy(tokenDto.getUserId()); - customerGridEntity.setUpdatedBy(tokenDto.getUserId()); - customerGridEntity.setTotalUser(0); customerGridEntity.setManageDistrict(addGridFormDTO.getManageDistrict()); customerGridEntity.setPid(addGridFormDTO.getAgencyId()); - customerGridEntity.setPids(baseDao.selectPidsByPid(addGridFormDTO.getAgencyId())); + customerGridEntity.setPids(baseDao.selectPidsByPid(addGridFormDTO.getAgencyId()));//查询所有上级组织id baseDao.insert(customerGridEntity); + //查询刚刚添加的gridId String gridId = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(),addGridFormDTO.getAgencyId(),null); AddGridResultDTO addGridResultDTO = new AddGridResultDTO(); addGridResultDTO.setGridId(gridId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 017ae50451..12c8339919 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -84,4 +84,15 @@ AND ca.pids LIKE concat('%', #{pids}, '%') + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedDetailResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedDetailResultDTO.java index 19681fbbd5..e94ec46f07 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedDetailResultDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/CertifiedDetailResultDTO.java @@ -74,4 +74,9 @@ public class CertifiedDetailResultDTO implements Serializable { */ private String contactMobile; + /** + * 居住地址 + */ + private String address; + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index 04bdbb07c6..3f716c5210 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -93,7 +93,8 @@ UNIX_TIMESTAMP(pi.created_time) AS applyTime, organization_type AS extraOrganization, extra_certifier_name AS contactPeople, - extra_certifier_mobile AS contactMobile + extra_certifier_mobile AS contactMobile, + CONCAT(street,estate,building) AS address FROM partymember_info pi WHERE From 78ed117bf3b659713975be1c2b337d83c47583f5 Mon Sep 17 00:00:00 2001 From: zxc <954985705@qq.com> Date: Tue, 28 Apr 2020 17:16:22 +0800 Subject: [PATCH 174/174] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=EF=BC=9A=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=8C=BA=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/CustomerAgencyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 12c8339919..1e40ebb4b8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -92,7 +92,7 @@ FROM customer_agency WHERE - pid = #{agencyId} + id = #{agencyId} AND del_flag = 0 \ No newline at end of file