diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index df99da5050..3e6ea66091 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -93,13 +93,13 @@ - + - epmet - elink@833066 + epmet_admin_user + EpmEt-db-UsEr 0 - 127.0.0.1 + 192.168.1.130 6379 123456 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index fdd4c12eb8..9d1876810e 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -86,6 +86,12 @@ 2.0.0 compile + + com.epmet + epmet-message-client + 2.0.0 + compile + @@ -143,6 +149,9 @@ wx9b6102a8ee5add65 16fdb68bc2b3e732324ba5d8b8a9b5e2 + + wx3d1372029eb816a3 + 651f02d71ed3f123dfb584b8bf0f4d8b @@ -177,6 +186,9 @@ wx9b6102a8ee5add65 16fdb68bc2b3e732324ba5d8b8a9b5e2 + + wx3d1372029eb816a3 + 651f02d71ed3f123dfb584b8bf0f4d8b @@ -211,6 +223,9 @@ wx9b6102a8ee5add65 16fdb68bc2b3e732324ba5d8b8a9b5e2 + + wx3d1372029eb816a3 + 651f02d71ed3f123dfb584b8bf0f4d8b 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 99b094eb1a..47c778977a 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,16 @@ package com.epmet.controller; -import com.epmet.common.token.dto.form.LoginByPassWordFormDTO; -import com.epmet.common.token.dto.form.LoginByWxCodeFormDTO; -import com.epmet.common.token.dto.result.UserTokenResultDTO; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.constant.Constant; 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; import org.springframework.beans.factory.annotation.Autowired; @@ -41,7 +42,7 @@ public class LoginController { * @param response * @param uuid * @Author yinzuomei - * @Description 生成验证码 + * @Description 运营端管理后台-生成验证码 * @Date 2020/3/17 16:08 **/ @GetMapping("captcha") @@ -61,10 +62,10 @@ public class LoginController { * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei - * @Description 微信小程序登录 + * @Description 居民端微信小程序登录 * @Date 2020/3/14 14:35 **/ - @PostMapping("loginbywxcode") + @PostMapping("/resiwxmp/loginbywxcode") public Result loginByWxCode(@RequestBody LoginByWxCodeFormDTO formDTO) { //效验数据 ValidatorUtils.validateEntity(formDTO); @@ -78,7 +79,7 @@ public class LoginController { * @Description 手机号+密码登录接口 * @Date 2020/3/14 19:46 **/ - @PostMapping("loginbypassword") + @PostMapping("/operweb/loginbypassword") public Result loginByPassword(@RequestBody LoginByPassWordFormDTO formDTO) { //效验数据 ValidatorUtils.validateEntity(formDTO); @@ -99,4 +100,29 @@ public class LoginController { 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-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByPassWordFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java similarity index 94% rename from epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByPassWordFormDTO.java rename to epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java index 742a38844e..89e751e249 100644 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByPassWordFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.common.token.dto.form; +package com.epmet.dto.form; import lombok.Data; diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPhoneFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPhoneFormDTO.java new file mode 100644 index 0000000000..591e6063b1 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPhoneFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 政府端手机号+验证码登录接口入参 + * @Author yinzuomei + * @Date 2020/4/18 10:38 + */ +@Data +public class LoginByPhoneFormDTO extends LoginCommonFormDTO implements Serializable { + private static final long serialVersionUID = 4193133227120225342L; + + @NotBlank(message = "wxCode不能为空") + private String wxCode; + + @NotBlank(message = "手机号不能为空") + private String phone; + + @NotBlank(message="验证码不能为空") + private String smsCode; + +} + diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java similarity index 93% rename from epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java rename to epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java index 0f61c36255..6a6559df59 100644 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.common.token.dto.form; +package com.epmet.dto.form; import lombok.Data; diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginCommonFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java similarity index 94% rename from epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginCommonFormDTO.java rename to epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java index 9b2390388e..af4df891c5 100644 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginCommonFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.common.token.dto.form; +package com.epmet.dto.form; import lombok.Data; 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 new file mode 100644 index 0000000000..806ddc43e2 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SendSmsCodeFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 政府端手机号+验证码登录接口入参 + * @Author yinzuomei + * @Date 2020/04/18 10:26 + */ +@Data +public class SendSmsCodeFormDTO extends LoginCommonFormDTO implements Serializable { + private static final long serialVersionUID = -1852541457359282018L; + + @NotBlank(message = "手机号不能为空") + private String phone; +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/result/UserTokenResultDTO.java b/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java similarity index 88% rename from epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/result/UserTokenResultDTO.java rename to epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java index e5296bf42b..8e4b715422 100644 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/result/UserTokenResultDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.common.token.dto.result; +package com.epmet.dto.result; import lombok.Data; 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 c590dee3b9..5b339e18ce 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -2,14 +2,18 @@ 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.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.result.PasswordLoginUserInfoResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; +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; @@ -18,7 +22,7 @@ import org.springframework.web.bind.annotation.RequestBody; * @Author yinzuomei * @Date 2020/3/16 14:48 */ -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class ) +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) public interface EpmetUserFeignClient { /** @@ -52,4 +56,24 @@ public interface EpmetUserFeignClient { **/ @PostMapping(value = "epmetuser/user/selectLoginUserInfoByPassword", consumes = MediaType.APPLICATION_JSON_VALUE) Result selectLoginUserInfoByPassword(@RequestBody PasswordLoginUserInfoFormDTO passwordLoginUserInfoFormDTO); + + /** + * @param phone + * @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); + + /** + * @param staffWechatFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 机验证码登录时记录微信openId与当前用户的关系 + * @Date 2020/4/18 22:44 + **/ + @PostMapping(value = "epmetuser/staffwechat/savestaffwechat", consumes = MediaType.APPLICATION_JSON_VALUE) + Result savestaffwechat(@RequestBody StaffWechatFormDTO staffWechatFormDTO); } 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 1ee00f03e0..60b63d04da 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 @@ -3,9 +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.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.result.PasswordLoginUserInfoResultDTO; import com.epmet.feign.EpmetUserFeignClient; @@ -34,4 +36,14 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectLoginUserInfoByPassword", passwordLoginUserInfoFormDTO); } + @Override + public Result checkCustomerStaff(String phone) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByPhone", phone); + } + + @Override + public Result savestaffwechat(StaffWechatFormDTO staffWechatFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffWechat", staffWechatFormDTO); + } + } 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 a37f43b604..7363eb93c2 100644 --- a/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java +++ b/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java @@ -10,6 +10,8 @@ package com.epmet.redis; 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.SendSmsCodeFormDTO; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -28,6 +30,11 @@ public class CaptchaRedis { * 验证码5分钟过期 */ private final static long EXPIRE = 60 * 5L; + /** + * 过期时长为30分钟,单位:秒 + */ + private final static long MINUTE_THIRTY_EXPIRE = 60 * 30 * 1L; + @Autowired private RedisUtils redisUtils; @@ -48,4 +55,31 @@ public class CaptchaRedis { return captcha; } + + /** + * @param sendSmsCodeFormDTO app、client、phone + * @param smsCode 验证码 + * @return void + * @Author yinzuomei + * @Description + * @Date 2020/4/18 13:53 + **/ + public void saveSmsCode(SendSmsCodeFormDTO sendSmsCodeFormDTO, String smsCode) { + String smsCodeKey = RedisKeys.getLoginSmsCodeKey(sendSmsCodeFormDTO.getApp(), sendSmsCodeFormDTO.getClient(), sendSmsCodeFormDTO.getPhone()); + logger.info(String.format("短信验证码key=%s", smsCodeKey)); + redisUtils.set(smsCodeKey, smsCode, MINUTE_THIRTY_EXPIRE); + } + + /** + * @param formDTO + * @return java.lang.String + * @Author yinzuomei + * @Description 获取登录时发送的验证码 + * @Date 2020/4/18 21:33 + **/ + public String getSmsCode(LoginByPhoneFormDTO formDTO) { + String smsCodeKey = RedisKeys.getLoginSmsCodeKey(formDTO.getApp(), formDTO.getClient(), formDTO.getPhone()); + String smsCode = (String) redisUtils.get(smsCodeKey); + return smsCode; + } } 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 dd37bfc58f..1433393413 100644 --- a/epmet-auth/src/main/java/com/epmet/service/LoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/LoginService.java @@ -1,10 +1,13 @@ package com.epmet.service; -import com.epmet.common.token.dto.form.LoginByPassWordFormDTO; -import com.epmet.common.token.dto.form.LoginByWxCodeFormDTO; -import com.epmet.common.token.dto.result.UserTokenResultDTO; +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; /** * @Description @@ -16,7 +19,7 @@ public interface LoginService { * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei - * @Description 微信小程序登录 + * @Description 居民端微信小程序登录 * @Date 2020/3/14 19:34 **/ Result loginByWxCode(LoginByWxCodeFormDTO formDTO); @@ -38,4 +41,32 @@ public interface LoginService { * @Date 2020/3/18 22:44 **/ Result logoutByToken(TokenDto tokenDto); + + /** + * @return cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult + * @param app + * @param wxCode + * @Author yinzuomei + * @Description 解析wxCode + * @Date 2020/4/19 0:24 + **/ + 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/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 4280c7d0f6..669c0596a5 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,23 +3,26 @@ 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.common.token.dto.form.LoginByPassWordFormDTO; -import com.epmet.common.token.dto.form.LoginByWxCodeFormDTO; -import com.epmet.common.token.dto.result.UserTokenResultDTO; +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; 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.PasswordLoginUserInfoFormDTO; -import com.epmet.dto.form.WxLoginUserInfoFormDTO; +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; @@ -62,8 +65,14 @@ public class LoginServiceImpl implements LoginService { @Autowired private CaptchaService captchaService; + @Autowired + private CaptchaRedis captchaRedis; + + @Autowired + private MessageFeignClient messageFeignClient; + /** - * 微信小程序登录 + * 居民端微信小程序登录 * * @param formDTO * @return com.epmet.commons.tools.utils.Result @@ -72,15 +81,21 @@ public class LoginServiceImpl implements LoginService { */ @Override public Result loginByWxCode(LoginByWxCodeFormDTO formDTO) { + if(!(LoginConstant.APP_RESI.equals(formDTO.getApp())&&LoginConstant.CLIENT_WXMP.equals(formDTO.getClient()))){ + logger.error("当前接口只适用于居民端微信小程序登录"); + throw new RenException("参数错误"); + } //1、根据wxCode获取微信信息 - WxMaJscode2SessionResult wxMaJscode2SessionResult = this.getWxMaUser(formDTO); + WxMaJscode2SessionResult wxMaJscode2SessionResult = this.getWxMaUser(formDTO.getApp(),formDTO.getWxCode()); logger.info("openId=[" + wxMaJscode2SessionResult.getOpenid() + "]unionId=[" + wxMaJscode2SessionResult.getUnionid() + "]"); //2、根据openId查询数据库,没有则直接插入一条记录 String userId = this.getUserId(formDTO, wxMaJscode2SessionResult); if (StringUtils.isNotBlank(userId)) { //3、封装token且存到redis + String token=this.generateToken(formDTO,userId); + this.saveTokenDto(formDTO,userId,wxMaJscode2SessionResult,token); UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); - userTokenResultDTO.setToken(this.packagingUserToken(formDTO, userId, wxMaJscode2SessionResult)); + userTokenResultDTO.setToken(token); return new Result().ok(userTokenResultDTO); }else{ logger.error("登录失败userId为空"); @@ -91,27 +106,31 @@ public class LoginServiceImpl implements LoginService { /** * 解析微信code获取小程序用户信息 * - * @param formDTO + * @param app + * @param wxCode * @return cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult * @author yinzuomei * @date 2020/3/14 20:16 */ - private WxMaJscode2SessionResult getWxMaUser(LoginByWxCodeFormDTO formDTO) { + @Override + public WxMaJscode2SessionResult getWxMaUser(String app,String wxCode) { WxMaJscode2SessionResult wxMaJscode2SessionResult = null; try { - if (LoginConstant.APP_GOV.equals(formDTO.getApp())) { - wxMaJscode2SessionResult = wxMaServiceUtils.govWxMaService().jsCode2SessionInfo(formDTO.getWxCode()); - } else if (LoginConstant.APP_OPER.equals(formDTO.getApp())) { - wxMaJscode2SessionResult = wxMaServiceUtils.operWxMaService().jsCode2SessionInfo(formDTO.getWxCode()); - } else if (LoginConstant.APP_RESI.equals(formDTO.getApp())) { - wxMaJscode2SessionResult = wxMaServiceUtils.resiWxMaService().jsCode2SessionInfo(formDTO.getWxCode()); + if (LoginConstant.APP_GOV.equals(app)) { + wxMaJscode2SessionResult = wxMaServiceUtils.govWxMaService().jsCode2SessionInfo(wxCode); + } else if (LoginConstant.APP_OPER.equals(app)) { + wxMaJscode2SessionResult = wxMaServiceUtils.operWxMaService().jsCode2SessionInfo(wxCode); + } else if (LoginConstant.APP_RESI.equals(app)) { + wxMaJscode2SessionResult = wxMaServiceUtils.resiWxMaService().jsCode2SessionInfo(wxCode); } } catch (WxErrorException e) { log.error("->[getMaOpenId]::error[{}]", "解析微信code失败"); } if (null == wxMaJscode2SessionResult) { + log.error(String.format("解析微信用户信息失败,app[%s],wxCode[%s]",app,wxCode)); throw new RenException("解析微信用户信息失败"); } else if (StringUtils.isBlank(wxMaJscode2SessionResult.getOpenid())) { + log.error(String.format("获取微信openid失败,app[%s],wxCode[%s]",app,wxCode)); throw new RenException("获取微信openid失败"); } return wxMaJscode2SessionResult; @@ -134,6 +153,7 @@ public class LoginServiceImpl implements LoginService { Result userResult = epmetUserFeignClient.selecWxLoginUserInfo(wxLoginUserInfoFormDTO); String userId = ""; if (!userResult.success()) { + logger.error("根据openId、app获取用户信息失败" + userResult.getMsg()); throw new RenException("获取用户信息失败" + userResult.getMsg()); } if(null!=userResult.getData()&&StringUtils.isNotBlank(userResult.getData().getId())){ @@ -221,42 +241,6 @@ public class LoginServiceImpl implements LoginService { return userWechatDTO; } - /** - * 封装用户token值 - * - * @param formDTO - * @param userId - * @param wxMaJscode2SessionResult - * @return java.lang.String - * @author yinzuomei - * @since 2020/3/14 19:34 - */ - private String packagingUserToken(LoginByWxCodeFormDTO formDTO, - String userId, - WxMaJscode2SessionResult wxMaJscode2SessionResult) { - // 生成token - Map map = new HashMap<>(); - map.put("app", formDTO.getApp()); - map.put("client", formDTO.getClient()); - map.put("userId", userId); - String token = jwtTokenUtils.createToken(map); -// logger.info("app:"+formDTO.getApp()+";client:"+formDTO.getClient()+";userId:"+userId+";生成token["+token+"]"); - int expire = jwtTokenProperties.getExpire(); - TokenDto tokenDto = new TokenDto(); - tokenDto.setApp(formDTO.getApp()); - tokenDto.setClient(formDTO.getClient()); - tokenDto.setUserId(userId); - tokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid()); - tokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey()); - tokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid()); - tokenDto.setToken(token); - tokenDto.setUpdateTime(System.currentTimeMillis()); - tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); - cpUserDetailRedis.set(tokenDto, expire); -// logger.info("token过期时间:"+tokenUtil.getExpire(tokenDto.getApp(),tokenDto.getClient(),tokenDto.getUserId())); -// logger.info("截止时间:"+ DateUtils.format(jwtTokenUtils.getExpiration(token),"yyyy-MM-dd HH:mm:ss")); - return token; - } /** * 手机号+密码登录接口 @@ -268,9 +252,9 @@ public class LoginServiceImpl implements LoginService { */ @Override public Result loginByPassword(LoginByPassWordFormDTO formDTO) { - if(LoginConstant.APP_RESI.equals(formDTO.getApp())){ - logger.error("居民端请使用微信登录"); - throw new RenException("居民端请使用微信登录"); + if(!(LoginConstant.APP_OPER.equals(formDTO.getApp())&&LoginConstant.CLIENT_WEB.equals(formDTO.getClient()))){ + logger.error("当前接口只适用于运营端管理后台"); + throw new RenException("当前接口只适用于运营端管理后台"); } //1、验证码是否正确 boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); @@ -283,9 +267,8 @@ public class LoginServiceImpl implements LoginService { passwordLoginUserInfoFormDTO.setApp(formDTO.getApp()); passwordLoginUserInfoFormDTO.setPhone(formDTO.getPhone()); Result userInfoResult = epmetUserFeignClient.selectLoginUserInfoByPassword(passwordLoginUserInfoFormDTO); - logger.info(userInfoResult.getCode() + userInfoResult.getMsg()); if (!userInfoResult.success() || null == userInfoResult.getData()) { - logger.error("账号不存在"); + logger.error("根据手机号查询运营人员信息失败"); throw new RenException("账号不存在"); } //3、密码是否正确 @@ -316,7 +299,7 @@ public class LoginServiceImpl implements LoginService { map.put("client", formDTO.getClient()); map.put("userId", userId); String token = jwtTokenUtils.createToken(map); -// logger.info("app:"+formDTO.getApp()+";client:"+formDTO.getClient()+";userId:"+userId+";生成token["+token+"]"); + logger.info("app:"+formDTO.getApp()+";client:"+formDTO.getClient()+";userId:"+userId+";生成token["+token+"]"); int expire = jwtTokenProperties.getExpire(); TokenDto tokenDto = new TokenDto(); tokenDto.setApp(formDTO.getApp()); @@ -326,8 +309,7 @@ public class LoginServiceImpl implements LoginService { tokenDto.setUpdateTime(System.currentTimeMillis()); tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); cpUserDetailRedis.set(tokenDto, expire); -// logger.info("token过期时间:"+tokenUtil.getExpire(tokenDto.getApp(),tokenDto.getClient(),tokenDto.getUserId())); -// logger.info("截止时间:"+ DateUtils.format(jwtTokenUtils.getExpiration(token),"yyyy-MM-dd HH:mm:ss")); + logger.info("截止时间:"+ DateUtils.format(jwtTokenUtils.getExpiration(token),"yyyy-MM-dd HH:mm:ss")); return token; } @@ -340,10 +322,134 @@ public class LoginServiceImpl implements LoginService { logger.error("账号不存在"); throw new RenException("当前用户信息获取失败"); } - cpUserDetailRedis.logout(tokenDto.getApp() , tokenDto.getClient() , tokenDto.getUserId()); - - //web端清空菜单栏和权限,小程序目前又 + //web端清空菜单栏和权限 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 + **/ + private String generateToken(LoginCommonFormDTO formDTO,String userId){ + Map map = new HashMap<>(); + map.put("app", formDTO.getApp()); + map.put("client", formDTO.getClient()); + map.put("userId", userId); + String token = jwtTokenUtils.createToken(map); + logger.info("app:"+formDTO.getApp()+";client:"+formDTO.getClient()+";userId:"+userId+";生成token["+token+"]"); + return token; + } + + /** + * @Description 生成token + * @Date 2020/4/18 23:04 + **/ + private String saveTokenDto(LoginCommonFormDTO formDTO, + String userId, + WxMaJscode2SessionResult wxMaJscode2SessionResult, + String token) { + int expire = jwtTokenProperties.getExpire(); + TokenDto tokenDto = new TokenDto(); + tokenDto.setApp(formDTO.getApp()); + tokenDto.setClient(formDTO.getClient()); + tokenDto.setUserId(userId); + tokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid()); + tokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey()); + tokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid()); + tokenDto.setToken(token); + tokenDto.setUpdateTime(System.currentTimeMillis()); + tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + cpUserDetailRedis.set(tokenDto, expire); + logger.info("截止时间:"+ DateUtils.format(jwtTokenUtils.getExpiration(token),"yyyy-MM-dd HH:mm:ss")); + return token; + } } diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index 7b50c86084..f3c4a05e89 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -104,11 +104,11 @@ wx: token: #微信小程序消息服务器配置的token aesKey: #微信小程序消息服务器配置的EncodingAESKey msgDataFormat: JSON -# - appid: @gov.wx.ma.appId@ -# secret: @gov.wx.ma.secret@ -# token: #微信小程序消息服务器配置的token -# aesKey: #微信小程序消息服务器配置的EncodingAESKey -# msgDataFormat: JSON + - appid: @gov.wx.ma.appId@ + secret: @gov.wx.ma.secret@ + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON # - appid: @oper.wx.ma.appId@ # secret: @oper.wx.ma.secret@ # token: #微信小程序消息服务器配置的token @@ -118,6 +118,6 @@ wx: # 党群e事通-居民端小程序配置appId resi: @resi.wx.ma.appId@ # 党群e事通-政府端小程序配置的appId - #gov: @gov.wx.ma.appId@ + gov: @gov.wx.ma.appId@ # 党群e事通-运营端小程序配置的appId #oper: @oper.wx.ma.appId@ diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 7eabb4ea78..ec95859518 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://47.104.224.45:3308/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://localhost:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet password: elink@833066 #oracle配置 diff --git a/epmet-cloud-generator/src/main/resources/generator.properties b/epmet-cloud-generator/src/main/resources/generator.properties index fe8a7f1bfc..576870dd31 100644 --- a/epmet-cloud-generator/src/main/resources/generator.properties +++ b/epmet-cloud-generator/src/main/resources/generator.properties @@ -3,7 +3,7 @@ main= # package=com.epmet -moduleName=customer +moduleName= # author=generator #汾 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 256113a848..6fc8b3b948 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -118,4 +118,5 @@ public interface Constant { * 否 */ String NO="no"; + } 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 f63f1274c4..a77e4f3130 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 @@ -10,8 +10,10 @@ public enum EpmetErrorCode { CANNOT_JOIN_GROUP(8001, "只有认证党员和居民才可以加入小组,请选择您的身份"), CANNOT_CREATE_GROUP(8002, "只有党员和热心居民才能创建小组,请选择您的身份"), GROUP_ALREADY_EXISTED(8003,"组名已存在"), + GOV_STAFF_NOT_EXISTS(8004,"未找到您所属的组织,请联系您单位的管理员,确认其录入的手机号和您注册的号码一致。"), + GOV_STAFF_DISABLED(8005,"您好,您的账户已被冻结,请联系管理员。"), LOSE_EFFICACY(8006,"此邀请链接已过期"), - + ERROR_PHONE(8007,"请输入正确的手机号"), 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/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 4b57bb3530..199e38e235 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 @@ -195,4 +195,16 @@ public class RedisKeys { public static String getResiGroupMemberInfoKey(String groupId, String userId){ return rootPrefix.concat("resi:group:member:").concat(groupId).concat(":").concat(userId); } + + /** + * @param phone 手机号 + * @param smsCode 短信验证码 + * @return java.lang.String + * @Author yinzuomei + * @Description 政府端登录发送验证码 epmet:app:client:phone + * @Date 2020/4/18 13:54 + **/ + public static String getLoginSmsCodeKey(String app, String client, String phone) { + return String.format(rootPrefix+"smsCode:login:%s:%s:%s",app,client,phone); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/PhoneValidatorUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/PhoneValidatorUtils.java new file mode 100644 index 0000000000..a762a6848d --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/PhoneValidatorUtils.java @@ -0,0 +1,27 @@ +package com.epmet.commons.tools.validator; + +import org.apache.commons.lang3.StringUtils; + +import java.util.regex.Pattern; + +/** + * @Description 手机号验证工具类 + * @Author yinzuomei + * @Date 2020/4/18 15:04 + */ +public class PhoneValidatorUtils { + private static final String REGEX_MOBILE ="((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19(1|[8-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))"; + + /** + * 判断是否是手机号 + * @param tel 手机号 + * @return boolean true:是 false:否 + */ + public static boolean isMobile(String tel) { + if (StringUtils.isEmpty(tel)){ + return false; + } + return Pattern.matches(REGEX_MOBILE, tel); + } +} + diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index dbdf2ef12c..a451ebf0b2 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -144,13 +144,17 @@ http://127.0.0.1:8092 + http://127.0.0.1:8093 + http://127.0.0.1:8094 + http://127.0.0.1:8095 http://127.0.0.1:8096 + diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml index b1d4d0b2df..bec82016e8 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml @@ -167,13 +167,13 @@ - + - epmet - elink@833066 + epmet_activiti_user + EpmEt-db-UsEr 0 - 127.0.0.1 + 192.168.1.130 6379 123456 diff --git a/epmet-module/epmet-demo/epmet-demo-server/pom.xml b/epmet-module/epmet-demo/epmet-demo-server/pom.xml index fb06ddf2f6..55e1cd3dd8 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/pom.xml +++ b/epmet-module/epmet-demo/epmet-demo-server/pom.xml @@ -110,13 +110,13 @@ - + - epmet - elink@833066 + epmet_demo_user + EpmEt-db-UsEr 0 - 127.0.0.1 + 192.168.1.130 6379 123456 diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index 59a90991f5..7eefa6619d 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -106,13 +106,13 @@ - + - epmet - elink@833066 + epmet_job_user + EpmEt-db-UsEr - 127.0.0.1 - 10.10.10.248 + 0 + 192.168.1.130 6379 123456 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 79ffd34959..f54b2636a0 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -127,13 +127,13 @@ - + - epmet - elink@833066 + epmet_message_user + EpmEt-db-UsEr 0 - 127.0.0.1 + 192.168.1.130 6379 123456 diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index 464ec9d2e6..1739dca832 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -129,13 +129,13 @@ - + - epmet - elink@833066 + epmet_oss_user + EpmEt-db-UsEr 0 - 127.0.0.1 + 192.168.1.130 6379 123456 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerOrganizationDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java similarity index 72% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerOrganizationDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java index 99da24c5af..9523753483 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerOrganizationDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java @@ -23,13 +23,13 @@ import lombok.Data; /** - * 客户组织表 + * 机关单位信息表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data -public class CustomerOrganizationDTO implements Serializable { +public class CustomerAgencyDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -44,44 +44,43 @@ public class CustomerOrganizationDTO implements Serializable { private String customerId; /** - * 上级组织ID + * 上级组织机构ID */ private String pid; /** - * 所有上级组织ID + * 所有上级组织机构ID(以英文:隔开) */ private String pids; /** - * 组织名称 + * 所有上级名称,以-连接 */ - private String organizationName; + private String allParentName; /** - * 组织编码 + * 组织名称 */ - private String organizationCode; + private String organizationName; /** - * 级别 字典表key:level + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) */ - private Integer level; + private String level; /** - * 地区码 阿里云公共api + * 地区编码 */ private Integer areaCode; - /** - * 排序 - */ - private Integer sort; - /** * 删除标识 */ - private Integer delFlag; + private String delFlag; /** * 乐观锁 @@ -108,4 +107,9 @@ public class CustomerOrganizationDTO implements Serializable { */ private Date updatedTime; + /** + * 总人数 + */ + private Integer totalUser; + } \ No newline at end of file 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 ce71b879e0..0248ff77e2 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 @@ -23,10 +23,10 @@ import lombok.Data; /** - * 客户部门表 + * 客户部门表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data public class CustomerDepartmentDTO implements Serializable { @@ -44,34 +44,29 @@ public class CustomerDepartmentDTO implements Serializable { private String customerId; /** - * 所属组织ID + * 所属组织机构ID(customer_organization.id) */ private String orgId; - /** - * 上级组织ID 用于查找归口部门 - */ - private String orgPid; - /** * 部门名称 */ - private String depatmentName; + private String departmentName; /** - * 部门编码 + * 部门职责 */ - private String depatmentCode; + private String departmentDuty; /** - * 排序 + * 总人数 */ - private Integer sort; + private Integer totalUser; /** * 删除标识:0.未删除 1.已删除 */ - private Integer delFlag; + private String delFlag; /** * 乐观锁 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java index f5ebbaa64f..a3c62138e1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java @@ -17,13 +17,14 @@ 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-03-16 @@ -49,68 +50,67 @@ public class CustomerGridDTO implements Serializable { private String gridName; /** - * 网格编码 + * 中心位置经度 */ - private String gridCode; + private String longitude; /** - * 上级组织ID + * 中心位置纬度 */ - private String pid; + private String latitude; /** - * 所有上级组织ID + * 所属地区码(所属组织地区码) */ - private String pids; + private String areaCode; /** - * 排序 + * 删除标识:0.未删除 1.已删除 */ - private Integer sort; + private Integer delFlag; /** - * 中心位置经度 + * 乐观锁 */ - private String longitude; + private Integer revision; /** - * 中心位置纬度 + * 创建人 */ - private String latitude; + private String createdBy; /** - * 所属地区码 + * 创建时间 */ - private String areaCode; + private Date createdTime; /** - * 删除标识:0.未删除 1.已删除 + * 更新人 */ - private Integer delFlag; + private String updatedBy; /** - * 乐观锁 + * 更新时间 */ - private Integer revision; + private Date updatedTime; /** - * 创建人 + * 管辖区域 */ - private String createdBy; + private String manageDistrict; /** - * 创建时间 + * 当前网格总人数 */ - private Date createdTime; + private Integer totalUser; /** - * 更新人 + * 所属组织机构ID(customer_organization.id) */ - private String updatedBy; + private String pid; /** - * 更新时间 + * 所有上级组织ID */ - private Date updatedTime; - + private String pids; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffOrganizationDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java similarity index 85% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffOrganizationDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java index e47a4c6ddb..797324673c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffOrganizationDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java @@ -23,13 +23,13 @@ import lombok.Data; /** - * 客户人员组织表 + * 人员-机关单位关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data -public class CustomerStaffOrganizationDTO implements Serializable { +public class CustomerStaffAgencyDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -46,17 +46,12 @@ public class CustomerStaffOrganizationDTO implements Serializable { /** * 用户ID */ - private String staffId; + private String userId; /** - * 组织ID + * 组织机构ID customer_agency.id */ - private String orgId; - - /** - * 级别 - */ - private Integer level; + private String agencyId; /** * 删除标识 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffDepartmentDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffDepartmentDTO.java index cbaadafa56..4751f197c1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffDepartmentDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffDepartmentDTO.java @@ -23,10 +23,10 @@ import lombok.Data; /** - * 客户人员部门表 + * 部门人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data public class CustomerStaffDepartmentDTO implements Serializable { @@ -46,17 +46,17 @@ public class CustomerStaffDepartmentDTO implements Serializable { /** * 用户ID */ - private String staffId; + private String userId; /** - * 部门ID + * 部门ID customer_department.id */ - private String departmentiD; + private String departmentId; /** * 删除标识 */ - private Integer delFlag; + private String delFlag; /** * 乐观锁 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffGridDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffGridDTO.java index 86edacc48e..471afebf64 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffGridDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffGridDTO.java @@ -23,10 +23,10 @@ import lombok.Data; /** - * 客户人员网格表 + * 网格人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data public class CustomerStaffGridDTO implements Serializable { @@ -39,19 +39,19 @@ public class CustomerStaffGridDTO implements Serializable { private String id; /** - * 客户ID + * 用户id, user.id */ - private String customerId; + private String userId; /** - * 用户ID + * 网格ID customer_grid.id */ - private String staffId; + private String gridId; /** - * 网格ID + * 客户ID */ - private String gridId; + private String customerId; /** * 删除标识 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffRoleDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffRoleDTO.java deleted file mode 100644 index 66c98e68bc..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffRoleDTO.java +++ /dev/null @@ -1,81 +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.dto; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 客户人员角色表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Data -public class CustomerStaffRoleDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID - */ - private String id; - - /** - * 用户ID - */ - private String staffId; - - /** - * 角色ID - */ - private String roleId; - - /** - * 删除标识 - */ - 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/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java new file mode 100644 index 0000000000..064d2173ea --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java @@ -0,0 +1,13 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class OrgTreeNode { + private String orgId; + private String orgName; + private String orgType; + private List subOrgs; +} diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 3a2f83e06b..deb18a6168 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -106,13 +106,13 @@ - + - epmet - elink@833066 + epmet_gov_org_user + EpmEt-db-UsEr 0 - 127.0.0.1 + 192.168.1.130 6379 123456 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRoleController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java similarity index 67% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRoleController.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 01c6e713fd..550cdb1832 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRoleController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -25,9 +25,9 @@ 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.CustomerRoleDTO; -import com.epmet.excel.CustomerRoleExcel; -import com.epmet.service.CustomerRoleService; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.excel.CustomerAgencyExcel; +import com.epmet.service.CustomerAgencyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -37,43 +37,43 @@ import java.util.Map; /** - * 客户角色表 + * 机关单位信息表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @RestController -@RequestMapping("customerrole") -public class CustomerRoleController { +@RequestMapping("customeragency") +public class CustomerAgencyController { @Autowired - private CustomerRoleService customerRoleService; + private CustomerAgencyService customerAgencyService; @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = customerRoleService.page(params); - return new Result>().ok(page); + 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){ - CustomerRoleDTO data = customerRoleService.get(id); - return new Result().ok(data); + public Result get(@PathVariable("id") String id){ + CustomerAgencyDTO data = customerAgencyService.get(id); + return new Result().ok(data); } @PostMapping - public Result save(@RequestBody CustomerRoleDTO dto){ + public Result save(@RequestBody CustomerAgencyDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - customerRoleService.save(dto); + customerAgencyService.save(dto); return new Result(); } @PutMapping - public Result update(@RequestBody CustomerRoleDTO dto){ + public Result update(@RequestBody CustomerAgencyDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - customerRoleService.update(dto); + customerAgencyService.update(dto); return new Result(); } @@ -81,14 +81,14 @@ public class CustomerRoleController { public Result delete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); - customerRoleService.delete(ids); + customerAgencyService.delete(ids); return new Result(); } @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = customerRoleService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, CustomerRoleExcel.class); + List list = customerAgencyService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerAgencyExcel.class); } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerDepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerDepartmentController.java index 6ca515264a..5f8dc2e298 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerDepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerDepartmentController.java @@ -37,10 +37,10 @@ import java.util.Map; /** - * 客户部门表 + * 客户部门表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @RestController @RequestMapping("customerdepartment") diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerOrganizationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerOrganizationController.java deleted file mode 100644 index d411443b2c..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerOrganizationController.java +++ /dev/null @@ -1,94 +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; - -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.CustomerOrganizationDTO; -import com.epmet.excel.CustomerOrganizationExcel; -import com.epmet.service.CustomerOrganizationService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; - - -/** - * 客户组织表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@RestController -@RequestMapping("customerorganization") -public class CustomerOrganizationController { - - @Autowired - private CustomerOrganizationService customerOrganizationService; - - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = customerOrganizationService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - CustomerOrganizationDTO data = customerOrganizationService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody CustomerOrganizationDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - customerOrganizationService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody CustomerOrganizationDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - customerOrganizationService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - customerOrganizationService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = customerOrganizationService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, CustomerOrganizationExcel.class); - } - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRelevantDepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRelevantDepartmentController.java deleted file mode 100644 index 7cc6d6811e..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerRelevantDepartmentController.java +++ /dev/null @@ -1,94 +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; - -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.CustomerRelevantDepartmentDTO; -import com.epmet.excel.CustomerRelevantDepartmentExcel; -import com.epmet.service.CustomerRelevantDepartmentService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; - - -/** - * 客户归口部门关系表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@RestController -@RequestMapping("customerrelevantdepartment") -public class CustomerRelevantDepartmentController { - - @Autowired - private CustomerRelevantDepartmentService customerRelevantDepartmentService; - - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = customerRelevantDepartmentService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - CustomerRelevantDepartmentDTO data = customerRelevantDepartmentService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody CustomerRelevantDepartmentDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - customerRelevantDepartmentService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody CustomerRelevantDepartmentDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - customerRelevantDepartmentService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - customerRelevantDepartmentService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = customerRelevantDepartmentService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, CustomerRelevantDepartmentExcel.class); - } - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffRoleController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java similarity index 64% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffRoleController.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java index b277f187c7..58219da027 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffRoleController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java @@ -25,9 +25,9 @@ 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.CustomerStaffRoleDTO; -import com.epmet.excel.CustomerStaffRoleExcel; -import com.epmet.service.CustomerStaffRoleService; +import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.excel.CustomerStaffAgencyExcel; +import com.epmet.service.CustomerStaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -37,43 +37,43 @@ import java.util.Map; /** - * 客户人员角色表 + * 人员-机关单位关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @RestController -@RequestMapping("customerstaffrole") -public class CustomerStaffRoleController { +@RequestMapping("customerstaffagency") +public class CustomerStaffAgencyController { @Autowired - private CustomerStaffRoleService customerStaffRoleService; + private CustomerStaffAgencyService customerStaffAgencyService; @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = customerStaffRoleService.page(params); - return new Result>().ok(page); + public Result> page(@RequestParam Map params){ + PageData page = customerStaffAgencyService.page(params); + return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - CustomerStaffRoleDTO data = customerStaffRoleService.get(id); - return new Result().ok(data); + public Result get(@PathVariable("id") String id){ + CustomerStaffAgencyDTO data = customerStaffAgencyService.get(id); + return new Result().ok(data); } @PostMapping - public Result save(@RequestBody CustomerStaffRoleDTO dto){ + public Result save(@RequestBody CustomerStaffAgencyDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - customerStaffRoleService.save(dto); + customerStaffAgencyService.save(dto); return new Result(); } @PutMapping - public Result update(@RequestBody CustomerStaffRoleDTO dto){ + public Result update(@RequestBody CustomerStaffAgencyDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - customerStaffRoleService.update(dto); + customerStaffAgencyService.update(dto); return new Result(); } @@ -81,14 +81,14 @@ public class CustomerStaffRoleController { public Result delete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); - customerStaffRoleService.delete(ids); + customerStaffAgencyService.delete(ids); return new Result(); } @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = customerStaffRoleService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffRoleExcel.class); + List list = customerStaffAgencyService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffAgencyExcel.class); } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java index b883f6a933..ee22c850bb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java @@ -37,10 +37,10 @@ import java.util.Map; /** - * 客户人员部门表 + * 部门人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @RestController @RequestMapping("customerstaffdepartment") 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 752fb2b9fc..ec584efb56 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 @@ -17,9 +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.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -29,7 +27,6 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.excel.CustomerStaffGridExcel; -import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO; import com.epmet.service.CustomerStaffGridService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -40,10 +37,10 @@ import java.util.Map; /** - * 客户人员网格表 + * 网格人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @RestController @RequestMapping("customerstaffgrid") @@ -94,15 +91,4 @@ public class CustomerStaffGridController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffGridExcel.class); } - /** - * @param - * @Author sun - * @Description 政府端-热心居民申请人工审核 - **/ - @PostMapping("manageaudit") - public Result manageAudit(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedAuditFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); - return customerStaffGridService.manageAudit(tokenDTO, formDTO); - } - } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffRoleDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java similarity index 83% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffRoleDao.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 21c279d181..185d2d33a1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffRoleDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -18,16 +18,16 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.CustomerStaffRoleEntity; +import com.epmet.entity.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; /** - * 客户人员角色表 + * 机关单位信息表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Mapper -public interface CustomerStaffRoleDao extends BaseDao { +public interface CustomerAgencyDao extends BaseDao { } \ 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 88235a5429..bd188f8351 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 @@ -22,10 +22,10 @@ import com.epmet.entity.CustomerDepartmentEntity; import org.apache.ibatis.annotations.Mapper; /** - * 客户部门表 + * 客户部门表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Mapper public interface CustomerDepartmentDao extends BaseDao { diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerRelevantDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerRelevantDepartmentDao.java deleted file mode 100644 index a054e54fdc..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerRelevantDepartmentDao.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.dao; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.CustomerRelevantDepartmentEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 客户归口部门关系表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Mapper -public interface CustomerRelevantDepartmentDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerOrganizationDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java similarity index 82% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerOrganizationDao.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 6455f9e7b5..8ac905edcb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerOrganizationDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -18,16 +18,16 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.CustomerOrganizationEntity; +import com.epmet.entity.CustomerStaffAgencyEntity; import org.apache.ibatis.annotations.Mapper; /** - * 客户组织表 + * 人员-机关单位关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Mapper -public interface CustomerOrganizationDao extends BaseDao { +public interface CustomerStaffAgencyDao extends BaseDao { } \ 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 ec0dd68a02..8a79a0dd2e 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 @@ -22,10 +22,10 @@ import com.epmet.entity.CustomerStaffDepartmentEntity; import org.apache.ibatis.annotations.Mapper; /** - * 客户人员部门表 + * 部门人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Mapper public interface CustomerStaffDepartmentDao extends BaseDao { 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 6f2b1def6f..01dc0c2721 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 @@ -22,10 +22,10 @@ import com.epmet.entity.CustomerStaffGridEntity; import org.apache.ibatis.annotations.Mapper; /** - * 客户人员网格表 + * 网格人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Mapper public interface CustomerStaffGridDao extends BaseDao { diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerOrganizationEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java similarity index 68% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerOrganizationEntity.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index 3a7f9343d1..b06e833347 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerOrganizationEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java @@ -26,61 +26,60 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 客户组织表 + * 机关单位信息表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("customer_organization") -public class CustomerOrganizationEntity extends BaseEpmetEntity { +@TableName("customer_agency") +public class CustomerAgencyEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; - /** - * ID - */ - private String id; - /** * 客户ID */ private String customerId; /** - * 上级组织ID + * 上级组织机构ID */ private String pid; /** - * 所有上级组织ID + * 所有上级组织机构ID(以英文:隔开) */ private String pids; /** - * 组织名称 + * 所有上级名称,以-连接 */ - private String organizationName; + private String allParentName; /** - * 组织编码 + * 组织名称 */ - private String organizationCode; + private String organizationName; /** - * 级别 字典表key:level + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) */ - private Integer level; + private String level; /** - * 地区码 阿里云公共api + * 地区编码 */ private Integer areaCode; /** - * 排序 + * 总人数 */ - private Integer sort; + private Integer totalUser; } 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 2ec4a1e951..b34f814bc1 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 @@ -26,10 +26,10 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 客户部门表 + * 客户部门表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data @EqualsAndHashCode(callSuper=false) @@ -44,28 +44,23 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity { private String customerId; /** - * 所属组织ID + * 所属组织机构ID(customer_organization.id) */ private String orgId; - /** - * 上级组织ID 用于查找归口部门 - */ - private String orgPid; - /** * 部门名称 */ - private String depatmentName; + private String departmentName; /** - * 部门编码 + * 部门职责 */ - private String depatmentCode; + private String departmentDuty; /** - * 排序 + * 总人数 */ - private Integer sort; + private Integer totalUser; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java index 1e101c1a5b..26d0cd84af 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java @@ -18,15 +18,12 @@ 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-03-16 @@ -48,39 +45,38 @@ public class CustomerGridEntity extends BaseEpmetEntity { */ private String gridName; - /** - * 网格编码 - */ - private String gridCode; - - /** - * 上级组织ID - */ - private String pid; - - /** - * 所有上级组织ID - */ - private String pids; - - /** - * 排序 - */ - private Integer sort; - - /** - * 中心位置经度 - */ + /** + * 中心位置经度 + */ private String longitude; - /** - * 中心位置纬度 - */ + /** + * 中心位置纬度 + */ private String latitude; - /** - * 所属地区码 - */ + /** + * 所属地区码(所属组织地区码) + */ private String areaCode; + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构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/entity/CustomerRoleEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java similarity index 80% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerRoleEntity.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java index 9cca6a932b..f9b1d01de8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerRoleEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java @@ -26,15 +26,15 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 客户角色表 + * 人员-机关单位关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("customer_role") -public class CustomerRoleEntity extends BaseEpmetEntity { +@TableName("customer_staff_agency") +public class CustomerStaffAgencyEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; @@ -44,18 +44,13 @@ public class CustomerRoleEntity extends BaseEpmetEntity { private String customerId; /** - * 角色名称 + * 用户ID */ - private String roleName; + private String userId; /** - * 角色编码 + * 组织机构ID customer_agency.id */ - private String roleCode; - - /** - * 排序 - */ - private Integer sort; + private String agencyId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffDepartmentEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffDepartmentEntity.java index 55da3442ad..486bd1d140 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffDepartmentEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffDepartmentEntity.java @@ -26,10 +26,10 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 客户人员部门表 + * 部门人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data @EqualsAndHashCode(callSuper=false) @@ -46,11 +46,11 @@ public class CustomerStaffDepartmentEntity extends BaseEpmetEntity { /** * 用户ID */ - private String staffId; + private String userId; /** - * 部门ID + * 部门ID customer_department.id */ - private String departmentiD; + private String departmentId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffGridEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffGridEntity.java index 6452776bfd..920e672a20 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffGridEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffGridEntity.java @@ -26,10 +26,10 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 客户人员网格表 + * 网格人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data @EqualsAndHashCode(callSuper=false) @@ -39,18 +39,18 @@ public class CustomerStaffGridEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; /** - * 客户ID + * 用户id, user.id */ - private String customerId; + private String userId; /** - * 用户ID + * 网格ID customer_grid.id */ - private String staffId; + private String gridId; /** - * 网格ID + * 客户ID */ - private String gridId; + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffRoleEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffRoleEntity.java deleted file mode 100644 index be4deaba69..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffRoleEntity.java +++ /dev/null @@ -1,51 +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.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-03-16 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("customer_staff_role") -public class CustomerStaffRoleEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 用户ID - */ - private String staffId; - - /** - * 角色ID - */ - private String roleId; - -} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerOrganizationExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java similarity index 68% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerOrganizationExcel.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java index 89597a98fc..27422f3157 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerOrganizationExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerAgencyExcel.java @@ -23,13 +23,13 @@ import lombok.Data; import java.util.Date; /** - * 客户组织表 + * 机关单位信息表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data -public class CustomerOrganizationExcel { +public class CustomerAgencyExcel { @Excel(name = "ID") private String id; @@ -37,29 +37,26 @@ public class CustomerOrganizationExcel { @Excel(name = "客户ID") private String customerId; - @Excel(name = "上级组织ID") + @Excel(name = "上级组织机构ID") private String pid; - @Excel(name = "所有上级组织ID") + @Excel(name = "所有上级组织机构ID(以英文:隔开)") private String pids; + @Excel(name = "所有上级名称,以-连接") + private String allParentName; + @Excel(name = "组织名称") private String organizationName; - @Excel(name = "组织编码") - private String organizationCode; - - @Excel(name = "级别 字典表key:level") - private Integer level; + @Excel(name = "机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province)") + private String level; - @Excel(name = "地区码 阿里云公共api") + @Excel(name = "地区编码") private Integer areaCode; - @Excel(name = "排序") - private Integer sort; - @Excel(name = "删除标识") - private Integer delFlag; + private String delFlag; @Excel(name = "乐观锁") private Integer revision; @@ -76,5 +73,8 @@ public class CustomerOrganizationExcel { @Excel(name = "更新时间") private Date updatedTime; + @Excel(name = "总人数") + private Integer totalUser; + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerDepartmentExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerDepartmentExcel.java index 0be683105c..0f9d4f02fc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerDepartmentExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerDepartmentExcel.java @@ -23,10 +23,10 @@ import lombok.Data; import java.util.Date; /** - * 客户部门表 + * 客户部门表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data public class CustomerDepartmentExcel { @@ -37,23 +37,20 @@ public class CustomerDepartmentExcel { @Excel(name = "客户ID") private String customerId; - @Excel(name = "所属组织ID") + @Excel(name = "所属组织机构ID(customer_organization.id)") private String orgId; - @Excel(name = "上级组织ID 用于查找归口部门") - private String orgPid; - @Excel(name = "部门名称") - private String depatmentName; + private String departmentName; - @Excel(name = "部门编码") - private String depatmentCode; + @Excel(name = "部门职责") + private String departmentDuty; - @Excel(name = "排序") - private Integer sort; + @Excel(name = "总人数") + private Integer totalUser; @Excel(name = "删除标识:0.未删除 1.已删除") - private Integer delFlag; + private String delFlag; @Excel(name = "乐观锁") private Integer revision; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerRelevantDepartmentExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerRelevantDepartmentExcel.java deleted file mode 100644 index 92e3f54489..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerRelevantDepartmentExcel.java +++ /dev/null @@ -1,62 +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.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-03-16 - */ -@Data -public class CustomerRelevantDepartmentExcel { - - @Excel(name = "ID") - private String id; - - @Excel(name = "部门ID") - private String departmentId; - - @Excel(name = "归口部门ID") - private String relevantDepartmentId; - - @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-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffOrganizationExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffAgencyExcel.java similarity index 85% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffOrganizationExcel.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffAgencyExcel.java index 313949ca7c..55abe860f5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffOrganizationExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffAgencyExcel.java @@ -23,13 +23,13 @@ import lombok.Data; import java.util.Date; /** - * 客户人员组织表 + * 人员-机关单位关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data -public class CustomerStaffOrganizationExcel { +public class CustomerStaffAgencyExcel { @Excel(name = "ID") private String id; @@ -38,13 +38,10 @@ public class CustomerStaffOrganizationExcel { private String customerId; @Excel(name = "用户ID") - private String staffId; + private String userId; - @Excel(name = "组织ID") - private String orgId; - - @Excel(name = "级别") - private Integer level; + @Excel(name = "组织机构ID customer_agency.id") + private String agencyId; @Excel(name = "删除标识") private Integer delFlag; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffDepartmentExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffDepartmentExcel.java index 3803bee96c..44467cf948 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffDepartmentExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffDepartmentExcel.java @@ -23,10 +23,10 @@ import lombok.Data; import java.util.Date; /** - * 客户人员部门表 + * 部门人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data public class CustomerStaffDepartmentExcel { @@ -38,13 +38,13 @@ public class CustomerStaffDepartmentExcel { private String customerId; @Excel(name = "用户ID") - private String staffId; + private String userId; - @Excel(name = "部门ID") - private String departmentiD; + @Excel(name = "部门ID customer_department.id") + private String departmentId; @Excel(name = "删除标识") - private Integer delFlag; + private String delFlag; @Excel(name = "乐观锁") private Integer revision; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffGridExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffGridExcel.java index 824316ff8f..b3e63882aa 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffGridExcel.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffGridExcel.java @@ -23,10 +23,10 @@ import lombok.Data; import java.util.Date; /** - * 客户人员网格表 + * 网格人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Data public class CustomerStaffGridExcel { @@ -34,15 +34,15 @@ public class CustomerStaffGridExcel { @Excel(name = "ID") private String id; - @Excel(name = "客户ID") - private String customerId; - - @Excel(name = "用户ID") - private String staffId; + @Excel(name = "用户id, user.id") + private String userId; - @Excel(name = "网格ID") + @Excel(name = "网格ID customer_grid.id") private String gridId; + @Excel(name = "客户ID") + private String customerId; + @Excel(name = "删除标识") private Integer delFlag; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffRoleExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffRoleExcel.java deleted file mode 100644 index b8a8fc05ac..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffRoleExcel.java +++ /dev/null @@ -1,62 +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.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-03-16 - */ -@Data -public class CustomerStaffRoleExcel { - - @Excel(name = "ID") - private String id; - - @Excel(name = "用户ID") - private String staffId; - - @Excel(name = "角色ID") - private String roleId; - - @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-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 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java deleted file mode 100644 index f1e7ef4c9e..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java +++ /dev/null @@ -1,25 +0,0 @@ -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.warmhearted.form.ResiWarmheartedAuditFormDTO; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; - -/** - * @Description 政府端工作人员审核 - * @Author sun - */ -@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartymemberFeignClientFallBack.class) -public interface ResiPartymemberFeignClient { - - /** - * @Author sun - * @Description 政府端-热心居民申请人工审核 - **/ - @PostMapping(value = "resi/partymember/resiwarmheartedapply/manageaudit") - Result manageAudit(ResiWarmheartedAuditFormDTO formDTO); - - -} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java deleted file mode 100644 index 90ddb00086..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.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.feign.ResiPartymemberFeignClient; -import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO; -import org.springframework.stereotype.Component; - -/** - * @Description 政府端工作人员审核 - * @Author sun - */ -@Component -public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignClient { - - @Override - public Result manageAudit(ResiWarmheartedAuditFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "manageAudit", formDTO); - } -} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerOrganizationRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java similarity index 92% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerOrganizationRedis.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java index 9205ed1744..3b8e96c9a2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerOrganizationRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java @@ -22,13 +22,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 客户组织表 + * 机关单位信息表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Component -public class CustomerOrganizationRedis { +public class CustomerAgencyRedis { @Autowired private RedisUtils redisUtils; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.java index 92452e202c..3a99915463 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.java @@ -22,10 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 客户部门表 + * 客户部门表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Component public class CustomerDepartmentRedis { diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerRelevantDepartmentRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerRelevantDepartmentRedis.java deleted file mode 100644 index 42714c551b..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerRelevantDepartmentRedis.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-03-16 - */ -@Component -public class CustomerRelevantDepartmentRedis { - @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-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffRoleRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffAgencyRedis.java similarity index 92% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffRoleRedis.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffAgencyRedis.java index 880014e64b..fa3f4c59f5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffRoleRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffAgencyRedis.java @@ -22,13 +22,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 客户人员角色表 + * 人员-机关单位关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Component -public class CustomerStaffRoleRedis { +public class CustomerStaffAgencyRedis { @Autowired private RedisUtils redisUtils; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java index b2d6ed382a..3c8bfdb608 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java @@ -22,10 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 客户人员部门表 + * 部门人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Component public class CustomerStaffDepartmentRedis { diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java index 4d0a0b4732..23b0eab20a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java @@ -22,10 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 客户人员网格表 + * 网格人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Component public class CustomerStaffGridRedis { diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffOrganizationRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffOrganizationRedis.java deleted file mode 100644 index c953577757..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffOrganizationRedis.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-03-16 - */ -@Component -public class CustomerStaffOrganizationRedis { - @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-org/gov-org-server/src/main/java/com/epmet/service/CustomerRoleService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java similarity index 68% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerRoleService.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index d5a7c70464..319e26890f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerRoleService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -19,49 +19,49 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.CustomerRoleDTO; -import com.epmet.entity.CustomerRoleEntity; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.entity.CustomerAgencyEntity; import java.util.List; import java.util.Map; /** - * 客户角色表 + * 机关单位信息表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ -public interface CustomerRoleService extends BaseService { +public interface CustomerAgencyService extends BaseService { /** * 默认分页 * * @param params - * @return PageData + * @return PageData * @author generator - * @date 2020-03-16 + * @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-03-16 + * @date 2020-04-20 */ - List list(Map params); + List list(Map params); /** * 单条查询 * * @param id - * @return CustomerRoleDTO + * @return CustomerAgencyDTO * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ - CustomerRoleDTO get(String id); + CustomerAgencyDTO get(String id); /** * 默认保存 @@ -69,9 +69,9 @@ public interface CustomerRoleService extends BaseService { * @param dto * @return void * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ - void save(CustomerRoleDTO dto); + void save(CustomerAgencyDTO dto); /** * 默认更新 @@ -79,9 +79,9 @@ public interface CustomerRoleService extends BaseService { * @param dto * @return void * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ - void update(CustomerRoleDTO dto); + void update(CustomerAgencyDTO dto); /** * 批量删除 @@ -89,7 +89,7 @@ public interface CustomerRoleService extends BaseService { * @param ids * @return void * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ void delete(String[] ids); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java index 46a5016af2..9722ca82af 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java @@ -26,10 +26,10 @@ import java.util.List; import java.util.Map; /** - * 客户部门表 + * 客户部门表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ public interface CustomerDepartmentService extends BaseService { @@ -39,7 +39,7 @@ public interface CustomerDepartmentService extends BaseService * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ PageData page(Map params); @@ -49,7 +49,7 @@ public interface CustomerDepartmentService extends BaseService * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ List list(Map params); @@ -59,7 +59,7 @@ public interface CustomerDepartmentService extends BaseService { +public interface CustomerStaffAgencyService extends BaseService { /** * 默认分页 * * @param params - * @return PageData + * @return PageData * @author generator - * @date 2020-03-16 + * @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-03-16 + * @date 2020-04-20 */ - List list(Map params); + List list(Map params); /** * 单条查询 * * @param id - * @return CustomerOrganizationDTO + * @return CustomerStaffAgencyDTO * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ - CustomerOrganizationDTO get(String id); + CustomerStaffAgencyDTO get(String id); /** * 默认保存 @@ -69,9 +69,9 @@ public interface CustomerOrganizationService extends BaseService { @@ -39,7 +39,7 @@ public interface CustomerStaffDepartmentService extends BaseService * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ PageData page(Map params); @@ -49,7 +49,7 @@ public interface CustomerStaffDepartmentService extends BaseService * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ List list(Map params); @@ -59,7 +59,7 @@ public interface CustomerStaffDepartmentService extends BaseService { @@ -42,7 +39,7 @@ public interface CustomerStaffGridService extends BaseService * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ PageData page(Map params); @@ -52,7 +49,7 @@ public interface CustomerStaffGridService extends BaseService * @author generator - * @date 2020-03-16 + * @date 2020-04-20 */ List list(Map params); @@ -62,7 +59,7 @@ public interface CustomerStaffGridService extends BaseService - * 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.CustomerStaffOrganizationDTO; -import com.epmet.entity.CustomerStaffOrganizationEntity; - -import java.util.List; -import java.util.Map; - -/** - * 客户人员组织表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -public interface CustomerStaffOrganizationService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-03-16 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-03-16 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return CustomerStaffOrganizationDTO - * @author generator - * @date 2020-03-16 - */ - CustomerStaffOrganizationDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-03-16 - */ - void save(CustomerStaffOrganizationDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-03-16 - */ - void update(CustomerStaffOrganizationDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-03-16 - */ - void delete(String[] ids); -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerRoleServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java similarity index 58% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerRoleServiceImpl.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 6b7011bc29..fa513326e4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerRoleServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -23,11 +23,11 @@ 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.CustomerRoleDao; -import com.epmet.dto.CustomerRoleDTO; -import com.epmet.entity.CustomerRoleEntity; -import com.epmet.redis.CustomerRoleRedis; -import com.epmet.service.CustomerRoleService; +import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.redis.CustomerAgencyRedis; +import com.epmet.service.CustomerAgencyService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,59 +38,59 @@ import java.util.List; import java.util.Map; /** - * 客户角色表 + * 机关单位信息表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Service -public class CustomerRoleServiceImpl extends BaseServiceImpl implements CustomerRoleService { +public class CustomerAgencyServiceImpl extends BaseServiceImpl implements CustomerAgencyService { @Autowired - private CustomerRoleRedis customerRoleRedis; + private CustomerAgencyRedis customerAgencyRedis; @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, CustomerRoleDTO.class); + return getPageData(page, CustomerAgencyDTO.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, CustomerRoleDTO.class); + return ConvertUtils.sourceToTarget(entityList, CustomerAgencyDTO.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 CustomerRoleDTO get(String id) { - CustomerRoleEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, CustomerRoleDTO.class); + public CustomerAgencyDTO get(String id) { + CustomerAgencyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerAgencyDTO.class); } @Override @Transactional(rollbackFor = Exception.class) - public void save(CustomerRoleDTO dto) { - CustomerRoleEntity entity = ConvertUtils.sourceToTarget(dto, CustomerRoleEntity.class); + public void save(CustomerAgencyDTO dto) { + CustomerAgencyEntity entity = ConvertUtils.sourceToTarget(dto, CustomerAgencyEntity.class); insert(entity); } @Override @Transactional(rollbackFor = Exception.class) - public void update(CustomerRoleDTO dto) { - CustomerRoleEntity entity = ConvertUtils.sourceToTarget(dto, CustomerRoleEntity.class); + public void update(CustomerAgencyDTO dto) { + CustomerAgencyEntity entity = ConvertUtils.sourceToTarget(dto, CustomerAgencyEntity.class); updateById(entity); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java index f7e78d5f23..e3b81d7432 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java @@ -38,10 +38,10 @@ import java.util.List; import java.util.Map; /** - * 客户部门表 + * 客户部门表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Service public class CustomerDepartmentServiceImpl extends BaseServiceImpl implements CustomerDepartmentService { diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerOrganizationServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerOrganizationServiceImpl.java deleted file mode 100644 index 883aa63409..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerOrganizationServiceImpl.java +++ /dev/null @@ -1,104 +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.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.CustomerOrganizationDao; -import com.epmet.dto.CustomerOrganizationDTO; -import com.epmet.entity.CustomerOrganizationEntity; -import com.epmet.redis.CustomerOrganizationRedis; -import com.epmet.service.CustomerOrganizationService; -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-03-16 - */ -@Service -public class CustomerOrganizationServiceImpl extends BaseServiceImpl implements CustomerOrganizationService { - - @Autowired - private CustomerOrganizationRedis customerOrganizationRedis; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, CustomerOrganizationDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, CustomerOrganizationDTO.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 CustomerOrganizationDTO get(String id) { - CustomerOrganizationEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, CustomerOrganizationDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(CustomerOrganizationDTO dto) { - CustomerOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, CustomerOrganizationEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(CustomerOrganizationDTO dto) { - CustomerOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, CustomerOrganizationEntity.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-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerRelevantDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerRelevantDepartmentServiceImpl.java deleted file mode 100644 index 090d95b5cc..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerRelevantDepartmentServiceImpl.java +++ /dev/null @@ -1,104 +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.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.CustomerRelevantDepartmentDao; -import com.epmet.dto.CustomerRelevantDepartmentDTO; -import com.epmet.entity.CustomerRelevantDepartmentEntity; -import com.epmet.redis.CustomerRelevantDepartmentRedis; -import com.epmet.service.CustomerRelevantDepartmentService; -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-03-16 - */ -@Service -public class CustomerRelevantDepartmentServiceImpl extends BaseServiceImpl implements CustomerRelevantDepartmentService { - - @Autowired - private CustomerRelevantDepartmentRedis customerRelevantDepartmentRedis; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, CustomerRelevantDepartmentDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, CustomerRelevantDepartmentDTO.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 CustomerRelevantDepartmentDTO get(String id) { - CustomerRelevantDepartmentEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, CustomerRelevantDepartmentDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(CustomerRelevantDepartmentDTO dto) { - CustomerRelevantDepartmentEntity entity = ConvertUtils.sourceToTarget(dto, CustomerRelevantDepartmentEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(CustomerRelevantDepartmentDTO dto) { - CustomerRelevantDepartmentEntity entity = ConvertUtils.sourceToTarget(dto, CustomerRelevantDepartmentEntity.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-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffRoleServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java similarity index 60% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffRoleServiceImpl.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index 52835fe03c..f1786860da 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffRoleServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -23,11 +23,11 @@ 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.CustomerStaffRoleDao; -import com.epmet.dto.CustomerStaffRoleDTO; -import com.epmet.entity.CustomerStaffRoleEntity; -import com.epmet.redis.CustomerStaffRoleRedis; -import com.epmet.service.CustomerStaffRoleService; +import com.epmet.dao.CustomerStaffAgencyDao; +import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.entity.CustomerStaffAgencyEntity; +import com.epmet.redis.CustomerStaffAgencyRedis; +import com.epmet.service.CustomerStaffAgencyService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,59 +38,59 @@ import java.util.List; import java.util.Map; /** - * 客户人员角色表 + * 人员-机关单位关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Service -public class CustomerStaffRoleServiceImpl extends BaseServiceImpl implements CustomerStaffRoleService { +public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl implements CustomerStaffAgencyService { @Autowired - private CustomerStaffRoleRedis customerStaffRoleRedis; + private CustomerStaffAgencyRedis customerStaffAgencyRedis; @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, CustomerStaffRoleDTO.class); + return getPageData(page, CustomerStaffAgencyDTO.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, CustomerStaffRoleDTO.class); + return ConvertUtils.sourceToTarget(entityList, CustomerStaffAgencyDTO.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 CustomerStaffRoleDTO get(String id) { - CustomerStaffRoleEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, CustomerStaffRoleDTO.class); + public CustomerStaffAgencyDTO get(String id) { + CustomerStaffAgencyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerStaffAgencyDTO.class); } @Override @Transactional(rollbackFor = Exception.class) - public void save(CustomerStaffRoleDTO dto) { - CustomerStaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffRoleEntity.class); + public void save(CustomerStaffAgencyDTO dto) { + CustomerStaffAgencyEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffAgencyEntity.class); insert(entity); } @Override @Transactional(rollbackFor = Exception.class) - public void update(CustomerStaffRoleDTO dto) { - CustomerStaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffRoleEntity.class); + public void update(CustomerStaffAgencyDTO dto) { + CustomerStaffAgencyEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffAgencyEntity.class); updateById(entity); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java index 1273b9fa90..81cf6dafd9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java @@ -38,10 +38,10 @@ import java.util.List; import java.util.Map; /** - * 客户人员部门表 + * 部门人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Service public class CustomerStaffDepartmentServiceImpl extends BaseServiceImpl implements CustomerStaffDepartmentService { 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 1e31399e1d..894bb6a888 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 @@ -20,25 +20,15 @@ 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.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.entity.CustomerStaffGridEntity; -import com.epmet.feign.ResiPartymemberFeignClient; import com.epmet.redis.CustomerStaffGridRedis; -import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO; import com.epmet.service.CustomerStaffGridService; -import com.epmet.util.ModuleConstant; 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,18 +38,16 @@ import java.util.List; import java.util.Map; /** - * 客户人员网格表 + * 网格人员关系表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2020-04-20 */ @Service public class CustomerStaffGridServiceImpl extends BaseServiceImpl implements CustomerStaffGridService { - private static final Logger logger = LoggerFactory.getLogger(CustomerStaffGridServiceImpl.class); + @Autowired private CustomerStaffGridRedis customerStaffGridRedis; - @Autowired - private ResiPartymemberFeignClient resiPartymemberFeignClient; @Override public PageData page(Map params) { @@ -77,8 +65,8 @@ public class CustomerStaffGridServiceImpl 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); @@ -113,20 +101,4 @@ public class CustomerStaffGridServiceImpl 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.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.dao.CustomerStaffOrganizationDao; -import com.epmet.dto.CustomerStaffOrganizationDTO; -import com.epmet.entity.CustomerStaffOrganizationEntity; -import com.epmet.redis.CustomerStaffOrganizationRedis; -import com.epmet.service.CustomerStaffOrganizationService; -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-03-16 - */ -@Service -public class CustomerStaffOrganizationServiceImpl extends BaseServiceImpl implements CustomerStaffOrganizationService { - - @Autowired - private CustomerStaffOrganizationRedis customerStaffOrganizationRedis; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, CustomerStaffOrganizationDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, CustomerStaffOrganizationDTO.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 CustomerStaffOrganizationDTO get(String id) { - CustomerStaffOrganizationEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, CustomerStaffOrganizationDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(CustomerStaffOrganizationDTO dto) { - CustomerStaffOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffOrganizationEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(CustomerStaffOrganizationDTO dto) { - CustomerStaffOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffOrganizationEntity.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-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 new file mode 100644 index 0000000000..c53d7724f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql @@ -0,0 +1,108 @@ +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)', + `DEPARTMENT_NAME` varchar(128) NOT NULL COMMENT '部门名称', + `DEPARTMENT_DUTY` varchar(255) NOT NULL COMMENT '部门职责', + `TOTAL_USER` int(11) NOT NULL COMMENT '总人数', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `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='客户部门表 '; +-- ----------------------------------------------------------------------- +-- ----------------------------------------------------------------------- +DROP TABLE IF EXISTS `customer_organization`; +CREATE TABLE `customer_organization` ( + `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)', + `AREA_CODE` int(10) NOT NULL COMMENT '地区编码', + `DEL_FLAG` varchar(1) 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 '更新时间', + `TOTAL_USER` int(11) DEFAULT NULL COMMENT '总人数', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织机构表 '; +-- ----------------------------------------------------------------------- +-- ----------------------------------------------------------------------- +DROP TABLE IF EXISTS `customer_staff_department`; +CREATE TABLE `customer_staff_department` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `USER_ID` varchar(64) NOT NULL COMMENT '用户ID', + `DEPARTMENT_ID` varchar(64) NOT NULL COMMENT '部门ID customer_department.id', + `DEL_FLAG` varchar(1) 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='部门人员关系表 '; + +-- ----------------------------------------------------------------------- +-- ----------------------------------------------------------------------- +DROP TABLE IF EXISTS `customer_staff_grid`; +CREATE TABLE `customer_staff_grid` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `USER_ID` varchar(64) NOT NULL COMMENT '用户id, user.id', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID customer_grid.id', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户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='网格人员关系表 '; +-- ----------------------------------------------------------------------- +-- ----------------------------------------------------------------------- +DROP TABLE IF EXISTS `customer_staff_organization`; +CREATE TABLE `customer_staff_organization` ( + `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', + `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='组织人员关系表 '; + +-- ----------------------------------------------------------------------- +-- ----------------------------------------------------------------------- +drop table IF EXISTS customer_relevant_department; +drop table IF EXISTS customer_role; +drop table IF EXISTS customer_staff_role; +drop table IF EXISTS pdman_db_version; + +-- ----------------------------------------------------------------------- +-- ----------------------------------------------------------------------- +alter table customer_grid MODIFY column PID VARCHAR(64) NOT NULL COMMENT '所属组织机构ID(customer_organization.id)'; +alter table customer_grid MODIFY column PIDS VARCHAR(1024) NOT NULL COMMENT '所有上级组织ID'; +ALTER TABLE customer_grid MODIFY COLUMN CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID'; +ALTER TABLE customer_grid MODIFY COLUMN LONGITUDE VARCHAR(32) DEFAULT NULL COMMENT '中心位置经度'; +ALTER TABLE customer_grid MODIFY COLUMN LATITUDE VARCHAR(32) DEFAULT NULL COMMENT '中心位置纬度'; +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 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 '当前网格总人数'; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerOrganizationDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml similarity index 72% rename from epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerOrganizationDao.xml rename to epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index a426a91bb1..18bb63b7b9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerOrganizationDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -1,24 +1,24 @@ - + - - + + + - - + 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 66f55caad8..9f595da2fe 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 @@ -7,10 +7,9 @@ - - - - + + + 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 80f430442c..7c35a3e1c5 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 @@ -2,37 +2,14 @@ - - - - - - - - - - - - - - - - - - - - - + SELECT + * + FROM + staff_wechat sw + WHERE + sw.DEL_FLAG = '0' + AND sw.USER_ID = #{userId} + AND sw.WX_OPEN_ID = #{wxOpenId} + + + + \ No newline at end of file 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 6800fd862d..34b509b54d 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 @@ -2,19 +2,6 @@ - - - -