Browse Source

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

master
wangxianzhang 4 years ago
parent
commit
1772d47a30
  1. 51
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
  2. 26
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
  3. 78
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
  4. 3
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java
  5. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java
  6. 55
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java
  7. 6
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java
  8. 127
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java
  9. 13
      epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
  10. 162
      epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java
  11. 24
      epmet-auth/src/main/java/com/epmet/controller/LoginController.java
  12. 32
      epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java
  13. 25
      epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java
  14. 9
      epmet-auth/src/main/java/com/epmet/redis/IcLoginTicketCacheBean.java
  15. 10
      epmet-auth/src/main/java/com/epmet/service/CaptchaService.java
  16. 9
      epmet-auth/src/main/java/com/epmet/service/IcLoginService.java
  17. 12
      epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java
  18. 16
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  19. 177
      epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java
  20. 2
      epmet-commons/epmet-commons-extapp-auth/pom.xml
  21. 5
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  22. 5
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
  23. 20
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java
  24. 4
      epmet-commons/epmet-commons-tools/pom.xml
  25. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java
  26. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java
  27. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java
  28. 17
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
  29. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java
  30. 53
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java
  31. 44
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java
  32. 45
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java
  33. 58
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java
  34. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  35. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java
  36. 62
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  37. 81
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java
  38. 13
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java
  39. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java
  40. 2
      epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java
  41. 3
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java
  42. 16
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java
  43. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  44. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java
  45. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  46. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  47. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java
  48. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java
  49. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java
  50. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml
  51. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  52. 16
      epmet-module/data-statistical/data-statistical-server/pom.xml
  53. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java
  54. 238
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java
  55. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  56. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  57. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  58. 189
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankStatisticsService.java
  59. 306
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankStatisticsServiceImpl.java
  60. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java
  61. 15
      epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java
  62. 3
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java
  63. 19
      epmet-module/epmet-demo/epmet-demo-server/pom.xml
  64. 58
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java
  65. 20
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java
  66. 82
      epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java
  67. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java
  68. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  69. 7
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  70. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java
  71. 105
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  72. 41
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  73. 73
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java
  74. 114
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  75. 120
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  76. 77
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  77. 15
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  78. 5
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
  79. 11
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java
  80. 6
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java
  81. 16
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java
  82. 9
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java
  83. 24
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java
  84. 24
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java
  85. 24
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java
  86. 24
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java
  87. 5
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  88. 7
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java
  89. 18
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java
  90. 5
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java
  91. 6
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java
  92. 68
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java
  93. 8
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java
  94. 29
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
  95. 112
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java
  96. 4
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml
  97. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java
  98. 4
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/PartyBranchManageController.java
  99. 4
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java
  100. 6
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueSuggestionController.java

51
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java

@ -1,6 +1,7 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO;
import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory;
@ -21,4 +22,54 @@ public interface EpmetAdminOpenFeignClient {
*/
@PostMapping("/sys/cors-config/list")
Result<List<CorsConfigResultDTO>> list();
/**
* @Description 文化程度
* @Param
* @Return {@link Result<List< OptionResultDTO >>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/education")
Result<List<OptionResultDTO>> getEducationOption();
/**
* @Description 住房性质
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/house")
Result<List<OptionResultDTO>> getHouseOption();
/**
* @Description 民族
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/nation")
Result<List<OptionResultDTO>> getNationOption();
/**
* @Description 九小场所
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/ninesmallplaces")
Result<List<OptionResultDTO>> getNineSmallPlacesOption();
/**
* @Description 人员关系
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("/sys/dict/data/relationship")
Result<List<OptionResultDTO>> getRelationshipOption();
}

26
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java

@ -1,6 +1,7 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO;
@ -15,4 +16,29 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli
public Result<List<CorsConfigResultDTO>> list() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "list", null);
}
@Override
public Result<List<OptionResultDTO>> getEducationOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getEducationOption", null);
}
@Override
public Result<List<OptionResultDTO>> getHouseOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHouseOption", null);
}
@Override
public Result<List<OptionResultDTO>> getNationOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNationOption", null);
}
@Override
public Result<List<OptionResultDTO>> getNineSmallPlacesOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNineSmallPlacesOption", null);
}
@Override
public Result<List<OptionResultDTO>> getRelationshipOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRelationshipOption", null);
}
}

78
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java

@ -8,18 +8,21 @@
package com.epmet.controller;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.service.SysDictDataService;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
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.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.service.SysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
@ -78,4 +81,73 @@ public class SysDictDataController {
return new Result();
}
/**
* @Description 九小场所
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("ninesmallplaces")
public Result<List<OptionResultDTO>> getNineSmallPlacesOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getNineSmallPlacesOption());
}
/**
* @Description 文化程度
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("education")
public Result<List<OptionResultDTO>> getEducationOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getEducationOption());
}
/**
* @Description 民族
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("nation")
public Result<List<OptionResultDTO>> getNationOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getNationOption());
}
/**
* @Description 人员关系
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("relationship")
public Result<List<OptionResultDTO>> getRelationshipOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getRelationshipOption());
}
/**
* @Description 住房性质
* @Param
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:27
*/
@PostMapping("house")
public Result<List<OptionResultDTO>> getHouseOption() {
return new Result<List<OptionResultDTO>>().ok(sysDictDataService.getHouseOption());
}
/**
* @Description 字典数据查询通用接口
* @Author sun
*/
@PostMapping("dictlist")
public Result<List<DictListResultDTO>> dictList(@RequestBody DictListFormDTO formDTO) {
return new Result<List<DictListResultDTO>>().ok(sysDictDataService.dictList(formDTO.getDictType()));
}
}

3
epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java

@ -9,6 +9,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.entity.DictData;
import com.epmet.entity.SysDictDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -27,4 +28,6 @@ public interface SysDictDataDao extends BaseDao<SysDictDataEntity> {
* 字典数据列表
*/
List<DictData> getDictDataList();
List<DictListResultDTO> selectDictList(String dictType);
}

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java

@ -57,7 +57,7 @@ public class LogOperationHelper implements ResultDataResolver {
form.setUserId(userId);
Result<CustomerStaffDTO> result = userOpenFeignClient.getCustomerStaffInfoByUserId(form);
CustomerStaffDTO staffInfo = getResultDataOrThrowsException(result, ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(),
"调用epmet-user服务获取staff信息发生异常");
"调用epmet-user服务获取staff信息发生异常", null);
return new OperatorInfo(staffInfo.getCustomerId(), staffInfo.getMobile(), staffInfo.getRealName());
}
}

55
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java

@ -8,11 +8,15 @@
package com.epmet.service;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.entity.SysDictDataEntity;
import java.util.List;
import java.util.Map;
/**
@ -31,5 +35,54 @@ public interface SysDictDataService extends BaseService<SysDictDataEntity> {
void update(SysDictDataDTO dto);
void delete(Long[] ids);
/**
* 九小场所
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:11
*/
List<OptionResultDTO> getNineSmallPlacesOption();
/**
* 文化程度
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
List<OptionResultDTO> getEducationOption();
/**
* 民族
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
List<OptionResultDTO> getNationOption();
/**
* 人员关系
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
List<OptionResultDTO> getRelationshipOption();
/**
* 住房性质
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
List<OptionResultDTO> getHouseOption();
/**
* @Description 字典数据查询通用接口
* @Author sun
*/
List<DictListResultDTO> dictList(String dictType);
}

6
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java

@ -82,7 +82,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
CustomerStaffFormDTO form = new CustomerStaffFormDTO();
form.setUserIds(new ArrayList<>(userIds));
Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form);
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常");
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null);
HashMap<String, CustomerStaffDTO> staffMap = new HashMap<>();
staffs.forEach(s -> {
@ -103,7 +103,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
form.setCustomerId(customerId);
form.setMobile(operatorMobile);
Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form);
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常");
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null);
if (staffs.size() == 0) {
return null;
@ -134,7 +134,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
CustomerStaffFormDTO form = new CustomerStaffFormDTO();
form.setRealName(operatorName);
Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form);
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常");
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常", null);
List<String> userIds = new ArrayList<>();
HashMap<String, CustomerStaffDTO> staffMap = new HashMap<String, CustomerStaffDTO>();

127
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java

@ -8,9 +8,13 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.SysDictDataDao;
@ -22,7 +26,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 字典类型
@ -85,4 +91,125 @@ public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysD
deleteBatchIds(Arrays.asList(ids));
}
/**
* 九小场所
*
* @Param
* @Return {@link List < OptionResultDTO >}
* @Author zhaoqifeng
* @Date 2021/10/26 17:11
*/
@Override
public List<OptionResultDTO> getNineSmallPlacesOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000001L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
dto.setSysDictDataId(item.getId().toString());
return dto;
}).collect(Collectors.toList());
}
/**
* 文化程度
*
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
@Override
public List<OptionResultDTO> getEducationOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000002L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
return dto;
}).collect(Collectors.toList());
}
/**
* 民族
*
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
@Override
public List<OptionResultDTO> getNationOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000003L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
return dto;
}).collect(Collectors.toList());
}
/**
* 人员关系
*
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
@Override
public List<OptionResultDTO> getRelationshipOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000004L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
return dto;
}).collect(Collectors.toList());
}
/**
* 住房性质
*
* @Param
* @Return {@link List<OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/26 17:12
*/
@Override
public List<OptionResultDTO> getHouseOption() {
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000005L);
wrapper.orderByAsc(SysDictDataEntity::getSort);
List<SysDictDataEntity> list = baseDao.selectList(wrapper);
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getDictValue());
dto.setLabel(item.getDictLabel());
return dto;
}).collect(Collectors.toList());
}
/**
* @Description 字典数据查询通用接口
* @Author sun
*/
@Override
public List<DictListResultDTO> dictList(String dictType) {
List<DictListResultDTO> resultDTOList = baseDao.selectDictList(dictType);
return resultDTOList;
}
}

13
epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml

@ -7,4 +7,17 @@
select dict_type_id, dict_label, dict_value from sys_dict_data order by dict_type_id, sort
</select>
<select id="selectDictList" resultType="com.epmet.commons.tools.dto.result.DictListResultDTO">
SELECT
a.dict_label label,
a.dict_value `value`
FROM
sys_dict_data a
INNER JOIN sys_dict_type b ON a.dict_type_id = b.id
WHERE
b.dict_type = #{dictType}
ORDER BY
a.sort ASC
</select>
</mapper>

162
epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java

@ -0,0 +1,162 @@
package com.epmet.controller;
import cn.hutool.core.bean.BeanUtil;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.LoginByPassWordFormDTO;
import com.epmet.dto.form.RootOrgListByStaffIdFormDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.redis.CaptchaRedis;
import com.epmet.redis.IcLoginTicketCacheBean;
import com.epmet.service.IcLoginService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
@RestController
@RequestMapping("ic")
public class IcLoinController implements ResultDataResolver {
public static final long IC_LOGIN_TICKET_EXPIRE_SECONDS = 2 * 60l;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private CaptchaRedis captchaRedis;
@Autowired
private IcLoginService icLoginService;
@Autowired
private RedisUtils redisUtils;
/**
* @description 基层治理赋能平台-根据手机号密码获取组织列表
*
* @param input
* @return
* @author wxz
* @date 2021.10.25 09:56:33
*/
@PostMapping("getmyorgsbypassword")
public Result<HashMap<String, Object>> getMyOrgsByPassword(@RequestBody LoginByPassWordFormDTO input) {
ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcGetOrgsByPwdGroup.class);
String captcha = input.getCaptcha();
String mobile = input.getMobile();
String password = input.getPassword();
String uuid = input.getUuid();
// 图片验证码
String captchaInCache = captchaRedis.getIcLoginCaptcha(uuid);
if (StringUtils.isBlank(captchaInCache) || !captcha.equals(captchaInCache)) {
throw new RenException(EpmetErrorCode.ERR10019.getCode());
}
// 获取用户信息
Result<List<CustomerStaffDTO>> staffResult = epmetUserFeignClient.checkCustomerStaff(mobile);
List<CustomerStaffDTO> staffList = getResultDataOrThrowsException(staffResult, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】获取用户信息失败", null);
if (CollectionUtils.isEmpty(staffList)) {
throw new RenException(EpmetErrorCode.ERR10003.getCode());
}
CustomerStaffDTO staffInfo = staffList.get(0);
if (!PasswordUtils.matches(password, staffInfo.getPassword())) {
throw new RenException(EpmetErrorCode.ERR10004.getCode());
}
String staffId = staffInfo.getUserId();
// 查询跟组织列表
RootOrgListByStaffIdFormDTO orgListForm = new RootOrgListByStaffIdFormDTO();
orgListForm.setStaffId(staffId);
Result<List<StaffOrgsResultDTO>> orgListResult = govOrgOpenFeignClient.getStaffOrgListByStaffId(orgListForm);
List<StaffOrgsResultDTO> orgs = getResultDataOrThrowsException(orgListResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】根据staffId查询所属客户跟组织列表失败", null);
// 生成登录票据
String ticket = UUID.randomUUID().toString().replace("-", "");
IcLoginTicketCacheBean ticketCacheBean = new IcLoginTicketCacheBean();
ticketCacheBean.setMobile(mobile);
ticketCacheBean.setStaffId(staffId);
cacheTicket(ticket, ticketCacheBean);
HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("staffId", staffId);
resultMap.put("ticket", ticket);
resultMap.put("orgs", orgs);
return new Result<HashMap<String, Object>>().ok(resultMap);
}
/**
* @description IC登录
*
* @param input
* @return
* @author wxz
* @date 2021.10.25 21:14:22
*/
@PostMapping("login")
public Result<UserTokenResultDTO> login(@RequestBody LoginByPassWordFormDTO input) {
ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcLoginGroup.class);
String ticket = input.getTicket();
String orgId = input.getRootAgencyId();
String staffId = input.getStaffId();
// ticket校验
IcLoginTicketCacheBean ticketCache = getTicketCache(ticket);
if (ticketCache == null || !ticketCache.getStaffId().equals(staffId)) {
// ticket&userId不对应
throw new RenException(EpmetErrorCode.ERR10008.getCode());
}
UserTokenResultDTO tokenInfo = icLoginService.login(staffId, orgId);
return new Result<UserTokenResultDTO>().ok(tokenInfo);
}
private void cacheTicket(String ticket, IcLoginTicketCacheBean cacheBean) {
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(cacheBean, false, true);
redisUtils.hMSet(RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket), stringObjectMap, IC_LOGIN_TICKET_EXPIRE_SECONDS);
}
/**
* @description 从缓存中取出ticket并删除
*
* @param ticket
* @return
* @author wxz
* @date 2021.10.26 08:58:27
*/
private IcLoginTicketCacheBean getTicketCache(String ticket) {
String key = RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket);
Map<String, Object> map = redisUtils.hGetAll(key);
if (CollectionUtils.sizeIsEmpty(map)) {
return null;
}
redisUtils.expire(key, 0);
return BeanUtil.mapToBean(map, IcLoginTicketCacheBean.class, false);
}
}

24
epmet-auth/src/main/java/com/epmet/controller/LoginController.java

@ -65,6 +65,30 @@ public class LoginController {
}
}
/**
* @description 基层治理平台登录验证码
*
* @param response
* @return
* @author wxz
* @date 2021.10.25 14:19:40
*/
@GetMapping("ic-login-captcha")
public void icLoginCaptcha(HttpServletResponse response, String uuid) throws IOException {
try {
//生成图片验证码
BufferedImage image = captchaService.createIcLoginCaptcha(uuid);
response.reset();
response.setHeader("Cache-Control", "no-store, no-cache");
response.setContentType("image/jpeg");
ServletOutputStream out = response.getOutputStream();
ImageIO.write(image, "jpg", out);
out.close();
} catch (IOException e) {
log.error("获取登陆验证码异常", e);
}
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.lang.String>

32
epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java

@ -14,27 +14,53 @@ import java.io.Serializable;
public class LoginByPassWordFormDTO extends LoginCommonFormDTO implements Serializable {
private static final long serialVersionUID = -7507437651048051183L;
// 基层治理平台账号密码获取组织列表分组
public interface IcGetOrgsByPwdGroup {}
// 基层治理平台登录分组
public interface IcLoginGroup {}
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空",groups = {AddUserShowGroup.class})
private String phone;
@NotBlank(message = "手机号不能为空",groups = {IcGetOrgsByPwdGroup.class})
private String mobile;
/**
* 密码
*/
@NotBlank(message = "密码不能为空",groups = {AddUserShowGroup.class})
@NotBlank(message = "密码不能为空",groups = {AddUserShowGroup.class, IcGetOrgsByPwdGroup.class})
private String password;
/**
* 验证码
*/
@NotBlank(message="验证码不能为空",groups = {AddUserShowGroup.class})
@NotBlank(message="验证码不能为空",groups = {AddUserShowGroup.class, IcGetOrgsByPwdGroup.class})
private String captcha;
/**
* 唯一标识
*/
@NotBlank(message="唯一标识不能为空",groups = {AddUserInternalGroup.class})
@NotBlank(message="唯一标识不能为空",groups = {AddUserInternalGroup.class, IcGetOrgsByPwdGroup.class})
private String uuid;
/**
* 登录票据目前ic基层治理平台用到了
*/
@NotBlank(message="登录票据ticket不能为空", groups = {IcLoginGroup.class})
private String ticket;
/**
* 所选的要登录的组织id
*/
@NotBlank(message = "要登录的orgId不能为空", groups = { IcLoginGroup.class })
private String rootAgencyId;
/**
* 工作人员id
*/
@NotBlank(message = "人员Id不能为空", groups = { IcLoginGroup.class })
private String staffId;
}

25
epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java

@ -45,6 +45,12 @@ public class CaptchaRedis {
redisUtils.set(key, captcha, EXPIRE);
}
public void setIcLoginCaptcha(String uuid, String captcha) {
String key = RedisKeys.getIcLoginCaptchaKey(uuid);
logger.info("保存验证码key=["+key+"]");
redisUtils.set(key, captcha, EXPIRE);
}
public String get(String uuid){
String key = RedisKeys.getLoginCaptchaKey(uuid);
String captcha = (String)redisUtils.get(key);
@ -57,6 +63,25 @@ public class CaptchaRedis {
return captcha;
}
/**
* @description 基层治理平台登录验证码查询
*
* @param uuid
* @return
* @author wxz
* @date 2021.10.25 14:28:28
*/
public String getIcLoginCaptcha(String uuid) {
String key = RedisKeys.getIcLoginCaptchaKey(uuid);
String captcha = (String)redisUtils.get(key);
//删除验证码
if(captcha != null){
redisUtils.delete(key);
}
return captcha;
}
/**
* @param sendSmsCodeFormDTO appclientphone
* @param smsCode 验证码

9
epmet-auth/src/main/java/com/epmet/redis/IcLoginTicketCacheBean.java

@ -0,0 +1,9 @@
package com.epmet.redis;
import lombok.Data;
@Data
public class IcLoginTicketCacheBean {
private String staffId;
private String mobile;
}

10
epmet-auth/src/main/java/com/epmet/service/CaptchaService.java

@ -23,6 +23,16 @@ public interface CaptchaService {
*/
BufferedImage create(String uuid);
/**
* @description 基层治理平台登录验证码
*
* @param
* @return
* @author wxz
* @date 2021.10.25 14:15:30
*/
BufferedImage createIcLoginCaptcha(String uuid);
/**
* 验证码效验
* @param uuid uuid

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

@ -0,0 +1,9 @@
package com.epmet.service;
import com.epmet.dto.result.UserTokenResultDTO;
public interface IcLoginService {
UserTokenResultDTO login(String staffId, String orgId);
}

12
epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java

@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.awt.image.BufferedImage;
import java.util.UUID;
/**
* 验证码
@ -43,6 +44,17 @@ public class CaptchaServiceImpl implements CaptchaService {
return producer.createImage(captcha);
}
@Override
public BufferedImage createIcLoginCaptcha(String uuid) {
//生成验证码
String captchaText = producer.createText();
//logger.info("uuid:"+uuid+",生成的验证码:"+captcha);
//保存验证码
captchaRedis.setIcLoginCaptcha(uuid, captchaText);
return producer.createImage(captchaText);
}
@Override
public boolean validate(String uuid, String code) {
String captcha = captchaRedis.get(uuid);

16
epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.service.impl;
import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
@ -45,6 +46,8 @@ public class GovWebServiceImpl implements GovWebService {
private CpUserDetailRedis cpUserDetailRedis;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private ThirdLoginServiceImpl thirdLoginService;
/**
* @param formDTO
@ -105,7 +108,11 @@ public class GovWebServiceImpl implements GovWebService {
String token = jwtTokenUtils.createToken(map);
logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]");
int expire = jwtTokenProperties.getExpire();
TokenDto tokenDto = new TokenDto();
String orgIdPath = thirdLoginService.getOrgIdPath(userId);
String[] orgIdPathParts = orgIdPath.split(":");
GovTokenDto tokenDto = new GovTokenDto();
tokenDto.setCustomerId(formDTO.getCustomerId());
tokenDto.setApp(formDTO.getApp());
tokenDto.setClient(formDTO.getClient());
@ -113,6 +120,13 @@ public class GovWebServiceImpl implements GovWebService {
tokenDto.setToken(token);
tokenDto.setUpdateTime(System.currentTimeMillis());
tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime());
tokenDto.setAgencyId(orgIdPathParts[orgIdPathParts.length - 1]);
tokenDto.setRootAgencyId(orgIdPathParts[0]);
tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId));
tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId));
tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, orgIdPathParts[orgIdPathParts.length - 1]));
tokenDto.setOrgIdPath(orgIdPath);
cpUserDetailRedis.set(tokenDto, expire);
logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss"));
return token;

177
epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java

@ -0,0 +1,177 @@
package com.epmet.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.epmet.auth.constants.AuthOperationConstants;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.security.dto.IcTokenDto;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.IpUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.jwt.JwtTokenProperties;
import com.epmet.jwt.JwtTokenUtils;
import com.epmet.service.IcLoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@Service
@Slf4j
public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver {
@Autowired
private JwtTokenUtils jwtTokenUtils;
@Autowired
private RedisUtils redisUtils;
@Autowired
private CpUserDetailRedis cpUserDetailRedis;
@Autowired
private JwtTokenProperties jwtTokenProperties;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private ThirdLoginServiceImpl thirdLoginService;
@Override
public UserTokenResultDTO login(String staffId, String orgId) {
String app = AppClientConstant.APP_IC;
String client = AppClientConstant.CLIENT_WEB;
// 1.获取用户token
String token = this.generateIcToken(staffId, app, client);
Result<CustomerAgencyDTO> agencyResult = govOrgOpenFeignClient.getAgencyById(orgId);
CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(agencyResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【IC平台登录】获取组织信息失败", null);
// 2.缓存token
cacheToken(app, client, staffId, token, orgId, agencyInfo.getCustomerId());
UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO();
userTokenResultDTO.setToken(token);
userTokenResultDTO.setCustomerId(agencyInfo.getCustomerId());
//7.发送登录事件
try {
sendLoginEvent(staffId, app, client);
} catch (RenException e) {
log.error(e.getInternalMsg());
} catch (Exception e) {
log.error("【工作端workLogin登录】发送登录事件失败,程序继续执行。");
}
return userTokenResultDTO;
}
/**
* @param staffId
* @return
* @description 生成Ic平台的Token
* @author wxz
* @date 2021.10.26 13:42:36
*/
private String generateIcToken(String staffId, String app, String client) {
Map<String, Object> map = new HashMap<>();
map.put("app", app);
map.put("client", client);
map.put("userId", staffId);
String token = jwtTokenUtils.createToken(map);
return token;
}
/**
* @param userId
* @param fromApp
* @param fromClient
* @return
* @description 发布登录时间
* @author wxz
* @date 2021.10.26 13:45:59
*/
private void sendLoginEvent(String userId, String fromApp, String fromClient) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
LoginMQMsg loginMQMsg = new LoginMQMsg();
loginMQMsg.setUserId(userId);
loginMQMsg.setLoginTime(new Date());
loginMQMsg.setIp(IpUtils.getIpAddr(request));
loginMQMsg.setFromApp(fromApp);
loginMQMsg.setFromClient(fromClient);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(AuthOperationConstants.LOGIN);
form.setContent(loginMQMsg);
messageOpenFeignClient.sendSystemMsgByMQ(form);
}
/**
* @description 缓存token到redis
*
* @param app
* @param client
* @param userId
* @param token
* @param rootAgencyId
* @return
* @author wxz
* @date 2021.10.26 14:19:07
*/
private void cacheToken(String app,
String client,
String userId,
String token,
String rootAgencyId,
String customerId) {
IcTokenDto tokenDto = new IcTokenDto();
int expire = jwtTokenProperties.getExpire();
long expireTime = jwtTokenUtils.getExpiration(token).getTime();
tokenDto.setApp(app);
tokenDto.setClient(client);
tokenDto.setUserId(userId);
tokenDto.setToken(token);
tokenDto.setExpireTime(expireTime);
tokenDto.setRootAgencyId(rootAgencyId);
tokenDto.setCustomerId(customerId);
//设置部门,网格,角色列表
tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId));
tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId));
CustomerAgencyDTO agency = thirdLoginService.getAgencyByStaffId(userId);
if (agency != null) {
tokenDto.setAgencyId(agency.getId());
tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, agency.getId()));
}
tokenDto.setOrgIdPath(thirdLoginService.getOrgIdPath(userId));
String key = RedisKeys.getCpUserKey(app, client, userId);
Map<String, Object> map = BeanUtil.beanToMap(tokenDto, false, true);
redisUtils.hMSet(key, map, expire);
}
}

2
epmet-commons/epmet-commons-extapp-auth/pom.xml

@ -18,7 +18,7 @@
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<commons.io.version>2.6</commons.io.version>
<hutool.version>4.6.1</hutool.version>
<easypoi.version>4.1.0</easypoi.version>
<easypoi.version>4.4.0</easypoi.version>
<joda.time.version>2.9.9</joda.time.version>
<fastjson.version>1.2.60</fastjson.version>
<gson.version>2.8.6</gson.version>

5
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java

@ -65,4 +65,9 @@ public interface ConsomerGroupConstants {
*/
String OPEN_DATA_PROJECT_CHANGE_EVENT_LISTENER_GROUP = "open_data_project_change_event_listener_group";
/**
* 开放的人员信息变更预警统计
*/
String IC_WARN_STATS_EVENT_LISTENER_GROUP = "ic_warn_stats_event_listener_group";
}

5
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java

@ -48,4 +48,9 @@ public interface TopicConstants {
* 项目
*/
String PROJECT = "project";
/**
* 项目
*/
String IC_RESI_USER = "ic_resi_user";
}

20
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java

@ -0,0 +1,20 @@
package com.epmet.commons.rocketmq.messages;
import lombok.Data;
import java.io.Serializable;
/**
* 居民信息新增修改推送MQ
* @author sun
*/
@Data
public class IcResiUserAddMQMsg implements Serializable {
//客户Id
private String customerId;
//居民ID
private String icResiUser;
}

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

@ -18,7 +18,7 @@
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<commons.io.version>2.6</commons.io.version>
<hutool.version>4.6.1</hutool.version>
<easypoi.version>4.1.3</easypoi.version>
<easypoi.version>4.4.0</easypoi.version>
<joda.time.version>2.9.9</joda.time.version>
<fastjson.version>1.2.60</fastjson.version>
<gson.version>2.8.6</gson.version>
@ -89,6 +89,8 @@
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>${easypoi.version}</version>
<!--<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/jar/easypoi-base-4.4.0.jar</systemPath>-->
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java

@ -17,6 +17,12 @@ public interface AppClientConstant {
* app类型-运营端
*/
String APP_OPER = "oper";
/**
* 基层治理平台端
*/
String APP_IC = "ic";
/**
* PC端:web
*/

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java

@ -74,6 +74,10 @@ public interface StrConstant {
*/
String STAR="*";
String QUESTION_MARK="?";
String QUESTION_MARK_TRANSFER="\\?";
String AND_MARK="&";
/**
* 空字符串
*/

20
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.commons.tools.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description 字典数据查询-接口入参
* @Author sun
*/
@Data
public class DictListFormDTO {
/**
* 字典类型
*/
@NotBlank(message = "字典类型不能为空")
private String dictType;
}

17
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.commons.tools.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 字典数据查询-接口返参
* @Author sun
*/
@Data
public class DictListResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L;
private String label;
private String value;
}

20
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.commons.tools.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/10/26 13:53
*/
@Data
public class OptionResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L;
private String label;
private String value;
private String sysDictDataId;
private List<OptionResultDTO> children;
}

53
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java

@ -0,0 +1,53 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.tools.enums;
/**
* form表单 配置item类型 枚举
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
public enum FormItemTypeEnum {
//枚举类型
INPUT("input", "输入框"),
RADIO("radio", "单选框"),
CHECKBOX("checkbox", "复选框"),
SELECT("select", "下拉框"),
TEXTAREA("textarea", "文本域"),
CASCADER("cascader", "及联"),
DATE_PICKER("datepicker", "组织"),
UN_KNOWN("un_known", "不支持的类型");
private String code;
private String desc;
FormItemTypeEnum(String value,String name) {
this.code = value;
this.desc = name;
}
public static FormItemTypeEnum getEnum(String code) {
FormItemTypeEnum[] values = FormItemTypeEnum.values();
for (FormItemTypeEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return UN_KNOWN;
}
public String getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

44
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java

@ -0,0 +1,44 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.exception.EpmetErrorCode;
public enum GenderEnum {
MAN("1", "男"),
WOMAN("2", "女"),
UN_KNOWN("0", "未知");
private String code;
private String name;
GenderEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getName(String code) {
GenderEnum[] genderEnums = values();
for (GenderEnum genderEnum : genderEnums) {
if (genderEnum.getCode() == code) {
return genderEnum.getName();
}
}
return EpmetErrorCode.SERVER_ERROR.getMsg();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

45
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java

@ -0,0 +1,45 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.exception.EpmetErrorCode;
public enum HouseTypeEnum {
//房屋类型,1楼房,2平房,3别墅
LOUFANG("1", "楼房"),
PINGFANG("2", "平房"),
BIESHU("3", "别墅");
private String code;
private String name;
HouseTypeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getName(String code) {
HouseTypeEnum[] houseTypeEnums = values();
for (HouseTypeEnum houseTypeEnum : houseTypeEnums) {
if (houseTypeEnum.getCode() == code) {
return houseTypeEnum.getName();
}
}
return EpmetErrorCode.SERVER_ERROR.getMsg();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

58
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java

@ -0,0 +1,58 @@
package com.epmet.commons.tools.enums;
/**
* @author Administrator
*/
public enum RelationshipEnum {
/**
* 环境变量枚举
*/
UN_KNOWN("0", "暂不清楚", 0),
SELF("1", "本人", 1),
spouse("2", "配偶", 2),
CHILD("3", "子女", 3),
PARENT("4", "父母", 4),
PARENT_IN_LAW("5", "岳父母或公婆", 5),
GRANDPARENT_IN_LAW("6", "祖父母", 6),
CHILD_IN_LAW("7", "媳婿", 7),
GRANDCHILD("8", "孙子女", 8),
BROTHER_AND_SISTER("9", "兄弟姐妹", 9),
OTHER("10", "其他", 10),
;
private final String code;
private final String name;
private final Integer sort;
RelationshipEnum(String code, String name, Integer sort) {
this.code = code;
this.name = name;
this.sort = sort;
}
public static RelationshipEnum getEnum(String code) {
RelationshipEnum[] values = RelationshipEnum.values();
for (RelationshipEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return RelationshipEnum.UN_KNOWN;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public Integer getSort(){
return sort;
}
}

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

@ -22,6 +22,7 @@ public enum EpmetErrorCode {
ERR10005(10005, "token不能为空"),
ERR10006(10006, "登录超时,请重新登录"),
ERR10007(10007, "当前帐号已在别处登录"),
ERR10008(10008, "Ticket错误"),
ERR10019(10019, "验证码不正确"),
SYSTEM_MQ_MSG_SEND_FAIL(10020, "MQ消息发送失败"),
ERR401(401, "未授权"),
@ -79,6 +80,11 @@ public enum EpmetErrorCode {
SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"),
HAVE_GUIDE_CANNOT_DEL(8211,"当前分类已经存在办事指南,不允许删除"),
GUIDE_CATEGORY_NAME_EXITS(8212,"分类已存在"),
CUSTOMER_FORM_NOT_EXITS(8213,"客户未配置表单"),
RESI_NOT_FOUND(8214,"居民信息找不到"),
BUILDING_NAME_EXITED(8215,"楼栋名称已存在"),
DOOR_NAME_EXITED(8216,"门牌号已存在"),
NEIGHBOOR_NAME_EXITED(8217,"小区名称已存在"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),
@ -217,6 +223,10 @@ public enum EpmetErrorCode {
UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存"),
BADGE_CHECK(8918,""),
ORG_ADD_FAILED(8919,"添加失败"),
ORG_EDIT_FAILED(8920,"编辑失败"),
ORG_DEL_FAILED(8921,"删除失败"),
//通用错误码 start
//通用的 错误消息自己定义返回

7
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java

@ -34,18 +34,19 @@ public interface ResultDataResolver {
* @return
* @param targetServiceName 目标service名称
* @param errorCode 错误码可以为空为空则使用上游服务抛出的错误码
* @param errorInternalMsg 错误信息可以为空为空则使用上游服务抛出的异常信息
* @param errorInternalMsg 内部错误信息可以为空为空则使用上游服务抛出的异常信息
* @param showMsg 展示给前端程序的错误信息可以为空为空则根据errorCode给定错误msg信息
* @author wxz
* @date 2021.06.07 22:45
*/
default <R> R getResultDataOrThrowsException(Result<R> result, String targetServiceName, Integer errorCode, String errorInternalMsg) {
default <R> R getResultDataOrThrowsException(Result<R> result, String targetServiceName, Integer errorCode, String errorInternalMsg, String showMsg) {
if (result == null) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "调用{}服务发生错误,返回Result为null", targetServiceName);
}
if (!result.success()) {
Integer finalErrorCode = errorCode == null ? result.getCode() : errorCode;
String finalErrorInternalMsg = StringUtils.isBlank(errorInternalMsg) ? result.getInternalMsg() : errorInternalMsg;
throw new RenException(finalErrorCode, finalErrorInternalMsg);
throw new RenException(finalErrorCode, finalErrorInternalMsg, showMsg, RenException.MessageMode.CODE_INTERNAL_EXTERNAL);
}
return result.getData();
}

62
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -39,6 +39,13 @@ public class RedisKeys {
return rootPrefix.concat("sys:captcha:").concat(uuid);
}
/**
* 登录验证码Key
*/
public static String getIcLoginCaptchaKey(String uuid) {
return rootPrefix.concat("sys:captcha:iclogin:").concat(uuid);
}
/**
* 登录用户Key
*/
@ -561,6 +568,61 @@ public class RedisKeys {
return rootPrefix.concat("message:mq:blocked:").concat(blockedMsgLabel);
}
/**
* @description 登录票据目前只有IC基层治理平台用到
*
* @param app
* @param ticket
* @return
* @author wxz
* @date 2021.10.25 17:49:43
*/
public static String loginTicket(String app, String ticket) {
return rootPrefix.concat("sys:security:ticket:").concat(app).concat(":").concat(ticket);
}
/**
* 政府端机关单位缓存Key
* @param formCode
* @param customerId
* @return
*/
public static String getIcFormKeyForAdd(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":add:").concat(customerId);
}
public static String getIcFormKeyForExport(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":export:").concat(customerId);
}
/**
* icd form items key
* @param customerId
* @param formCode
* @return
*/
public static String getIcFormItemsKey(String customerId, String formCode) {
return rootPrefix.concat("icform:").concat(formCode).concat(":items:").concat(customerId);
}
/**
* desc导出居民信息时 临时存储居民信息 便于其他sheet复用信息
* @param resiId
* @return
*/
public static String getExportResiBaseInfoKey(String resiId) {
return rootPrefix.concat("resi:").concat("export").concat(":temp:").concat(resiId);
}
/**
* desc:获取客户的居民下载模版是否变更的key 1表示变更 0没有变更
* @param customerId
* @return
*/
public static String getResiTempChangedKey(String customerId) {
return rootPrefix.concat("resi:").concat("export").concat(":template:changed").concat(customerId);
}
/**
* desc:获取执行完毕的 业务 参数结果key
* @param bizMethod

81
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java

@ -0,0 +1,81 @@
package com.epmet.commons.tools.security.dto;
import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Set;
/**
* @Description ic平台token
* @author wxz
* @date 2021.10.26 13:58:03
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class IcTokenDto extends BaseTokenDto {
/**
* 当前登录的组织id(顶级)
*/
private String rootAgencyId;
/**
* 当前用户所属的机关单位id
*/
private String agencyId;
/**
* 当前网格对应的组织结构id的全路径用:隔开
*/
private String orgIdPath;
/**
* 当前所在网格id
*/
private String gridId;
/***
* 所在网格列表
*/
private Set<String> gridIdList;
/**
* 部门id列表
*/
private Set<String> deptIdList;
/**
* 功能权限列表实际上是gov_staff => staff_role => role_operation查询到的operationKey
*/
private Set<String> permissions;
/**
* 角色ID列表
*/
private List<GovTokenDto.Role> roleList;
/**
* 过期时间戳
*/
private Long expireTime;
@Data
public static class Role {
private String id;
private String roleKey;
private String roleName;
public Role() {
}
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}

13
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java

@ -6,7 +6,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.List;
/**
@ -35,18 +34,6 @@ public class LoginUserUtil {
return userId;
}
/**
* 查询登录用户的客户Id
* @return
*/
public String getCurrentCustomerId() {
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
if (request == null) {
return null;
}
return request.getHeader(AppClientConstant.CUSTOMER_ID);
}
/**
* 登录用户的App头信息
* @return

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java

@ -12,6 +12,7 @@ import com.epmet.commons.tools.constant.StrConstant;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.commons.util.InetUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.http.server.reactive.ServerHttpRequest;
@ -127,12 +128,12 @@ public class IpUtils {
* 遍历本地网卡的方式在云平台虚拟机取不到真正的ip
* @return
*/
InetAddress localAddress = InetAddress.getLocalHost();
if (isValidAddress(localAddress)) {
return localAddress.getHostAddress();
InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class);
if (inetUtils == null || inetUtils.findFirstNonLoopbackHostInfo() == null) {
logger.warn("Could not get local host ip address");
} else {
SERVER_IP = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
}
logger.warn("Could not get local host ip address");
return null;
} catch (Exception e) {
logger.error("IpUtils getServerIp exception ", e);
}

2
epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java

@ -117,7 +117,7 @@ class EpmetWebFilter implements WebFilter, ResultDataResolver {
adminOpenFeignClient.list(),
ServiceConstant.EPMET_ADMIN_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(),
"调用Admin服务查询Cors配置失败");
"调用Admin服务查询Cors配置失败", null);
} catch (Exception e) {
logger.error("调用Admin服务查询Cors配置失败");
}

3
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java

@ -11,4 +11,7 @@ public interface OrgConstant {
String CITY = "city";
String DISTRICT = "district";
String GRID_ID="GRID_ID";
String GENDER="GENDER";
String HOUSE_TYPE_KEY="HOUSE_TYPE";
}

16
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java

@ -0,0 +1,16 @@
package com.epmet.dataaggre.dto.epmetuser;
import lombok.Data;
/**
* @Description TODO
* @Author yinzuomei
* @Date 2021/10/27 4:26 下午
*/
@Data
public class IcFormResColumnDTO {
private String tableName;
private String columnName;
private String label;
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java

@ -24,6 +24,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* 机关单位信息表
@ -98,4 +99,5 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @Date 2021/9/23 10:16
*/
List<String> getOrgList(@Param("staffId") String staffId);
}

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java

@ -19,11 +19,13 @@ package com.epmet.dataaggre.dao.opercustomize;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO;
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO;
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* APP底部菜单栏信息
@ -56,4 +58,5 @@ public interface CustomerFootBarDao extends BaseDao<CustomerFootBarEntity> {
* @date 2021/7/28 10:56
*/
CustomerFootBarEntity selectDefaultIcon(@Param("customerId") String customerId, @Param("appType")String appType, @Param("barKey")String barKey);
}

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -172,4 +172,5 @@ public interface GovOrgService {
* @date 2021/11/5 2:57 下午
*/
CustomerGridDTO getGridInfo(String gridId);
}

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -555,4 +555,5 @@ public class GovOrgServiceImpl implements GovOrgService {
return customerGridDao.getGridInfo(gridId);
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java

@ -73,7 +73,7 @@ public class QuestionnaireServiceImpl implements QuestionnaireService, ResultDat
CustomerGridFormDTO form = new CustomerGridFormDTO();
form.setGridId(gridId);
Result<CustomerGridDTO> gridInfoResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(form);
CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败");
CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败", null);
// 网格父级ID列表:网格ID(拼接起来,冒号分割)
String gridIdPath = gridInfo.getPids().concat(":").concat(gridInfo.getId());
List<PrPublishRangeEntity> publishRangeEntity = prPublishRangeService.getPublishRangeEntity(projectKey);

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java

@ -39,4 +39,5 @@ public interface CustomerFootBarService extends BaseService<CustomerFootBarEntit
* @date 2021/7/27 18:59
*/
AppFootBarResultDTO queryAppFootBars(AppFootBarFormDTO footBarFormDTO);
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao;
import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO;
import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO;
import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO;
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO;
import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity;
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity;
import com.epmet.dataaggre.service.opercrm.CustomerParameterService;
@ -38,6 +39,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Set;
/**

1
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml

@ -38,4 +38,5 @@
and c.BAR_KEY=#{barKey}
AND C.DISPLAY='1'
</select>
</mapper>

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java

@ -335,7 +335,7 @@ public interface DataStatisticalOpenFeignClient {
/**
* 事件上报
* @Param formDTO
* @Return {@link Result<List<BaseDisputeProcessDTO>>}
* @Return {@link Result<List<EventInfoResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/15 16:50
*/

16
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -97,7 +97,21 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>2.2.6</version>
<version>3.0.3</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.wnjustdoit</groupId>

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java

@ -95,8 +95,18 @@ public class FactOriginExtractController {
@PostMapping("project")
public Result projectData(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
if (null != extractOriginFormDTO) {
projectExtractService.saveOriginProjectDaily(extractOriginFormDTO);
if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId())) {
List<String> daysBetween;
if (StringUtils.isBlank(extractOriginFormDTO.getDateId())) {
daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate());
daysBetween.forEach(dateId -> {
extractOriginFormDTO.setDateId(dateId);
projectExtractService.saveOriginProjectDaily(extractOriginFormDTO);
});
} else{
projectExtractService.saveOriginProjectDaily(extractOriginFormDTO);
}
} else {
List<String> customerIds = dimCustomerService.selectCustomerIdPage(1, 100);
customerIds.forEach(customerId -> {

238
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java

@ -5,9 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.group.form.GroupTotalFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.dto.stats.topic.form.TopicStatusFormDTO;
import com.epmet.service.StatsGroupService;
import com.epmet.service.StatsTopicService;
import com.epmet.service.evaluationindex.extract.todata.*;
@ -94,6 +92,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
}
private void submitJob(ExtractOriginFormDTO param) {
CountDownLatch countDownLatch = new CountDownLatch(NumConstant.FIVE);
boolean isRange = StringUtils.isBlank(param.getDateId());
List<String> daysBetween = null;
if (isRange) {
@ -101,139 +100,159 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
}
List<String> finalDaysBetween = daysBetween;
threadPool.submit(() -> {
CustomerIdAndDateIdFormDTO formDTO = new CustomerIdAndDateIdFormDTO();
formDTO.setCustomerId(param.getCustomerId());
if (!isRange) {
try {
formDTO.setDateId(param.getDateId());
dimCustomerPartymemberService.statsPartyMember(formDTO);
} catch (Exception e) {
log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(formDTO), e);
}
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
formDTO.setDateId(dateDimId);
try {
CustomerIdAndDateIdFormDTO formDTO = new CustomerIdAndDateIdFormDTO();
formDTO.setCustomerId(param.getCustomerId());
if (!isRange) {
try {
formDTO.setDateId(param.getDateId());
dimCustomerPartymemberService.statsPartyMember(formDTO);
} catch (Exception e) {
log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(formDTO), e);
}
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
formDTO.setDateId(dateDimId);
dimCustomerPartymemberService.statsPartyMember(formDTO);
}
} catch (Exception e) {
log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
} catch (Exception e) {
log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
} finally {
countDownLatch.countDown();
}
});
threadPool.submit(() -> {
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
try {
groupExtractService.extractGroupData(paramNew);
} catch (Exception e) {
log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
try {
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
try {
groupExtractService.extractGroupData(paramNew);
} catch (Exception e) {
log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
groupExtractService.extractGroupData(paramNew);
}
} catch (Exception e) {
log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} catch (Exception e) {
log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} finally {
countDownLatch.countDown();
}
});
threadPool.submit(() -> {
log.debug("extractAll start param:{}", JSON.toJSONString(param));
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
try {
factOriginTopicMainDailyService.topicCleaning(paramNew);
} catch (Exception e) {
log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
log.info("extractAll cal param:{}", JSON.toJSONString(paramNew));
try {
log.debug("extractAll start param:{}", JSON.toJSONString(param));
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
try {
factOriginTopicMainDailyService.topicCleaning(paramNew);
} catch (Exception e) {
log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
log.info("extractAll cal param:{}", JSON.toJSONString(paramNew));
factOriginTopicMainDailyService.topicCleaning(paramNew);
}
} catch (Exception e) {
log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} catch (Exception e) {
log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
log.debug("extractAll end param:{}", JSON.toJSONString(paramNew));
} finally {
countDownLatch.countDown();
}
log.debug("extractAll end param:{}", JSON.toJSONString(paramNew));
});
threadPool.submit(() -> {
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
try {
issueExtractService.issueExtractMain(paramNew);
} catch (Exception e) {
log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
try {
issueExtractService.issueExtractLog(paramNew);
} catch (Exception e) {
log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
try {
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
try {
issueExtractService.issueExtractMain(paramNew);
} catch (Exception e) {
log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} catch (Exception e) {
log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
try {
issueExtractService.issueExtractLog(paramNew);
} catch (Exception e) {
log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
issueExtractService.issueExtractMain(paramNew);
}
} catch (Exception e) {
log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
issueExtractService.issueExtractLog(paramNew);
}
} catch (Exception e) {
log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} catch (Exception e) {
log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} finally {
countDownLatch.countDown();
}
});
//小组活动
threadPool.submit(() -> {
ExtractOriginFormDTO extractOriginFormDTO = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
//截止到当前dateId
try {
factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId());
} catch (Exception e) {
log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e);
}
try {
factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId());
} catch (Exception e) {
log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e);
}
} else {
//参数指定日期内,比如startDate=20210501,endDate=20210513;依次计算截止到20210501的数据.....截止到20210513的数据
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
extractOriginFormDTO.setDateId(dateDimId);
try {
ExtractOriginFormDTO extractOriginFormDTO = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
//截止到当前dateId
try {
factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId());
} catch (Exception e) {
log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e);
}
} catch (Exception e) {
log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e);
}
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
extractOriginFormDTO.setDateId(dateDimId);
try {
factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId());
} catch (Exception e) {
log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e);
}
} else {
//参数指定日期内,比如startDate=20210501,endDate=20210513;依次计算截止到20210501的数据.....截止到20210513的数据
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
extractOriginFormDTO.setDateId(dateDimId);
factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId());
}
} catch (Exception e) {
log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e);
}
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
extractOriginFormDTO.setDateId(dateDimId);
factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId());
}
} catch (Exception e) {
log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e);
}
} catch (Exception e) {
log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e);
}
} finally {
countDownLatch.countDown();
}
});
@ -297,7 +316,18 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
}
});*/
submitProjectRelationData(param, finalDaysBetween);
Future<?> future = submitProjectRelationData(param, finalDaysBetween);
try {
future.get();
} catch (Exception e) {
log.error("submitProjectRelationData exception:{}",e);
}
try {
countDownLatch.await();
log.info("extractAll submitJob execute end,param:{}",JSON.toJSONString(param));
} catch (InterruptedException e) {
log.error("extractAll daily InterruptedException:{}", e);
}
}
@Override

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java

@ -20,7 +20,6 @@ package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
@ -166,7 +165,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
* @param logDailyEntityList
* @author yinzuomei
* @description 批量插入fact_origin_topic_log_daily
* @Date 2020/9/16 12:53
* @Date 2020/9/16 12:53
**/
private void saveFactOriginTopicLogDailyEntity(List<FactOriginTopicLogDailyEntity> logDailyEntityList) {
//批量插入
@ -175,7 +174,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
factOriginTopicLogDailyDao.insertBatchEntity(list);
});
}
/**
* @return java.util.Map<java.lang.String,java.lang.Object>
* @param topicOriginInfoList
@ -195,8 +194,8 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
GridInfoDTO gridInfoDTO=gridMap.get(topicOriginInfoDTO.getGridId());
if(null==gridInfoDTO){
log.warn("没有找到 gridId="+topicOriginInfoDTO.getGridId()+" 的基本信息");
// continue;
throw new RenException("gridInfoDTO is null gridId="+topicOriginInfoDTO.getGridId());
continue;
//throw new RenException("gridInfoDTO is null gridId="+topicOriginInfoDTO.getGridId());
}
// 一年的第几周
String weekId = DateUtils.format(topicOriginInfoDTO.getOriginalBusinessTime(), DateUtils.DATE_PATTERN_YYYY).concat("W").concat(String.valueOf(DateUtils.getWeekOfYear(topicOriginInfoDTO.getOriginalBusinessTime())));
@ -419,4 +418,4 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
}
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java

@ -121,7 +121,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
});
});
// 5. 查询pid
List<String> agencyIds = result.stream().map(r -> r.getAgencyId()).distinct().collect(Collectors.toList());
List<String> agencyIds = result.stream().map(IssueMainDailyFormDTO::getAgencyId).distinct().collect(Collectors.toList());
List<AgencyInfoResultDTO> agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds);
if (CollectionUtils.isEmpty(agencyInfoList)){
throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST);
@ -138,7 +138,9 @@ public class IssueExtractServiceImpl implements IssueExtractService {
}
});
});
delAndInsertMain(customerId,dateId,result);
//过滤掉pids为空的数据
List<IssueMainDailyFormDTO> collect = result.stream().filter(o -> StringUtils.isNotBlank(o.getPids())).collect(Collectors.toList());
delAndInsertMain(customerId,dateId,collect);
return true;
}
@ -244,7 +246,9 @@ public class IssueExtractServiceImpl implements IssueExtractService {
}
});
});
delAndInsertLog(customerId,dateId,result);
//去除pids 为空的数据
List<IssueLogDailyFormDTO> collect = result.stream().filter(o -> StringUtils.isNotBlank(o.getPids())).collect(Collectors.toList());
delAndInsertLog(customerId,dateId,collect);
return true;
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

@ -224,7 +224,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}));
//插入数据
if (!list.isEmpty()) {
factOriginProjectMainDailyService.saveOrUpdateBatch(list);
factOriginProjectMainDailyService.insertBatch(list);
}
}

189
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankStatisticsService.java

@ -0,0 +1,189 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import java.util.Map;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/12/7 10:43
*/
public interface OrgRankStatisticsService {
/**
* 网格被吹哨项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getGridProjectCount(String customerId, String monthId, String dateId);
/**
* 部门被吹哨项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getDeptProjectCount(String customerId, String monthId, String dateId);
/**
* 组织被吹哨项目数含下级组织网格部门
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getAgencyProjectCount(String customerId, String monthId, String dateId);
/**
* 网格被吹哨项目中已结案项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getGridProjectClosedCount(String customerId, String monthId, String dateId);
/**
* 部门被吹哨项目中已结案项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getDeptProjectClosedCount(String customerId, String monthId, String dateId);
/**
* 组织被吹哨项目中已结案项目数含下级组织网格部门
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getAgencyProjectClosedCount(String customerId, String monthId, String dateId);
/**
* 网格被吹哨项目中自己办结项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getGridProjectResolvedCount(String customerId, String monthId, String dateId);
/**
* 部门被吹哨项目中自己办结项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getDeptProjectResolvedCount(String customerId, String monthId, String dateId);
/**
* 组织被吹哨项目中自己办结项目数含下级组织网格部门
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getAgencyProjectResolvedCount(String customerId, String monthId, String dateId);
/**
* 网格自治项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getGridProjectSelfCount(String customerId, String monthId, String dateId);
/**
* 部门自治项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getDeptProjectSelfCount(String customerId, String monthId, String dateId);
/**
* 组织自治项目数含下级组织网格部门
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getAgencyProjectSelfCount(String customerId, String monthId, String dateId);
/**
* 网格产生的项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getGridProjectTotal(String customerId, String monthId, String dateId);
/**
* 组织产生的项目数含下级组织网格部门
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getAgencyProjectTotal(String customerId, String monthId, String dateId);
/**
* 网格产生的项目数中结案的项目数
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getGridProjectClosedTotal(String customerId, String monthId, String dateId);
/**
* 组织产生的项目数中结案的项目数含下级组织网格部门
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
Map<String, OrgStatisticsResultDTO> getAgencyProjectClosedTotal(String customerId, String monthId, String dateId);
}

306
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankStatisticsServiceImpl.java

@ -0,0 +1,306 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.service.evaluationindex.extract.toscreen.OrgRankStatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/12/7 10:43
*/
@Service
@Slf4j
public class OrgRankStatisticsServiceImpl implements OrgRankStatisticsService {
/**
* 网格被吹哨项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map < String, OrgStatisticsResultDTO >}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getGridProjectCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 部门被吹哨项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getDeptProjectCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 组织被吹哨项目数含下级组织网格部门
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getAgencyProjectCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 网格被吹哨项目中已结案项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getGridProjectClosedCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 部门被吹哨项目中已结案项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getDeptProjectClosedCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 组织被吹哨项目中已结案项目数含下级组织网格部门
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getAgencyProjectClosedCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 网格被吹哨项目中自己办结项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getGridProjectResolvedCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 部门被吹哨项目中自己办结项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getDeptProjectResolvedCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 组织被吹哨项目中自己办结项目数含下级组织网格部门
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getAgencyProjectResolvedCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 网格自治项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getGridProjectSelfCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 部门自治项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getDeptProjectSelfCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 组织自治项目数含下级组织网格部门
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getAgencyProjectSelfCount(String customerId, String monthId, String dateId) {
return null;
}
/**
* 网格产生的项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getGridProjectTotal(String customerId, String monthId, String dateId) {
return null;
}
/**
* 组织产生的项目数含下级组织网格部门
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getAgencyProjectTotal(String customerId, String monthId, String dateId) {
return null;
}
/**
* 网格产生的项目数中结案的项目数
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getGridProjectClosedTotal(String customerId, String monthId, String dateId) {
return null;
}
/**
* 组织产生的项目数中结案的项目数含下级组织网格部门
*
* @param customerId
* @param monthId
* @param dateId
* @Param customerId
* @Param monthId
* @Param dateId
* @Return {@link Map< String, OrgStatisticsResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/7 10:52
*/
@Override
public Map<String, OrgStatisticsResultDTO> getAgencyProjectClosedTotal(String customerId, String monthId, String dateId) {
return null;
}
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java

@ -173,6 +173,7 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
}
});
});
partyMemberList = partyMemberList.stream().filter(item -> StringUtils.isNotBlank(item.getAgencyId())).collect(Collectors.toList());
delAndInsertParty(partyMemberList,customerId,dateId);
});
});

15
epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java

@ -2,8 +2,9 @@ package com.epmet.stats.test.read;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
/**
@ -13,7 +14,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty;
*/
public class CustomStringStringConverter implements Converter<String> {
@Override
public Class supportJavaTypeKey() {
public Class<?> supportJavaTypeKey() {
return String.class;
}
@ -34,8 +35,8 @@ public class CustomStringStringConverter implements Converter<String> {
* @return
*/
@Override
public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return "自定义:" + cellData.getStringValue();
}
@ -51,9 +52,9 @@ public class CustomStringStringConverter implements Converter<String> {
* @return
*/
@Override
public CellData convertToExcelData(String value, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return new CellData(value);
public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return new WriteCellData<>(value);
}
}

3
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java

@ -1,5 +1,6 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -44,6 +45,7 @@ public class ExternalCustomerController {
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("add")
public Result<ExternalCustomerResultDTO> add(@RequestBody ExternalCustomerFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ExternalCustomerFormDTO.AddExternalCustomerGroup.class);
@ -57,6 +59,7 @@ public class ExternalCustomerController {
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("update")
public Result<ExternalCustomerResultDTO> update(@RequestBody ExternalCustomerFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ExternalCustomerFormDTO.UpdateExternalCustomerGroup.class);

19
epmet-module/epmet-demo/epmet-demo-server/pom.xml

@ -13,6 +13,25 @@
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.3</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>

58
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java

@ -0,0 +1,58 @@
package com.epmet.utils;
import com.alibaba.excel.EasyExcelFactory;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @description excel解析
*
* @return
* @author wxz
* @date 2021.10.28 13:36:26
*/
public class ExcelPaseTest {
public static void main(String[] args) {
new ExcelPaseTest().sqlizeGridNameAndCodeFromExcel();
}
/**
* @description 读取excel生成根据网格name更新网格code的sql
*
* @param
* @return
* @author wxz
* @date 2021.10.28 13:34:31
*/
public void sqlizeGridNameAndCodeFromExcel() {
TempDynamicEasyExcelListener readListener = new TempDynamicEasyExcelListener();
EasyExcelFactory.read(new File("/Users/wangxianzhang/Documents/1027平阴县网格编码及人员统计表.xls"), IndexOrNameData.class, readListener).headRowNumber(4).sheet(0).doRead();
List<Map<Integer, String>> headList = readListener.getHeadList();
List<IndexOrNameData> dataList = readListener.getDataList();
List<String> exceptList = new ArrayList<>();
for (IndexOrNameData data : dataList) {
String content = data.getColumn();
int startIndex = content.indexOf("370");
if (startIndex == -1) {
exceptList.add(content);
} else {
String gridName = content.substring(0, startIndex).trim();
String gridCode = content.substring(startIndex);
String sqlPattern = String.format("update customer_grid set CODE='%s' where GRID_NAME='%s';", gridCode, gridName);
System.out.println(sqlPattern);
}
}
System.err.println("========异常行=======");
for (String s : exceptList) {
System.err.println(s);
}
}
}

20
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java

@ -0,0 +1,20 @@
package com.epmet.utils;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class IndexOrNameData {
/**
* 强制读取第三个 这里不建议 index name 同时用要么一个对象只用index要么一个对象只用name去匹配
*/
@ExcelProperty(index = 3)
private String column;
///**
// * 用名字去匹配,这里需要注意,如果名字重复,会导致只有一个字段读取到数据
// */
//@ExcelProperty("字符串标题")
//private String string;
//@ExcelProperty("日期标题")
//private Date date;
}

82
epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java

@ -0,0 +1,82 @@
package com.epmet.utils;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 创建一个监听器
*/
@Slf4j
public class TempDynamicEasyExcelListener extends AnalysisEventListener<IndexOrNameData> {
/**
* 表头数据存储所有的表头数据
*/
private List<Map<Integer, String>> headList = new ArrayList<>();
/**
* 数据体
*/
private List<IndexOrNameData> dataList = new ArrayList<>();
/**
* 这里会一行行的返回头
*
* @param headMap
* @param context
*/
//@Override
//public void invokeHeadMap(IcResiUserController.IndexOrNameData headMap, AnalysisContext context) {
// log.info("解析到一条头数据:{}", JSON.toJSONString(headMap));
// //存储全部表头数据
// headList.add(headMap);
//}
@Override
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
log.info("解析到一条头数据:{}", JSON.toJSONString(headMap));
//存储全部表头数据
headList.add(headMap);
}
/**
* 这个每一条数据解析都会来调用
*
* @param data
* one row value. Is is same as {@link AnalysisContext#readRowHolder()}
* @param context
*/
@Override
public void invoke(IndexOrNameData data, AnalysisContext context) {
//log.info("解析到一条数据:{}", JSON.toJSONString(data));
if (data.getColumn() != null) {
dataList.add(data);
}
}
/**
* 所有数据解析完成了 都会来调用
*
* @param context
*/
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
// 这里也要保存数据,确保最后遗留的数据也存储到数据库
log.info("所有数据解析完成!");
}
public List<Map<Integer, String>> getHeadList() {
return headList;
}
public List<IndexOrNameData> getDataList() {
return dataList;
}
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form.demand;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Set;
@Data
public class UserDemandNameQueryFormDTO implements Serializable {
private static final long serialVersionUID = 1562457999313501989L;
public interface AddUserInternalGroup {}
@NotBlank(message = "客户idbu不能为空",groups =AddUserInternalGroup.class)
private String customerId;
@NotEmpty(message = "分类编码不能为空",groups =AddUserInternalGroup.class)
private Set<String> codeSet;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -5,7 +5,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
@ -53,4 +53,7 @@ public interface EpmetHeartOpenFeignClient {
**/
@PostMapping("/heart/resi/volunteer/queryuservolunteerinfo/{userId}")
Result<VolunteerInfoDTO> queryUserVolunteerInfo(@PathVariable("userId") String userId);
@PostMapping("/heart/icresidemanddict/demangnames")
Result<String> queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO);
}

7
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -6,8 +6,8 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
@ -48,4 +48,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<VolunteerInfoDTO> queryUserVolunteerInfo(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryUserVolunteerInfo", userId);
}
@Override
public Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryDemandNames", formDTO);
}
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java

@ -18,6 +18,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -42,7 +43,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("actcustomized")
public class ActCustomizedController {
@Autowired
private ActCustomizedService actCustomizedService;
@ -68,6 +69,7 @@ public class ActCustomizedController {
* @description 保存自定义配置
* @Date 2020/7/20 17:25
**/
@NoRepeatSubmit
@RequirePermission(requirePermission = RequirePermissionEnum.MORE_HEART_CUSTOMIZED_SAVE)
@PostMapping("save")
public Result saveConfigs(@RequestBody SaveActCustomizedFormDTO formDTO){
@ -89,4 +91,4 @@ public class ActCustomizedController {
CustomerHeartConfigsResultDTO resultDTO = actCustomizedService.getCustomerHeartConfigs(formDTO);
return new Result<CustomerHeartConfigsResultDTO>().ok(resultDTO);
}
}
}

105
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java

@ -0,0 +1,105 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
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.IcResiDemandDictDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.service.IcResiDemandDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@RestController
@RequestMapping("icresidemanddict")
public class IcResiDemandDictController {
@Autowired
private IcResiDemandDictService icResiDemandDictService;
@GetMapping("page")
public Result<PageData<IcResiDemandDictDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcResiDemandDictDTO> page = icResiDemandDictService.page(params);
return new Result<PageData<IcResiDemandDictDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IcResiDemandDictDTO> get(@PathVariable("id") String id){
IcResiDemandDictDTO data = icResiDemandDictService.get(id);
return new Result<IcResiDemandDictDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IcResiDemandDictDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiDemandDictService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IcResiDemandDictDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiDemandDictService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiDemandDictService.delete(ids);
return new Result();
}
@PostMapping("demandoption")
public Result<List<OptionResultDTO>> getDemandOptions(@LoginUser TokenDto tokenDto) {
return new Result<List<OptionResultDTO>>().ok(icResiDemandDictService.getDemandOptions(tokenDto.getCustomerId()));
}
/**
* 居民信息列表需要展示分类名称单独开出来这个接口供user查询
* @param formDTO
* @return
*/
@PostMapping("demangnames")
public Result<String> queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,UserDemandNameQueryFormDTO.AddUserInternalGroup.class);
return icResiDemandDictService.queryDemandNames(formDTO);
}
}

41
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@Mapper
public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
List<OptionResultDTO> selectDemandOptions(@Param("customerId") String customerId);
List<OptionResultDTO> selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode);
String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);
}

73
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java

@ -0,0 +1,73 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_demand_dict")
public class IcResiDemandDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 父级
*/
private String parentCode;
/**
* 字典值
*/
private String categoryCode;
/**
* 字典描述
*/
private String categoryName;
/**
* 级别
*/
private String level;
/**
* 备注
*/
private String remark;
/**
* 排序
*/
private Integer sort;
}

114
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java

@ -0,0 +1,114 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcResiDemandDictDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import java.util.List;
import java.util.Map;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcResiDemandDictDTO>
* @author generator
* @date 2021-10-27
*/
PageData<IcResiDemandDictDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcResiDemandDictDTO>
* @author generator
* @date 2021-10-27
*/
List<IcResiDemandDictDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcResiDemandDictDTO
* @author generator
* @date 2021-10-27
*/
IcResiDemandDictDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-10-27
*/
void save(IcResiDemandDictDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-10-27
*/
void update(IcResiDemandDictDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-10-27
*/
void delete(String[] ids);
/**
* @Description 获取居民需求
* @Param customerId
* @Return {@link List< OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/27 17:57
*/
List<OptionResultDTO> getDemandOptions(String customerId);
/**
* 居民信息列表需要展示分类名称单独开出来这个接口供user查询
* @param formDTO
* @return
*/
Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO);
}

120
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java

@ -0,0 +1,120 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiDemandDictDao;
import com.epmet.dto.IcResiDemandDictDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import com.epmet.service.IcResiDemandDictService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@Service
public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDictDao, IcResiDemandDictEntity> implements IcResiDemandDictService {
@Override
public PageData<IcResiDemandDictDTO> page(Map<String, Object> params) {
IPage<IcResiDemandDictEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcResiDemandDictDTO.class);
}
@Override
public List<IcResiDemandDictDTO> list(Map<String, Object> params) {
List<IcResiDemandDictEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcResiDemandDictDTO.class);
}
private QueryWrapper<IcResiDemandDictEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiDemandDictEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcResiDemandDictDTO get(String id) {
IcResiDemandDictEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcResiDemandDictDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcResiDemandDictDTO dto) {
IcResiDemandDictEntity entity = ConvertUtils.sourceToTarget(dto, IcResiDemandDictEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcResiDemandDictDTO dto) {
IcResiDemandDictEntity entity = ConvertUtils.sourceToTarget(dto, IcResiDemandDictEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param customerId
* @Description 获取居民需求
* @Param customerId
* @Return {@link List< OptionResultDTO >}
* @Author zhaoqifeng
* @Date 2021/10/27 17:57
*/
@Override
public List<OptionResultDTO> getDemandOptions(String customerId) {
return baseDao.selectDemandOptions(customerId);
}
@Override
public Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO) {
return new Result<String>().ok(baseDao.selectCategoryNames(formDTO.getCustomerId(),formDTO.getCodeSet()));
}
}

77
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -0,0 +1,77 @@
<?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.IcResiDemandDictDao">
<resultMap type="com.epmet.entity.IcResiDemandDictEntity" id="icResiDemandDictMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="parentCode" column="PARENT_CODE"/>
<result property="categoryCode" column="CATEGORY_CODE"/>
<result property="categoryName" column="CATEGORY_NAME"/>
<result property="level" column="LEVEL"/>
<result property="remark" column="REMARK"/>
<result property="sort" column="SORT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<resultMap id="DemandResult" type="com.epmet.commons.tools.dto.result.OptionResultDTO">
<result column="customerId"/>
<result column="value" property="value"/>
<result column="label" property="label"/>
<collection property="children" ofType="com.epmet.commons.tools.dto.result.OptionResultDTO"
select="selectChildDemands" column="customerId=customerId,parentCode=value">
</collection>
</resultMap>
<select id="selectDemandOptions" resultMap="DemandResult">
SELECT
CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label"
FROM
ic_resi_demand_dict
WHERE
DEL_FLAG = 0
AND LEVEL = 1
AND CUSTOMER_ID = #{customerId}
ORDER BY
SORT ASC
</select>
<select id="selectChildDemands" resultMap="DemandResult">
SELECT
CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label"
FROM
ic_resi_demand_dict
WHERE
DEL_FLAG = 0
AND LEVEL = 2
AND CUSTOMER_ID = #{customerId}
AND PARENT_CODE = #{parentCode}
ORDER BY
SORT ASC
</select>
<select id="selectCategoryNames" parameterType="map" resultType="java.lang.String">
SELECT
GROUP_CONCAT(m.CATEGORY_NAME)
FROM
ic_resi_demand_dict m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
<if test="null != codeSet and codeSet.size() > 0">
AND m.CATEGORY_CODE IN
<foreach item="code" collection="codeSet" open="(" separator="," close=")">
#{code}
</foreach>
</if>
</select>
</mapper>

15
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java

@ -85,4 +85,19 @@ public interface SystemMessageType {
*/
String PROJECT_EDIT = "project_edit";
/**
* 居民信息添加
*/
String IC_RESI_USER_ADD = "ic_resi_user_add";
/**
* 居民信息修改
*/
String IC_RESI_USER_EDIT = "ic_resi_user_edit";
/**
* 居民信息删除
*/
String IC_RESI_USER_DEL = "ic_resi_user_del";
}

5
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java

@ -187,6 +187,11 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.PROJECT_EDIT:
topic = TopicConstants.PROJECT;
break;
case SystemMessageType.IC_RESI_USER_ADD:
case SystemMessageType.IC_RESI_USER_EDIT:
case SystemMessageType.IC_RESI_USER_DEL:
topic = TopicConstants.IC_RESI_USER;
break;
}
return topic;
}

11
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java

@ -11,13 +11,13 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.feign.fallback.OssFeignClientFallback;
import com.epmet.feign.fallback.OssFeignClientFallbackFactory;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
@ -55,6 +55,15 @@ public interface OssFeignClient {
@PostMapping(value ="oss/file/uploadqrcodeV2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
Result<UploadImgResultDTO> uploadQrCodeV2(@RequestPart(value = "file") MultipartFile file, @RequestParam("customerId") String customerId);
/**
* desc:通过文件路径获取文件地址
* @param filePath 文件路径 eg:epmet
* @param privacy 内部 外部
* @return
*/
@GetMapping(value = "oss/file/getOssFileUrl")
Result<String> getOssFileUrl(@RequestParam String filePath, @RequestParam String privacy);
//@Configuration
class MultipartSupportConfig {

6
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java

@ -13,7 +13,6 @@ import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.feign.OssFeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
/**
@ -40,4 +39,9 @@ public class OssFeignClientFallback implements OssFeignClient {
return ModuleUtils.feignConError(ServiceConstant.EPMET_OSS_SERVER, "uploadQrCodeV2", file, customerId);
}
@Override
public Result<String> getOssFileUrl(String filePath, String privacy) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_OSS_SERVER, "download", filePath,privacy);
}
}

16
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java

@ -25,17 +25,23 @@ import java.util.UUID;
public abstract class AbstractCloudStorageService {
/** 云存储配置信息 */
CloudStorageConfig config;
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJun
* @date 2021/3/30 10:05 上午
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
public abstract String getOssDomain(String privacy);
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
public String getOssDomain(String privacy){
return null;
};
public abstract String getOssPrefix(String privacy);
/**
* 文件路径
* @param prefix 前缀

9
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java

@ -90,6 +90,15 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService {
}
}
@Override
public String getOssPrefix(String privacy) {
if (PrivacyType.INTERNAL.equalsIgnoreCase(privacy)) {
return config.getAliyun().getInternal().getAliyunPrefix();
} else {
return config.getAliyun().getExternal().getAliyunPrefix();
}
}
@Override
public String upload(byte[] data, String path, String privacyType) {
return upload(new ByteArrayInputStream(data), path, privacyType);

24
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java

@ -34,6 +34,30 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService {
this.config = config;
}
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssDomain(String privacy) {
return config.getFastdfsDomain();
}
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssPrefix(String privacy) {
return null;
}
@Override
public String upload(byte[] data, String path, String privacyType) {
return upload(new ByteArrayInputStream(data), path, privacyType);

24
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java

@ -28,6 +28,30 @@ public class LocalCloudStorageService extends AbstractCloudStorageService {
this.config = config;
}
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssDomain(String privacy) {
return config.getLocalDomain();
}
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssPrefix(String privacy) {
return config.getLocalPrefix();
}
@Override
public String upload(byte[] data, String path, String privacyType) {
return upload(new ByteArrayInputStream(data), path, privacyType);

24
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java

@ -47,6 +47,30 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService {
clientConfig = new ClientConfig(new Region(config.getQcloudRegion()));
}
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssDomain(String privacy) {
return config.getQcloudDomain();
}
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssPrefix(String privacy) {
return config.getQcloudPrefix();
}
@Override
public String upload(byte[] data, String path, String privacyType) {
return upload(new ByteArrayInputStream(data), path, privacyType);

24
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java

@ -44,6 +44,30 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService {
}
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssDomain(String privacy) {
return config.getQiniuDomain();
}
/**
* desc: 获取oss前缀
*
* @param privacy
* @return java.lang.String
* @author LiuJanJu * @date 2021/3/30 10:05 上午
*/
@Override
public String getOssPrefix(String privacy) {
return config.getQiniuPrefix();
}
@Override
public String upload(byte[] data, String path, String privacyType) {
try {

5
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -423,4 +423,9 @@ public class OssController {
return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId);
}
@GetMapping("getOssFileUrl")
public Result<String> download(@RequestParam(required = false) String filePath,@RequestParam(required = false) String privacy){
return new Result<String>().ok(ossService.getOssFileUrl(filePath,privacy));
}
}

7
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java

@ -53,4 +53,11 @@ public interface OssService extends BaseService<OssEntity> {
* @author sun
*/
Result<UploadImgResultDTO> uploadImgV2(MultipartFile file, String privacy, String customerId);
/**
* desc:通过文件路径获取下载 全路径 不传文件路径则为服务域名
* @param filePath
* @return
*/
String getOssFileUrl(String filePath,String privacy);
}

18
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java

@ -36,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Map;
@ -242,5 +243,22 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
return new Result<UploadImgResultDTO>().ok(dto);
}
@Override
public String getOssFileUrl(String filePath,String privacy) {
if (StringUtils.isBlank(filePath)){
filePath = StrConstant.EPMETY_STR;
}
AbstractCloudStorageService storageService = OssFactory.build();
String ossDomain = storageService.getOssDomain(privacy);
String ossPrefix = storageService.getOssPrefix(privacy);
if (StringUtils.isBlank(ossDomain)){
throw new RenException("oss配置错误");
}
if (StringUtils.isBlank(ossPrefix)){
ossPrefix = StrConstant.EPMETY_STR;
}
return ossDomain.concat(File.separator).concat(ossPrefix).concat(File.separator).concat(filePath);
}
}

5
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java

@ -3,7 +3,6 @@ package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 居民端积分总排行周排行月排行接口返参DTO
@ -15,6 +14,10 @@ import java.util.List;
public class ResiPointRankListResultDTO implements Serializable {
private static final long serialVersionUID = 685408245193506541L;
/**
* 用户Id
*/
private String userId;
/**
* 当前用户昵称
* */

6
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java

@ -6,7 +6,6 @@ import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.Result;
import com.epmet.entity.PointVerificationStatisticalDailyEntity;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import com.epmet.entity.UserPointTotalEntity;
import com.epmet.service.PointVerificationStatisticalDailyService;
import com.epmet.service.UserPointStatisticalDailyService;
import com.epmet.service.UserPointTotalService;
@ -62,10 +61,5 @@ public class TestController {
pointVerificationStatisticalDailyService.testUnixKey(entity);
return new Result();
}
@PostMapping("testtotal")
public Result testTotal(@RequestBody UserPointTotalEntity entity){
userPointTotalService.testInsertOrUpdate(entity);
return new Result();
}
}

68
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java

@ -18,17 +18,13 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.UserPointTotalDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.entity.UserPointTotalEntity;
import java.util.List;
import java.util.Map;
/**
* 用户积分总计
@ -38,66 +34,6 @@ import java.util.Map;
*/
public interface UserPointTotalService extends BaseService<UserPointTotalEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<UserPointTotalDTO>
* @author generator
* @date 2020-07-20
*/
PageData<UserPointTotalDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<UserPointTotalDTO>
* @author generator
* @date 2020-07-20
*/
List<UserPointTotalDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return UserPointTotalDTO
* @author generator
* @date 2020-07-20
*/
UserPointTotalDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-07-20
*/
void save(UserPointTotalDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-07-20
*/
void update(UserPointTotalDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-07-20
*/
void delete(String[] ids);
/**
* @Description 获取指定居民的积分信息
* @param param
@ -125,8 +61,6 @@ public interface UserPointTotalService extends BaseService<UserPointTotalEntity>
**/
void insertOrUpdate(UserPointTotalEntity entity);
void testInsertOrUpdate(UserPointTotalEntity entity);
/**
* @Description 获取指定居民的积分信息 - 使用客户Id匹配兼容多客户情况
* @param customerUserParam
@ -135,4 +69,4 @@ public interface UserPointTotalService extends BaseService<UserPointTotalEntity>
* @date 2020.07.22 15:58
**/
ResiPointDetailResultDTO getMyPointGroupByCustomer(CommonUserFormDTO customerUserParam);
}
}

8
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java

@ -380,7 +380,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
form.setSearchScopeObjectId(searchScopeObjectId);
Result<List<GroupDetailResultDTO>> result = resiGroupOpenFeignClient.listGroupDetailsExcludeGroupIds(form);
List<GroupDetailResultDTO> groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败");
List<GroupDetailResultDTO> groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败", null);
if (CollectionUtils.isEmpty(groups)) {
return new ArrayList<>();
}
@ -412,7 +412,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
// 查询这些小组的基本信息
Result<List<GroupDetailResultDTO>> listResult = resiGroupOpenFeignClient.listGroupDetailsByGroupIds(groupIds);
List<GroupDetailResultDTO> groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错");
List<GroupDetailResultDTO> groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错", null);
// 将小组基本信息转化为map
HashMap<String, GroupDetailResultDTO> groupMap = new HashMap<>();
@ -454,7 +454,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
CustomerGridFormDTO form = new CustomerGridFormDTO();
form.setGridId(gridId);
Result<CustomerGridDTO> result = govOrgOpenFeignClient.getGridBaseInfoByGridId(form);
return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败");
return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败", null);
}
@Override
@ -464,7 +464,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
form.setGridId(gridId);
form.setUserId(userId);
List<GroupDetailResultDTO> groupList = getResultDataOrThrowsException(resiGroupOpenFeignClient.listGroupsByMember(form),
ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败");
ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败", null);
if (CollectionUtils.isEmpty(groupList)) {
return new ArrayList();

29
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java

@ -55,6 +55,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -148,7 +149,7 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
if(myResiInfoResult.success() && null != myResiInfoResult.getData() && !myResiInfoResult.getData().isEmpty()){
if(StringUtils.isBlank(pointRankFormDTO.getCustomerId())) {
//缓存中的customerId是不准确的,前端一定会传customerId,所以不会执行此代码
log.warn("com.epmet.service.impl.UserPointTotalServiceImpl.getPointRanking,传参缺失客户Id,参数:{}",pointRankFormDTO);
log.warn("getPointRanking,传参缺失客户Id,参数:{}",pointRankFormDTO);
//缓存中陌生人游客也有对应的customerId
pointRankFormDTO.setCustomerId(myResiInfoResult.getData().get(NumConstant.ZERO).getCustomerId());
}
@ -202,18 +203,22 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
}
List<String> userIds = rankList.stream().map(ResiPointRankResultDTO::getUserId).collect(Collectors.toList());
//查询用户昵称
Result<List<UserBaseInfoResultDTO>> userInfo =
epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
boolean userRequestCallback = userInfo.success() && null != userInfo.getData() && !userInfo.getData().isEmpty();
for (int i = NumConstant.ZERO; i < rankList.size(); i++) {
ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o,ResiPointRankListResultDTO.class);
Result<List<UserBaseInfoResultDTO>> userInfo = epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
Map<String,UserBaseInfoResultDTO> userInfoMap = new HashMap<>();
if (userInfo.success() && CollectionUtils.isNotEmpty(userInfo.getData())){
userInfoMap = userInfo.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity(),(o1,o2)->o1));
}
for (ResiPointRankResultDTO resiPointRankResultDTO : rankList) {
ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o, ResiPointRankListResultDTO.class);
ResiPointRankingResultDTO target = new ResiPointRankingResultDTO();
target.setRanking(rankList.get(i).getRank());
target.setPoint(rankList.get(i).getTotalPoint());
if(userRequestCallback) {
target.setNickname(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getNickname());
target.setHeadImgUrl(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getHeadImgUrl());
target.setRanking(resiPointRankResultDTO.getRank());
target.setPoint(resiPointRankResultDTO.getTotalPoint());
target.setNickname(StrConstant.EPMETY_STR);
target.setHeadImgUrl(StrConstant.EPMETY_STR);
UserBaseInfoResultDTO infoResultDTO = userInfoMap.get(resiPointRankResultDTO.getUserId());
if (infoResultDTO != null) {
target.setNickname(infoResultDTO.getNickname());
target.setHeadImgUrl(infoResultDTO.getHeadImgUrl());
}
resultObj.setRankList(target);
result.add(resultObj);

112
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java

@ -17,34 +17,27 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.UserPointTotalDao;
import com.epmet.dto.UserPointTotalDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.UserPointTotalEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.UserPointTotalService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -57,62 +50,9 @@ import java.util.stream.Collectors;
@Slf4j
public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao, UserPointTotalEntity> implements UserPointTotalService {
@Autowired
EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<UserPointTotalDTO> page(Map<String, Object> params) {
IPage<UserPointTotalEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, UserPointTotalDTO.class);
}
@Override
public List<UserPointTotalDTO> list(Map<String, Object> params) {
List<UserPointTotalEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, UserPointTotalDTO.class);
}
private QueryWrapper<UserPointTotalEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<UserPointTotalEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public UserPointTotalDTO get(String id) {
UserPointTotalEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, UserPointTotalDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(UserPointTotalDTO dto) {
UserPointTotalEntity entity = ConvertUtils.sourceToTarget(dto, UserPointTotalEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(UserPointTotalDTO dto) {
UserPointTotalEntity entity = ConvertUtils.sourceToTarget(dto, UserPointTotalEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 获取指定居民的积分信息
* @param param
@ -145,8 +85,7 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
//1.获取当前用户昵称以及当前用户所属客户Id
List<String> userIdParam = new LinkedList<>();
userIdParam.add(pointRankFormDTO.getUserId());
Result<List<UserBaseInfoResultDTO>> myResiInfoResult =
epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam);
Result<List<UserBaseInfoResultDTO>> myResiInfoResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam);
if(myResiInfoResult.success() && null != myResiInfoResult.getData() && !myResiInfoResult.getData().isEmpty()){
if(StringUtils.isBlank(pointRankFormDTO.getCustomerId())) {
//缓存中的customerId是不准确的,前端一定会传customerId,所以不会执行此代码
@ -204,19 +143,23 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
List<String> userIds = rankList.stream().map(ResiPointRankResultDTO::getUserId).collect(Collectors.toList());
//查询用户昵称
Result<List<UserBaseInfoResultDTO>> userInfo =
epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
boolean userRequestCallback = userInfo.success() && null != userInfo.getData() && !userInfo.getData().isEmpty();
for (int i = NumConstant.ZERO; i < rankList.size(); i++) {
ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o,ResiPointRankListResultDTO.class);
Result<List<UserBaseInfoResultDTO>> userInfo = epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
Map<String,UserBaseInfoResultDTO> userInfoMap = new HashMap<>();
if (userInfo.success() && CollectionUtils.isNotEmpty(userInfo.getData())){
userInfoMap = userInfo.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity(),(o1, o2)->o1));
}
for (ResiPointRankResultDTO resiPointRankResultDTO : rankList) {
ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o, ResiPointRankListResultDTO.class);
ResiPointRankingResultDTO target = new ResiPointRankingResultDTO();
target.setRanking(rankList.get(i).getRank());
target.setPoint(rankList.get(i).getTotalPoint());
if(userRequestCallback) {
target.setNickname(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getNickname());
target.setHeadImgUrl(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getHeadImgUrl());
target.setRanking(resiPointRankResultDTO.getRank());
target.setPoint(resiPointRankResultDTO.getTotalPoint());
target.setNickname(StrConstant.EPMETY_STR);
target.setHeadImgUrl(StrConstant.EPMETY_STR);
UserBaseInfoResultDTO infoResultDTO = userInfoMap.get(resiPointRankResultDTO.getUserId());
if (infoResultDTO != null) {
target.setNickname(infoResultDTO.getNickname());
target.setHeadImgUrl(infoResultDTO.getHeadImgUrl());
}
resultObj.setRankList(target);
result.add(resultObj);
@ -234,21 +177,6 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
@Override
public void insertOrUpdate(UserPointTotalEntity entity) {
baseDao.insertOrUpdate(entity);
/*
UserPointTotalEntity existed = baseDao.selectIfExisted(entity.getUserId());
if(null != existed && StringUtils.isNotBlank(existed.getId())){
existed.setUsedPoint(null == existed.getUsedPoint() ? entity.getUsedPoint() : entity.getUsedPoint() + existed.getUsedPoint());
existed.setUsablePoint(null == existed.getUsablePoint() ? entity.getUsablePoint() : entity.getUsablePoint() + existed.getUsablePoint());
existed.setTotalPoint(null == existed.getTotalPoint() ? entity.getTotalPoint() : entity.getTotalPoint() + existed.getTotalPoint());
updateById(existed);
}else{
insert(entity);
}*/
}
@Override
public void testInsertOrUpdate(UserPointTotalEntity entity) {
baseDao.insertOrUpdate(entity);
}
@ -267,4 +195,4 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
return result;
}
}
}

4
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml

@ -66,7 +66,7 @@
point.total_point,
@point := point.total_point
FROM
( SELECT * FROM user_point_total WHERE CUSTOMER_ID = #{customerId} ORDER BY total_point DESC ) point,
( SELECT * FROM user_point_total WHERE CUSTOMER_ID = #{customerId} and del_flag = '0' ORDER BY total_point DESC ) point,
( SELECT @point := NULL, @rank := 1 ) a
) temp
@ -122,4 +122,4 @@
UPDATED_BY = #{createdBy}
</insert>
</mapper>
</mapper>

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java

@ -55,7 +55,7 @@ public class PingyinPrivateEpmetApiService extends ApiService<Result> implements
String urlParams = super.convertQueryParams2String(constructCommonUrlParamsMap(platformKey, authType, uuid, currentTimeMillis, sign));
String requestUrl = baseUrl.concat(apiUrl).concat(urlParams);
Result<String> stringResult = HttpClientManager.getInstance().sendPostByHttps(requestUrl, "{}");
String remoteResultString = getResultDataOrThrowsException(stringResult, "【调用平阴私有化平台获取AccessToken】", EpmetErrorCode.SERVER_ERROR.getCode(), null);
String remoteResultString = getResultDataOrThrowsException(stringResult, "【调用平阴私有化平台获取AccessToken】", EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
Result<GetAccessTokenResultDTO> remoteResult = parsePlatformResponseResult(remoteResultString, GetAccessTokenResultDTO.class);
log.info("【调用平阴私有化平台获取AccessToken】结果:{}", remoteResultString);
accessTokenFromCache = remoteResult.getData().getAccessToken();
@ -159,7 +159,7 @@ public class PingyinPrivateEpmetApiService extends ApiService<Result> implements
String jsonString = JSON.toJSONString(form);
Result result = super.sendPostRequest(platformId, ThirdPlatformActions.PUSH_COMPONENT_ACCESS_TOKEN, jsonString, null, urlParams);
getResultDataOrThrowsException(result, "【平阴私有化平台】推送ComponentAccessToken", EpmetErrorCode.SERVER_ERROR.getCode(), null);
getResultDataOrThrowsException(result, "【平阴私有化平台】推送ComponentAccessToken", EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
}
@Override

4
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/PartyBranchManageController.java

@ -1,6 +1,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -34,6 +35,7 @@ public class PartyBranchManageController {
* @description 添加党支部
* @Date 2020/6/17 12:47
**/
@NoRepeatSubmit
@PostMapping("add")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_BRANCH_ADD)
public Result<PartyBranchAddResultDTO> addPartyBranch(@RequestBody PartyBranchAddFormDTO formDTO) {
@ -107,7 +109,7 @@ public class PartyBranchManageController {
* @param formDTO
* @author yinzuomei
* @description 6党员列表查询
* @Date 2020/6/18 0:17
* @Date 2020/6/18 0:17
**/
@PostMapping("/partymember/list")
public Result<List<PartyMemberInfoResultDTO>> listPartyMember(@RequestBody PartyBranchIdFormDTO formDTO){

4
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java

@ -18,6 +18,7 @@
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.ExcelUtils;
@ -127,6 +128,7 @@ public class IssueCategoryController {
* @Description 议题保存/修改分类
* @Author sun
**/
@NoRepeatSubmit
@PostMapping("save")
public Result saveCategory(@LoginUser TokenDto tokenDto, @RequestBody IssueSaveCategoryFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -135,4 +137,4 @@ public class IssueCategoryController {
return new Result();
}
}
}

6
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueSuggestionController.java

@ -17,6 +17,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IssueSuggestionDTO;
@ -43,7 +44,7 @@ import java.util.List;
@RestController
@RequestMapping("issuesuggestion")
public class IssueSuggestionController {
@Autowired
private IssueSuggestionService issueSuggestionService;
@ -66,6 +67,7 @@ public class IssueSuggestionController {
* @description 保存居民端用户对议题的建议或意见
* @Date 2020/11/18 13:15
**/
@NoRepeatSubmit
@PostMapping("save")
public Result<SaveIssueSuggestionResultDTO> saveIssueSuggestion(@RequestBody IssueSuggestionDTO dto) {
SaveIssueSuggestionResultDTO resultDTO = issueSuggestionService.saveIssueSuggestion(dto);
@ -84,4 +86,4 @@ public class IssueSuggestionController {
List<IssueSuggestionResDTO> list = issueSuggestionService.listIssueSug(formDTO);
return new Result<List<IssueSuggestionResDTO>>().ok(list);
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save