Browse Source

Merge branch 'lingshan_master' of http://git.elinkit.com.cn:7070/r/epmet-cloud

master
wxz 2 years ago
parent
commit
729e17cda6
  1. 3
      doc/epmet-cloud.md
  2. 10
      epmet-auth/pom.xml
  3. 3
      epmet-auth/src/main/java/com/epmet/AuthApplication.java
  4. 41
      epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java
  5. 9
      epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java
  6. 471
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  7. 74
      epmet-commons/epmet-commons-tools/pom.xml
  8. 10
      epmet-module/data-report/data-report-client/pom.xml
  9. 5
      epmet-module/data-report/data-report-server/pom.xml
  10. 12
      epmet-module/epmet-heart/epmet-heart-client/pom.xml
  11. 32
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenServiceRstDTO.java
  12. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java
  13. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java
  14. 70
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java
  15. 30
      epmet-module/epmet-third/epmet-third-client/pom.xml
  16. 33
      epmet-module/epmet-third/epmet-third-server/pom.xml
  17. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java
  18. 179
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java
  19. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java
  20. 8
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java
  21. 61
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java
  22. 14
      epmet-module/gov-issue/gov-issue-client/pom.xml
  23. 14
      epmet-module/gov-org/gov-org-client/pom.xml
  24. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java
  25. 18
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/ConfigPartyCenterHouseFormDTO.java
  26. 28
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/HouseTreeDTO.java
  27. 14
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/HouseTreeFormDTO.java
  28. 75
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingshanPartyCenterHouseLianhuDTO.java
  29. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PartyCenterHouseBindLianHuFormDTO.java
  30. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PartyCenterHouseResultDTO.java
  31. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseChangeEnums.java
  32. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  33. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  34. 36
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  35. 22
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  36. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/LingshanPartyCenterHouseLianhuDao.java
  37. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  38. 38
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  39. 119
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  40. 50
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
  41. 6
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  42. 18
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/LingshanPartyCenterHouseLianhuDao.xml
  43. 11
      epmet-module/gov-project/gov-project-client/pom.xml
  44. 83
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventAddEditFormDTO.java
  45. 86
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventFormsDTO.java
  46. 22
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java
  47. 23
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java
  48. 102
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventResultDTO.java
  49. 21
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java
  50. 12
      epmet-module/gov-project/gov-project-server/pom.xml
  51. 88
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java
  52. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/CustomerProjectParameterDao.java
  53. 19
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/EventEntityDao.java
  54. 43
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventDetailEntity.java
  55. 97
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventEntity.java
  56. 9
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java
  57. 20
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java
  58. 19
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/EventService.java
  59. 136
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java
  60. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  61. 13
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/EventEntityDao.xml
  62. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml
  63. 16
      epmet-user/epmet-user-client/pom.xml
  64. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java
  65. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/ResiImportDyzxhPostProcessor.java
  66. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/ResiImportPostProcessor.java
  67. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  68. 64
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

3
doc/epmet-cloud.md

@ -20,6 +20,9 @@ PS:目前正在测试通过负载均衡器和本地环境变量实现动态修
- dysmsapi.aliyuncs.com 阿里云短信
- api.weixin.qq.com 微信直接交互(二维码等)
- oss-cn-qingdao.aliyuncs.com(如果需要用到oss)
- service.sdmap.gov.cn 地图搜索代理
- wprd03.is.autonavi.com 地图瓦片代理
- oapi.dingtalk.com 钉钉后台交互(如果需要)

10
epmet-auth/pom.xml

@ -138,11 +138,11 @@
<artifactId>epmet-auth-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<artifactId>dingtalk-spring-boot-starter</artifactId>
<groupId>com.taobao</groupId>
<version>1.0.0</version>
</dependency>
<!-- <dependency>-->
<!-- <artifactId>dingtalk-spring-boot-starter</artifactId>-->
<!-- <groupId>com.taobao</groupId>-->
<!-- <version>1.0.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>

3
epmet-auth/src/main/java/com/epmet/AuthApplication.java

@ -8,7 +8,6 @@
package com.epmet;
import com.taobao.dingtalk.spring.annotations.EnableDingTalk;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
@ -21,7 +20,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@EnableDingTalk
//@EnableDingTalk
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients

41
epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java

@ -3,7 +3,6 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.*;
import com.epmet.dto.result.ResiDingAppLoginResDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.service.ThirdLoginService;
@ -159,11 +158,11 @@ public class ThirdLoginController {
* @param formDTO
* @return
*/
@PostMapping("resilogin-ding")
public Result<ResiDingAppLoginResDTO> resiLoginDing(@RequestBody ResiDingAppLoginFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO,ResiDingAppLoginFormDTO.InnerMiniApp.class);
return new Result<ResiDingAppLoginResDTO>().ok(thirdLoginService.resiLoginDing(formDTO));
}
// @PostMapping("resilogin-ding")
// public Result<ResiDingAppLoginResDTO> resiLoginDing(@RequestBody ResiDingAppLoginFormDTO formDTO) {
// ValidatorUtils.validateEntity(formDTO,ResiDingAppLoginFormDTO.InnerMiniApp.class);
// return new Result<ResiDingAppLoginResDTO>().ok(thirdLoginService.resiLoginDing(formDTO));
// }
/**
* 烟台建立应用授权给我们走企业免登
@ -173,11 +172,11 @@ public class ThirdLoginController {
* @param formDTO
* @return
*/
@PostMapping("resilogin-ding-md")
public Result<ResiDingAppLoginResDTO> resiLoginDingMd(@RequestBody DingAppLoginMdFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<ResiDingAppLoginResDTO>().ok(thirdLoginService.resiLoginDingMd(formDTO));
}
// @PostMapping("resilogin-ding-md")
// public Result<ResiDingAppLoginResDTO> resiLoginDingMd(@RequestBody DingAppLoginMdFormDTO formDTO) {
// ValidatorUtils.validateEntity(formDTO);
// return new Result<ResiDingAppLoginResDTO>().ok(thirdLoginService.resiLoginDingMd(formDTO));
// }
/**
* 企业内部应用开发不授权了 文档地址https://open.dingtalk.com/document/orgapp-server/enterprise-internal-application-logon-free
@ -200,11 +199,11 @@ public class ThirdLoginController {
* @return
* 目前烟台用的这个
*/
@PostMapping("resilogin-internalding")
public Result<ResiDingAppLoginResDTO> resiLoginInternalDing(@RequestBody DingAppLoginMdFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<ResiDingAppLoginResDTO>().ok(thirdLoginService.resiLoginInternalDing(formDTO));
}
// @PostMapping("resilogin-internalding")
// public Result<ResiDingAppLoginResDTO> resiLoginInternalDing(@RequestBody DingAppLoginMdFormDTO formDTO) {
// ValidatorUtils.validateEntity(formDTO);
// return new Result<ResiDingAppLoginResDTO>().ok(thirdLoginService.resiLoginInternalDing(formDTO));
// }
/**
* 根据免登授权码, 获取登录用户身份
@ -212,11 +211,11 @@ public class ThirdLoginController {
* @param formDTO 免登授权码
* @return
*/
@PostMapping("govlogin-internalding")
public Result<UserTokenResultDTO> login(@RequestBody DingAppLoginMdFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<UserTokenResultDTO>().ok(thirdLoginService.govLoginInternalDing(formDTO));
}
// @PostMapping("govlogin-internalding")
// public Result<UserTokenResultDTO> login(@RequestBody DingAppLoginMdFormDTO formDTO) {
// ValidatorUtils.validateEntity(formDTO);
// return new Result<UserTokenResultDTO>().ok(thirdLoginService.govLoginInternalDing(formDTO));
// }
/**
* 根据免登授权码, 获取登录用户身份

9
epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java

@ -1,7 +1,6 @@
package com.epmet.service;
import com.epmet.dto.form.*;
import com.epmet.dto.result.ResiDingAppLoginResDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
@ -93,7 +92,7 @@ public interface ThirdLoginService {
* @param formDTO
* @return
*/
ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO);
// ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO);
/**
* 企业简历内部应用授权给第三方
@ -102,21 +101,21 @@ public interface ThirdLoginService {
* @param formDTO
* @return
*/
ResiDingAppLoginResDTO resiLoginDingMd(DingAppLoginMdFormDTO formDTO);
// ResiDingAppLoginResDTO resiLoginDingMd(DingAppLoginMdFormDTO formDTO);
/**
* 企业内部应用免登 文档地址https://open.dingtalk.com/document/orgapp-server/enterprise-internal-application-logon-free
* @param formDTO
* @return
*/
ResiDingAppLoginResDTO resiLoginInternalDing(DingAppLoginMdFormDTO formDTO);
// ResiDingAppLoginResDTO resiLoginInternalDing(DingAppLoginMdFormDTO formDTO);
/**
* desc:企业内部应用 工作端登录
* @param formDTO
* @return
*/
UserTokenResultDTO govLoginInternalDing(DingAppLoginMdFormDTO formDTO);
// UserTokenResultDTO govLoginInternalDing(DingAppLoginMdFormDTO formDTO);
/**
* desc:烟台sso根据authCode 获取本系统token

471
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -5,22 +5,18 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.dingtalk.module.DingTalkResult;
import com.epmet.auth.constants.AuthOperationConstants;
import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerDingDingRedis;
import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache;
import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils;
@ -31,8 +27,6 @@ import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.constant.AuthHttpUrlConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.dto.*;
import com.epmet.dto.dingres.DingUserDetailDTO;
import com.epmet.dto.dingres.V2UserGetuserinfoResDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
@ -43,11 +37,6 @@ import com.epmet.jwt.JwtTokenUtils;
import com.epmet.redis.CaptchaRedis;
import com.epmet.service.GovWebService;
import com.epmet.service.ThirdLoginService;
import com.taobao.api.ApiException;
import com.taobao.dingtalk.client.DingTalkClientToken;
import com.taobao.dingtalk.client.DingTalkClientUser;
import com.taobao.dingtalk.vo.result.AccessTokenResult;
import com.taobao.dingtalk.vo.result.UserBaseInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -87,10 +76,10 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Autowired
private DingTalkClientToken dingTalkClientToken;
@Autowired
private DingTalkClientUser dingTalkClientUser;
// @Autowired
// private DingTalkClientToken dingTalkClientToken;
// @Autowired
// private DingTalkClientUser dingTalkClientUser;
@Autowired
private GovWebService govWebService;
@ -870,54 +859,54 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
* @param formDTO
* @return
*/
@Override
public ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO) {
//获取用户手机号
log.info("1、钉钉居民端应用登录入参:"+ JSON.toJSONString(formDTO));
ResiDingAppLoginResDTO resDTO= null;
try {
resDTO = new ResiDingAppLoginResDTO();
resDTO.setCustomerId(getCurrentCustomerId());
//1、获取用户手机号
String miniAppId = formDTO.getMiniAppId();
DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId);
DingTalkResult<AccessTokenResult> userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret());
log.info("2、resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken));
if (!userAccessToken.success() || null == userAccessToken.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用微信api异常:" + JSON.toJSONString(userAccessToken), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
}
DingTalkResult<UserBaseInfo> me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken());
log.info("3、resiLoginDing me:{}",JSON.toJSONString(me));
resDTO.setExtInfo(JSON.toJSONString(me.getData()));
if (!me.success() || StringUtils.isBlank(me.getData().getMobile())) {
log.error("resilogin-ding登录接口报错,入参:" + JSON.toJSONString(formDTO) + ";获取手机号为空, userAccessToken.getData().getAccessToken()=" + userAccessToken.getData().getAccessToken());
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空");
}
// 2、调用userfeign接口获取userId、注册网格相关信息 todo
DingLoginResiFormDTO dingLoginResiFormDTO=ConvertUtils.sourceToTarget(me.getData(),DingLoginResiFormDTO.class);
dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO);
if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) {
//临时打个日志
log.error(String.format("resilogin-ding获取epmetUserId异常,入参:%s,user服务返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(loginResiResDTOResult)));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
}
DingLoginResiResDTO resiResDTO=loginResiResDTOResult.getData();
resDTO.setGridId(resiResDTO.getGridId());
resDTO.setGridName(resiResDTO.getGridName());
resDTO.setAgencyId(resiResDTO.getAgencyId());
resDTO.setEpmetUserId(resiResDTO.getEpmetUserId());
resDTO.setRegFlag(resiResDTO.getRegFlag());
//3.生成token,并且存放Redis
String token=this.saveTokenDtoDing(formDTO.getMiniAppId(),AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId());
resDTO.setAuthorization(token);
} catch (ApiException e) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getErrMsg(), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
}
return resDTO;
}
// @Override
// public ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO) {
// //获取用户手机号
// log.info("1、钉钉居民端应用登录入参:"+ JSON.toJSONString(formDTO));
// ResiDingAppLoginResDTO resDTO= null;
// try {
// resDTO = new ResiDingAppLoginResDTO();
// resDTO.setCustomerId(getCurrentCustomerId());
// //1、获取用户手机号
// String miniAppId = formDTO.getMiniAppId();
// DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId);
// DingTalkResult<AccessTokenResult> userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret());
// log.info("2、resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken));
// if (!userAccessToken.success() || null == userAccessToken.getData()) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用微信api异常:" + JSON.toJSONString(userAccessToken), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
// }
// DingTalkResult<UserBaseInfo> me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken());
// log.info("3、resiLoginDing me:{}",JSON.toJSONString(me));
// resDTO.setExtInfo(JSON.toJSONString(me.getData()));
// if (!me.success() || StringUtils.isBlank(me.getData().getMobile())) {
// log.error("resilogin-ding登录接口报错,入参:" + JSON.toJSONString(formDTO) + ";获取手机号为空, userAccessToken.getData().getAccessToken()=" + userAccessToken.getData().getAccessToken());
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空");
// }
// // 2、调用userfeign接口获取userId、注册网格相关信息 todo
// DingLoginResiFormDTO dingLoginResiFormDTO=ConvertUtils.sourceToTarget(me.getData(),DingLoginResiFormDTO.class);
// dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
// Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO);
// if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) {
// //临时打个日志
// log.error(String.format("resilogin-ding获取epmetUserId异常,入参:%s,user服务返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(loginResiResDTOResult)));
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
// }
// DingLoginResiResDTO resiResDTO=loginResiResDTOResult.getData();
// resDTO.setGridId(resiResDTO.getGridId());
// resDTO.setGridName(resiResDTO.getGridName());
// resDTO.setAgencyId(resiResDTO.getAgencyId());
// resDTO.setEpmetUserId(resiResDTO.getEpmetUserId());
// resDTO.setRegFlag(resiResDTO.getRegFlag());
//
// //3.生成token,并且存放Redis
// String token=this.saveTokenDtoDing(formDTO.getMiniAppId(),AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId());
// resDTO.setAuthorization(token);
//
// } catch (ApiException e) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getErrMsg(), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
// }
// return resDTO;
// }
private String saveTokenDtoDing(String miniAppId,String app,String client, String userId,String customerId) {
//生成token串
@ -943,84 +932,84 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
return token;
}
@Override
public ResiDingAppLoginResDTO resiLoginDingMd(DingAppLoginMdFormDTO formDTO) {
// 获取用户手机号
log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO));
ResiDingAppLoginResDTO resDTO = null;
resDTO = new ResiDingAppLoginResDTO();
resDTO.setCustomerId(getCurrentCustomerId());
// 1、获取用户手机号
DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOMd(formDTO.getMiniAppId(), formDTO.getAuthCode());
dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
// 2、调用userfeign接口获取userId、注册网格相关信息
Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO);
if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) {
// 临时打个日志
log.error(String.format("resiLoginDingMd获取epmetUserId异常,入参:%s,user服务返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(loginResiResDTOResult)));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
}
DingLoginResiResDTO resiResDTO = loginResiResDTOResult.getData();
resDTO.setGridId(resiResDTO.getGridId());
resDTO.setGridName(resiResDTO.getGridName());
resDTO.setAgencyId(resiResDTO.getAgencyId());
resDTO.setEpmetUserId(resiResDTO.getEpmetUserId());
resDTO.setRegFlag(resiResDTO.getRegFlag());
// 3.生成token,并且存放Redis
String token = this.saveTokenDtoDing(formDTO.getMiniAppId(), AppClientConstant.APP_RESI, AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId());
resDTO.setAuthorization(token);
return resDTO;
}
private DingLoginResiFormDTO getDingLoginResiFormDTOMd(String miniAppId, String authCode) {
DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId);
// 1、服务商获取第三方应用授权企业的access_token,文档地址:https://open.dingtalk.com/document/orgapp-server/obtains-the-enterprise-authorized-credential
// 烟台的CorpId: dingaae55cbc47a96845f5bf40eda33b7ba0
String yantaiCorpId = "dingaae55cbc47a96845f5bf40eda33b7ba0";
DingTalkResult<String> res = dingTalkClientToken.getThirdAuthCorpAccessToken(dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), "abc", yantaiCorpId);
if (!res.success() || StringUtils.isBlank(res.getData())) {
log.error(String.format("企业内部应用免登服务商获取第三方应用授权企业的access_token失败,customKey:%s,customSecret:%s,corpId:%s", dingMiniInfo.getSuiteSecret(), dingMiniInfo.getSuiteSecret(), yantaiCorpId));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务商获取第三方应用授权企业的access_token", "服务商获取第三方应用授权企业的access_token");
}
String accessToken = res.getData();
log.info(String.format("1、服务商获取第三方应用授权企业的access_token返参:%s", accessToken));
// 2、通过免登码获取用户信息,文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-userid-of-a-user-by-using-the-log-free
DingTalkResult<String> v2UserGetuserinfoRes = dingTalkClientToken.getUserInfo(accessToken, authCode);
if (!v2UserGetuserinfoRes.success() || StringUtils.isBlank(v2UserGetuserinfoRes.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "通过免登码获取用户信息异常", "通过免登码获取用户信息异常");
}
log.info(String.format("2、通过免登码获取用户信息返参:%s", v2UserGetuserinfoRes.getData()));
V2UserGetuserinfoResDTO v2UserGetuserinfoResDTO = JSON.parseObject(v2UserGetuserinfoRes.getData(), V2UserGetuserinfoResDTO.class);
if (null == v2UserGetuserinfoResDTO || StringUtils.isBlank(v2UserGetuserinfoResDTO.getUserid())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉用户userid为空", "获取钉钉用户userid为空");
}
// 3、查询用户详情,文档地址:https://open.dingtalk.com/document/isvapp-server/query-user-details
DingTalkResult<String> v2UserGetRes = dingTalkClientToken.getUserDetail(v2UserGetuserinfoResDTO.getUserid(), accessToken);
if (!v2UserGetRes.success() || StringUtils.isBlank(v2UserGetRes.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据userId查询用户详情失败", "根据userId查询用户详情失败");
}
log.info(String.format("3、查询用户详情:%s", v2UserGetRes.getData()));
DingUserDetailDTO dingUserDetailDTO = JSON.parseObject(v2UserGetRes.getData(), DingUserDetailDTO.class);
if (null == dingUserDetailDTO || StringUtils.isBlank(dingUserDetailDTO.getMobile())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空");
}
DingLoginResiFormDTO dingLoginResiFormDTO = new DingLoginResiFormDTO();
dingLoginResiFormDTO.setAvatarUrl(dingUserDetailDTO.getAvatar());
dingLoginResiFormDTO.setEmail(dingUserDetailDTO.getOrg_email());
dingLoginResiFormDTO.setMobile(dingUserDetailDTO.getMobile());
dingLoginResiFormDTO.setNick(dingUserDetailDTO.getName());
dingLoginResiFormDTO.setOpenId(StrConstant.EPMETY_STR);
dingLoginResiFormDTO.setStateCode(dingUserDetailDTO.getState_code());
dingLoginResiFormDTO.setUnionId(dingUserDetailDTO.getUnionid());
return dingLoginResiFormDTO;
}
// @Override
// public ResiDingAppLoginResDTO resiLoginDingMd(DingAppLoginMdFormDTO formDTO) {
// // 获取用户手机号
// log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO));
// ResiDingAppLoginResDTO resDTO = null;
// resDTO = new ResiDingAppLoginResDTO();
// resDTO.setCustomerId(getCurrentCustomerId());
// // 1、获取用户手机号
// DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOMd(formDTO.getMiniAppId(), formDTO.getAuthCode());
// dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
// // 2、调用userfeign接口获取userId、注册网格相关信息
// Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO);
// if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) {
// // 临时打个日志
// log.error(String.format("resiLoginDingMd获取epmetUserId异常,入参:%s,user服务返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(loginResiResDTOResult)));
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
// }
// DingLoginResiResDTO resiResDTO = loginResiResDTOResult.getData();
// resDTO.setGridId(resiResDTO.getGridId());
// resDTO.setGridName(resiResDTO.getGridName());
// resDTO.setAgencyId(resiResDTO.getAgencyId());
// resDTO.setEpmetUserId(resiResDTO.getEpmetUserId());
// resDTO.setRegFlag(resiResDTO.getRegFlag());
//
// // 3.生成token,并且存放Redis
// String token = this.saveTokenDtoDing(formDTO.getMiniAppId(), AppClientConstant.APP_RESI, AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId());
// resDTO.setAuthorization(token);
//
// return resDTO;
// }
// private DingLoginResiFormDTO getDingLoginResiFormDTOMd(String miniAppId, String authCode) {
// DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId);
//
// // 1、服务商获取第三方应用授权企业的access_token,文档地址:https://open.dingtalk.com/document/orgapp-server/obtains-the-enterprise-authorized-credential
// // 烟台的CorpId: dingaae55cbc47a96845f5bf40eda33b7ba0
// String yantaiCorpId = "dingaae55cbc47a96845f5bf40eda33b7ba0";
// DingTalkResult<String> res = dingTalkClientToken.getThirdAuthCorpAccessToken(dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), "abc", yantaiCorpId);
// if (!res.success() || StringUtils.isBlank(res.getData())) {
// log.error(String.format("企业内部应用免登服务商获取第三方应用授权企业的access_token失败,customKey:%s,customSecret:%s,corpId:%s", dingMiniInfo.getSuiteSecret(), dingMiniInfo.getSuiteSecret(), yantaiCorpId));
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务商获取第三方应用授权企业的access_token", "服务商获取第三方应用授权企业的access_token");
// }
// String accessToken = res.getData();
// log.info(String.format("1、服务商获取第三方应用授权企业的access_token返参:%s", accessToken));
//
// // 2、通过免登码获取用户信息,文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-userid-of-a-user-by-using-the-log-free
// DingTalkResult<String> v2UserGetuserinfoRes = dingTalkClientToken.getUserInfo(accessToken, authCode);
// if (!v2UserGetuserinfoRes.success() || StringUtils.isBlank(v2UserGetuserinfoRes.getData())) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "通过免登码获取用户信息异常", "通过免登码获取用户信息异常");
// }
// log.info(String.format("2、通过免登码获取用户信息返参:%s", v2UserGetuserinfoRes.getData()));
// V2UserGetuserinfoResDTO v2UserGetuserinfoResDTO = JSON.parseObject(v2UserGetuserinfoRes.getData(), V2UserGetuserinfoResDTO.class);
// if (null == v2UserGetuserinfoResDTO || StringUtils.isBlank(v2UserGetuserinfoResDTO.getUserid())) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉用户userid为空", "获取钉钉用户userid为空");
// }
//
//
// // 3、查询用户详情,文档地址:https://open.dingtalk.com/document/isvapp-server/query-user-details
// DingTalkResult<String> v2UserGetRes = dingTalkClientToken.getUserDetail(v2UserGetuserinfoResDTO.getUserid(), accessToken);
// if (!v2UserGetRes.success() || StringUtils.isBlank(v2UserGetRes.getData())) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据userId查询用户详情失败", "根据userId查询用户详情失败");
// }
// log.info(String.format("3、查询用户详情:%s", v2UserGetRes.getData()));
// DingUserDetailDTO dingUserDetailDTO = JSON.parseObject(v2UserGetRes.getData(), DingUserDetailDTO.class);
// if (null == dingUserDetailDTO || StringUtils.isBlank(dingUserDetailDTO.getMobile())) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空");
// }
//
// DingLoginResiFormDTO dingLoginResiFormDTO = new DingLoginResiFormDTO();
// dingLoginResiFormDTO.setAvatarUrl(dingUserDetailDTO.getAvatar());
// dingLoginResiFormDTO.setEmail(dingUserDetailDTO.getOrg_email());
// dingLoginResiFormDTO.setMobile(dingUserDetailDTO.getMobile());
// dingLoginResiFormDTO.setNick(dingUserDetailDTO.getName());
// dingLoginResiFormDTO.setOpenId(StrConstant.EPMETY_STR);
// dingLoginResiFormDTO.setStateCode(dingUserDetailDTO.getState_code());
// dingLoginResiFormDTO.setUnionId(dingUserDetailDTO.getUnionid());
// return dingLoginResiFormDTO;
// }
/**
@ -1043,57 +1032,57 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
* @param formDTO
* @return
*/
@Override
public ResiDingAppLoginResDTO resiLoginInternalDing(DingAppLoginMdFormDTO formDTO) {
// 获取用户手机号
log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO));
ResiDingAppLoginResDTO resDTO = new ResiDingAppLoginResDTO();
resDTO.setCustomerId(getCurrentCustomerId());
// 1、获取用户手机号
DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOInternal(formDTO.getMiniAppId(), formDTO.getAuthCode());
dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
resDTO.setRealName(dingLoginResiFormDTO.getNick());
// 2、调用userfeign接口获取userId、注册网格相关信息
Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO);
if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) {
// 临时打个日志
log.error(String.format("resiLoginInternalDing获取epmetUserId异常,入参:%s", JSON.toJSONString(dingLoginResiFormDTO)));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:"+ JSON.toJSONString(loginResiResDTOResult), "获取epmetUserId异常");
}
DingLoginResiResDTO resiResDTO = loginResiResDTOResult.getData();
resDTO.setGridId(resiResDTO.getGridId());
resDTO.setGridName(resiResDTO.getGridName());
resDTO.setAgencyId(resiResDTO.getAgencyId());
resDTO.setEpmetUserId(resiResDTO.getEpmetUserId());
resDTO.setRegFlag(resiResDTO.getRegFlag());
// 3.生成token,并且存放Redis
String token = this.saveTokenDtoDing(formDTO.getMiniAppId(), AppClientConstant.APP_RESI, AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId());
resDTO.setAuthorization(token);
return resDTO;
}
@Override
public UserTokenResultDTO govLoginInternalDing(DingAppLoginMdFormDTO formDTO) {
// 获取用户手机号
log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO));
ResiDingAppLoginResDTO resDTO = null;
resDTO = new ResiDingAppLoginResDTO();
resDTO.setCustomerId(getCurrentCustomerId());
// 1、获取用户手机号
DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOInternal(formDTO.getMiniAppId(), formDTO.getAuthCode());
dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
GovWebLoginFormDTO loginGovParam = new GovWebLoginFormDTO();
loginGovParam.setCustomerId(dingLoginResiFormDTO.getCustomerId());
loginGovParam.setPhone(dingLoginResiFormDTO.getMobile());
return govWebService.loginByThirdPlatform(loginGovParam);
}
// @Override
// public ResiDingAppLoginResDTO resiLoginInternalDing(DingAppLoginMdFormDTO formDTO) {
// // 获取用户手机号
// log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO));
// ResiDingAppLoginResDTO resDTO = new ResiDingAppLoginResDTO();
// resDTO.setCustomerId(getCurrentCustomerId());
//
// // 1、获取用户手机号
// DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOInternal(formDTO.getMiniAppId(), formDTO.getAuthCode());
// dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
// resDTO.setRealName(dingLoginResiFormDTO.getNick());
// // 2、调用userfeign接口获取userId、注册网格相关信息
// Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO);
// if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) {
// // 临时打个日志
// log.error(String.format("resiLoginInternalDing获取epmetUserId异常,入参:%s", JSON.toJSONString(dingLoginResiFormDTO)));
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:"+ JSON.toJSONString(loginResiResDTOResult), "获取epmetUserId异常");
// }
// DingLoginResiResDTO resiResDTO = loginResiResDTOResult.getData();
// resDTO.setGridId(resiResDTO.getGridId());
// resDTO.setGridName(resiResDTO.getGridName());
// resDTO.setAgencyId(resiResDTO.getAgencyId());
// resDTO.setEpmetUserId(resiResDTO.getEpmetUserId());
// resDTO.setRegFlag(resiResDTO.getRegFlag());
//
// // 3.生成token,并且存放Redis
// String token = this.saveTokenDtoDing(formDTO.getMiniAppId(), AppClientConstant.APP_RESI, AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId());
// resDTO.setAuthorization(token);
//
// return resDTO;
// }
// @Override
// public UserTokenResultDTO govLoginInternalDing(DingAppLoginMdFormDTO formDTO) {
// // 获取用户手机号
// log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO));
// ResiDingAppLoginResDTO resDTO = null;
// resDTO = new ResiDingAppLoginResDTO();
// resDTO.setCustomerId(getCurrentCustomerId());
//
// // 1、获取用户手机号
// DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOInternal(formDTO.getMiniAppId(), formDTO.getAuthCode());
// dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
//
//
// GovWebLoginFormDTO loginGovParam = new GovWebLoginFormDTO();
// loginGovParam.setCustomerId(dingLoginResiFormDTO.getCustomerId());
// loginGovParam.setPhone(dingLoginResiFormDTO.getMobile());
//
// return govWebService.loginByThirdPlatform(loginGovParam);
// }
@Override
public UserTokenResultDTO yanTaiSSOLogin(String authCode) {
@ -1115,55 +1104,55 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
* @param authCode
* @return
*/
private DingLoginResiFormDTO getDingLoginResiFormDTOInternal(String miniAppId, String authCode) {
DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId);
if (dingMiniInfo == null){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉应用配置异常", "获取钉钉应用配置异常");
}
// 1、获取企业内部应用的accessToken文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-access_token-of-an-internal-app
String accessToken = "";
DingTalkResult<String> dingTalkResult = dingTalkClientToken.getAppAccessTokenToken(dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret());
if (!dingTalkResult.success() || StringUtils.isBlank(dingTalkResult.getData())) {
log.error(String.format("获取企业内部应用的accessToken失败,customKey:%s,customSecret:%s", dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取企业内部应用的accessToken异常", "获取企业内部应用的accessToken");
}
accessToken = dingTalkResult.getData();
log.info(String.format("1、获取企业内部应用的accessToken返参:%s", accessToken));
// 2、通过免登码获取用户信息,文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-userid-of-a-user-by-using-the-log-free
DingTalkResult<String> v2UserGetuserinfoRes = dingTalkClientToken.getUserInfo(accessToken, authCode);
if (!v2UserGetuserinfoRes.success() || StringUtils.isBlank(v2UserGetuserinfoRes.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "通过免登码获取用户信息异常", "通过免登码获取用户信息异常");
}
log.info(String.format("2、通过免登码获取用户信息返参:%s", v2UserGetuserinfoRes.getData()));
V2UserGetuserinfoResDTO v2UserGetuserinfoResDTO = JSON.parseObject(v2UserGetuserinfoRes.getData(), V2UserGetuserinfoResDTO.class);
if (null == v2UserGetuserinfoResDTO || StringUtils.isBlank(v2UserGetuserinfoResDTO.getUserid())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉用户userid为空", "获取钉钉用户userid为空");
}
// 3、查询用户详情,文档地址:https://open.dingtalk.com/document/isvapp-server/query-user-details
DingTalkResult<String> v2UserGetRes = dingTalkClientToken.getUserDetail(v2UserGetuserinfoResDTO.getUserid(), accessToken);
if (!v2UserGetRes.success() || StringUtils.isBlank(v2UserGetRes.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据userId查询用户详情失败", "根据userId查询用户详情失败");
}
log.info(String.format("3、查询用户详情:%s", v2UserGetRes.getData()));
DingUserDetailDTO dingUserDetailDTO = JSON.parseObject(v2UserGetRes.getData(), DingUserDetailDTO.class);
if (null == dingUserDetailDTO || StringUtils.isBlank(dingUserDetailDTO.getMobile())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空");
}
DingLoginResiFormDTO dingLoginResiFormDTO = new DingLoginResiFormDTO();
dingLoginResiFormDTO.setAvatarUrl(dingUserDetailDTO.getAvatar());
dingLoginResiFormDTO.setEmail(dingUserDetailDTO.getOrg_email());
dingLoginResiFormDTO.setMobile(dingUserDetailDTO.getMobile());
dingLoginResiFormDTO.setNick(dingUserDetailDTO.getName());
dingLoginResiFormDTO.setOpenId(StrConstant.EPMETY_STR);
dingLoginResiFormDTO.setStateCode(dingUserDetailDTO.getState_code());
dingLoginResiFormDTO.setUnionId(dingUserDetailDTO.getUnionid());
return dingLoginResiFormDTO;
}
// private DingLoginResiFormDTO getDingLoginResiFormDTOInternal(String miniAppId, String authCode) {
// DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId);
// if (dingMiniInfo == null){
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉应用配置异常", "获取钉钉应用配置异常");
// }
// // 1、获取企业内部应用的accessToken文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-access_token-of-an-internal-app
// String accessToken = "";
// DingTalkResult<String> dingTalkResult = dingTalkClientToken.getAppAccessTokenToken(dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret());
// if (!dingTalkResult.success() || StringUtils.isBlank(dingTalkResult.getData())) {
// log.error(String.format("获取企业内部应用的accessToken失败,customKey:%s,customSecret:%s", dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret()));
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取企业内部应用的accessToken异常", "获取企业内部应用的accessToken");
// }
// accessToken = dingTalkResult.getData();
// log.info(String.format("1、获取企业内部应用的accessToken返参:%s", accessToken));
//
//
// // 2、通过免登码获取用户信息,文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-userid-of-a-user-by-using-the-log-free
// DingTalkResult<String> v2UserGetuserinfoRes = dingTalkClientToken.getUserInfo(accessToken, authCode);
// if (!v2UserGetuserinfoRes.success() || StringUtils.isBlank(v2UserGetuserinfoRes.getData())) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "通过免登码获取用户信息异常", "通过免登码获取用户信息异常");
// }
// log.info(String.format("2、通过免登码获取用户信息返参:%s", v2UserGetuserinfoRes.getData()));
// V2UserGetuserinfoResDTO v2UserGetuserinfoResDTO = JSON.parseObject(v2UserGetuserinfoRes.getData(), V2UserGetuserinfoResDTO.class);
// if (null == v2UserGetuserinfoResDTO || StringUtils.isBlank(v2UserGetuserinfoResDTO.getUserid())) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉用户userid为空", "获取钉钉用户userid为空");
// }
//
//
// // 3、查询用户详情,文档地址:https://open.dingtalk.com/document/isvapp-server/query-user-details
// DingTalkResult<String> v2UserGetRes = dingTalkClientToken.getUserDetail(v2UserGetuserinfoResDTO.getUserid(), accessToken);
// if (!v2UserGetRes.success() || StringUtils.isBlank(v2UserGetRes.getData())) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据userId查询用户详情失败", "根据userId查询用户详情失败");
// }
// log.info(String.format("3、查询用户详情:%s", v2UserGetRes.getData()));
// DingUserDetailDTO dingUserDetailDTO = JSON.parseObject(v2UserGetRes.getData(), DingUserDetailDTO.class);
// if (null == dingUserDetailDTO || StringUtils.isBlank(dingUserDetailDTO.getMobile())) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空");
// }
//
// DingLoginResiFormDTO dingLoginResiFormDTO = new DingLoginResiFormDTO();
// dingLoginResiFormDTO.setAvatarUrl(dingUserDetailDTO.getAvatar());
// dingLoginResiFormDTO.setEmail(dingUserDetailDTO.getOrg_email());
// dingLoginResiFormDTO.setMobile(dingUserDetailDTO.getMobile());
// dingLoginResiFormDTO.setNick(dingUserDetailDTO.getName());
// dingLoginResiFormDTO.setOpenId(StrConstant.EPMETY_STR);
// dingLoginResiFormDTO.setStateCode(dingUserDetailDTO.getState_code());
// dingLoginResiFormDTO.setUnionId(dingUserDetailDTO.getUnionid());
// return dingLoginResiFormDTO;
// }
/**
* 客户写死吧

74
epmet-commons/epmet-commons-tools/pom.xml

@ -14,7 +14,6 @@
<properties>
<hibernate.validator.version>6.0.17.Final</hibernate.validator.version>
<commons.lang.version>3.7</commons.lang.version>
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<commons.io.version>2.6</commons.io.version>
<hutool.version>4.6.1</hutool.version>
@ -32,6 +31,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>hibernate-validator</artifactId>
<groupId>org.hibernate.validator</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -45,6 +50,16 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<exclusions>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<artifactId>commons-fileupload</artifactId>
<groupId>commons-fileupload</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -66,15 +81,16 @@
<artifactId>hibernate-validator</artifactId>
<version>${hibernate.validator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons.lang.version}</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@ -90,6 +106,12 @@
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>${easypoi.version}</version>
<exclusions>
<exclusion>
<artifactId>javassist</artifactId>
<groupId>org.javassist</groupId>
</exclusion>
</exclusions>
<!--<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/jar/easypoi-base-4.4.0.jar</systemPath>-->
</dependency>
@ -137,24 +159,54 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<exclusions>
<exclusion>
<artifactId>httpclient</artifactId>
<groupId>org.apache.httpcomponents</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<exclusions>
<exclusion>
<artifactId>httpclient</artifactId>
<groupId>org.apache.httpcomponents</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- 钉钉机器人 -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<exclusions>
<exclusion>
<artifactId>kotlin-stdlib-common</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.wnjustdoit</groupId>
@ -201,6 +253,16 @@
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java</artifactId>
<version>3.1.322</version>
<exclusions>
<exclusion>
<artifactId>okio</artifactId>
<groupId>com.squareup.okio</groupId>
</exclusion>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

10
epmet-module/data-report/data-report-client/pom.xml

@ -16,6 +16,16 @@
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<artifactId>commons-collections4</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
<exclusion>
<artifactId>objenesis</artifactId>
<groupId>org.objenesis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>

5
epmet-module/data-report/data-report-server/pom.xml

@ -100,6 +100,11 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
</dependency>
</dependencies>
<build>

12
epmet-module/epmet-heart/epmet-heart-client/pom.xml

@ -17,12 +17,24 @@
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<artifactId>objenesis</artifactId>
<groupId>org.objenesis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>commons-collections4</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

32
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenServiceRstDTO.java

@ -1,10 +1,14 @@
package com.epmet.dto.result.agentservice;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.security.PrivateKey;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
@AllArgsConstructor
@ -13,8 +17,9 @@ public class LingShanScreenServiceRstDTO {
private String content;
private String applicantName;
private String applicantMobile;
private String applicantHomeAddress;
private String exceptServeAddress;
private Date createdTime;
private Date exceptServeTime;
private String agentName;
private String agentMobile;
@ -26,4 +31,29 @@ public class LingShanScreenServiceRstDTO {
* 纬度
*/
private String latitude;
private String processTime;
private String processDesc;
private List<String> attachments;
private String processStatus;
private String closeDesc;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date closeTime;
private Integer satisfication;
/**
* 处理进展
*/
private List<ProcessNode> processNodes = new ArrayList<>();
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class ProcessNode {
private Integer processType;
private String processTypeName;
private String processorName;
private String processDesc;
private List<String> processAttachments = new ArrayList<>();
}
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java

@ -286,6 +286,19 @@ public class LingShanAgentServiceController {
return new Result<List<LingShanScreenServiceRstDTO>>().ok(rl);
}
/**
* @Description: 中央大屏:服务详情
* @param id:
* @Return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.agentservice.LingShanScreenServiceRstDTO>
* @Author: wangxianzhang
* @Date: 2023/5/17 2:40 PM
*/
@GetMapping("screen/serviceDetail")
public Result<LingShanScreenServiceRstDTO> screenServiceDetail(@RequestParam("id") String id) {
LingShanScreenServiceRstDTO c = lingShanServiceAgentService.screenServiceDetail(id);
return new Result<LingShanScreenServiceRstDTO>().ok(c);
}
/**
* @Description: 服务类型数量分析
* @param orgType:

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java

@ -38,4 +38,6 @@ public interface LingShanAgentServiceService {
List<ScreenAgentServiceCategoryAnalysisRstDTO> serviceCategoryAnalysis(String orgType, String orgId);
List<AgentServiceTrendAnalysisRstDTO> serviceTrendAnalysis(String orgType, String orgId);
LingShanScreenServiceRstDTO screenServiceDetail(String id);
}

70
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java

@ -513,7 +513,6 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ
d.setAgentMobile(agentInfo.getMobile());
}
// todo 此处要查什么??申请人家庭住址?申请人家庭住址是什么?
// IcResiUserDTO resiUser = getResultDataOrReturnNull(userOpenFeignClient.getIcResiUserDTO(rec.getApplicantId()), ServiceConstant.EPMET_USER_SERVER);
// if (resiUser == null) {
// log.error("【灵山大屏】代办事件列表:查询申请人信息失败,申请人ID:" + rec.getApplicantId());
@ -527,6 +526,8 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ
// }
d.setContent(rec.getContent());
d.setExceptServeAddress(rec.getExceptServeAddress());
d.setExceptServeTime(rec.getExceptServeTime());
d.setCreatedTime(rec.getCreatedTime());
d.setApplicantName(rec.getApplicantName());
d.setApplicantMobile(rec.getContactMobile());
@ -537,6 +538,73 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ
}).collect(Collectors.toList());
}
@Override
public LingShanScreenServiceRstDTO screenServiceDetail(String id) {
LingshanAgentServiceRecordEntity serviceRecord = agentServiceRecordDao.selectById(id);
if (serviceRecord == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未找到对应服务,ID:" + id);
}
LingShanScreenServiceRstDTO rd = new LingShanScreenServiceRstDTO();
rd.setExceptServeAddress(serviceRecord.getExceptServeAddress());
rd.setExceptServeTime(serviceRecord.getExceptServeTime());
rd.setContent(serviceRecord.getContent());
rd.setLatitude(serviceRecord.getLatitude());
rd.setLongitude(serviceRecord.getLongitude());
rd.setAgentMobile(serviceRecord.getContactMobile());
rd.setAgentName(serviceRecord.getAgentName());
rd.setApplicantMobile(serviceRecord.getContactMobile());
rd.setApplicantName(serviceRecord.getApplicantName());
rd.setCreatedTime(serviceRecord.getCreatedTime());
rd.setCloseTime(serviceRecord.getCloseTime());
rd.setSatisfication(serviceRecord.getSatisfication());
rd.setAttachments(JSON.parseArray(serviceRecord.getAttachments(), String.class));
// 处理进展
List<LingShanScreenServiceRstDTO.ProcessNode> processNodes = rd.getProcessNodes();
// 创建起始节点
LingShanScreenServiceRstDTO.ProcessNode nc = createProcessNode(LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT, serviceRecord.getApplicantName(), null, new ArrayList<>());
processNodes.add(nc);
// 根据最新状态拼接后续处理节点
int processStatus = serviceRecord.getProcessStatus().intValue();
LingShanAgentServiceProcessStatusEnum processStatusEnum = LingShanAgentServiceProcessStatusEnum.getByStatus(processStatus);
if (LingShanAgentServiceProcessStatusEnum.WITHDRAW.getStatusCode() == processStatus) {
// 已撤回
LingShanScreenServiceRstDTO.ProcessNode nd = createProcessNode(processStatusEnum, serviceRecord.getApplicantName(), null, new ArrayList<>());
processNodes.add(nd);
} else {
// 正常处理流程
if (processStatus == LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode()) {
// 受理 0 1
LingShanScreenServiceRstDTO.ProcessNode np = createProcessNode(processStatusEnum, serviceRecord.getAgentName(), serviceRecord.getProcessDesc(), new ArrayList<>());
processNodes.add(np);
} else if (processStatus == LingShanAgentServiceProcessStatusEnum.REJECTED.getStatusCode()) {
// 驳回 0 2
LingShanScreenServiceRstDTO.ProcessNode np = createProcessNode(processStatusEnum, serviceRecord.getAgentName(), serviceRecord.getProcessDesc(), new ArrayList<>());
processNodes.add(np);
} else {
// 办结 0 1 3
LingShanScreenServiceRstDTO.ProcessNode na = createProcessNode(LingShanAgentServiceProcessStatusEnum.ACCEPTED, serviceRecord.getAgentName(), serviceRecord.getProcessDesc(), new ArrayList<>());
LingShanScreenServiceRstDTO.ProcessNode ncc = createProcessNode(LingShanAgentServiceProcessStatusEnum.CLOSED, serviceRecord.getAgentName(), serviceRecord.getCloseDesc(), JSON.parseArray(serviceRecord.getProcessAttachments(), String.class));
processNodes.add(na);
processNodes.add(ncc);
}
}
return rd;
}
private LingShanScreenServiceRstDTO.ProcessNode createProcessNode(LingShanAgentServiceProcessStatusEnum processStatusEnum, String applicantName, String processDesc, List<String> processAttachments) {
return new LingShanScreenServiceRstDTO.ProcessNode(
processStatusEnum.getStatusCode(),
processStatusEnum.getStatusName(),
applicantName, processDesc, processAttachments);
}
@Override
public List<ScreenAgentServiceCategoryAnalysisRstDTO> serviceCategoryAnalysis(String orgType, String orgId) {

30
epmet-module/epmet-third/epmet-third-client/pom.xml

@ -24,6 +24,14 @@
<artifactId>feign-form-spring</artifactId>
<groupId>io.github.openfeign.form</groupId>
</exclusion>
<exclusion>
<artifactId>objenesis</artifactId>
<groupId>org.objenesis</groupId>
</exclusion>
<exclusion>
<artifactId>asm</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@ -31,12 +39,28 @@
<artifactId>weixin-java-mp</artifactId>
<version>3.6.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>commons-collections4</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.openfeign.form</groupId>
@ -52,6 +76,12 @@
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
<exclusions>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

33
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -157,16 +157,27 @@
<artifactId>rocketmq-acl</artifactId>
<version>4.9.2</version>
</dependency>
<dependency>
<artifactId>dingtalk-spring-boot-starter</artifactId>
<groupId>com.taobao</groupId>
<version>1.0.0</version>
</dependency>
<!-- <dependency>-->
<!-- <artifactId>dingtalk-common</artifactId>-->
<!-- <groupId>com.taobao</groupId>-->
<!-- <version>1.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <artifactId>dingtalk-spring-boot-starter</artifactId>-->
<!-- <groupId>com.taobao</groupId>-->
<!-- <version>1.0.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<!--Knife4j-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>2.0.5</version>
</dependency>
</dependencies>
<build>
@ -228,7 +239,8 @@
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-third</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy
</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
@ -288,7 +300,8 @@
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-third</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy
</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
@ -347,7 +360,8 @@
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-third</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy
</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
@ -407,7 +421,8 @@
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-third</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy
</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java

@ -1,7 +1,6 @@
package com.epmet;
import com.epmet.mq.properties.RocketMQProperties;
import com.taobao.dingtalk.spring.annotations.EnableDingTalk;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@ -9,7 +8,6 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableDingTalk
@EnableConfigurationProperties(RocketMQProperties.class)
@SpringBootApplication
@EnableDiscoveryClient

179
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java

@ -1,29 +1,14 @@
package com.epmet.controller.dingtalk;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.dingtalk.util.DingCallbackCrypto;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.DingMiniInfoFormDTO;
import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dao.OpenSyncBizDataDao;
import com.epmet.dto.DingMiniInfoDTO;
import com.epmet.dto.form.ExemptLoginUserDetailFormDTO;
import com.epmet.entity.OpenSyncBizDataEntity;
import com.epmet.redis.DingDingCallbackRedis;
import com.epmet.service.DingTalkService;
import com.epmet.service.OpenSyncBizDataService;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* ISV 小程序回调信息处理
@ -65,81 +50,81 @@ public class CallbackController {
@Autowired
private DingTalkService dingTalkService;
@PostMapping(value = "dingCallback")
public Object dingCallback(
@RequestParam(value = "signature") String signature,
@RequestParam(value = "timestamp") Long timestamp,
@RequestParam(value = "nonce") String nonce,
@RequestParam(value = "suiteKey") String suiteKey,
@RequestBody(required = false) JSONObject body
) {
String params = "signature:" + signature + " timestamp:" + timestamp + " nonce:" + nonce + " body:" + body + "suiteKey::"+suiteKey;
try {
log.info("begin callback:" + params);
DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfo(suiteKey);
DingCallbackCrypto dingTalkEncryptor = new DingCallbackCrypto(dingMiniInfo.getToken(), dingMiniInfo.getAesKey(), suiteKey);
// 从post请求的body中获取回调信息的加密数据进行解密处理
String encrypt = body.getString("encrypt");
String plainText = dingTalkEncryptor.getDecryptMsg(signature, timestamp.toString(), nonce, encrypt);
JSONObject callBackContent = JSON.parseObject(plainText);
log.info("推来的消息体:"+plainText);
// 根据回调事件类型做不同的业务处理
String eventType = callBackContent.getString("EventType");
if (EVENT_CHECK_CREATE_SUITE_URL.equals(eventType)) {
log.info("验证新创建的回调URL有效性: " + plainText);
} else if (EVENT_CHECK_UPADTE_SUITE_URL.equals(eventType)) {
log.info("验证更新回调URL有效性: " + plainText);
} else if (EVENT_SUITE_TICKET.equals(eventType)) {
// suite_ticket用于用签名形式生成accessToken(访问钉钉服务端的凭证),需要保存到应用的db。
// 钉钉会定期向本callback url推送suite_ticket新值用以提升安全性。
// 应用在获取到新的时值时,保存db成功后,返回给钉钉success加密串(如本demo的return)
log.info("应用suite_ticket数据推送: " + plainText);
} else if (EVENT_TMP_AUTH_CODE.equals(eventType)) {
// 本事件应用应该异步进行授权开通企业的初始化,目的是尽最大努力快速返回给钉钉服务端。用以提升企业管理员开通应用体验
// 即使本接口没有收到数据或者收到事件后处理初始化失败都可以后续再用户试用应用时从前端获取到corpId并拉取授权企业信息,进而初始化开通及企业。
log.info("企业授权开通应用事件: " + plainText);
} else if (EVENT_SYNC_HTTP_PUSH_HIGH.equals(eventType)){
List<Map<String, Object>> bizData = (List<Map<String, Object>>) callBackContent.get("bizData");
if (CollectionUtils.isNotEmpty(bizData)){
List<OpenSyncBizDataEntity> list = new ArrayList<>();
bizData.forEach(b -> {
OpenSyncBizDataEntity e = new OpenSyncBizDataEntity();
e.setSuiteKey(suiteKey);
e.setSubscribeId(b.get("subscribe_id").toString());
e.setCorpId(b.get("corp_id").toString());
e.setBizId(b.get("biz_id").toString());
e.setBizData(b.get("biz_data").toString());
e.setBizType(b.get("biz_type").toString());
list.add(e);
openSyncBizDataService.delete(e);
if (e.getBizType().equals(NumConstant.TWO_STR)){
Map<String,String> ticketMap = JSON.parseObject(e.getBizData(), Map.class);
dingCallbackRedis.set(suiteKey,ticketMap.get("suiteTicket"));
}
});
openSyncBizDataService.insertBatch(list);
}
} else{
// 其他类型事件处理
}
// 返回success的加密信息表示回调处理成功
return dingTalkEncryptor.getEncryptedMap("success", timestamp, nonce);
} catch (Exception e) {
//失败的情况,应用的开发者应该通过告警感知,并干预修复
log.error("process callback fail." + params, e);
return "fail";
}
}
@PostMapping("getExemptLoginUserDetail")
public Result<Object> getExemptLoginUserDetail(@RequestBody ExemptLoginUserDetailFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ExemptLoginUserDetailFormDTO.ExemptLoginUserDetailForm.class);
return new Result<Object>().ok(dingTalkService.getExemptLoginUserDetail(formDTO));
}
// @PostMapping(value = "dingCallback")
// public Object dingCallback(
// @RequestParam(value = "signature") String signature,
// @RequestParam(value = "timestamp") Long timestamp,
// @RequestParam(value = "nonce") String nonce,
// @RequestParam(value = "suiteKey") String suiteKey,
// @RequestBody(required = false) JSONObject body
// ) {
// String params = "signature:" + signature + " timestamp:" + timestamp + " nonce:" + nonce + " body:" + body + "suiteKey::"+suiteKey;
// try {
// log.info("begin callback:" + params);
// DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfo(suiteKey);
// DingCallbackCrypto dingTalkEncryptor = new DingCallbackCrypto(dingMiniInfo.getToken(), dingMiniInfo.getAesKey(), suiteKey);
//
// // 从post请求的body中获取回调信息的加密数据进行解密处理
// String encrypt = body.getString("encrypt");
// String plainText = dingTalkEncryptor.getDecryptMsg(signature, timestamp.toString(), nonce, encrypt);
// JSONObject callBackContent = JSON.parseObject(plainText);
//
// log.info("推来的消息体:"+plainText);
//
// // 根据回调事件类型做不同的业务处理
// String eventType = callBackContent.getString("EventType");
// if (EVENT_CHECK_CREATE_SUITE_URL.equals(eventType)) {
// log.info("验证新创建的回调URL有效性: " + plainText);
// } else if (EVENT_CHECK_UPADTE_SUITE_URL.equals(eventType)) {
// log.info("验证更新回调URL有效性: " + plainText);
// } else if (EVENT_SUITE_TICKET.equals(eventType)) {
// // suite_ticket用于用签名形式生成accessToken(访问钉钉服务端的凭证),需要保存到应用的db。
// // 钉钉会定期向本callback url推送suite_ticket新值用以提升安全性。
// // 应用在获取到新的时值时,保存db成功后,返回给钉钉success加密串(如本demo的return)
// log.info("应用suite_ticket数据推送: " + plainText);
// } else if (EVENT_TMP_AUTH_CODE.equals(eventType)) {
// // 本事件应用应该异步进行授权开通企业的初始化,目的是尽最大努力快速返回给钉钉服务端。用以提升企业管理员开通应用体验
// // 即使本接口没有收到数据或者收到事件后处理初始化失败都可以后续再用户试用应用时从前端获取到corpId并拉取授权企业信息,进而初始化开通及企业。
// log.info("企业授权开通应用事件: " + plainText);
// } else if (EVENT_SYNC_HTTP_PUSH_HIGH.equals(eventType)){
// List<Map<String, Object>> bizData = (List<Map<String, Object>>) callBackContent.get("bizData");
// if (CollectionUtils.isNotEmpty(bizData)){
// List<OpenSyncBizDataEntity> list = new ArrayList<>();
// bizData.forEach(b -> {
// OpenSyncBizDataEntity e = new OpenSyncBizDataEntity();
// e.setSuiteKey(suiteKey);
// e.setSubscribeId(b.get("subscribe_id").toString());
// e.setCorpId(b.get("corp_id").toString());
// e.setBizId(b.get("biz_id").toString());
// e.setBizData(b.get("biz_data").toString());
// e.setBizType(b.get("biz_type").toString());
// list.add(e);
// openSyncBizDataService.delete(e);
// if (e.getBizType().equals(NumConstant.TWO_STR)){
// Map<String,String> ticketMap = JSON.parseObject(e.getBizData(), Map.class);
// dingCallbackRedis.set(suiteKey,ticketMap.get("suiteTicket"));
// }
// });
// openSyncBizDataService.insertBatch(list);
// }
// } else{
// // 其他类型事件处理
// }
//
// // 返回success的加密信息表示回调处理成功
// return dingTalkEncryptor.getEncryptedMap("success", timestamp, nonce);
// } catch (Exception e) {
// //失败的情况,应用的开发者应该通过告警感知,并干预修复
// log.error("process callback fail." + params, e);
// return "fail";
// }
// }
// @PostMapping("getExemptLoginUserDetail")
// public Result<Object> getExemptLoginUserDetail(@RequestBody ExemptLoginUserDetailFormDTO formDTO){
// ValidatorUtils.validateEntity(formDTO, ExemptLoginUserDetailFormDTO.ExemptLoginUserDetailForm.class);
// return new Result<Object>().ok(dingTalkService.getExemptLoginUserDetail(formDTO));
// }
/**
* Desc: 获取钉钉小程序信息
@ -147,9 +132,9 @@ public class CallbackController {
* @author zxc
* @date 2022/9/15 10:46
*/
@PostMapping("getDingMiniInfo")
public Result<DingMiniInfoCache> getDingMiniInfo(@RequestBody DingMiniInfoFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, DingMiniInfoFormDTO.DingMiniInfoForm.class);
return new Result<DingMiniInfoCache>().ok(dingTalkService.getDingMiniInfo(formDTO));
}
// @PostMapping("getDingMiniInfo")
// public Result<DingMiniInfoCache> getDingMiniInfo(@RequestBody DingMiniInfoFormDTO formDTO){
// ValidatorUtils.validateEntity(formDTO, DingMiniInfoFormDTO.DingMiniInfoForm.class);
// return new Result<DingMiniInfoCache>().ok(dingTalkService.getDingMiniInfo(formDTO));
// }
}

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java

@ -1,6 +1,8 @@
package com.epmet.controller.tccc;
import com.epmet.commons.tools.utils.net.TCCCClientUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -8,8 +10,10 @@ import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("tccc")
@Api(tags = "获取腾讯呼叫中心URL")
public class TCCCAuthController {
@ApiOperation(value = "tccc")
@RequestMapping("getTcccAuth")
public String getTcccAuth() {
try {

8
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java

@ -1,9 +1,5 @@
package com.epmet.service;
import com.epmet.commons.tools.dto.form.DingMiniInfoFormDTO;
import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache;
import com.epmet.dto.form.ExemptLoginUserDetailFormDTO;
/**
* @Author zxc
* @DateTime 2022/9/14 14:56
@ -11,7 +7,7 @@ import com.epmet.dto.form.ExemptLoginUserDetailFormDTO;
*/
public interface DingTalkService {
Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO);
// Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO);
/**
* Desc: 获取钉钉小程序信息
@ -19,6 +15,6 @@ public interface DingTalkService {
* @author zxc
* @date 2022/9/15 10:46
*/
DingMiniInfoCache getDingMiniInfo(DingMiniInfoFormDTO formDTO);
// DingMiniInfoCache getDingMiniInfo(DingMiniInfoFormDTO formDTO);
}

61
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java

@ -1,24 +1,11 @@
package com.epmet.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.aliyun.dingtalk.module.DingTalkResult;
import com.epmet.commons.tools.dto.form.DingMiniInfoFormDTO;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.OpenSyncBizDataDao;
import com.epmet.dto.DingMiniInfoDTO;
import com.epmet.dto.form.ExemptLoginUserDetailFormDTO;
import com.epmet.redis.DingDingCallbackRedis;
import com.epmet.service.DingTalkService;
import com.taobao.dingtalk.client.DingTalkClientToken;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Map;
/**
* @Author zxc
@ -29,21 +16,21 @@ import java.util.Map;
@Slf4j
public class DingTalkServiceImpl implements DingTalkService {
@Autowired
private DingTalkClientToken dingTalkClientToken;
@Autowired
private OpenSyncBizDataDao openSyncBizDataDao;
// @Autowired
// private DingTalkClientToken dingTalkClientToken;
// @Autowired
// private OpenSyncBizDataDao openSyncBizDataDao;
@Autowired
private DingDingCallbackRedis dingCallbackRedis;
@Autowired
private RedisUtils redisUtils;
@Override
public Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO) {
DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfoByAppId(formDTO.getMiniAppId());
DingTalkResult<String> exemptLoginUserDetail = dingTalkClientToken.getExemptLoginUserDetail(formDTO.getCorpId(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), dingCallbackRedis.get(dingMiniInfo.getSuiteKey()), formDTO.getCode());
return exemptLoginUserDetail.getData();
}
// @Override
// public Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO) {
// DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfoByAppId(formDTO.getMiniAppId());
// DingTalkResult<String> exemptLoginUserDetail = dingTalkClientToken.getExemptLoginUserDetail(formDTO.getCorpId(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), dingCallbackRedis.get(dingMiniInfo.getSuiteKey()), formDTO.getCode());
// return exemptLoginUserDetail.getData();
// }
/**
* Desc: 获取钉钉小程序信息
@ -51,18 +38,18 @@ public class DingTalkServiceImpl implements DingTalkService {
* @author zxc
* @date 2022/9/15 10:46
*/
@Override
public DingMiniInfoCache getDingMiniInfo(DingMiniInfoFormDTO formDTO) {
String key = RedisKeys.getDingMiniInfoKey(formDTO.getMiniAppId());
Map<String, Object> dingMiniInfoMap = redisUtils.hGetAll(key);
if (!CollectionUtils.isEmpty(dingMiniInfoMap)) {
return ConvertUtils.mapToEntity(dingMiniInfoMap,DingMiniInfoCache.class);
}
DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfoByAppId(formDTO.getMiniAppId());
if (null != dingMiniInfo){
redisUtils.hMSet(key, BeanUtil.beanToMap(dingMiniInfo));
return ConvertUtils.sourceToTarget(dingMiniInfo,DingMiniInfoCache.class);
}
return null;
}
// @Override
// public DingMiniInfoCache getDingMiniInfo(DingMiniInfoFormDTO formDTO) {
// String key = RedisKeys.getDingMiniInfoKey(formDTO.getMiniAppId());
// Map<String, Object> dingMiniInfoMap = redisUtils.hGetAll(key);
// if (!CollectionUtils.isEmpty(dingMiniInfoMap)) {
// return ConvertUtils.mapToEntity(dingMiniInfoMap,DingMiniInfoCache.class);
// }
// DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfoByAppId(formDTO.getMiniAppId());
// if (null != dingMiniInfo){
// redisUtils.hMSet(key, BeanUtil.beanToMap(dingMiniInfo));
// return ConvertUtils.sourceToTarget(dingMiniInfo,DingMiniInfoCache.class);
// }
// return null;
// }
}

14
epmet-module/gov-issue/gov-issue-client/pom.xml

@ -16,6 +16,20 @@
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<artifactId>objenesis</artifactId>
<groupId>org.objenesis</groupId>
</exclusion>
<exclusion>
<artifactId>asm</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
<exclusion>
<artifactId>commons-collections4</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>

14
epmet-module/gov-org/gov-org-client/pom.xml

@ -17,6 +17,20 @@
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<artifactId>objenesis</artifactId>
<groupId>org.objenesis</groupId>
</exclusion>
<exclusion>
<artifactId>commons-collections4</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
<exclusion>
<artifactId>asm</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java

@ -89,5 +89,8 @@ public class IcHouseListResultDTO implements Serializable {
*/
private String houseCode;
/**
* 灵山项目是否党员中心户1是0不是
*/
private String partyCenterHouseFlag;
}

18
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/ConfigPartyCenterHouseFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.result.lingshan;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2023/5/17 12:45
*/
@Data
public class ConfigPartyCenterHouseFormDTO {
private String houseId;
/**
* 灵山项目是否党员中心户1是0不是
*/
private String partyCenterHouseFlag;
}

28
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/HouseTreeDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.result.lingshan;
import lombok.Data;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2023/5/17 9:21
*/
@Data
public class HouseTreeDTO {
private String id;
/**
* 小区neighborHood
* 楼栋building
* 单元unit
* 房屋:house
*/
private String type;
private String name;
/**
* 下级机关组织
*/
private List<HouseTreeDTO> children;
}

14
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/HouseTreeFormDTO.java

@ -0,0 +1,14 @@
package com.epmet.dto.result.lingshan;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2023/5/17 9:29
*/
@Data
public class HouseTreeFormDTO {
private String gridId;
}

75
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingshanPartyCenterHouseLianhuDTO.java

@ -0,0 +1,75 @@
package com.epmet.dto.result.lingshan;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* 灵山_党员中心户联户
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-16
*/
@Data
public class LingshanPartyCenterHouseLianhuDTO implements Serializable {
/**
* 主键联户记录表
*/
@JsonIgnore
private String id;
/**
* 客户id
*/
@JsonIgnore
private String customerId;
/**
* 党员中心户房屋idlingshan_party_center_house.HOUSE_ID
*/
@JsonIgnore
private String partyCenterHouseId;
/**
* 联户房屋所属组织id
*/
@JsonIgnore
private String agencyId;
/**
* 联户房屋所属网格id
*/
@JsonIgnore
private String gridId;
/**
* 联户grid_id的path包含grid_id
*/
@JsonIgnore
private String gridIdPath;
/**
* 联户小区id
*/
private String neighborHoodId;
/**
* 联户楼栋id
*/
private String buildingId;
/**
* 联户单元id
*/
private String buildingUnitId;
/**
* 联户联户房屋id
*/
private String houseId;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PartyCenterHouseBindLianHuFormDTO.java

@ -12,6 +12,6 @@ import java.util.List;
@Data
public class PartyCenterHouseBindLianHuFormDTO {
private String partyCenterHouseId;
private List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseIdList;
private List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseList;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PartyCenterHouseResultDTO.java

@ -93,6 +93,9 @@ public class PartyCenterHouseResultDTO {
* 联户数
*/
private Integer totalLianHu;
/**
* 灵山项目是否党员中心户1是0不是
*/
private String partyCenterHouseFlag;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseChangeEnums.java

@ -14,8 +14,9 @@ public enum HouseChangeEnums {
RENT_FLAG("RENT_FLAG","房屋状态"),
OWNER_NAME("OWNER_NAME","房主姓名"),
OWNER_PHONE("OWNER_PHONE","房主电话"),
OWNER_ID_CARD("OWNER_ID_CARD","房主身份证");
OWNER_ID_CARD("OWNER_ID_CARD","房主身份证"),
// 灵山项目:是否党员中心户:1是;0不是
PARTY_CENTER_HOUSE_FLAG("PARTY_CENTER_HOUSE_FLAG", "党员中心户");
private String column;
private String columnName;

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.ConfigPartyCenterHouseFormDTO;
import com.epmet.feign.fallback.GovOrgOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
@ -782,4 +783,13 @@ public interface GovOrgOpenFeignClient {
Result<List<LingShanScreenPartyObjectByTypeRstDTO>> lingshanPartyServiceCenterList(
@RequestParam(value = "objType", required = false) String objType,
@RequestParam(value = "orgId", required = false) String orgId);
/**
* 灵山项目新增居民/修改居民/删除居民/导入居民时重新更新房屋是否是党员中心户
*
* @param formDTO
* @return
*/
@PostMapping("/gov/org/ichouse/updatePartyCenterHouse")
Result updatePartyCenterHouse(@RequestBody ConfigPartyCenterHouseFormDTO formDTO);
}

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -7,6 +7,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.ConfigPartyCenterHouseFormDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import java.util.List;
@ -483,4 +484,15 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<LingShanScreenPartyObjectByTypeRstDTO>> lingshanPartyServiceCenterList(String objType, String orgId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "lingshanPartyServiceCenterList", objType, orgId);
}
/**
* 灵山项目新增居民/修改居民/删除居民/导入居民时重新更新房屋是否是党员中心户
*
* @param formDTO
* @return
*/
@Override
public Result updatePartyCenterHouse(ConfigPartyCenterHouseFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "updatePartyCenterHouse", formDTO);
}
}

36
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java

@ -33,8 +33,7 @@ import com.epmet.dto.result.HouseAgencyInfoResultDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuFormDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO;
import com.epmet.dto.result.lingshan.*;
import com.epmet.service.IcHouseService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -189,7 +188,7 @@ public class IcHouseController {
@PostMapping("bingLianHu")
public Result bingLianHu( @RequestBody PartyCenterHouseBindLianHuFormDTO formDTO) {
if(StringUtils.isNotBlank(formDTO.getPartyCenterHouseId())){
icHouseService.bingLianHu(formDTO.getPartyCenterHouseId(),formDTO.getLianHuHouseIdList());
icHouseService.bingLianHu(formDTO.getPartyCenterHouseId(),formDTO.getLianHuHouseList());
}
return new Result();
}
@ -200,12 +199,33 @@ public class IcHouseController {
* @param partyCenterHouseId
* @return
*/
@PostMapping("queryLianHuHouseId/{partyCenterHouseId}")
public Result<List<String>> queryLianHuHouseId(@PathVariable("partyCenterHouseId") String partyCenterHouseId) {
List<String> list = icHouseService.queryLianHuHouseId(partyCenterHouseId);
return new Result<List<String>>().ok(list);
@PostMapping("queryLianHuHouse/{partyCenterHouseId}")
public Result<List<LingshanPartyCenterHouseLianhuDTO>> queryLianHuHouse(@PathVariable("partyCenterHouseId") String partyCenterHouseId) {
List<LingshanPartyCenterHouseLianhuDTO> list = icHouseService.queryLianHuHouse(partyCenterHouseId);
return new Result<List<LingshanPartyCenterHouseLianhuDTO>>().ok(list);
}
/**
* 灵山项目-绑定联户时候选择同网格内的房屋
* 房屋树小区-楼栋-单元-房屋共4级
* 可以根据网格id的房屋
*
* @param formDTO
* @return
*/
@PostMapping("housetree")
public Result<List<HouseTreeDTO>> getOrgTreeData(@RequestBody HouseTreeFormDTO formDTO) {
return new Result<List<HouseTreeDTO>>().ok(icHouseService.getOrgTreeData(formDTO.getGridId()));
}
/**
* 灵山项目新增居民/修改居民/删除居民/导入居民时重新更新房屋是否是党员中心户
* @param formDTO
* @return
*/
@PostMapping("updatePartyCenterHouse")
public Result updatePartyCenterHouse(@RequestBody ConfigPartyCenterHouseFormDTO formDTO){
icHouseService.updatePartyCenterHouse(formDTO.getHouseId(),formDTO.getPartyCenterHouseFlag());
return new Result();
}
}

22
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java

@ -24,6 +24,7 @@ import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.IcBuildingListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.HouseTreeDTO;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.entity.IcHouseEntity;
@ -255,4 +256,25 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
*/
IcBuildingEntity getBuildingInfoByName(CheckHouseInfoFormDTO formDTO);
/**
* 1楼栋节点
* @param neighborHoodId
* @return
*/
List<HouseTreeDTO> selectBuildingTree(@Param("neighborHoodId") String neighborHoodId);
/**
* 2单元节点
* @param buildingId
* @return
*/
List<HouseTreeDTO> selectUnit(@Param("buildingId") String buildingId);
/**
* 3房屋节点
* @param unitId
* @return
*/
List<HouseTreeDTO> selectHouseTree(@Param("unitId") String unitId);
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/LingshanPartyCenterHouseLianhuDao.java

@ -4,8 +4,6 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.LingshanPartyCenterHouseLianhuEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 灵山_党员中心户联户
*
@ -15,12 +13,7 @@ import java.util.List;
@Mapper
public interface LingshanPartyCenterHouseLianhuDao extends BaseDao<LingshanPartyCenterHouseLianhuEntity> {
/**
* 查询党员中心对应的联户房屋id
* @param partyCenterHouseId
* @return
*/
List<String> queryLianHuHouseId(String partyCenterHouseId);
int deleteByPartyCenterHouseId(String partyCenterHouseId);
LingshanPartyCenterHouseLianhuEntity selectByHouseId(String houseId);
}

25
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java

@ -14,6 +14,8 @@ import com.epmet.dto.result.HouseAgencyInfoResultDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.dto.result.lingshan.HouseTreeDTO;
import com.epmet.dto.result.lingshan.LingshanPartyCenterHouseLianhuDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuDetailDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -154,14 +156,31 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
/**
* 灵山项目-党员中心户绑定联户
* @param partyCenterHouseId
* @param lianHuHouseIdList
* @param lianHuHouseList
*/
void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseIdList);
void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseList);
/**
* 灵山项目-查询联户房屋列表
* @param partyCenterHouseId
* @return
*/
List<String> queryLianHuHouseId(String partyCenterHouseId);
List<LingshanPartyCenterHouseLianhuDTO> queryLianHuHouse(String partyCenterHouseId);
/**
* 灵山项目-绑定联户时候选择同网格内的房屋
* 房屋树小区-楼栋-单元-房屋共4级
* 可以根据网格id的房屋
*
* @param gridId
* @return
*/
List<HouseTreeDTO> getOrgTreeData(String gridId);
/**
* 更新房屋是否是党员中心户
* @param houseId
* @param partyCenterHouseFlag
*/
void updatePartyCenterHouse(String houseId, String partyCenterHouseFlag);
}

38
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -356,6 +356,44 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerIdCard()) ? entity.getOwnerIdCard() : "无");
entityList.add(e);
}
if (StringUtils.isNotBlank(entity.getPartyCenterHouseFlag())) {
if(!entity.getPartyCenterHouseFlag().equals(houseDTO.getPartyCenterHouseFlag())){
String originName=NumConstant.ZERO_STR.equals(entity.getPartyCenterHouseFlag())?"否":"是";
String nowName="";
if(NumConstant.ZERO_STR.equals(houseDTO.getPartyCenterHouseFlag())){
nowName="否";
}else if(NumConstant.ONE_STR.equals(houseDTO.getPartyCenterHouseFlag())){
nowName="是";
}else{
nowName="-";
}
sbAfter.append(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumnName()).append(":").append(nowName).append(";");
sbBefore.append(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumnName()).append(":").append(originName).append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
e.setChangeCol(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumn());
e.setChangeAfter(nowName);
e.setChangeBefore(originName);
entityList.add(e);
}
} else {
// 原来不确定是否是党员中心户
String nowName="";
if(NumConstant.ZERO_STR.equals(houseDTO.getPartyCenterHouseFlag())){
nowName="否";
}else if(NumConstant.ONE_STR.equals(houseDTO.getPartyCenterHouseFlag())){
nowName="是";
}else{
nowName="-";
}
sbAfter.append(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumnName()).append(":").append(nowName).append(";");
sbBefore.append(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumnName()).append(":").append("-").append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
e.setChangeCol(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumn());
e.setChangeAfter(nowName);
e.setChangeBefore("-");
entityList.add(e);
}
if (StringUtils.isNotBlank(sbAfter)) {
String before = sbBefore.substring(NumConstant.ZERO, sbBefore.length() - NumConstant.ONE);
String after = sbAfter.substring(NumConstant.ZERO, sbAfter.length() - NumConstant.ONE);

119
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -1,6 +1,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
@ -25,6 +26,8 @@ import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.form.lingshan.PartyCenterHousePageFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.HouseTreeDTO;
import com.epmet.dto.result.lingshan.LingshanPartyCenterHouseLianhuDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuDetailDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO;
import com.epmet.entity.*;
@ -36,6 +39,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.CustomerGridService;
import com.epmet.service.HouseService;
import com.epmet.service.IcHouseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -422,8 +426,12 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
public PageData<PartyCenterHouseResultDTO> queryPartyCenterHouseList(PartyCenterHousePageFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId());
PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize());
List<PartyCenterHouseResultDTO> list=baseDao.selectListPartyCenterHouse(formDTO.getCustomerId(),staffInfoCacheResult.getAgencyId(),
formDTO.getNeighborHoodName(),formDTO.getBuildingName(),formDTO.getBuildingId(),formDTO.getPartyCenterHouseFlag());
List<PartyCenterHouseResultDTO> list=baseDao.selectListPartyCenterHouse(formDTO.getCustomerId(),
staffInfoCacheResult.getAgencyId(),
formDTO.getNeighborHoodName(),
formDTO.getBuildingName(),
formDTO.getBuildingId(),
formDTO.getPartyCenterHouseFlag());
list.forEach(item -> {
item.setHouseTypeName(HouseTypeEnums.getTypeValue(item.getHouseType()));
item.setPurposeName(HousePurposeEnums.getTypeValue(item.getPurpose()));
@ -436,48 +444,50 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
* 灵山项目-党员中心户绑定联户
*
* @param partyCenterHouseId
* @param lianHuHouseIdList
* @param lianHuHouseList
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseIdList) {
public void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseList) {
IcHouseEntity partyCenterHouse=baseDao.selectById(partyCenterHouseId);
IcNeighborHoodEntity neighborHoodEntity=icNeighborHoodDao.selectById(partyCenterHouse.getNeighborHoodId());
CustomerGridDTO gridDTO=SpringContextUtils.getBean(CustomerGridService.class).get(neighborHoodEntity.getGridId());
String gridIdPath=PidUtils.convertPid2OrgIdPath(gridDTO.getId(), gridDTO.getPids());
// 先删除
LambdaQueryWrapper<LingshanPartyCenterHouseLianhuEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(LingshanPartyCenterHouseLianhuEntity::getPartyCenterHouseId,partyCenterHouseId);
partyCenterHouseLianhuDao.deleteByPartyCenterHouseId(partyCenterHouseId);
// 后插入
lianHuHouseIdList.forEach(lianHuHouseId->{
lianHuHouseList.forEach(lianHuHouse->{
//根据选中类型,查询下面的房屋
List<IcHouseEntity> list=new ArrayList<>();
if(!"house".equals(lianHuHouseId.getType())){
if(!"house".equals(lianHuHouse.getType())){
LambdaQueryWrapper<IcHouseEntity> query = new LambdaQueryWrapper<>();
query.eq("neighborHood".equals(lianHuHouseId.getType()), IcHouseEntity::getNeighborHoodId, lianHuHouseId.getId())
.eq("building".equals(lianHuHouseId.getType()), IcHouseEntity::getBuildingId, lianHuHouseId.getId())
.eq("unit".equals(lianHuHouseId.getType()), IcHouseEntity::getBuildingUnitId, lianHuHouseId.getId());
query.eq("neighborHood".equals(lianHuHouse.getType()), IcHouseEntity::getNeighborHoodId, lianHuHouse.getId())
.eq("building".equals(lianHuHouse.getType()), IcHouseEntity::getBuildingId, lianHuHouse.getId())
.eq("unit".equals(lianHuHouse.getType()), IcHouseEntity::getBuildingUnitId, lianHuHouse.getId());
list.addAll(baseDao.selectList(query));
}else{
IcHouseEntity icHouseEntity=baseDao.selectById(lianHuHouseId.getId());
IcHouseEntity icHouseEntity=baseDao.selectById(lianHuHouse.getId());
list.add(icHouseEntity);
}
if(CollectionUtils.isNotEmpty(list)){
for(IcHouseEntity houseEntity:list){
LingshanPartyCenterHouseLianhuEntity entity=new LingshanPartyCenterHouseLianhuEntity();
entity.setPartyCenterHouseId(partyCenterHouseId);
//目前只能绑定同一个网格下的房屋
entity.setCustomerId(neighborHoodEntity.getCustomerId());
entity.setAgencyId(neighborHoodEntity.getAgencyId());
entity.setGridId(neighborHoodEntity.getGridId());
entity.setGridIdPath(gridIdPath);
entity.setNeighborHoodId(houseEntity.getNeighborHoodId());
entity.setBuildingId(houseEntity.getBuildingId());
entity.setBuildingUnitId(houseEntity.getBuildingUnitId());
entity.setHouseId(houseEntity.getId());
partyCenterHouseLianhuDao.insert(entity);
LingshanPartyCenterHouseLianhuEntity existedEntiy=partyCenterHouseLianhuDao.selectByHouseId(houseEntity.getId());
if (null == existedEntiy) {
LingshanPartyCenterHouseLianhuEntity entity = new LingshanPartyCenterHouseLianhuEntity();
entity.setPartyCenterHouseId(partyCenterHouseId);
// 目前只能绑定同一个网格下的房屋
entity.setCustomerId(neighborHoodEntity.getCustomerId());
entity.setAgencyId(neighborHoodEntity.getAgencyId());
entity.setGridId(neighborHoodEntity.getGridId());
entity.setGridIdPath(gridIdPath);
entity.setNeighborHoodId(houseEntity.getNeighborHoodId());
entity.setBuildingId(houseEntity.getBuildingId());
entity.setBuildingUnitId(houseEntity.getBuildingUnitId());
entity.setHouseId(houseEntity.getId());
partyCenterHouseLianhuDao.insert(entity);
}
}
}
});
@ -491,11 +501,66 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
* @return
*/
@Override
public List<String> queryLianHuHouseId(String partyCenterHouseId) {
public List<LingshanPartyCenterHouseLianhuDTO> queryLianHuHouse(String partyCenterHouseId) {
if(StringUtils.isBlank(partyCenterHouseId)){
return new ArrayList<>();
}
return partyCenterHouseLianhuDao.queryLianHuHouseId(partyCenterHouseId);
LambdaQueryWrapper<LingshanPartyCenterHouseLianhuEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(LingshanPartyCenterHouseLianhuEntity::getPartyCenterHouseId,partyCenterHouseId);
List<LingshanPartyCenterHouseLianhuEntity> list=partyCenterHouseLianhuDao.selectList(queryWrapper);
return ConvertUtils.sourceToTarget(list,LingshanPartyCenterHouseLianhuDTO.class);
}
/**
* 灵山项目-绑定联户时候选择同网格内的房屋
* 房屋树小区-楼栋-单元-房屋共4级
* 可以根据网格id的房屋
*
* @param gridId
* @return
*/
@Override
public List<HouseTreeDTO> getOrgTreeData(String gridId) {
LambdaQueryWrapper<IcNeighborHoodEntity> neighborHoodWrapper = new LambdaQueryWrapper<>();
neighborHoodWrapper.eq(IcNeighborHoodEntity::getGridId, gridId)
.select(IcNeighborHoodEntity::getId,IcNeighborHoodEntity::getNeighborHoodName);
List<IcNeighborHoodEntity> list = icNeighborHoodDao.selectList(neighborHoodWrapper);
List<HouseTreeDTO> resultList = new ArrayList<>();
for (IcNeighborHoodEntity neighborHoodEntity : list) {
HouseTreeDTO houseTreeDTO = new HouseTreeDTO();
houseTreeDTO.setId(neighborHoodEntity.getId());
houseTreeDTO.setType("neighborHood");
houseTreeDTO.setName(neighborHoodEntity.getNeighborHoodName());
List<HouseTreeDTO> buildingList=icBuildingDao.selectBuildingTree(neighborHoodEntity.getId());
houseTreeDTO.setChildren(buildingList);
resultList.add(houseTreeDTO);
}
return resultList;
}
/**
* 更新房屋是否是党员中心户
*
* @param houseId
* @param partyCenterHouseFlag:是否党员中心户1是0不是
*/
@Override
public void updatePartyCenterHouse(String houseId, String partyCenterHouseFlag) {
if(NumConstant.ZERO_STR.equals(partyCenterHouseFlag)){
//房屋如果不是党员中心户,自动删除绑定的联户
partyCenterHouseLianhuDao.deleteByPartyCenterHouseId(houseId);
}
//加一条变更记录吧。。 就当留痕了
IcHouseEntity origin = baseDao.selectById(houseId);
IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(origin, IcHouseDTO.class);
icHouseDTO.setPartyCenterHouseFlag(partyCenterHouseFlag);
SpringContextUtils.getBean(HouseService.class).houseChangeRecord(houseId, icHouseDTO.getCustomerId(), icHouseDTO);
//修改
LambdaUpdateWrapper<IcHouseEntity> update = new LambdaUpdateWrapper<>();
update.set(IcHouseEntity::getPartyCenterHouseFlag, partyCenterHouseFlag)
.set(IcHouseEntity::getUpdatedTime,new Date())
.eq(IcHouseEntity::getId, houseId);
baseDao.update(null, update);
}

50
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -552,4 +552,54 @@
</select>
<resultMap id="HouseTreeDTOMap" type="com.epmet.dto.result.lingshan.HouseTreeDTO">
<result property="id" column="id"/>
<result property="name" column="BUILDING_NAME"/>
<result property="type" column="type"/>
<collection property="children" ofType="com.epmet.dto.result.lingshan.HouseTreeDTO"
column="{buildingId=id}" select="com.epmet.dao.IcBuildingDao.selectUnit"/>
</resultMap>
<!-- 楼栋节点 -->
<select id="selectBuildingTree" parameterType="map" resultMap="HouseTreeDTOMap">
select id ,
BUILDING_NAME,
'building' as type
from ic_building
where DEL_FLAG = '0'
and NEIGHBOR_HOOD_ID = #{neighborHoodId}
order by sort asc,CREATED_TIME asc
</select>
<resultMap id="UnitMap" type="com.epmet.dto.result.lingshan.HouseTreeDTO">
<result property="id" column="id"/>
<result property="name" column="UNIT_NAME"/>
<result property="type" column="type"/>
<collection property="children" ofType="com.epmet.dto.result.lingshan.HouseTreeDTO"
column="{unitId=id}" select="com.epmet.dao.IcBuildingDao.selectHouseTree"/>
</resultMap>
<!-- 单元节点 -->
<select id="selectUnit" parameterType="map" resultMap="UnitMap">
SELECT
u.ID,
u.UNIT_NAME,
'unit' AS type
FROM
ic_building_unit u
WHERE
u.DEL_FLAG = '0'
AND u.BUILDING_ID = #{buildingId}
ORDER BY
u.UNIT_NUM ASC
</select>
<!-- 房屋节点 -->
<select id="selectHouseTree" parameterType="map" resultType="com.epmet.dto.result.lingshan.HouseTreeDTO">
select ih.id,
ih.DOOR_NAME as name,
'house' as type
from ic_house ih
where ih.DEL_FLAG='0'
and ih.BUILDING_UNIT_ID=#{unitId}
order by ih.DOOR_NAME asc
</select>
</mapper>

6
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -118,7 +118,8 @@
gr.GRID_NAME,
IFNULL(a.sort,0) as sort,
IFNULL(a.REMARK,'') AS remark,
a.CUSTOMER_ID
a.CUSTOMER_ID,
a.PARTY_CENTER_HOUSE_FLAG as partyCenterHouseFlag
from ic_house a
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
@ -736,7 +737,8 @@
from lingshan_party_center_house_lianhu r
where r.PARTY_CENTER_HOUSE_ID=ih.ID
and r.DEL_FLAG='0'
)as totalLianHu
)as totalLianHu,
ih.PARTY_CENTER_HOUSE_FLAG as partyCenterHouseFlag
FROM
ic_house ih
inner join ic_building_unit u

18
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/LingshanPartyCenterHouseLianhuDao.xml

@ -22,18 +22,16 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 查询党员中心对应的联户房屋id -->
<select id="queryLianHuHouseId" parameterType="java.lang.String" resultType="java.lang.String">
SELECT
distinct h.HOUSE_ID
FROM
lingshan_party_center_house_lianhu h
WHERE
h.DEL_FLAG = '0'
AND h.PARTY_CENTER_HOUSE_ID = #{partyCenterHouseId}
</select>
<delete id="deleteByPartyCenterHouseId" parameterType="java.lang.String">
delete from lingshan_party_center_house_lianhu where PARTY_CENTER_HOUSE_ID=#{partyCenterHouseId}
</delete>
<select id="selectByHouseId" parameterType="java.lang.String" resultType="com.epmet.entity.LingshanPartyCenterHouseLianhuEntity">
select
*
from lingshan_party_center_house_lianhu
where DEL_FLAG='0'
and HOUSE_ID = #{houseId}
</select>
</mapper>

11
epmet-module/gov-project/gov-project-client/pom.xml

@ -16,12 +16,21 @@
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<artifactId>objenesis</artifactId>
<groupId>org.objenesis</groupId>
</exclusion>
<exclusion>
<artifactId>commons-collections4</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-mine-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

83
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventAddEditFormDTO.java

@ -1,83 +0,0 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class EventAddEditFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 事件编号
*/
private String code;
/**
* 事件状态
*/
private String status;
/**
* 上报人员
*/
private String reporter;
/**
* 联系电话
*/
private String phone;
/**
* 上报事件
*/
private Date reportDate;
/**
* 紧急程度
*/
private String urgency;
/**
* 所属网格
*/
private String grid;
/**
* 事件类型
*/
private String eventType;
/**
* 即办类型
*/
private String type;
/**
* 办理期限
*/
private Date lastDate;
/**
* 满意度
*/
private String satisficing;
/**
* 页码
*/
private Integer pageNo = 1;
/**
* 每页显示数量
*/
private Integer pageSize = 20;
private Boolean isPage = true;
private String customerId;
private String agencyId;
private String staffId;
private String userId;
private String app;
private String client;
}

86
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventFormsDTO.java

@ -1,86 +0,0 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 灵山项目事件 formDTO
*/
@Data
public class EventFormsDTO implements Serializable {
private static final long serialVersionUID = 1;
public interface Detail extends CustomerClientShowGroup {
}
public interface GovRedDot extends CustomerClientShowGroup {
}
/**
* 事件编号
*/
private String code;
/**
* 事件状态
*/
private String status;
/**
* 上报人员
*/
private String reporter;
/**
* 联系电话
*/
private String phone;
/**
* 上报事件
*/
private Date reportDate;
/**
* 紧急程度
*/
private String urgency;
/**
* 所属网格
*/
private String grid;
/**
* 事件类型
*/
private String eventType;
/**
* 即办类型
*/
private String type;
/**
* 办理期限
*/
private Date lastDate;
/**
* 满意度
*/
private String satisficing;
/**
* 页码
*/
private Integer pageNo = 1;
/**
* 每页显示数量
*/
private Integer pageSize = 20;
private Boolean isPage = true;
private String customerId;
private String agencyId;
private String staffId;
}

22
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java

@ -124,4 +124,24 @@ public class IcEventAddEditFormDTO implements Serializable {
@Valid
private IcEventToIssueFormDTO issueInfo;
}
/**
* 办理状态0上报 1阅收 2完结 3审核 4事件评价 5结案归档
*/
private Integer manageStatus;
/**
* 办理时间
*/
private Date manageTime;
/**
* 办理人
*/
private String manageResi;
/**
* 办理人电话
*/
private String manageResiTel;
}

23
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java

@ -6,6 +6,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 事件管理_回复
@ -50,7 +51,27 @@ public class IcEventReplyFormDTO implements Serializable {
@NotBlank(message = "满意度不能为空", groups = {Comment.class})
private String satisfaction;
/**
* 办理状态0上报 1阅收 2完结 3审核 4事件评价 5结案归档
*/
private Integer manageStatus;
/**
* 办理时间
*/
private Date manageTime;
/**
* 办理人
*/
private String manageResi;
/**
* 办理人电话
*/
private String manageResiTel;
private String customerId;
private String userId;
}
}

102
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventResultDTO.java

@ -1,102 +0,0 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 即墨灵山项目
*/
@Data
public class EventResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 事件编号
*/
private String code;
/**
* 事件状态
*/
private String status;
/**
* 事件明细ID
*/
private String detailId;
/**
* 上报人员
*/
private String reporter;
/**
* 联系电话
*/
private String phone;
/**
* 上报事件事件
*/
private Date reportDate;
/**
* 紧急程度
*/
private String urgency;
/**
* 所属网格
*/
private String grid;
/**
* 事件类型
*/
private String eventType;
/**
* 即办类型
*/
private String type;
/**
* 办理期限
*/
private Date lastDate;
/**
* 事件地址
*/
private String eventAddr;
/**
* 坐标经度
*/
private String longitude;
/**
* 坐标纬度
*/
private String latitude;
/**
* 音频
*/
private String voice;
/**
* 视频
*/
private String video;
/**
* 满意度
*/
private String satisficing;
/**
* 解决情况
*/
private String remark;
/**
* 事件描述
*/
private String conetnt;
}

21
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -92,5 +93,25 @@ public class IcEventProcessListResultDTO implements Serializable {
*/
private String actualServiceTime;
/**
* 办理状态0上报 1阅收 2完结 3审核 4事件评价 5结案归档
*/
private Integer manageStatus;
/**
* 办理时间
*/
private Date manageTime;
/**
* 办理人
*/
private String manageResi;
/**
* 办理人电话
*/
private String manageResiTel;
}

12
epmet-module/gov-project/gov-project-server/pom.xml

@ -33,6 +33,12 @@
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<artifactId>objenesis</artifactId>
<groupId>org.objenesis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
@ -59,6 +65,12 @@
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>

88
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java

@ -1,88 +0,0 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.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.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.form.EventAddEditFormDTO;
import com.epmet.dto.form.EventFormsDTO;
import com.epmet.dto.result.EventResultDTO;
import com.epmet.service.EventService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author yan Lu
* @date 2023-04-14 19:07
* @deprecated 社会治理--事件处理
*/
@Slf4j
@RestController
@RequestMapping("event")
public class EventController {
@Autowired
private EventService eventService;
/**
* 社会治理 事件列表
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("list")
public Result<PageData<EventResultDTO>> getList(@LoginUser TokenDto tokenDto, @RequestBody EventFormsDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<EventResultDTO>>().ok(eventService.getList(formDTO));
}
/**
* @deprecated 根据ID获取事件
* @param id
* @return
*/
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<EventResultDTO> get(@PathVariable("id") String id){
EventResultDTO data = eventService.getById(id);
return new Result<EventResultDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("add")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody EventAddEditFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setApp(tokenDto.getApp());
formDTO.setClient(tokenDto.getClient());
eventService.save(formDTO);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody EventResultDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
eventService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
eventService.delete(ids);
return new Result();
}
}

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/CustomerProjectParameterDao.java

@ -87,5 +87,5 @@ public interface CustomerProjectParameterDao extends BaseDao<CustomerProjectPara
* @param key
* @return java.lang.String
*/
String selectValueByKey(@Param("customerId") String customerId, @Param("key") String key);
// String selectValueByKey(@Param("customerId") String customerId, @Param("key") String key);
}

19
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/EventEntityDao.java

@ -1,19 +0,0 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.EventFormsDTO;
import com.epmet.dto.result.EventResultDTO;
import com.epmet.entity.EventEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 灵山项目
*/
@Mapper
public interface EventEntityDao extends BaseDao<EventEntity> {
List<EventResultDTO> getList(EventFormsDTO formDTO);
}

43
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventDetailEntity.java

@ -1,43 +0,0 @@
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;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("event_detail")
public class EventDetailEntity extends BaseEpmetEntity {
/**
* 事件ID
*/
private String eventId;
/**
* 上报人
*/
private String reporter;
/**
* 接收人
*/
private String recipient;
/**
* 上报事件
*/
private Date reportDate;
/**
* 事件附件地址
*/
private String atts;
/**
* 事件处理耗时
*/
private String timeSpent;
/**
* 反馈内容
*/
private String content;
}

97
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventEntity.java

@ -1,97 +0,0 @@
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;
/**
* 灵山项目事件
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("event_entity")
public class EventEntity extends BaseEpmetEntity {
/**
* 事件编号
*/
private String code;
/**
* 事件状态
*/
private String status;
/**
* 事件明细ID
*/
private String detailId;
/**
* 上报人员
*/
private String reporter;
/**
* 联系电话
*/
private String phone;
/**
* 上报事件事件
*/
private Date reportDate;
/**
* 紧急程度
*/
private String urgency;
/**
* 所属网格
*/
private String grid;
/**
* 事件类型
*/
private String eventType;
/**
* 即办类型
*/
private String type;
/**
* 办理期限
*/
private Date lastDate;
/**
* 事件地址
*/
private String eventAddr;
/**
* 坐标经度
*/
private String longitude;
/**
* 坐标纬度
*/
private String latitude;
/**
* 音频
*/
private String voice;
/**
* 视频
*/
private String video;
/**
* 满意度
*/
private String satisficing;
/**
* 解决情况
*/
private String remark;
/**
* 事件描述
*/
private String conetnt;
}

9
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java

@ -61,6 +61,11 @@ public class IcEventEntity extends BaseEpmetEntity {
*/
private String idCard;
/**
* 事件分类分类Id :灵山专用
*/
private String categoryId;
/**
* 反映渠道字典表dictTypeKey:ic_event_source_type;随手拍随时讲0多媒体反应1社区电话212345:3网格员手持终端4
*/
@ -117,7 +122,7 @@ public class IcEventEntity extends BaseEpmetEntity {
private Integer readFlag;
/**
* 报事人的红点:展示1不展示0人大代表回复工作人员回复/立项/转需求/办结更新为1;
* 报事人的红点:展示1不展示0人大代表回复工作人员回复/立项/转需求/办结更新为1;
*/
private Integer redDot;
@ -157,7 +162,7 @@ public class IcEventEntity extends BaseEpmetEntity {
private Date commentTime;
/**
* 事件审核状态[涉及附件审核需要加的状态]审核中auditing
* 事件审核状态[涉及附件审核需要加的状态]审核中auditing
auto_passed: 自动通过
review结果不确定需要人工审核
block: 结果违规

20
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java

@ -46,4 +46,24 @@ public class IcEventReplyEntity extends BaseEpmetEntity {
*/
private String userShowName;
/**
* 办理状态0上报 1阅收 2完结 3审核 4事件评价 5结案归档
*/
private Integer manageStatus;
/**
* 办理时间
*/
private Date manageTime;
/**
* 办理人
*/
private String manageResi;
/**
* 办理人电话
*/
private String manageResiTel;
}

19
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/EventService.java

@ -1,19 +0,0 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.EventAddEditFormDTO;
import com.epmet.dto.form.EventFormsDTO;
import com.epmet.dto.result.EventResultDTO;
public interface EventService {
PageData<EventResultDTO> getList(EventFormsDTO formDTO);
EventResultDTO getById(String id);
void update(EventResultDTO dto);
void delete(String[] ids);
void save(EventAddEditFormDTO dto);
}

136
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java

@ -1,136 +0,0 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.EventEntityDao;
import com.epmet.dto.form.EventAddEditFormDTO;
import com.epmet.dto.form.EventFormsDTO;
import com.epmet.dto.result.EventResultDTO;
import com.epmet.entity.EventEntity;
import com.epmet.entity.IcEventOperationLogEntity;
import com.epmet.service.EventService;
import com.epmet.service.IcEventOperationLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
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.Date;
import java.util.List;
@Service
public class EventServiceImpl extends BaseServiceImpl<EventEntityDao, EventEntity> implements EventService {
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private IcEventOperationLogService icEventOperationLogService;
/**
* @param formDTO
* @return
* @deprecated 查询事件列表
*/
@Override
public PageData<EventResultDTO> getList(EventFormsDTO formDTO) {
if (StringUtils.isBlank(formDTO.getAgencyId())) {
//获取当前工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setAgencyId(staffInfo.getAgencyId());
}
//分页查询当前组织下网格内事件数据
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<EventResultDTO> list = baseDao.getList(formDTO);
PageInfo<EventResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* @param id
* @return
* @deprecated 获取事件详情
*/
@Override
public EventResultDTO getById(String id) {
EventEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, EventResultDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(EventResultDTO dto) {
EventEntity entity = ConvertUtils.sourceToTarget(dto, EventEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
for (String id : ids) {
EventEntity entity = baseDao.selectById(id);
if (null == entity) {
continue;
}
LambdaUpdateWrapper<EventEntity> wrapper = new LambdaUpdateWrapper();
wrapper.eq(EventEntity::getId, id).set(EventEntity::getUpdatedTime, new Date())
.set(EventEntity::getUpdatedBy, loginUserUtil.getLoginUserId())
.set(EventEntity::getDelFlag, NumConstant.ONE_STR);
baseDao.update(null, wrapper);
// icEventCategoryService.delInsert(id,null);
}
}
@Override
public void save(EventAddEditFormDTO formDTO) {
EventEntity entity = ConvertUtils.sourceToTarget(formDTO, EventEntity.class);
entity.setId(IdWorker.getIdStr());
// List<IcEventOperationLogEntity> logList = new ArrayList<>();
// logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), new Date(), "add", "publish"));
// icEventOperationLogService.insertBatch(logList);
insert(entity);
}
/**
* @param customerId
* @param staffId
* @return
* @deprecated 获取当前登陆人员信息
*/
public CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", staffId));
}
return staffInfo;
}
/**
* 事件管理操作日志记录
*
* @return
*/
private IcEventOperationLogEntity logEntity(String customerId, String icEventId, String userId, Date operateTime, String actionCode, String actionDesc) {
IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity();
logEntity.setCustomerId(customerId);
logEntity.setIcEventId(icEventId);
logEntity.setUserId(userId);
logEntity.setUserIdentity("staff");
logEntity.setActionCode(actionCode);
logEntity.setActionDesc(actionDesc);
logEntity.setOperateTime(operateTime);
return logEntity;
}
}

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -378,6 +378,10 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
replyEntity.setIcEventId(entity.getId());
replyEntity.setFromUserId(formDTO.getUserId());
replyEntity.setContent(formDTO.getContent());
replyEntity.setManageTime(formDTO.getManageTime());
replyEntity.setManageStatus(formDTO.getManageStatus());
replyEntity.setManageResi(formDTO.getManageResi());
replyEntity.setManageResiTel(formDTO.getManageResiTel());
replyEntity.setUserShowName(staffInfo.getAgencyName() + "-" + staffInfo.getRealName());
icEventReplyService.insert(replyEntity);
//回复对应的操作记录
@ -798,6 +802,10 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
replyEntity.setCustomerId(formDTO.getCustomerId());
replyEntity.setIcEventId(formDTO.getIcEventId());
replyEntity.setFromUserId(formDTO.getUserId());
replyEntity.setManageResi(formDTO.getManageResi());
replyEntity.setManageResiTel(formDTO.getManageResiTel());
replyEntity.setManageStatus(formDTO.getManageStatus());
replyEntity.setManageTime(formDTO.getManageTime());
replyEntity.setContent(formDTO.getContent());
replyEntity.setUserShowName(staffInfo.getAgencyName() + "-" + staffInfo.getRealName());
icEventReplyService.insert(replyEntity);

13
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/EventEntityDao.xml

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.EventEntityDao">
<select id="getList" resultType="com.epmet.dto.result.EventResultDTO">
select * from event_entity
<where>
DEL_FLAG = '0'
</where>
order by REPORT_DATE DESC, CREATED_TIME DESC
</select>
</mapper>

8
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml

@ -10,7 +10,11 @@
'回复' processName,
UNIX_TIMESTAMP(created_time) processTime,
user_show_name departmentName,
content publicReply
content publicReply,
manage_status,
manage_time,
manage_resi,
manage_resi_tel
FROM
ic_event_reply
WHERE
@ -34,4 +38,4 @@
ORDER BY
r.CREATED_TIME DESC
</select>
</mapper>
</mapper>

16
epmet-user/epmet-user-client/pom.xml

@ -17,6 +17,16 @@
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<artifactId>objenesis</artifactId>
<groupId>org.objenesis</groupId>
</exclusion>
<exclusion>
<artifactId>asm</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@ -24,6 +34,12 @@
<artifactId>gov-org-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>commons-collections4</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

5
epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java

@ -15,6 +15,7 @@ import com.epmet.constant.SystemMessageType;
import com.epmet.service.IcNatService;
import com.epmet.service.IcResiUserService;
import com.epmet.service.StatsResiWarnService;
import com.epmet.service.impl.IcResiUserServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
@ -77,6 +78,10 @@ public class ICWarnStatsEventListener implements MessageListenerConcurrently {
if (!updateIcNatResiFlag(tags, obj)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"消费失败,等待重新消费");
}
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
SpringContextUtils.getBean(IcResiUserServiceImpl.class).syncHousePartyCenterHouse(null,obj.getIcResiUser());
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【开放数据事件监听器】-居民信息变动MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));

35
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/ResiImportDyzxhPostProcessor.java

@ -0,0 +1,35 @@
package com.epmet.processor;
import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
@Slf4j
@Component
public class ResiImportDyzxhPostProcessor extends ResiImportPostProcessor{
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Override
public void consume(Map<String, String> resiInfoMap) {
System.out.println(resiInfoMap);
String customerId=resiInfoMap.get("CUSTOMER_ID");
// String userId=resiInfoMap.get("ID");
String userId=resiInfoMap.get("IC_RESI_USER");
//推送MQ事件
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
mqMsg.setCustomerId(customerId);
mqMsg.setIcResiUser(userId);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.IC_RESI_USER_ADD);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
}
}

21
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/ResiImportPostProcessor.java

@ -0,0 +1,21 @@
package com.epmet.processor;
import java.util.Map;
/**
* @Description 居民信息导入之后的处理方法
* @Author wangxianzhang
* @Time 2023/5/17 1:33 PM
*/
public abstract class ResiImportPostProcessor {
/**
* @Description: 居民信息导入之后的消费方法
* @param resiInfoMap: 居民信息map
* @Return void
* @Author: wangxianzhang
* @Date: 2023/5/17 1:33 PM
*/
public abstract void consume(Map<String, String> resiInfoMap);
}

15
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -6,7 +6,6 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.bean.ResiImportCategoryData;
@ -46,6 +45,7 @@ import com.epmet.enums.IcResiUserTableEnum;
import com.epmet.excel.handler.IcResiImportDynamicExcelListener;
import com.epmet.excel.handler.IcResiVirtualSheetImportListener;
import com.epmet.feign.*;
import com.epmet.processor.ResiImportPostProcessor;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.IcResiUserImportService;
@ -170,6 +170,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
private IcPartyMemberDao icPartyMemberDao;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private List<ResiImportPostProcessor> resiImportPostProcessors;
/**
* 子表中不需要的列因为主表中需要身份证号网格等信息但子表中不需要这些列必填只要有身份证号即可因此字表判断的时候需要排除这些列
@ -584,6 +586,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
categoryData = null;
}
} catch (Exception e) {
String errorMsg;
@ -762,6 +765,12 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
// 将成功的居民的身份证号添加到列表中
successIdCards.add(row.get(ID_CARD_COLUMN_NO));
// 居民信息-党员信息导入后置处理器回调
LinkedHashMap<String, String> finalColumnAndValues = columnAndValues;
resiImportPostProcessors.forEach(p -> {
p.consume(finalColumnAndValues);
});
} catch (Exception e) {
String errorMsg;
if (e instanceof RenException || e instanceof EpmetException) {
@ -1040,7 +1049,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
superOptions = new HashMap<>();
superOptions.put(superColumnValue, options);
itemIdAndOptionsCache.put(currentItemId, superOptions);
if (options == null) {
System.out.println(options);
}
String colValue = options.get(cellContent);
columnWrapper.setColValue(colValue);
}

64
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -61,6 +61,7 @@ import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.lingshan.ConfigPartyCenterHouseFormDTO;
import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO;
import com.epmet.entity.*;
import com.epmet.enums.RenHuConditionEnum;
@ -132,8 +133,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private UserService userService;
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Autowired
private IcResiUserDao icResiUserDao;
// @Autowired
// private IcResiUserDao icResiUserDao;
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@Autowired
@ -154,8 +155,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private GuardarDatosFeignClient guardarDatosFeignClient;
@Resource
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
@Resource
private GovOrgOpenFeignClient getGovOrgOpenFeignClient;
// @Resource
// private GovOrgOpenFeignClient getGovOrgOpenFeignClient;
@Resource
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Resource
@ -169,8 +170,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Resource
private IcUserChangeDetailedDao icUserChangeDetailedDao;
@Autowired
private DataReportOpenFeignClient dataReportOpenFeignClient;
// @Autowired
// private DataReportOpenFeignClient dataReportOpenFeignClient;
@Autowired
private IcResiRentContractInfoDao icResiRentContractInfoDao;
@ -200,6 +201,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(DelIcResiUserFormDTO formDTO) {
IcResiUserEntity origin=baseDao.selectById(formDTO.getIcResiUserId());
baseDao.updateToDel(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class);
Result<Set<String>> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO);
@ -232,7 +234,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
LambdaQueryWrapper<IcResiUserEntity> resiWrapper=new LambdaQueryWrapper<>();
resiWrapper.eq(IcResiUserEntity::getAgencyId,formDTO.getAgencyId());
resiWrapper.select(IcResiUserEntity::getId);
List<IcResiUserEntity> resiIds=icResiUserDao.selectList(resiWrapper);
List<IcResiUserEntity> resiIds=baseDao.selectList(resiWrapper);
for(IcResiUserEntity entity:resiIds){
baseDao.updateToDel(entity.getId(),formDTO.getCurrentStaffId());
CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class);
@ -448,7 +450,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
//3.变更记录表和变更记录明细表新增数据
saveUserChangeRecord(tokenDto, map, resiUserId, name);
return resiUserId;
}
@ -792,7 +793,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
/**
* @description: 生成居民变更记录
* @param null:
* @param entity
* @param map
* @return
* @author: sun
*/
@ -830,7 +832,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
//修改前数据库居民十八类信息值
List<String> columns = categoryListResult.getData().stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList());
Map<String, String> hash = icResiUserDao.getCategoryListMap(columns, entity.getId());
Map<String, String> hash = baseDao.getCategoryListMap(columns, entity.getId());
//封装变更记录和变更明细数据
//变更记录
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
@ -1684,7 +1686,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
r.setVillageName(neighborHood.getNeighborHoodName());
// 2.志愿者类型填充
List<String> volunteers = icResiUserDao.selectVolunteerByUserId(resiEntity.getId());
List<String> volunteers = baseDao.selectVolunteerByUserId(resiEntity.getId());
if (CollectionUtils.isNotEmpty(volunteers)) {
String[] vCategories = volunteers.get(0).split(",");
@ -1701,7 +1703,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
ArrayList<String> resiCategoryNames = new ArrayList<>();
Map<String, String> categories = icResiUserDao.getCategoryListMap(resiCategoryColumns, resiUserId);
Map<String, String> categories = baseDao.getCategoryListMap(resiCategoryColumns, resiUserId);
categories.forEach((k, v) -> {
if (NumConstant.ONE_STR.equals(v)) {
ResiCategoryEnum enumObject = ResiCategoryEnum.getEnum(k);
@ -2831,7 +2833,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
public Result editMember(IcResiUserConfirmSubmitDTO dto) {
IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId());
IcResiUserEntity user = baseDao.selectById(dto.getIcResiUserId());
LambdaQueryWrapper<IcResiUserEntity> userWrapper = new LambdaQueryWrapper<>();
userWrapper.ne(IcResiUserEntity::getId, dto.getIcResiUserId());
@ -3247,7 +3249,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
entity.setUnitId(houseInfo.getBuildingUnitId());
entity.setAgencyId(houseInfo.getAgencyId());
// 根据homeId获取gridId和pids
Result<HouseAgencyInfoResultDTO> resultDTOResult = getGovOrgOpenFeignClient.getHouseAgencyInfo(houseInfo.getHomeId());
Result<HouseAgencyInfoResultDTO> resultDTOResult = govOrgOpenFeignClient.getHouseAgencyInfo(houseInfo.getHomeId());
HouseAgencyInfoResultDTO data = resultDTOResult.getData();
entity.setGridId(data.getGridId());
entity.setPids(data.getPids() + ":" + data.getAgencyId());
@ -3911,4 +3913,38 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return fzBig.multiply(NumConstant.ONE_HUNDRED_DECIMAL).divide(totalBig, NumConstant.TWO, BigDecimal.ROUND_HALF_UP);
}
/**
* 灵山需求
* @param houseId 房屋id
*/
public void syncHousePartyCenterHouse(String houseId,String resiUserId) {
if(StringUtils.isBlank(houseId)){
IcResiUserEntity entity=baseDao.selectById(resiUserId);
houseId=entity.getHomeId();
}
// 查询房屋里的所有人
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, houseId)
.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR)
.select(IcResiUserEntity::getId);
List<IcResiUserEntity> resiList = baseDao.selectList(wrapper);
//默认该房屋不是党员中心户
ConfigPartyCenterHouseFormDTO configPartyCenterHouseFormDTO=new ConfigPartyCenterHouseFormDTO();
configPartyCenterHouseFormDTO.setHouseId(houseId);
configPartyCenterHouseFormDTO.setPartyCenterHouseFlag(NumConstant.ZERO_STR);
if(CollectionUtils.isNotEmpty(resiList)){
List<String> resiIds = resiList.stream().map(IcResiUserEntity::getId).collect(Collectors.toList());
// 是否有党员中心户
LambdaQueryWrapper<IcPartyMemberEntity> queryWrapper = new LambdaQueryWrapper();
queryWrapper.in(IcPartyMemberEntity::getIcResiUser, resiIds)
.eq(IcPartyMemberEntity::getIsDyzxh, NumConstant.ONE_STR);
List<IcPartyMemberEntity> dyzxhList = icPartyMemberDao.selectList(queryWrapper);
if (CollectionUtils.isNotEmpty(dyzxhList)) {
configPartyCenterHouseFormDTO.setPartyCenterHouseFlag(NumConstant.ONE_STR);
}
}
govOrgOpenFeignClient.updatePartyCenterHouse(configPartyCenterHouseFormDTO);
}
}

Loading…
Cancel
Save