Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into dev_bugfix_ljj

dev_shibei_match
jianjun 4 years ago
parent
commit
b21fa3c943
  1. 6
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
  2. 7
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
  3. 9
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.7__add_dict_data_V3.sql
  4. 85
      epmet-auth/src/main/java/com/epmet/controller/LoginController.java
  5. 1
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  6. 2
      epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java
  7. 2
      epmet-auth/src/main/resources/bootstrap.yml
  8. 34
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java
  9. 19
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java
  10. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
  11. 35
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java
  12. 41
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java
  13. 30
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  14. 55
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  15. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java
  16. 6
      epmet-gateway/pom.xml
  17. 5
      epmet-gateway/src/main/resources/bootstrap.yml
  18. 21
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectMonthResultDTO.java
  19. 35
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectResultDTO.java
  20. 93
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java
  21. 6
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java
  22. 45
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ResiEventDTO.java
  23. 45
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java
  24. 36
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java
  25. 32
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectCategoryTotalFormDTO.java
  26. 13
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectTotalFormDTO.java
  27. 57
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java
  28. 12
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/IssueProjectCategory.java
  29. 63
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectAnalysisResultDTO.java
  30. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryResultDTO.java
  31. 26
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java
  32. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java
  33. 10
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java
  34. 14
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectTotalResultDTO.java
  35. 19
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/UserTopicPageFormDTO.java
  36. 22
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/UserTopicResDTO.java
  37. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
  38. 51
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java
  39. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java
  40. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
  41. 49
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java
  42. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java
  43. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java
  44. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java
  45. 49
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java
  46. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java
  47. 493
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java
  48. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
  49. 22
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  50. 23
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  51. 32
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  52. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
  53. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  54. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java
  55. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java
  56. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  57. 36
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java
  58. 317
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  59. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java
  60. 47
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java
  61. 62
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  62. 39
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml
  63. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml
  64. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  65. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml
  66. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  67. 138
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  68. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml
  69. 41
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java
  70. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java
  71. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java
  72. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java
  73. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java
  74. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java
  75. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java
  76. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java
  77. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java
  78. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyUserPointResultDTO.java
  79. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java
  80. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java
  81. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java
  82. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TopProfileResultDTO.java
  83. 38
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java
  84. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
  85. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  86. 43
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java
  87. 83
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java
  88. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  89. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java
  90. 29
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java
  91. 24
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  92. 36
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml
  93. 6
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml
  94. 6
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml
  95. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml
  96. 6
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml
  97. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml
  98. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnCommunityProjectProfileDao.xml
  99. 6
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml
  100. 6
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml

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

@ -1,6 +1,8 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
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.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO;
@ -8,6 +10,7 @@ import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
@ -84,4 +87,7 @@ public interface EpmetAdminOpenFeignClient {
*/
@PostMapping("/sys/dict/data/dictmap/{dictType}")
Result<Map<String, String>> dictMap(@PathVariable("dictType") String dictType);
@PostMapping("/sys/dict/data/dictlist")
Result<List<DictListResultDTO>> dictList(@RequestBody DictListFormDTO formDTO);
}

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

@ -1,6 +1,8 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
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.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
@ -46,4 +48,9 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli
public Result<Map<String, String>> dictMap(String dictType) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictMap", dictType);
}
@Override
public Result<List<DictListResultDTO>> dictList(DictListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictList", formDTO);
}
}

9
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.7__add_dict_data_V3.sql

@ -0,0 +1,9 @@
-- 1、增加字典类型
INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000011, 'age_group', '年龄范围', '', 11, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58');
-- 2、增加字典数据
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000230, 1000000000000000011, '50岁以下', '0', '', 0, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000231, 1000000000000000011, '50-59岁', '1', '', 1, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000232, 1000000000000000011, '60-69岁', '2', '', 2, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000233, 1000000000000000011, '70-79岁', '3', '', 3, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000234, 1000000000000000011, '80岁以上', '4', '', 4, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42');

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

@ -23,6 +23,9 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
/**
* @Description 通用登录接口
@ -145,4 +148,86 @@ public class LoginController {
}
return new Result().ok("");
}
//================start test code==========
/**
* 校验签名
*/
public static boolean checkSignature(String signature, String timestamp, String nonce) {
System.out.println("signature:" + signature + "timestamp:" + timestamp + "nonc:" + nonce);
String WECHAT_TOKEN = "1jkoyyih83nj8";
String[] arr = new String[]{WECHAT_TOKEN, timestamp, nonce};
// 将token、timestamp、nonce三个参数进行字典序排序
Arrays.sort(arr);
StringBuilder content = new StringBuilder();
for (int i = 0; i < arr.length; i++) {
content.append(arr[i]);
}
MessageDigest md = null;
String tmpStr = null;
try {
md = MessageDigest.getInstance("SHA-1");
// 将三个参数字符串拼接成一个字符串进行sha1加密
byte[] digest = md.digest(content.toString().getBytes());
tmpStr = byteToStr(digest);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
content = null;
// 将sha1加密后的字符串可与signature对比,标识该请求来源于微信
System.out.println(tmpStr.equals(signature.toUpperCase()));
return tmpStr != null ? tmpStr.equals(signature.toUpperCase()) : false;
}
/**
* 将字节数组转换为十六进制字符串
*
* @param byteArray
* @return
*/
private static String byteToStr(byte[] byteArray) {
String strDigest = "";
for (int i = 0; i < byteArray.length; i++) {
strDigest += byteToHexStr(byteArray[i]);
}
return strDigest;
}
/**
* 将字节转换为十六进制字符串
*
* @param mByte
* @return
*/
private static String byteToHexStr(byte mByte) {
char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
char[] tempArr = new char[2];
tempArr[0] = Digit[(mByte >>> 4) & 0X0F];
tempArr[1] = Digit[mByte & 0X0F];
String s = new String(tempArr);
return s;
}
/**
* 打开开发者模式签名认证
* @param signature
* @param timestamp
* @param nonce
* @param echostr
* @return
*/
@ResponseBody
@RequestMapping(value = "/service", method = RequestMethod.GET)
public Object defaultView(String signature, String timestamp, String nonce, String echostr) {
if (echostr == null || echostr.isEmpty()) {
return nonce;
}
if (this.checkSignature(signature, timestamp, nonce)) {
return echostr;
}
return nonce;
}
}

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

@ -4,7 +4,6 @@ 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;
import com.epmet.commons.tools.utils.DateUtils;

2
epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java

@ -295,7 +295,7 @@ public class LoginServiceImpl implements LoginService {
if (!flag) {
logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone()));
//2020-05-21去除验证码校验
return new Result<UserTokenResultDTO>().error(EpmetErrorCode.ERR10019.getCode());
//return new Result<UserTokenResultDTO>().error(EpmetErrorCode.ERR10019.getCode());
}
//2、账号是否存在
//获取用户信息

2
epmet-auth/src/main/resources/bootstrap.yml

@ -32,6 +32,8 @@ spring:
namespace: @nacos.discovery.namespace@
#不把自己注册到注册中心的地址
register-enabled: @nacos.register-enabled@
serviceListChangedListening:
enable: @nacos.service-list-changed-listening.enable@
config:
enabled: @nacos.config-enabled@
server-addr: @nacos.server-addr@

34
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java

@ -1,5 +1,6 @@
package com.epmet.commons.tools.aspect;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import com.epmet.commons.tools.exception.*;
@ -14,6 +15,9 @@ import javax.servlet.http.HttpServletRequest;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
/**
* 日志切面
@ -54,6 +58,8 @@ public abstract class BaseRequestLogAspect {
// transactionSerial = UUID.randomUUID().toString();
//}
Map<String, String> requestHeaders = getRequestHeaders(request);
// 将当前线程名称设置为事务流水号
if (!StringUtils.isEmpty(transactionSerial)) {
Thread.currentThread().setName(transactionSerial);
@ -64,7 +70,8 @@ public abstract class BaseRequestLogAspect {
try {
Object[] args = point.getArgs();
ThreadLocalConstant.requestParam.set(Arrays.toString(point.getArgs()));
log.info(">>>>>>>>请求信息>>>>>>>>:事务流水号:{},url:{} ,method:{},请求参数:{}", transactionSerial, requestURI, method, objectsToString(args));
log.info(">>>>>>>>请求信息>>>>>>>>:事务流水号:{},url:{} ,method:{},请求参数:{},请求头:{}",
transactionSerial, requestURI, method, objectsToString(args), requestHeaders);
result = point.proceed();
resultInfoLog(transactionSerial, getExecPeriod(startTime), result);
} catch (EpmetException e) {
@ -99,6 +106,23 @@ public abstract class BaseRequestLogAspect {
return result;
}
/**
* @Description 获取请求头信息
* @return
* @author wxz
* @date 2021.03.31 13:59
*/
private Map<String, String> getRequestHeaders(HttpServletRequest request) {
Enumeration<String> headerNames = request.getHeaderNames();
HashMap<String, String> headerMap = new HashMap<>();
while (headerNames.hasMoreElements()) {
String headerName = headerNames.nextElement();
String headerValue = request.getHeader(headerName);
headerMap.put(headerName, headerValue);
}
return headerMap;
}
/**
* info日志
* @param transactionSerial
@ -258,7 +282,13 @@ public abstract class BaseRequestLogAspect {
StringBuilder builder = new StringBuilder("[");
for (Object object : args) {
if (object != null) {
builder.append(object.toString());
try {
// 尝试作为json解析
String objectString = JSON.toJSONString(object);
builder.append(objectString);
} catch (Exception e) {
builder.append(object.toString());
}
builder.append(",");
}
}

19
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java

@ -0,0 +1,19 @@
package com.epmet.commons.tools.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/12/8 14:50
*/
@Data
public class OptionDataResultDTO implements Serializable {
private static final long serialVersionUID = 416877704759019210L;
private String label;
private String value;
private String code;
private String radio;
}

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java

@ -18,7 +18,8 @@ public enum DictTypeEnum {
GENDER("gender", "性别", 8),
USER_DEMAND_STATUS("user_demand_status", "居民需求状态",8),
USER_DEMAND_REPORT_TYPE("user_demand_report_type","居民需求上报类型",9),
USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10)
USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10),
AGE_GROUP("age_group", "年龄范围", 11),
;
private final String code;

35
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java

@ -0,0 +1,35 @@
package com.epmet.commons.tools.feign;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
public class EpmetBaseRequestInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
if (requestAttributes == null) {
return;
}
HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
Enumeration<String> values = request.getHeaders(name);
while (values.hasMoreElements()) {
String value = values.nextElement();
template.header(name, value);
}
}
}
}
}

41
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java

@ -1,8 +1,8 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* <p>
* https://www.renren.io
*
* <p>
* 版权所有侵权必究
*/
@ -10,49 +10,32 @@ package com.epmet.commons.tools.feign;
import feign.Logger;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
/**
* Feign调用携带header
* 各服务可以自定义自己的RequestInterceptor如果自定义了此处不会再生效会优先使用自定义的拦截器实例
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Configuration
public class FeignConfig implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
if (requestAttributes == null) {
return;
}
HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
Enumeration<String> values = request.getHeaders(name);
while (values.hasMoreElements()) {
String value = values.nextElement();
template.header(name, value);
}
}
}
public class FeignConfig {
@Bean
@ConditionalOnMissingBean
RequestInterceptor requestInterceptor() {
return new EpmetBaseRequestInterceptor();
}
@Bean
@ConditionalOnMissingBean
Logger.Level feignLoggerLevel() {
return Logger.Level.BASIC;//控制台会输出debug日志
}
}

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

@ -349,6 +349,13 @@ public class RedisKeys {
return rootPrefix.concat("stats:calflag");
}
/**
* 插入大屏指标数据分布式锁 key
*/
public static String getScreenIndexDataLockKey() {
return rootPrefix.concat("stats:indexcal:lock");
}
/**
* footbar缓存key
* @param customerId
@ -359,12 +366,6 @@ public class RedisKeys {
return rootPrefix.concat("footbar").concat(":").concat(customerId).concat(":").concat(appType);
}
/**
* 插入大屏指标数据分布式锁 key
*/
public static String getScreenIndexDataLockKey() {
return rootPrefix.concat("stats:indexcal:lock");
}
/**
* @return
@ -568,6 +569,15 @@ public class RedisKeys {
return rootPrefix.concat("message:mq:blocked:").concat(blockedMsgLabel);
}
/**
* desc:获取执行完毕的 业务 参数结果key
* @param bizMethod
* @return
*/
public static String getBackDoorbizExcuteResult(String bizMethod) {
return rootPrefix.concat("backdoor:").concat(bizMethod);
}
/**
* @description 登录票据目前只有IC基层治理平台用到
*
@ -623,12 +633,4 @@ public class RedisKeys {
return rootPrefix.concat("resi:").concat("export").concat(":template:changed").concat(customerId);
}
/**
* desc:获取执行完毕的 业务 参数结果key
* @param bizMethod
* @return
*/
public static String getBackDoorbizExcuteResult(String bizMethod) {
return rootPrefix.concat("backdoor:").concat(bizMethod);
}
}

55
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -11,6 +11,7 @@ package com.epmet.commons.tools.utils;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.TimeListResultDTO;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
@ -890,4 +891,58 @@ public class DateUtils {
format = DateUtils.format(DateUtils.getMonthEnd(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD);
System.out.println(format);
}
/**
* @Author sun
* @Description 获取dateId对应的num天的dateId活monthId
* dateId yyyymmdd
* type[date;month]
* num[1;-1]
* 20211201 date 1 -> 20211202
* 20211201 month -1 -> 202111
**/
public static String dateOrmonthId(String dateId, String type, int num){
Calendar cal=Calendar.getInstance();
if (StringUtils.isNotBlank(dateId)){
cal.setTime(DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD));
}
if("date".equals(type)){
cal.add(Calendar.DATE, num);
}else if("month".equals(type)){
cal.add(Calendar.MONTH, num);
}
Date time=cal.getTime();
if("month".equals(type)){
return new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMM).format(time);
}
return new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).format(time);
}
/**
* @Author sun
* @Description 获取dateId对应上一个月过去12个月的monthId
* dateId yyyymmdd
* 20211201 -> 202012-202111的值
**/
public static LinkedHashMap<String,String> getXproSub(String dateId){
java.time.format.DateTimeFormatter fmt = java.time.format.DateTimeFormatter.ofPattern("yyyyMM");
LinkedHashMap<String,String> xAxis = new LinkedHashMap<>();
Calendar cal=Calendar.getInstance();
cal.setTime(DateUtils.parseDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD));
TimeZone tz = cal.getTimeZone();
ZoneId zid = tz == null ? ZoneId.systemDefault() : tz.toZoneId();
java.time.LocalDate today = java.time.LocalDateTime.ofInstant(cal.toInstant(), zid).toLocalDate();
//java.time.LocalDate today = java.time.LocalDate.now();
for(int i = NumConstant.TWELVE;i > NumConstant.ZERO; i--){
java.time.LocalDate localDate = today.minusMonths(i);
String s = localDate.getMonth().getValue() + "月";
xAxis.put(localDate.format(fmt),s);
}
LinkedHashMap<String, String> result = Maps.newLinkedHashMap();
xAxis.entrySet().stream().sorted(Map.Entry.comparingByKey())
.forEachOrdered((e -> result.put(e.getKey(),e.getValue())));
return result;
}
}

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java

@ -31,7 +31,6 @@ public class Pinyin4jUtil {
duoyinMap.put('均',new String[]{"jun"});
duoyinMap.put('会', new String[]{"hui"});
duoyinMap.put('属', new String[]{"shu"});
duoyinMap.put('调', new String[]{"diao"});
}
/**
@ -43,6 +42,7 @@ public class Pinyin4jUtil {
*/
public static String getFirstSpellPinYin(String src, boolean isFullSpell) {
String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1));
System.out.println("targetStr="+targetStr);
String[] split = targetStr.split(",");
if (split.length > 1) {
targetStr = split[0];
@ -59,6 +59,7 @@ public class Pinyin4jUtil {
*/
public static String getSpellPinYin(String src, boolean isFullSpell,Integer preFont) {
String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, preFont));
System.out.println("targetStr="+targetStr);
String[] split = targetStr.split(",");
if (split.length > 1) {
targetStr = split[0];
@ -195,8 +196,9 @@ public class Pinyin4jUtil {
}
public static void main(String[] args) {
System.out.println(getFirstSpellPinYin("区直部门",false));
System.out.println(getSpellPinYin("党员提出话题数",false,4));
System.out.println(getSpellPinYin("社区超期项目数",false,4));
//System.out.println(getSpellPinYin("社区超期项目数",true,0));
System.out.println(getFirstSpellPinYin("区直部门",true));
//System.out.println(getSpellPinYin("党员提出话题数",false,4));
//System.out.println(getSpellPinYin("社区超期项目数",false,4));
}
}

6
epmet-gateway/pom.xml

@ -323,11 +323,11 @@
<!-- <gateway.routes.gov-issue-server.uri>http://localhost:8101</gateway.routes.gov-issue-server.uri>-->
<gateway.routes.gov-issue-server.uri>lb://gov-issue-server</gateway.routes.gov-issue-server.uri>
<!-- 23、政府工作端项目管理 -->
<!-- <gateway.routes.gov-project-server.uri>http://localhost:8102</gateway.routes.gov-project-server.uri>-->
<!-- <gateway.routes.gov-project-server.uri>http://localhost:8102</gateway.routes.gov-project-server.uri>-->
<gateway.routes.gov-project-server.uri>lb://gov-project-server</gateway.routes.gov-project-server.uri>
<!-- 24、公共服务 -->
<!--<gateway.routes.common-service-server.uri>lb://common-service-server</gateway.routes.common-service-server.uri>-->
<gateway.routes.common-service-server.uri>http://localhost:8103</gateway.routes.common-service-server.uri>
<gateway.routes.common-service-server.uri>lb://common-service-server</gateway.routes.common-service-server.uri>
<!--<gateway.routes.common-service-server.uri>http://localhost:8103</gateway.routes.common-service-server.uri>-->
<!-- 25、党建园地 -->
<gateway.routes.resi-home-server.uri>lb://resi-home-server</gateway.routes.resi-home-server.uri>
<!-- <gateway.routes.resi-home-server.uri>http://localhost:8104</gateway.routes.resi-home-server.uri>-->

5
epmet-gateway/src/main/resources/bootstrap.yml

@ -486,13 +486,16 @@ epmet:
- /data/aggregator/**
- /gov/voice/**
- /resi/voice/**
- /epmet/point/**
# 内部认证url白名单(在白名单中的,就不会再校验登录了)
internalAuthUrlsWhiteList:
- /epmetuser/customerstaff/customerlist
- /auth/wechat/**
- /**/druid/**
- /gov/project/project/platformcallback
- /oper/customize/customerstartpage/homestartpage
- /tduck-api/**
- /epmet/point/mqCallback/**
# 外部应用认证,使用AccessToken等头进行认证
externalOpenUrls:

21
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectMonthResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dataaggre.dto.datastats.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 项目月数据-接口返参
* @Auth sun
*/
@Data
public class FactAgencyProjectMonthResultDTO implements Serializable {
private static final long serialVersionUID = 466974582608407121L;
//组织Id
private String agencyId;
//月维度Id
private String monthId;
//当月项目总数 【当前组织及下级前一月新增项目数】
private Integer projectIncr = 0;
}

35
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectResultDTO.java

@ -0,0 +1,35 @@
package com.epmet.dataaggre.dto.datastats.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 项目总数-接口返参
* @Auth sun
*/
@Data
public class FactAgencyProjectResultDTO implements Serializable {
private static final long serialVersionUID = 466974582608407121L;
@JsonIgnore
BigDecimal bi = new BigDecimal(0);
//组织Id
private String agencyId;
//组织名称
private String dateId;
//月维度Id
private String monthId;
//项目总数
private Integer projectTotal = 0;
//处理中项目数
private Integer pendingTotal = 0;
//处理中项目占比
private String pendingRatio = "0%";
//已结案中项目数
private Integer closedTotal = 0;
//已结案中项目占比
private String closedRatio = "0%";
}

93
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java

@ -0,0 +1,93 @@
/**
* 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.dataaggre.dto.govissue;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 议题项目分类字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Data
public class IssueProjectCategoryDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id, 产品默认default
*/
private String customerId;
/**
* 上级分类ID 顶级此列存储0
*/
private String pid;
/**
* 所有上级分类ID用逗号分开
*/
private String pids;
/**
* 上级分类编码
*/
private String parentCategoryCode;
/**
* 分类编码分类编码+customer_id唯一
*/
private String categoryCode;
/**
* 分类名称
*/
private String categoryName;
/**
* 分类类别1,2,3,4....
*/
private String categoryType;
/**
* 排序
*/
private Integer sort;
/**
* 是否禁用(enable:启用 disable:禁用)
*/
private String isDisable;
/**
* 颜色
*/
private String color;
}

6
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java

@ -24,8 +24,12 @@ public class GridsInfoListResultDTO implements Serializable {
private String gridId;
/**
* 网格名称
* 组织-网格名称
*/
private String gridName;
/**
* 网格名称
*/
private String name;
}

45
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ResiEventDTO.java

@ -0,0 +1,45 @@
/**
* 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.dataaggre.dto.govproject;
import lombok.Data;
import java.io.Serializable;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Data
public class ResiEventDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
private String projectId;
private String reportUserId;
}

45
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java

@ -0,0 +1,45 @@
package com.epmet.dataaggre.dto.govproject.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description 赋能平台项目分类分析-接口入参
* @Auth sun
*/
@NoArgsConstructor
@Data
public class CategoryProjectFormDTO implements Serializable {
private static final long serialVersionUID = -8515172319313536407L;
//组织Id
@NotBlank(message = "组织ID不能为空", groups = {Category.class})
private String agencyId;
//日期yyyymmdd
@NotBlank(message = "组织ID不能为空", groups = {Category.class})
private String dateId;
//一级分类Id
@NotBlank(message = "分类Code不能为空", groups = {Category.class})
private String categoryCode;
//页码
@Min(1)
private Integer pageNo = 1;
//每页多少条
private Integer pageSize = 20;
//是否分页(是:true 否:false)
private Boolean isPage = true;
//明天的dateId值
private String toDateId;
private String customerId;
private List<String> categoreCodeList;
public interface Category extends CustomerClientShowGroup {
}
}

36
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.dataaggre.dto.govproject.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Description 赋能平台项目分类分析-接口入参
* @Auth sun
*/
@NoArgsConstructor
@Data
public class ProjectAnalysisFormDTO implements Serializable {
private static final long serialVersionUID = -8515172319313536407L;
//小程序话题或事件发起人Id
@NotBlank(message = "话题或事件发起人Id不能为空", groups = {Analysis.class})
private String userId;
//一级分类Id集合
@NotNull(message = "分类Code集合不能为空", groups = {Analysis.class})
private List<String> categoryCodeList;
//当前查看的项目Id
@NotBlank(message = "当前查看项目Id不能为空", groups = {Analysis.class})
private String projectId;
private String customerId;
public interface Analysis extends CustomerClientShowGroup {
}
}

32
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectCategoryTotalFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dataaggre.dto.govproject.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description 赋能平台项目分类分析-接口入参
* @Auth sun
*/
@NoArgsConstructor
@Data
public class ProjectCategoryTotalFormDTO implements Serializable {
private static final long serialVersionUID = -8515172319313536407L;
//组织Id
@NotBlank(message = "组织ID不能为空", groups = {Project.class})
private String agencyId;
//日期yyyymmdd
@NotBlank(message = "日维度ID不能为空", groups = {Project.class})
private String dateId;
private String customerId;
public interface Project extends CustomerClientShowGroup {
}
}

13
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectTotalFormDTO.java

@ -19,7 +19,7 @@ public class ProjectTotalFormDTO implements Serializable {
@NotBlank(message = "组织ID不能为空", groups = {Total.class, Monthincr.class, Statuslist.class})
private String agencyId;
//日期yyyymmdd
@NotBlank(message = "组织ID不能为空", groups = {Total.class, Monthincr.class, Statuslist.class})
@NotBlank(message = "日维度ID不能为空", groups = {Total.class, Monthincr.class, Statuslist.class})
private String dateId;
//状态:待处理 pending,结案closed
@NotBlank(message = "项目状态不能为空", groups = {Statuslist.class})
@ -32,4 +32,15 @@ public class ProjectTotalFormDTO implements Serializable {
public interface Statuslist extends CustomerClientShowGroup {
}
//较昨日的dateId值
private String yeDateId;
//较dateId上月的monthId值
private String monthId;
//查询数据起始月份Id
private String startMonth;
//查询数据结束月份Id
private String endMonth;
//明天的dateId值
private String toDateId;
}

57
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java

@ -0,0 +1,57 @@
package com.epmet.dataaggre.dto.govproject.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 赋能平台项目处理分析分类下项目列表-接口返参
* @Auth sun
*/
@Data
public class CategoryProjectResultDTO implements Serializable {
private static final long serialVersionUID = 6188316867855643263L;
//总条数
private Integer total = 0;
private List<Project> list;
@Data
public static class Project {
//项目所属组织Id
private String agencyId;
//项目Id
private String projectId;
//项目编码[目前没这个功能 默认为空]
private String projectCode = "";
//一级分类Code集合
private List<String> categoryCodes = new ArrayList<>();
//一级分类名称集合
private List<String> categoryNames = new ArrayList<>();
//来源:议题issue 项目立项:agency 事件:resi_event【控制电机查看时里边三个按钮的显示】
private String origin;
//网格Id[上报给组织的事件、直接立项的项目此值为空]
private String gridId = "";
//网格名[上报给组织的事件、直接立项的项目此值为空]
private String gridName = "";
//状态:待处理 pending,已结案closed
private String status;
//标题
private String title;
//转项目时间
private String time;
//小程序居民端话题或事件创建人【立项项目此值为空】
private String userId = "";
//分类对应的所有上级,英文逗号隔开【目前分类只有两级,所以这个字段值其实就是一类的id值】
@JsonIgnore
private String categoryPids;
//二级分类code
@JsonIgnore
private String categoryCode;
}
}

12
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/IssueProjectCategory.java

@ -0,0 +1,12 @@
package com.epmet.dataaggre.dto.govproject.result;
import lombok.Data;
import java.io.Serializable;
@Data
public class IssueProjectCategory implements Serializable {
private static final long serialVersionUID = -2226298165882293959L;
private String issueId;
private String projectId;
}

63
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectAnalysisResultDTO.java

@ -0,0 +1,63 @@
package com.epmet.dataaggre.dto.govproject.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 赋能平台项目处理分析研判分析-接口返参
* @Auth sun
*/
@Data
public class ProjectAnalysisResultDTO implements Serializable {
private static final long serialVersionUID = 6188316867855643263L;
//小程序居民Id
private String userId;
//负能平台居民Id
private String icUserId;
//负能平台居民名称
private String icUserName;
//家庭里人员集合
private List<Home> homeUserList = new ArrayList<>();
//楼院小组下分类项目列表
private List<Category> groupProjectList = new ArrayList<>();
//事件上报下分类项目列表
private List<Category> eventProjectList = new ArrayList<>();
@Data
public static class Home {
//家庭Id
private String homeId;
//居民Id
private String icUserId;
//居民姓名
private String icUserName;
}
@Data
public static class Category {
//一级分类Id
private String categoryCode;
//一级分类名称
private String categoryName;
//分类下项目列表【创建时间倒序】
private List<Project> projectList = new ArrayList<>();
}
@Data
public static class Project {
//项目Id
private String projectId;
//项目标题
private String title;
//状态:待处理 pending,结案closed
private String status;
}
}

33
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.dataaggre.dto.govproject.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author sun
* @dscription
*/
@NoArgsConstructor
@Data
public class ProjectCategoryResultDTO implements Serializable {
private static final long serialVersionUID = 3217246702883400582L;
/**
* 项目ID
*/
private String projectId;
/**
* 项目标题
*/
private String title;
/**
* 项目状态
*/
private String status;
/**
* 二级分类Code
*/
private String categoryCode;
}

26
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java

@ -0,0 +1,26 @@
package com.epmet.dataaggre.dto.govproject.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 赋能平台项目分类分析各分类项目数图表-接口返参
* @Auth sun
*/
@Data
public class ProjectCategoryTotalResultDTO implements Serializable {
private static final long serialVersionUID = 6188316867855643263L;
//组织Id
private String agencyId;
//一级分类Code
private String categoryCode;
//一级分类名称
private String categoryName;
//一级分类颜色
private String color = "";
//分类下项目总数
private Integer total = 0;
}

4
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java

@ -13,8 +13,8 @@ public class ProjectMonthIncrResultDTO implements Serializable {
private static final long serialVersionUID = 6188316867855643263L;
//横坐标值
private String value;
private Integer value = 0;
//横坐标
private Integer type;
private String type;
}

10
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java

@ -17,12 +17,14 @@ public class ProjectStatusListResultDTO implements Serializable {
//项目Id
private String projectId;
//来源:议题issue 项目立项:agency 事件:resi_event
private Integer origin;
private String origin;
//状态:待处理 pending,结案closed
private Integer status;
private String status;
//经度
private Integer longitude;
private String longitude;
//纬度
private Integer dimension;
private String latitude;
//项目标题
private String title;
}

14
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectTotalResultDTO.java

@ -17,18 +17,18 @@ public class ProjectTotalResultDTO implements Serializable {
//日期yyyymmdd
private String dateId;
//项目总数
private Integer projectTotal;
private Integer projectTotal = 0;
//较昨日数
private Integer dateIncr;
private Integer dateIncr = 0;
//较上月数
private Integer monthIncr;
private Integer monthIncr = 0;
//未结案项目数
private Integer pendingTotal;
private Integer pendingTotal = 0;
//为结案项目占比 xx%
private String pendingRatio;
private String pendingRatio = "0%";
//已结案项目数
private Integer closedTotal;
private Integer closedTotal = 0;
//已结案项目占比
private String closedRatio;
private String closedRatio = "0%";
}

19
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/UserTopicPageFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dataaggre.dto.resigroup.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@Data
public class UserTopicPageFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
//@NotBlank(message = "epmetUserId不能为空" , groups = AddUserInternalGroup.class)
private List<String> epmetUserIdList;
@NotNull(message = "pageNo不能为空",groups = AddUserInternalGroup.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空",groups = AddUserInternalGroup.class)
private Integer pageSize;
}

22
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/UserTopicResDTO.java

@ -0,0 +1,22 @@
package com.epmet.dataaggre.dto.resigroup.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 个人分析发布话题分页列表
*/
@Data
public class UserTopicResDTO implements Serializable {
private String topicId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date releaseTime;
private String topicContent;
private Boolean shiftIssue;
private String issueId;
private Boolean shiftProject=false;
private String projectId="";
}

17
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java

@ -207,6 +207,15 @@ public class EpmetUserController {
return new Result<UserEventLogoResultDTO>().ok(epmetUserService.mentionMeEvent(tokenDto.getUserId()));
}
@GetMapping("export/staffpatroll")
public void export(@LoginUser TokenDto tokenDto, @RequestBody StaffListFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO, StaffListFormDTO.Staff.class);
formDTO.setUserId(tokenDto.getUserId());
//formDTO.setUserId("73ae6280e46a6653a5605d51d5462725");
List<StaffListResultDTO> resultDTOS = epmetUserService.staffPatrolList(formDTO);
ExcelUtils.exportExcelToTarget(response, null, resultDTOS, StaffPatrollExcel.class);
}
/**
* @Param formDTO
* @Description 通讯录姓名检索工作人员
@ -261,14 +270,6 @@ public class EpmetUserController {
return new Result<CustomerStaffResultDTO>().ok(epmetUserService.getStaffInfo(staffId));
}
@GetMapping("export/staffpatroll")
public void export(@LoginUser TokenDto tokenDto, @RequestBody StaffListFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO, StaffListFormDTO.Staff.class);
formDTO.setUserId(tokenDto.getUserId());
//formDTO.setUserId("73ae6280e46a6653a5605d51d5462725");
List<StaffListResultDTO> resultDTOS = epmetUserService.staffPatrolList(formDTO);
ExcelUtils.exportExcelToTarget(response, null, resultDTOS, StaffPatrollExcel.class);
}
/**
* @Param formDTO

51
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java

@ -6,17 +6,13 @@ import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectTotalResultDTO;
import com.epmet.dataaggre.dto.govproject.form.*;
import com.epmet.dataaggre.dto.govproject.result.*;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.LinkedList;
import java.util.List;
/**
@ -75,9 +71,9 @@ public class GovProjectController {
* @author sun
*/
@PostMapping("projectmonthincr")
public Result<List<ProjectMonthIncrResultDTO>> projectMonthIncr(@RequestBody ProjectTotalFormDTO formDTO) {
public Result<LinkedList<ProjectMonthIncrResultDTO>> projectMonthIncr(@RequestBody ProjectTotalFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ProjectTotalFormDTO.Monthincr.class);
return new Result<List<ProjectMonthIncrResultDTO>>().ok(govProjectService.projectMonthIncr(formDTO));
return new Result<LinkedList<ProjectMonthIncrResultDTO>>().ok(govProjectService.projectMonthIncr(formDTO));
}
/**
@ -85,9 +81,42 @@ public class GovProjectController {
* @author sun
*/
@PostMapping("projectstatuslist")
public Result<List<ProjectTotalResultDTO>> projectStatusList(@RequestBody ProjectTotalFormDTO formDTO) {
public Result<List<ProjectStatusListResultDTO>> projectStatusList(@RequestBody ProjectTotalFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ProjectTotalFormDTO.Statuslist.class);
return new Result<List<ProjectTotalResultDTO>>().ok(govProjectService.projectStatusList(formDTO));
return new Result<List<ProjectStatusListResultDTO>>().ok(govProjectService.projectStatusList(formDTO));
}
/**
* @Description 赋能平台项目分类分析各分类项目数图表
* @author sun
*/
@PostMapping("projectcategorylist")
public Result<List<ProjectCategoryTotalResultDTO>> projectCategoryList(@LoginUser TokenDto tokenDto, @RequestBody ProjectCategoryTotalFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ProjectCategoryTotalFormDTO.Project.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<ProjectCategoryTotalResultDTO>>().ok(govProjectService.projectCategoryList(formDTO));
}
/**
* @Description 赋能平台项目处理分析分类下项目列表
* @author sun
*/
@PostMapping("categoryprojectlist")
public Result<CategoryProjectResultDTO> categoryProjectList(@LoginUser TokenDto tokenDto, @RequestBody CategoryProjectFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CategoryProjectFormDTO.Category.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<CategoryProjectResultDTO>().ok(govProjectService.categoryProjectList(formDTO));
}
/**
* @Description 赋能平台项目处理分析研判分析
* @author sun
*/
@PostMapping("projectanalysis")
public Result<ProjectAnalysisResultDTO> projectAnalysis(@LoginUser TokenDto tokenDto, @RequestBody ProjectAnalysisFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ProjectAnalysisFormDTO.Analysis.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<ProjectAnalysisResultDTO>().ok(govProjectService.projectAnalysis(formDTO));
}
}

12
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java

@ -1,12 +1,15 @@
package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO;
import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO;
import com.epmet.dataaggre.dto.resigroup.result.UserTopicResDTO;
import com.epmet.dataaggre.service.resigroup.ResiGroupService;
import com.epmet.dto.form.PageUserReportEventFormDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -39,4 +42,13 @@ public class ResiGroupController {
return new Result<List<CandidateListResultDTO>>().ok(resiGroupService.candidateList(formDTO));
}
/**
* 数字赋能平台-个人分析发布话题分页列表
* @return
*/
@PostMapping("pageusertopic")
public Result<PageData<UserTopicResDTO>> pageUserTopic(@RequestBody PageUserReportEventFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PageUserReportEventFormDTO.AddUserInternalGroup.class);
return new Result<PageData<UserTopicResDTO>>().ok(resiGroupService.pageUserTopic(formDTO));
}
}

14
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java

@ -24,6 +24,8 @@ import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
@ -335,4 +337,16 @@ public interface DataStatsDao {
* @author sun
*/
List<CustomerDataManageResultDTO.CustomerDataManage> projectList(CustomerDataManageFormDTO formDTO);
/**
* @Description 分别查询组织下dateId较昨日较上月项目统计数据
* @author sun
*/
List<FactAgencyProjectResultDTO> getProjectTotal(ProjectTotalFormDTO formDTO);
/**
* @Description 查询dateId的上一月过去12个月份组织项目数据
* @author sun
*/
List<FactAgencyProjectMonthResultDTO> getProjectMonthIncr(ProjectTotalFormDTO formDTO);
}

49
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java

@ -0,0 +1,49 @@
/**
* 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.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity;
import com.epmet.dto.IcResiUserDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户基础信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-26
*/
@Mapper
public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
/**
* @Description 根据身份证号查询负能平台用户信息
* @author sun
*/
IcResiUserDTO getIcResiUser(@Param("idCard") String idCard, @Param("customerId") String customerId);
/**
* @Description 查询人员的家庭成员数据
* @author sun
*/
List<ProjectAnalysisResultDTO.Home> getHomeUserList(@Param("homeId") String homeId, @Param("icUserId") String icUserId);
}

6
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java

@ -20,6 +20,7 @@ package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO;
import com.epmet.dataaggre.entity.epmetuser.UserBaseInfoEntity;
import com.epmet.dto.UserBaseInfoDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -50,4 +51,9 @@ public interface UserBaseInfoDao extends BaseDao<UserBaseInfoEntity> {
*/
List<String> selectUserIdByCustomerId(@Param("userIds") List<String> userIds);
/**
* @Description 查询userId的身份证号在小程序用户中存在的多个userId值
* @author sun
*/
List<UserBaseInfoDTO> getUserBaseList(@Param("userId") String userId, @Param("customerId") String customerId);
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java

@ -21,6 +21,8 @@ import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -103,4 +105,10 @@ public interface EvaluationIndexDao {
*/
String selectAgencyNameByAgencyId(@Param("agencyId")String agencyId);
/**
* @Description 按dateId查询组织下一级分类项目总数统计
* @author sun
*/
List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.govissue;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO;
import com.epmet.dataaggre.dto.govissue.form.VotingIssueListFormDTO;
@ -74,4 +75,10 @@ public interface IssueDao extends BaseDao<IssueEntity> {
Integer selectIssueCount(@Param("gridIds") List<String> gridIds,@Param("issueType")String issueType);
List<IssueInfoDTO> selectShiftProjectIssueList(@Param("customerId") String customerId, @Param("gridId") String gridId);
/**
* @Description 查询客户下分类信息
* @author sun
**/
List<IssueProjectCategoryDictDTO> getCategoryList(@Param("customerId") String customerId, @Param("level") String level, @Param("isDisable") String isDisable);
}

49
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java

@ -20,10 +20,14 @@ package com.epmet.dataaggre.dao.govproject;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
import com.epmet.dataaggre.dto.govproject.ProjectDTO;
import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO;
import com.epmet.dataaggre.dto.govproject.ResiEventDTO;
import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO;
import com.epmet.dataaggre.dto.govproject.form.CategoryProjectFormDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.*;
import com.epmet.dataaggre.entity.govproject.ProjectEntity;
import com.epmet.dto.ProjectCategoryDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -70,4 +74,45 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
List<ProjectDistributionResultDTO> selectList(@Param("customerId") String customerId,@Param("list")List<String> issueIds);
int countRedDot(String userId);
/**
* @Description 查询组织下截止到dateId的某个状态的项目列表
* @author sun
*/
List<ProjectStatusListResultDTO> getProjectStatusList(ProjectTotalFormDTO formDTO);
List<IssueProjectCategory> selectProjectIssueCategory(@Param("issueIds") List<String> issueIds);
/**
* @Description 查询组织截止某一天的某个分类下的项目列表
* @author sun
*/
List<CategoryProjectResultDTO.Project> categoryProjectList(CategoryProjectFormDTO formDTO);
/**
* @Description 查询项目对应的所有分类信息
* @author sun
*/
List<CategoryProjectResultDTO.Project> getCategoryList(@Param("projectIds") List<String> projectIds);
/**
* @Description 查询来源事件的项目居民端创建人信息
* @author sun
*/
List<ResiEventDTO> getEventList(@Param("projectIds") List<String> projectIds);
/**
* @Description 查询来源话题的项目居民端创建人信息
* @author sun
*/
List<ProjectRelatedPersonnelDTO> getTopicUser(@Param("projectIds") List<String> projectIds);
/**
* @Description 根据项目来源查询不同分类不同创建人下的分类项目
* @author sun
*/
List<ProjectCategoryResultDTO> getProjectCategoryList(@Param("customerId") String customerId,
@Param("secondCodeList") List<String> secondCodeList,
@Param("userIds") List<String> userIds,
@Param("origin") String origin);
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java

@ -19,7 +19,9 @@ package com.epmet.dataaggre.dao.resigroup;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO;
import com.epmet.dataaggre.dto.resigroup.result.UserTopicResDTO;
import com.epmet.dataaggre.entity.resigroup.ResiTopicEntity;
import com.epmet.dto.form.PageUserReportEventFormDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -35,4 +37,12 @@ import java.util.List;
public interface ResiTopicDao extends BaseDao<ResiTopicEntity> {
List<ResiTopicDTO> selectTopicInfoByIds(@Param("list") List<String> topicIds);
/**
* 数据分析-个人档案-发布话题列表
*
* @param formDTO
* @return
*/
List<UserTopicResDTO> selectListTopic(PageUserReportEventFormDTO formDTO);
}

493
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java

@ -0,0 +1,493 @@
/**
* 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.dataaggre.entity.epmetuser;
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-26
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_user")
public class IcResiUserEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
*
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 网格ID
*/
private String gridId;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 单元id
*/
private String unitId;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 是否本地户籍
*/
private String isBdhj;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
/**
* 出生日期
*/
private String birthday;
/**
* 备注
*/
private String remarks;
/**
* 联系人
*/
private String contacts;
/**
* 联系人电话
*/
private String contactsMobile;
/**
* 九小场所url
*/
private String ninePlace;
/**
* 是否党员
*/
private String isParty;
/**
* 是否低保户
*/
private String isDbh;
/**
* 是否保障房
*/
private String isEnsureHouse;
/**
* 是否失业
*/
private String isUnemployed;
/**
* 是否育龄妇女
*/
private String isYlfn;
/**
* 是否退役军人
*/
private String isVeterans;
/**
* 是否统战人员
*/
private String isUnitedFront;
/**
* 是否信访人员
*/
private String isXfry;
/**
* 是否志愿者
*/
private String isVolunteer;
/**
* 是否老年人
*/
private String isOldPeople;
/**
* 是否空巢
*/
private String isKc;
/**
* 是否失独
*/
private String isSd;
/**
* 是否失能
*/
private String isSn;
/**
* 是否失智
*/
private String isSz;
/**
* 是否残疾
*/
private String isCj;
/**
* 是否大病
*/
private String isDb;
/**
* 是否慢病
*/
private String isMb;
/**
* 是否特殊人群
*/
private String isSpecial;
/**
* 文化程度字典表
*/
private String culture;
/**
* 文化程度备注
*/
private String cultureRemakes;
/**
* 特长字典表
*/
private String specialSkill;
/**
* 兴趣爱好
*/
private String hobby;
/**
* 兴趣爱好备注
*/
private String hobbyRemakes;
/**
* 宗教信仰
*/
private String faith;
/**
* 宗教信仰备注
*/
private String faithRemakes;
/**
* 残疾类别字典表
*/
private String cjlb;
/**
* 残疾登记(状况)字典表
*/
private String cjzk;
/**
* 残疾证号
*/
private String cjzh;
/**
* 残疾说明
*/
private String cjsm;
/**
* 有无监护人yes no
*/
private String ynJdr;
/**
* 有无技能特长yes no
*/
private String ynJntc;
/**
* 有无劳动能力
*/
private String ynLdnl;
/**
* 有无非义务教育阶段助学yes no
*/
private String ynFywjyjdzx;
/**
* 所患大病
*/
private String shdb;
/**
* 患大病时间
*/
private String dbsj;
/**
* 所患慢性病
*/
private String shmxb;
/**
* 患慢性病时间
*/
private String mxbsj;
/**
* 是否参保
*/
private String isCb;
/**
* 自付金额
*/
private String zfje;
/**
* 救助金额
*/
private String jzje;
/**
* 救助时间[yyyy-MM-dd]
*/
private String jzsj;
/**
* 享受救助明细序号
*/
private String jzmxxh;
/**
* 健康信息备注
*/
private String healthRemakes;
/**
* 工作单位
*/
private String gzdw;
/**
* 职业
*/
private String zy;
/**
* 离退休时间
*/
private String ltxsj;
/**
* 工作信息备注
*/
private String workRemake;
/**
* 退休金额
*/
private String txje;
/**
* 月收入
*/
private String ysr;
/**
* 籍贯
*/
private String jg;
/**
* 户籍所在地
*/
private String hjszd;
/**
* 现居住地
*/
private String xjzd;
/**
* 人户情况
*/
private String rhzk;
/**
* 居住信息备注
*/
private String jzxxRemakes;
/**
* 民族字典表
*/
private String mz;
/**
* 与户主关系字典表
*/
private String yhzgx;
/**
* 居住情况字典表
*/
private String jzqk;
/**
* 婚姻状况字典表
*/
private String hyzk;
/**
* 配偶情况字典表
*/
private String poqk;
/**
* 有无赡养人
*/
private String ynSyr;
/**
* 与赡养人关系字典表
*/
private String ysyrgx;
/**
* 赡养人电话
*/
private String syrMobile;
/**
* 家庭信息备注
*/
private String jtxxRemakes;
/**
* 预留字段1
*/
private String field1;
/**
* 预留字段2
*/
private String field2;
/**
* 预留字段3
*/
private String field3;
/**
* 预留字段4
*/
private String field4;
/**
* 预留字段5
*/
private String field5;
/**
* 预留字段6
*/
private String field6;
/**
* 预留字段7
*/
private String field7;
/**
* 预留字段8
*/
private String field8;
/**
* 预留字段9
*/
private String field9;
/**
* 预留字段10
*/
private String field10;
}

13
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java

@ -6,6 +6,8 @@ import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
@ -247,4 +249,15 @@ public interface DataStatsService {
*/
CustomerDataManageResultDTO operateExport(CustomerDataManageFormDTO formDTO) throws ParseException;
/**
* @Description 分别查询组织下dateId较昨日较上月项目统计数据
* @author sun
*/
List<FactAgencyProjectResultDTO> getProjectTotal(ProjectTotalFormDTO formDTO);
/**
* @Description 查询dateId的上一月过去12个月份组织项目数据
* @author sun
*/
List<FactAgencyProjectMonthResultDTO> getProjectMonthIncr(ProjectTotalFormDTO formDTO);
}

22
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -23,7 +23,9 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity;
@ -2121,5 +2123,23 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultDTO;
}
/**
* @Description 分别查询组织下dateId较昨日较上月项目统计数据
* @author sun
*/
@Override
public List<FactAgencyProjectResultDTO> getProjectTotal(ProjectTotalFormDTO formDTO) {
return dataStatsDao.getProjectTotal(formDTO);
}
/**
* @Description 查询dateId的上一月过去12个月份组织项目数据
* @author sun
*/
@Override
public List<FactAgencyProjectMonthResultDTO> getProjectMonthIncr(ProjectTotalFormDTO formDTO) {
return dataStatsDao.getProjectMonthIncr(formDTO);
}
}

23
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -1,12 +1,13 @@
package com.epmet.dataaggre.service.epmetuser;
import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO;
import com.epmet.dataaggre.dto.epmetuser.form.*;
import com.epmet.dataaggre.dto.epmetuser.form.*;
import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
import java.util.List;
@ -148,4 +149,22 @@ public interface EpmetUserService {
* @author sun
*/
StaffDetailV2FormDTO selectByStaffId(String staffId);
/**
* @Description 查询userId的身份证号在小程序用户中存在的多个userId值
* @author sun
*/
List<UserBaseInfoDTO> getUserBaseList(String userId, String customerId);
/**
* @Description 根据身份证号查询负能平台用户信息
* @author sun
*/
IcResiUserDTO getIcResiUser(String idNum, String customerId);
/**
* @Description 查询人员的家庭成员数据
* @author sun
*/
List<ProjectAnalysisResultDTO.Home> getHomeUserList(String homeId, String icUserId);
}

32
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -26,6 +26,7 @@ import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity;
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity;
@ -36,6 +37,8 @@ import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService;
import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.result.StaffRoleResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -79,6 +82,8 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private DataStatsService dataStatsService;
@Resource
private GovStaffRoleDao govStaffRoleDao;
@Resource
private IcResiUserDao icResiUserDao;
/**
* @Description 根据UserIds查询
@ -703,5 +708,32 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return result;
}
/**
* @Description 查询userId的身份证号在小程序用户中存在的多个userId值
* @author sun
*/
@Override
public List<UserBaseInfoDTO> getUserBaseList(String userId, String customerId) {
return userBaseInfoDao.getUserBaseList(userId, customerId);
}
/**
* @Description 根据身份证号查询负能平台用户信息
* @author sun
*/
@Override
public IcResiUserDTO getIcResiUser(String idNum, String customerId) {
return icResiUserDao.getIcResiUser(idNum, customerId);
}
/**
* @Description 查询人员的家庭成员数据
* @author sun
*/
@Override
public List<ProjectAnalysisResultDTO.Home> getHomeUserList(String homeId, String icUserId) {
return icResiUserDao.getHomeUserList(homeId, icUserId);
}
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java

@ -6,6 +6,8 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO;
import java.util.List;
@ -86,4 +88,9 @@ public interface EvaluationIndexService {
*/
ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String agencyId);
/**
* @Description 按dateId查询组织下一级分类项目总数统计
* @author sun
*/
List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO);
}

11
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java

@ -11,6 +11,8 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import lombok.extern.slf4j.Slf4j;
@ -206,4 +208,13 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
return resultDTO;
}
/**
* @Description 按dateId查询组织下一级分类项目总数统计
* @author sun
*/
@Override
public List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO) {
return evaluationIndexDao.projectCategoryList(formDTO);
}
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java

@ -1,6 +1,7 @@
package com.epmet.dataaggre.service.govissue;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.form.AllIssueFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO;
@ -45,4 +46,10 @@ public interface GovIssueService {
List<ClosedIssueListResultDTO> closedIssueList(ClosedIssueListFormDTO fromDTO);
List<IssueInfoDTO> selectShiftProjectIssueList(String customerId,String gridId,Integer pageNo,Integer pageSize);
/**
* @Description 查询客户下分类信息
* @author sun
**/
List<IssueProjectCategoryDictDTO> categoryList(String customerId, String level, String isDisable);
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java

@ -8,6 +8,7 @@ import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.constant.IssueConstant;
import com.epmet.dataaggre.dao.govissue.IssueApplicationDao;
import com.epmet.dataaggre.dao.govissue.IssueDao;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.form.AllIssueFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO;
@ -323,4 +324,13 @@ public class GovIssueServiceImpl implements GovIssueService {
return issueDao.selectShiftProjectIssueList(customerId, gridId);
}
/**
* @Description 查询客户下一级分类信息
* @author sun
**/
@Override
public List<IssueProjectCategoryDictDTO> categoryList(String customerId, String level, String isDisable) {
return issueDao.getCategoryList(customerId, level, isDisable);
}
}

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

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

36
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java

@ -1,12 +1,12 @@
package com.epmet.dataaggre.service.govproject;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.form.*;
import com.epmet.dataaggre.dto.govproject.result.*;
import java.util.LinkedList;
import java.util.List;
/**
@ -61,11 +61,37 @@ public interface GovProjectService {
* @Description 赋能平台项目处理分析进12月新增项目折线图
* @author sun
*/
List<ProjectMonthIncrResultDTO> projectMonthIncr(ProjectTotalFormDTO formDTO);
LinkedList<ProjectMonthIncrResultDTO> projectMonthIncr(ProjectTotalFormDTO formDTO);
/**
* @Description 赋能平台项目处理分析按状态查询项目列表
* @author sun
*/
List<ProjectTotalResultDTO> projectStatusList(ProjectTotalFormDTO formDTO);
List<ProjectStatusListResultDTO> projectStatusList(ProjectTotalFormDTO formDTO);
/**
* @Description 赋能平台项目分类分析各分类项目数图表
* @author sun
*/
List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO);
/**
* @Description 赋能平台项目处理分析分类下项目列表
* @author sun
*/
CategoryProjectResultDTO categoryProjectList(CategoryProjectFormDTO formDTO);
/**
* @Description 赋能平台项目处理分析研判分析
* @author sun
*/
ProjectAnalysisResultDTO projectAnalysis(ProjectAnalysisFormDTO formDTO);
/**
* 找出这些议题中对应的项目id,以及项目对应的一级分类编码
*
* @param issueIds
* @return
*/
List<IssueProjectCategory> getIssueProjectFirstCategory(List<String> issueIds);
}

317
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -5,25 +5,37 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.constant.ProjectConstant;
import com.epmet.dataaggre.dao.govproject.ProjectDao;
import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectMonthResultDTO;
import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectResultDTO;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO;
import com.epmet.dataaggre.dto.govproject.ProjectDTO;
import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO;
import com.epmet.dataaggre.dto.govproject.ResiEventDTO;
import com.epmet.dataaggre.dto.govproject.form.*;
import com.epmet.dataaggre.dto.govproject.result.*;
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.govissue.GovIssueService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dataaggre.service.resigroup.ResiGroupService;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.form.TimestampIntervalFormDTO;
import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -52,6 +64,12 @@ public class GovProjectServiceImpl implements GovProjectService {
private GovIssueService govIssueService;
@Autowired
private ResiGroupService resiGroupService;
@Autowired
private DataStatsService dataStatsService;
@Autowired
private EvaluationIndexService evaluationIndexService;
@Autowired
private EpmetUserService epmetUserService;
/**
* @Description 查询项目信息
@ -251,7 +269,40 @@ public class GovProjectServiceImpl implements GovProjectService {
*/
@Override
public ProjectTotalResultDTO projectTotal(ProjectTotalFormDTO formDTO) {
return null;
ProjectTotalResultDTO result = new ProjectTotalResultDTO();
result.setAgencyId(formDTO.getAgencyId());
result.setDateId(formDTO.getDateId());
//较昨日dateId值
formDTO.setYeDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", -1));
//较上月monthId值
formDTO.setMonthId(DateUtils.dateOrmonthId(formDTO.getDateId(), "month", -1));
//1.分别查询组织下dateId、较昨日、较上月项目统计数据
List<FactAgencyProjectResultDTO> list = dataStatsService.getProjectTotal(formDTO);
if (CollectionUtils.isEmpty(list) || !formDTO.getDateId().equals(list.get(0).getDateId())) {
return result;
}
//2.封装数据
list.forEach(l -> {
if (formDTO.getDateId().equals(l.getDateId())) {
result.setProjectTotal(l.getProjectTotal());
result.setPendingTotal(l.getPendingTotal());
result.setPendingRatio(l.getPendingRatio());
result.setClosedTotal(l.getClosedTotal());
result.setClosedRatio(l.getClosedRatio());
//默认较昨日较上个月增长值就是当前日期的数据
result.setDateIncr(l.getProjectTotal());
result.setMonthIncr(l.getProjectTotal());
}
if (formDTO.getYeDateId().equals(l.getDateId())) {
result.setDateIncr(result.getProjectTotal() - l.getProjectTotal());
} else if (formDTO.getMonthId().equals(l.getMonthId())) {
result.setMonthIncr(result.getProjectTotal() - l.getProjectTotal());
}
});
return result;
}
/**
@ -259,8 +310,30 @@ public class GovProjectServiceImpl implements GovProjectService {
* @author sun
*/
@Override
public List<ProjectMonthIncrResultDTO> projectMonthIncr(ProjectTotalFormDTO formDTO) {
return null;
public LinkedList<ProjectMonthIncrResultDTO> projectMonthIncr(ProjectTotalFormDTO formDTO) {
LinkedList<ProjectMonthIncrResultDTO> resultList = new LinkedList<>();
//1.获取起始终止月份值
LinkedHashMap<String, String> map = DateUtils.getXproSub(formDTO.getDateId());
List<String> monthIdList = map.keySet().stream().collect(Collectors.toList());
formDTO.setStartMonth(monthIdList.get(NumConstant.ZERO));
formDTO.setEndMonth(monthIdList.get(NumConstant.ELEVEN));
//2.查询dateId的上一月过去12个月份数据【2021-12-08 数据是202012到202111的数据】
List<FactAgencyProjectMonthResultDTO> list = dataStatsService.getProjectMonthIncr(formDTO);
//3.封装数据并返回
map.forEach((k, v) -> {
ProjectMonthIncrResultDTO dto = new ProjectMonthIncrResultDTO();
dto.setType(v);
list.forEach(l -> {
if (k.equals(l.getMonthId())) {
dto.setValue(l.getProjectIncr());
}
});
resultList.add(dto);
});
return resultList;
}
/**
@ -268,8 +341,236 @@ public class GovProjectServiceImpl implements GovProjectService {
* @author sun
*/
@Override
public List<ProjectTotalResultDTO> projectStatusList(ProjectTotalFormDTO formDTO) {
return null;
public List<ProjectStatusListResultDTO> projectStatusList(ProjectTotalFormDTO formDTO) {
//所选日期后一天的dateId值
formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1));
//1.查询组织下截止到dateId的某个状态的项目列表
List<ProjectStatusListResultDTO> resultList = projectDao.getProjectStatusList(formDTO);
return resultList;
}
/**
* @Description 赋能平台项目分类分析各分类项目数图表
, * @author sun
*/
@Override
public List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO) {
List<ProjectCategoryTotalResultDTO> resultList = new ArrayList<>();
//1.查询客户下一级分类信息
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), "1", "enable");
//2.按dateId查询组织下一级分类项目总数
List<ProjectCategoryTotalResultDTO> list = evaluationIndexService.projectCategoryList(formDTO);
//3.封装数据并返回
//有数据的排在前边,没数据的按分类顺序排在后边
Map<String, String> map = new HashMap<>();
list.forEach(l -> {
ProjectCategoryTotalResultDTO dto = new ProjectCategoryTotalResultDTO();
dto.setAgencyId(formDTO.getAgencyId());
dto.setTotal(l.getTotal());
categoryList.forEach(ca -> {
if (ca.getCategoryCode().equals(l.getCategoryCode())) {
dto.setCategoryCode(ca.getCategoryCode());
dto.setCategoryName(ca.getCategoryName());
dto.setColor(ca.getColor());
}
});
map.put(l.getCategoryCode(), l.getCategoryCode());
resultList.add(dto);
});
categoryList.forEach(ca -> {
if (!map.containsKey(ca.getCategoryCode())) {
ProjectCategoryTotalResultDTO dto = new ProjectCategoryTotalResultDTO();
dto.setAgencyId(formDTO.getAgencyId());
dto.setCategoryCode(ca.getCategoryCode());
dto.setCategoryName(ca.getCategoryName());
dto.setColor(ca.getColor());
resultList.add(dto);
map.put(ca.getCategoryCode(), ca.getCategoryCode());
}
});
return resultList;
}
/**
* @Description 赋能平台项目处理分析分类下项目列表
* @author sun
*/
@Override
public CategoryProjectResultDTO categoryProjectList(CategoryProjectFormDTO formDTO) {
CategoryProjectResultDTO resultDTO = new CategoryProjectResultDTO();
//所选日期后一天的dateId值
formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1));
//1.查询客户下分类信息
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null);
List<String> categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(m -> m.getCategoryCode()).collect(Collectors.toList());
formDTO.setCategoreCodeList(categoreCodeList);
//2.查询组织及下级截止某一天的某个一级分类下的项目列表
PageInfo<CategoryProjectResultDTO.Project> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> projectDao.categoryProjectList(formDTO));
if (org.springframework.util.CollectionUtils.isEmpty(result.getList())) {
return resultDTO;
}
resultDTO.setTotal((int) result.getTotal());
//3.查询已有项目列表涉及的所有分类信息【一个项目存在多个一级分类下的二级分类】
List<String> projectIds = result.getList().stream().map(CategoryProjectResultDTO.Project::getProjectId).collect(Collectors.toList());
List<CategoryProjectResultDTO.Project> list = projectDao.getCategoryList(projectIds);
//4.查询网格信息【楼院小组类项目、上报事件且上报给网格的项目才存在网格Id】
List<String> gridIds = result.getList().stream().map(CategoryProjectResultDTO.Project::getGridId).collect(Collectors.toList());
gridIds = gridIds.stream().distinct().collect(Collectors.toList());
List<GridsInfoListResultDTO> gridList = govOrgService.gridListByIds(gridIds);
//5.查询来源议题、事件的项目居民端创建人userId
List<ResiEventDTO> eventUser = projectDao.getEventList(projectIds);
List<ProjectRelatedPersonnelDTO> topicUser = projectDao.getTopicUser(projectIds);
//5.封装数据
result.getList().forEach(re -> {
//项目涉及网格信息
gridList.forEach(g -> {
if (StringUtils.isNotBlank(re.getGridId()) && re.getGridId().equals(g.getGridId())) {
re.setGridName(g.getName());
}
});
//项目涉及分类信息【一个项目涉及多个一级分类】
//一级分类Id
List<String> caId = new ArrayList<>();
list.forEach(ca -> {
if (ca.getProjectId().equals(re.getProjectId())) {
caId.add(ca.getCategoryPids());
}
});
//一级分类名称、code集合
List<String> caName = new ArrayList<>();
List<String> caCode = new ArrayList<>();
categoryList.forEach(ca -> caId.stream().filter(li -> ca.getId().equals(li)).forEach(s -> {
caName.add(ca.getCategoryName());
caCode.add(ca.getCategoryCode());
}));
re.setCategoryNames(caName);
re.setCategoryCodes(caCode);
//项目来源话题、事件的创建人信息
eventUser.forEach(ev -> {
if (re.getProjectId().equals(ev.getProjectId())) {
re.setUserId(ev.getReportUserId());
}
});
topicUser.forEach(to -> {
if (re.getProjectId().equals(to.getProjectId())) {
re.setUserId(to.getUserId());
}
});
});
resultDTO.setList(result.getList());
return resultDTO;
}
/**
* @Description 赋能平台项目处理分析研判分析
* @author sun
*/
@Override
public ProjectAnalysisResultDTO projectAnalysis(ProjectAnalysisFormDTO formDTO) {
ProjectAnalysisResultDTO resultDTO = new ProjectAnalysisResultDTO();
resultDTO.setUserId(formDTO.getUserId());
//1.查询userId的身份证号在小程序用户中存在的多个userId值
List<UserBaseInfoDTO> userList = epmetUserService.getUserBaseList(formDTO.getUserId(), formDTO.getCustomerId());
List<String> userIds = userList.stream().map(UserBaseInfoDTO::getUserId).collect(Collectors.toList());
//2.查询对应负能平台用户家庭信息
if (!org.springframework.util.CollectionUtils.isEmpty(userList)) {
//2-1.根据身份证号查询负能平台用户信息
IcResiUserDTO icResiUserDTO = epmetUserService.getIcResiUser(userList.get(0).getIdNum(), formDTO.getCustomerId());
resultDTO.setIcUserId(icResiUserDTO.getId());
resultDTO.setIcUserName(icResiUserDTO.getName());
if (null != icResiUserDTO) {
//2-2.查询人员的家庭成员数据
List<ProjectAnalysisResultDTO.Home> homeList = epmetUserService.getHomeUserList(icResiUserDTO.getHomeId(), icResiUserDTO.getId());
resultDTO.setHomeUserList(homeList);
}
}
if (org.springframework.util.CollectionUtils.isEmpty(userIds)) {
userIds = new ArrayList<>();
userIds.add(formDTO.getUserId());
}
//3.查询一级分类数据
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null);
List<String> secondCodeList = formDTO.getCategoryCodeList().stream().flatMap(code -> categoryList.stream().filter(ca -> code.equals(ca.getParentCategoryCode())).map(second -> {
return second.getCategoryCode();
})).collect(Collectors.toList());
//4.根据userId集合和二级分类Code集合查询来源楼院小组的项目
List<ProjectCategoryResultDTO> groupList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "issue");
//5.根据userId集合和二级分类Code集合查询来源事件上报的项目
List<ProjectCategoryResultDTO> eventList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "resiEvent");
//6.封装数据
//楼院小组下分类项目列表
List<ProjectAnalysisResultDTO.Category> groupProjectList = new ArrayList<>();
//事件上报下分类项目列表
List<ProjectAnalysisResultDTO.Category> eventProjectList = new ArrayList<>();
formDTO.getCategoryCodeList().forEach(code -> {
//一级分类code下的二级分类code集合
Map<String, String> secondCodeMap = new HashMap<>();
//来源楼院小组的分类及项目列表
ProjectAnalysisResultDTO.Category groupCa = new ProjectAnalysisResultDTO.Category();
List<ProjectAnalysisResultDTO.Project> groupPrList = new ArrayList<>();
//来源事件上报的分类及项目列表
ProjectAnalysisResultDTO.Category eventCa = new ProjectAnalysisResultDTO.Category();
List<ProjectAnalysisResultDTO.Project> eventPrList = new ArrayList<>();
categoryList.forEach(ca -> {
groupCa.setCategoryCode(code);
eventCa.setCategoryCode(code);
if (code.equals(ca.getCategoryCode())) {
groupCa.setCategoryName(ca.getCategoryName());
eventCa.setCategoryName(ca.getCategoryName());
}
if (code.equals(ca.getParentCategoryCode())) {
secondCodeMap.put(ca.getCategoryCode(), ca.getCategoryCode());
}
});
//当前分类下来源楼院小组的项目
groupList.forEach(gr -> {
if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) {
ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class);
groupPrList.add(project);
}
});
groupCa.setProjectList(groupPrList);
groupProjectList.add(groupCa);
//当前分类下来源事件上报的项目
eventList.forEach(gr -> {
if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) {
ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class);
eventPrList.add(project);
}
});
eventCa.setProjectList(eventPrList);
eventProjectList.add(eventCa);
});
resultDTO.setGroupProjectList(groupProjectList);
resultDTO.setEventProjectList(eventProjectList);
return resultDTO;
}
/**
* 找出这些议题中对应的项目id,以及项目对应的一级分类编码
*
* @param issueIds
* @return
*/
@Override
public List<IssueProjectCategory> getIssueProjectFirstCategory(List<String> issueIds) {
return projectDao.selectProjectIssueCategory(issueIds);
}
}

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java

@ -1,9 +1,11 @@
package com.epmet.dataaggre.service.resigroup;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO;
import com.epmet.dataaggre.dto.resigroup.form.*;
import com.epmet.dataaggre.dto.resigroup.result.*;
import com.epmet.dto.form.PageUserReportEventFormDTO;
import java.util.List;
@ -61,4 +63,11 @@ public interface ResiGroupService {
* @return com.epmet.dataaggre.dto.resigroup.result.GroupActRankResultDTO
*/
List<GroupActRankResultDTO> querySubRankList(GroupActRankFormDTO formDTO);
/**
* 分页查询我发布的话题
* @param formDTO
* @return
*/
PageData<UserTopicResDTO> pageUserTopic(PageUserReportEventFormDTO formDTO);
}

47
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java

@ -3,12 +3,15 @@ package com.epmet.dataaggre.service.resigroup.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.resigroup.ResiGroupDao;
import com.epmet.dataaggre.dao.resigroup.ResiTopicDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO;
import com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO;
import com.epmet.dataaggre.dto.resigroup.form.*;
@ -18,7 +21,9 @@ import com.epmet.dataaggre.redis.ResiGroupRedis;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dataaggre.service.resigroup.ResiGroupService;
import com.epmet.dto.form.PageUserReportEventFormDTO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -27,10 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -53,6 +55,8 @@ public class ResiGroupServiceImpl implements ResiGroupService {
private DataStatsService dataStatsService;
@Autowired
private GovOrgService govOrgService;
@Autowired
private GovProjectService govProjectService;
@Override
public List<ResiTopicDTO> selectTopicInfoByIds(List<String> topicIds) {
@ -358,4 +362,39 @@ public class ResiGroupServiceImpl implements ResiGroupService {
}
return resultDTOList;
}
/**
* 数据分析-个人档案-发布话题列表
*
* @param formDTO
* @return
*/
@Override
public PageData<UserTopicResDTO> pageUserTopic(PageUserReportEventFormDTO formDTO) {
if (org.apache.commons.collections4.CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())) {
return new PageData<UserTopicResDTO>(new ArrayList<>(), NumConstant.ZERO);
}
PageInfo<UserTopicResDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> resiTopicDao.selectListTopic(formDTO));
List<UserTopicResDTO> list =pageInfo.getList();
//根据议题id查询出每个议题对应的项目id,以及项目分类编码
List<String> issueIds=list.stream().filter(dto -> StringUtils.isNotBlank(dto.getIssueId())).map(UserTopicResDTO::getIssueId).collect(Collectors.toList());
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(issueIds)){
List<IssueProjectCategory> categoryList= govProjectService.getIssueProjectFirstCategory(issueIds);
for(UserTopicResDTO topicResDTO :pageInfo.getList()){
topicResDTO.setShiftProject(false);
topicResDTO.setProjectId(StrConstant.EPMETY_STR);
for(IssueProjectCategory category:categoryList){
if(topicResDTO.getIssueId().equals(category.getIssueId())&&StringUtils.isNotBlank(category.getProjectId())){
topicResDTO.setShiftProject(true);
topicResDTO.setProjectId(category.getProjectId());
break;
}
}
}
}
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
}

62
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

@ -1045,4 +1045,66 @@
GROUP BY t.orgId
</select>
<select id="getProjectTotal" resultType="com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectResultDTO">
SELECT * FROM (
SELECT
agency_id,
date_id,
month_id,
project_total,
pending_total,
(case when pending_ratio is null then '0%' else CONCAT(FORMAT(pending_ratio*100,2),'%') end) pendingRatio,
closed_total,
(case when closed_ratio is null then '0%' else CONCAT(FORMAT(closed_ratio*100,2),'%') end) closedRatio
FROM fact_agency_project_daily
WHERE agency_id = #{agencyId}
AND date_id = #{dateId}
UNION ALL
SELECT
agency_id,
date_id,
month_id,
project_total,
pending_total,
(case when pending_ratio is null then '0%' else CONCAT(FORMAT(pending_ratio*100,2),'%') end) pendingRatio,
closed_total,
(case when closed_ratio is null then '0%' else CONCAT(FORMAT(closed_ratio*100,2),'%') end) closedRatio
FROM fact_agency_project_daily
WHERE agency_id = #{agencyId}
AND date_id = #{yeDateId}
UNION ALL
(
SELECT
agency_id,
date_id,
month_id,
project_total,
pending_total,
(case when pending_ratio is null then '0%' else CONCAT(FORMAT(pending_ratio*100,2),'%') end) pendingRatio,
closed_total,
(case when closed_ratio is null then '0%' else CONCAT(FORMAT(closed_ratio*100,2),'%') end) closedRatio
FROM fact_agency_project_daily
WHERE agency_id = #{agencyId}
AND month_id = #{monthId}
ORDER BY date_id DESC
LIMIT 1
)
) a
ORDER BY a.date_id DESC
</select>
<select id="getProjectMonthIncr" resultType="com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectMonthResultDTO">
SELECT
agency_id,
month_id,
project_incr
FROM
fact_agency_project_monthly
WHERE
agency_id = #{agencyId}
AND month_id &gt;= #{startMonth}
AND month_id <![CDATA[ <= ]]> #{endMonth}
ORDER BY month_id ASC
</select>
</mapper>

39
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

@ -0,0 +1,39 @@
<?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.dataaggre.dao.epmetuser.IcResiUserDao">
<select id="getIcResiUser" resultType="com.epmet.dto.IcResiUserDTO">
SELECT
id,
customer_id,
agency_id,
grid_id,
home_id,
name,
mobile,
gender,
id_card,
birthday
FROM
ic_resi_user
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND id_card = #{idCard}
</select>
<select id="getHomeUserList" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO$Home">
SELECT
id icUserId,
home_id homeId,
name icUserName
FROM
ic_resi_user
WHERE
del_flag = '0'
AND home_id = #{homeId}
ORDER BY id = #{icUserId} desc <!-- 指定某个人排在第一位 -->
</select>
</mapper>

12
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml

@ -38,4 +38,16 @@
</foreach>
)
</select>
<select id="getUserBaseList" resultType="com.epmet.dto.UserBaseInfoDTO">
SELECT
*
FROM
user_base_info
WHERE
del_flag = '0'
AND id_num = ( SELECT id_num FROM user_base_info WHERE user_id = #{userId})
AND customer_id = #{customerId}
</select>
</mapper>

14
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml

@ -182,4 +182,18 @@
AND DEL_FLAG = 0
</select>
<select id="projectCategoryList" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO">
SELECT
org_id agencyId,
category_code categoryCode,
project_total total
FROM
screen_project_category_org_daily
WHERE
`level` = '1'
AND org_id = #{agencyId}
AND date_id = #{dateId}
ORDER BY project_total DESC
</select>
</mapper>

16
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml

@ -124,4 +124,20 @@
</if>
order by i.SHIFTED_TIME desc
</select>
<select id="getCategoryList" resultType="com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO">
SELECT
*
FROM issue_project_category_dict
WHERE del_flag = 0
AND customer_id = #{customerId}
<if test="level != null and level.trim() != ''">
AND category_type = #{level}
</if>
<if test="isDisable != null and isDisable.trim() != ''">
AND is_disable = #{isDisable}
</if>
ORDER BY category_code
</select>
</mapper>

3
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml

@ -22,7 +22,8 @@
cg.grid_name,
CONCAT(ca.organization_name,'-',cg.grid_name)
) AS 'gridName',
cg.customer_id AS 'customerId'
cg.customer_id AS 'customerId',
cg.grid_name AS 'name'
FROM
customer_grid cg
INNER JOIN customer_agency ca ON cg.pid = ca.id

138
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

@ -155,4 +155,142 @@
AND rem.RED_DOT = '1'
AND rem.USER_ID = #{userId}
</select>
<select id="getProjectStatusList" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectStatusListResultDTO">
SELECT
agency_id agencyId,
id projectId,
origin origin,
`status` status,
locate_longitude longitude,
locate_dimension latitude,
title title
FROM
project
WHERE
del_flag = '0'
AND org_id_path LIKE CONCAT('%', #{agencyId}, '%')
AND `status` = #{status}
AND created_time <![CDATA[<]]> DATE_FORMAT(#{toDateId}, '%Y-%m-%d')
ORDER BY created_time DESC
</select>
<select id="categoryProjectList" resultType="com.epmet.dataaggre.dto.govproject.result.CategoryProjectResultDTO$Project">
SELECT
p.agency_id agencyId,
p.id projectId,
p.origin origin,
IFNULL(pc.grid_id, '') gridId,
p.`status` status,
p.title title,
p.created_time time
FROM
project p
INNER JOIN project_category pc ON p.id = pc.project_id
WHERE
p.del_flag = '0'
AND p.org_id_path LIKE CONCAT('%', #{agencyId}, '%')
AND p.created_time <![CDATA[<]]> DATE_FORMAT(#{toDateId}, '%Y-%m-%d')
<foreach collection="categoreCodeList" item="code" open="AND pc.category_code IN (" separator="," close=")">
#{code}
</foreach>
GROUP BY
pc.project_id
ORDER BY
p.created_time DESC
</select>
<select id="getCategoryList" resultType="com.epmet.dataaggre.dto.govproject.result.CategoryProjectResultDTO$Project">
SELECT
project_id projectId,
substring_index(category_pids, ',', 1) categoryPids, <!-- 目前分类只有两级,所以这个字段值其实就是一类的id值,后续上报上来的数据会存在多个 -->
category_code categoryCode
FROM
project_category
WHERE
del_flag = '0'
<foreach collection="projectIds" item="projectId" open="AND project_id IN (" separator="," close=")">
#{projectId}
</foreach>
GROUP BY
category_pids, project_id
ORDER BY project_id
</select>
<select id="getEventList" resultType="com.epmet.dataaggre.dto.govproject.ResiEventDTO">
SELECT
project_id projectId,
report_user_id reportUserId
FROM
resi_event
WHERE
DEL_FLAG = '0'
<foreach collection="projectIds" item="projectId" open="AND project_id IN (" separator="," close=")">
#{projectId}
</foreach>
</select>
<select id="getTopicUser" resultType="com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO">
SELECT
project_id projectId,
user_id userId
FROM
project_related_personnel
WHERE
del_flag = '0'
AND source_type = 'topic'
<foreach collection="projectIds" item="projectId" open="AND project_id IN (" separator="," close=")">
#{projectId}
</foreach>
</select>
<select id="selectProjectIssueCategory" parameterType="map" resultType="com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory">
SELECT
p.ORIGIN_ID AS issueId,
p.id AS projectId
FROM
project p
WHERE
p.DEL_FLAG = '0'
<foreach item="issueId" collection="issueIds" separator="OR" open="AND (" close=")" index="">
p.ORIGIN_ID = #{issueId}
</foreach>
</select>
<select id="getProjectCategoryList" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectCategoryResultDTO">
SELECT
p.id projectId,
p.title title,
p.`status` status,
pc.category_code categoryCode
FROM
project p
INNER JOIN project_category pc ON p.id = pc.project_id
<if test="origin != null and origin != '' and origin == 'issue'">
INNER JOIN project_related_personnel prp ON p.id = prp.project_id AND prp.source_type = 'topic'
</if>
<if test="origin != null and origin != '' and origin == 'resiEvent'">
INNER JOIN resi_event re ON p.ID = re.PROJECT_ID
</if>
WHERE
p.del_flag = '0'
AND p.customer_id = #{customerId}
AND p.origin = #{origin}
<foreach collection="secondCodeList" item="code" open="AND pc.category_code IN (" separator="," close=")">
#{code}
</foreach>
<if test="origin != null and origin != '' and origin == 'issue'">
<foreach collection="userIds" item="userId" open="AND prp.user_id IN (" separator="," close=")">
#{userId}
</foreach>
</if>
<if test="origin != null and origin != '' and origin == 'resiEvent'">
<foreach collection="userIds" item="userId" open="AND re.report_user_id IN (" separator="," close=")">
#{userId}
</foreach>
</if>
GROUP BY pc.project_id
ORDER BY p.created_time DESC
</select>
</mapper>

19
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml

@ -22,4 +22,23 @@
#{topicId}
</foreach>
</select>
<!-- 发布话题,分页-->
<select id="selectListTopic" parameterType="com.epmet.dto.form.PageUserReportEventFormDTO"
resultType="com.epmet.dataaggre.dto.resigroup.result.UserTopicResDTO">
SELECT
rt.id as topicId,
IFNULL(rt.TOPIC_CONTENT,'语音话题') as topicContent,
rt.SHIFT_ISSUE as shiftIssue,
IFNULL(rt.ISSUE_ID,'') AS issueId,
rt.CREATED_TIME as releaseTime
FROM
resi_topic RT
WHERE
rt.DEL_FLAG = '0'
<foreach item="epmetUserId" collection="epmetUserIdList" open="AND (" separator="or" close=")" index="">
rt.CREATED_BY = #{epmetUserId}
</foreach>
order by rt.CREATED_TIME desc
</select>
</mapper>

41
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.result.heart;
import lombok.Data;
/**
* @Description 描述
* @Author wangxianzhang
* @Date 2021/12/10 4:24 下午
* @Version 1.0
*/
@Data
public class VolunteerDemandServiceStatsResultDTO {
private String customerId;
private String dateId;
/**
* 客户下志愿者总数
*/
private Integer volunteerTotal;
/**
* 客户下志愿者中党员数量
*/
private Integer partyTotal;
/**
* 客户下志愿者中居民数量
*/
private Integer resiTotal;
/**
* 客户下志愿者服务总次数
*/
private Integer serviceTotal;
/**
* 客户下党员志愿者服务次数
*/
private Integer partyServiceTotal;
/**
* 客户下居民志愿者服务次数
*/
private Integer resiServiceTotal;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java

@ -87,4 +87,6 @@ public class FineExampleResultDTO implements Serializable {
* PLAT_JOIN PARTY_RATIO 平台参与议事的党员占比
*/
private String platJoinPartyRatio = "0.00%";
private String dataEndTime;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java

@ -44,4 +44,6 @@ public class GovernCapacityRankResultDTO implements Serializable {
* 当前agencyName的上一级组织名称
*/
private String parentAgencyName;
private String monthId;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java

@ -46,4 +46,6 @@ public class GovernCapacityResultDTO implements Serializable {
private String parentAgencyName;
private String orgId;
private String monthId;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java

@ -39,4 +39,9 @@ public class GrassRootsGovernRankResultDTO implements Serializable {
* 组织名称
*/
private String orgName;
/**
* 数据所属月份
*/
private String monthId;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java

@ -35,4 +35,9 @@ public class GrassRootsGovernResultDTO implements Serializable {
* 办结率当前界面是社区时显示
*/
private String closedProjectRatio;
/**
* 数据所属月份
*/
private String monthId;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java

@ -31,4 +31,6 @@ public class GrassRootsOrgRankResultDTO implements Serializable {
* 组织名称
*/
private String orgName;
private String monthId;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java

@ -27,4 +27,9 @@ public class GrassRootsOrgResultDTO implements Serializable {
* 项目数
*/
private Integer projectTotal;
/**
* 数据所属月份
*/
private String monthId;
}

4
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java

@ -57,4 +57,8 @@ public class OrgRankDataResultDTO implements Serializable {
private String parentAgencyName;
private String orgId;
/**
* 数据所属月份
*/
private String monthId;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyUserPointResultDTO.java

@ -28,4 +28,6 @@ public class PartyUserPointResultDTO implements Serializable {
* 用户积分
* */
private Integer point;
private String dataEndTime;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java

@ -31,4 +31,9 @@ public class PmTotalResultDTO implements Serializable {
* 议题数
*/
private Integer issueTotal;
/**
* 数据所属月份
*/
private String monthId;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java

@ -27,4 +27,6 @@ public class ProjectProfileResultDTO implements Serializable {
* 级别
*/
private String level;
private String dataEndTime;
}

4
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java

@ -49,4 +49,8 @@ public class PublicPartiProfileResultDTO implements Serializable {
private String joinCompareLatestTrend = "";
/**
* 数据所属月份
*/
private String monthId;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TopProfileResultDTO.java

@ -42,4 +42,6 @@ public class TopProfileResultDTO implements Serializable {
* 项目总数
*/
private Integer projectNum = 0;
private String dataEndTime;
}

38
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java

@ -0,0 +1,38 @@
package com.epmet.datareport.controller.heart;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.datareport.service.heart.DemandService;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description 描述
* @Author wangxianzhang
* @Date 2021/12/10 3:55 下午
* @Version 1.0
*/
@RestController
@RequestMapping("heart/demand")
public class DataReportHeartDemandController {
@Autowired
private DemandService demandService;
/**
* 查询志愿者需求服务统计信息
* @param loginUser
* @return
*/
@PostMapping("volunteer/service")
public Result<VolunteerDemandServiceStatsResultDTO> getVolunteerServiceStats(@LoginUser TokenDto loginUser) {
String customerId = loginUser.getCustomerId();
VolunteerDemandServiceStatsResultDTO r = demandService.getVolunteerServiceStats(customerId);
return new Result<VolunteerDemandServiceStatsResultDTO>().ok(r);
}
}

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java

@ -11,6 +11,14 @@ import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantity
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService;
import com.epmet.datareport.service.project.ProjectService;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO;
import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO;
import com.epmet.dto.form.screen.ScreenCommonFormDTO;
import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO;
import com.epmet.dto.result.screen.ProjectQuantityResultDTO;
import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO;
import com.epmet.datareport.service.project.ProjectService;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.project.MassesDiscontentFormV2DTO;
import com.epmet.dto.result.project.MassesDiscontentResultV2DTO;
import com.epmet.project.constant.ProjectConstant;

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -20,6 +20,7 @@ package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.ScreenCustomerAgencyCommonDTO;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.result.ParentListResultDTO;
import com.epmet.dto.ScreenCustomerAgencyCommonDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.dto.result.plugins.DeptNodeDTO;

43
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java

@ -0,0 +1,43 @@
/**
* 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.datareport.dao.fact;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 志愿者服务情况统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-08
*/
@Mapper
public interface FactVolunteerServiceDailyDao extends BaseDao<FactVolunteerServiceDailyEntity> {
/**
* 查询最新一条"志愿者需求服务统计信息"
* @param customerId
* @return
*/
VolunteerDemandServiceStatsResultDTO getLatestVolunteerDemandServiceStats(@Param("customerId") String customerId);
}

83
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java

@ -0,0 +1,83 @@
/**
* 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.datareport.entity.heart;
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-12-08
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_volunteer_service_daily")
public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* yyyyMMdd
*/
private String dateId;
/**
* yyyyMM
*/
private String monthId;
/**
* 截止到当前dateId当前客户下共有多少个爱心互助的志愿者
*/
private Integer volunteerTotal;
/**
* 截止到当前dateId当前客户下XX个爱心互助志愿者中党员有多少个
*/
private Integer partyTotal;
/**
* 截止到当前dateId当前客户下XX个爱心互助志愿者中居民有多少个
*/
private Integer resiTotal;
/**
* 服务总次数
*/
private Integer serviceTotal;
/**
* 党员服务总次数
*/
private Integer partyServiceTotal;
/**
* 居民服务总次数
*/
private Integer resiServiceTotal;
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java

@ -190,6 +190,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
result.setMonthIncr(convertPercentStr(latest.getMonthIncr(), NumConstant.ZERO));
result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth().abs(), NumConstant.ZERO));
result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth().abs(), NumConstant.ZERO));
result.setMonthId(monthId);
return result;
}
@ -286,6 +287,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
rank.setResponseRatio(convertPercentStr(o.getResponseRatio(),NumConstant.ONE));
rank.setSatisfactionRatio(convertPercentStr(o.getSatisfactionRatio(),NumConstant.ONE));
rank.setParentAgencyName(o.getParentAgencyName());
rank.setMonthId(o.getMonthId());
result.add(rank);
});
return result;

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java

@ -0,0 +1,13 @@
package com.epmet.datareport.service.heart;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
/**
* @Description 需求服务
* @Author wangxianzhang
* @Date 2021/12/10 4:18 下午
* @Version 1.0
*/
public interface DemandService {
VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId);
}

29
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java

@ -0,0 +1,29 @@
package com.epmet.datareport.service.heart.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.fact.FactVolunteerServiceDailyDao;
import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity;
import com.epmet.datareport.service.heart.DemandService;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description 需求服务
* @Author wangxianzhang
* @Date 2021/12/10 4:20 下午
* @Version 1.0
*/
@Service
public class DemandServiceImpl implements DemandService {
@Autowired
private FactVolunteerServiceDailyDao factVolunteerServiceDailyDao;
@Override
public VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId) {
return factVolunteerServiceDailyDao.getLatestVolunteerDemandServiceStats(customerId);
}
}

24
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java

@ -211,7 +211,7 @@ public class ProjectServiceImpl implements ProjectService {
}
/**
* @Description 项目详情
* @Description 项目详情
* @Param processListFormDTO
* @author zxc
* @date 2020/10/23 10:33 上午
@ -285,9 +285,9 @@ public class ProjectServiceImpl implements ProjectService {
}
/**
* @return
* @Description 难点赌点-获取组织下拉框
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
@ -297,7 +297,7 @@ public class ProjectServiceImpl implements ProjectService {
//1、根据token获取本级agencyId、获取userId
String agencyId = getLoginUserDetails(tokenDto);
String userId=getLoginUserUserId(tokenDto);
String userId = getLoginUserUserId(tokenDto);
//2、获取本级组织机构
Result<CustomerAgencyDTO> customerAgencyDTO = govOrgOpenFeignClient.getAgencyById(agencyId);
@ -328,7 +328,7 @@ public class ProjectServiceImpl implements ProjectService {
Result<SubAgencyResultDTO> SubAgencyResultDTO = govOrgOpenFeignClient.subAgencyList(form);
List<SubListResultDTO> subAgencyList = SubAgencyResultDTO.getData().getAgencyList();
for(int i=0;i<subAgencyList.size();i++){
for (int i = 0; i < subAgencyList.size(); i++) {
ProjectNextAgencyResultDTO subAgencyDto = new ProjectNextAgencyResultDTO();
subAgencyDto.setOrgId(subAgencyList.get(i).getAgencyId());
subAgencyDto.setOrgName(subAgencyList.get(i).getAgencyName());
@ -337,30 +337,30 @@ public class ProjectServiceImpl implements ProjectService {
}
}
if(null == resultList) return new ArrayList<>();
if (null == resultList) return new ArrayList<>();
return resultList;
}
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @param param
* @return
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @author jiangyy
* @date 2020.10.19 16:38
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public List<ProjectDifficultRankResultDTO> getDifficultyRank(DifficultyRankFormDTO param) {
PageHelper.startPage(null == param.getPageNo() ? NumConstant.ONE:param.getPageNo(),param.getTopNum());
List<ProjectDifficultRankResultDTO> result = projectDao.difficultyRank(param);
for (int i = 0; i < result.size (); i ++){
List<String> imgUrlList ;
imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId()) ;
for (int i = 0; i < result.size(); i++) {
List<String> imgUrlList;
imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId());
result.get(i).setImgUrlList(imgUrlList);
}
if(null == result) return new ArrayList<>();
if (null == result) return new ArrayList<>();
return result;
}

36
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml

@ -0,0 +1,36 @@
<?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.datareport.dao.fact.FactVolunteerServiceDailyDao">
<resultMap type="com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity" id="factVolunteerServiceDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="volunteerTotal" column="VOLUNTEER_TOTAL"/>
<result property="partyTotal" column="PARTY_TOTAL"/>
<result property="resiTotal" column="RESI_TOTAL"/>
<result property="serviceTotal" column="SERVICE_TOTAL"/>
<result property="partyServiceTotal" column="PARTY_SERVICE_TOTAL"/>
<result property="resiServiceTotal" column="RESI_SERVICE_TOTAL"/>
<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>
<select id="getLatestVolunteerDemandServiceStats"
resultType="com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO">
select *
from fact_volunteer_service_daily
where DEL_FLAG = 0
and CUSTOMER_ID = #{customerId}
order by DATE_ID desc
limit 1
</select>
</mapper>

6
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml

@ -35,7 +35,8 @@
IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO,
IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO,
IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
pa.AGENCY_NAME AS parentAgencyName
pa.AGENCY_NAME AS parentAgencyName,
rankData.MONTH_ID as monthId
FROM screen_customer_agency agency
left join screen_customer_agency pa
on(agency.PARENT_AREA_CODE=pa.AREA_CODE
@ -61,7 +62,8 @@
IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO,
IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO,
IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
ca.agency_name AS parentAgencyName
ca.agency_name AS parentAgencyName,
rankData.MONTH_ID as monthId
FROM screen_customer_grid grid
left join screen_customer_agency ca
on (ca.agency_id = grid.parent_agency_id)

6
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml

@ -14,7 +14,8 @@
rankData.CLOSE_PROJECT_RATIO AS closedProjectRatio,
rankData.SATISFACTION_RATIO AS satisfactionRatio,
agency.AGENCY_NAME AS parentAgencyName,
rankData.ORG_ID as orgId
rankData.ORG_ID as orgId,
rankData.MONTH_ID
FROM
screen_org_rank_data rankData
LEFT JOIN screen_customer_agency agency
@ -39,7 +40,8 @@
rankData.CLOSE_PROJECT_RATIO AS closedProjectRatio,
rankData.SATISFACTION_RATIO AS satisfactionRatio,
agency.AGENCY_NAME AS parentAgencyName,
rankData.ORG_ID as orgId
rankData.ORG_ID as orgId,
rankData.MONTH_ID
FROM
screen_org_rank_data rankData
left join screen_customer_grid scg on(

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

@ -103,7 +103,8 @@
SELECT
m.USER_ID,
concat( m.surname, CASE char_length( m.NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name,
m.POINT_TOTAL AS point
m.POINT_TOTAL AS point,
m.DATA_END_TIME
FROM
screen_party_user_rank_data m
left join screen_customer_grid scg

6
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml

@ -17,7 +17,8 @@
publish_issue_total AS publishIssueTotal,
IFNULL(publish_issue_ratio,0) AS publishIssueRatioA,
PLAT_ISSUE_TOTAL AS platIssueTotal,
IFNULL(PLAT_JOIN_PARTY_RATIO,0) AS platJoinPartyRatio
IFNULL(PLAT_JOIN_PARTY_RATIO,0) AS platJoinPartyRatio,
DATA_END_TIME as dataEndTime
FROM
screen_pioneer_data
WHERE
@ -44,7 +45,8 @@
CEILING(sum(data.publish_issue_total)) AS publishIssueTotal,
IFNULL(avg(data.publish_issue_ratio),0) AS publishIssueRatioA,
CEILING(sum(data.PLAT_ISSUE_TOTAL)) AS platIssueTotal,
IFNULL(avg(data.PLAT_JOIN_PARTY_RATIO),0) AS platJoinPartyRatio
IFNULL(avg(data.PLAT_JOIN_PARTY_RATIO),0) AS platJoinPartyRatio,
DATA_END_TIME as dataEndTime
FROM
screen_pioneer_data data
LEFT JOIN

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

@ -38,7 +38,8 @@
group_total AS groupNum,
topic_total AS topicNum,
issue_total AS issueNum,
project_total AS projectNum
project_total AS projectNum,
DATA_END_TIME as dataEndTime
FROM
screen_user_total_data
WHERE

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnCommunityProjectProfileDao.xml

@ -5,7 +5,8 @@
<select id="selectProjectProfile" resultType="com.epmet.evaluationindex.screen.dto.result.ProjectProfileResultDTO">
SELECT ORG_ID,
PROJECT_TOTAL,
LEVEL
LEVEL,
DATA_END_TIME as dataEndTime
FROM screen_an_community_project_profile
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}

6
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml

@ -9,7 +9,8 @@
CLOSED_PROJECT_TOTAL,
CONCAT( 0 + cast( TRUNCATE ( PROJECT_RESPONSE_RATIO, 1 ) AS CHAR ), '%' ) AS "projectResponseRatio",
CONCAT( 0 + cast( TRUNCATE ( PROJECT_SATIS_RATIO, 1 ) AS CHAR ), '%' ) AS "projectSatisRatio",
CONCAT( 0 + cast( TRUNCATE ( CLOSED_PROJECT_RATIO, 1 ) AS CHAR ), '%' ) AS "closedProjectRatio"
CONCAT( 0 + cast( TRUNCATE ( CLOSED_PROJECT_RATIO, 1 ) AS CHAR ), '%' ) AS "closedProjectRatio",
MONTH_ID
FROM screen_an_grass_roots_govern_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
@ -55,7 +56,8 @@
CLOSED_PROJECT_TOTAL,
CONCAT( 0 + cast( TRUNCATE ( PROJECT_RESPONSE_RATIO, 1 ) AS CHAR ), '%' ) AS "projectResponseRatio",
CONCAT( 0 + cast( TRUNCATE ( PROJECT_SATIS_RATIO, 1 ) AS CHAR ), '%' ) AS "projectSatisRatio",
CONCAT( 0 + cast( TRUNCATE ( CLOSED_PROJECT_RATIO, 1 ) AS CHAR ), '%' ) AS "closedProjectRatio"
CONCAT( 0 + cast( TRUNCATE ( CLOSED_PROJECT_RATIO, 1 ) AS CHAR ), '%' ) AS "closedProjectRatio",
MONTH_ID
FROM screen_an_grass_roots_govern_monthly
WHERE DEL_FLAG = 0
AND PID = #{agencyId}

6
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml

@ -7,7 +7,8 @@
<select id="selectGrassRootsOrg" resultType="com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgResultDTO">
SELECT GROUP_TOTAL,
ISSUE_TOTAL,
PROJECT_TOTAL
PROJECT_TOTAL,
MONTH_ID
FROM screen_an_grass_roots_org_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
@ -47,7 +48,8 @@
SELECT ORG_NAME,
GROUP_TOTAL,
ISSUE_TOTAL,
PROJECT_TOTAL
PROJECT_TOTAL,
MONTH_ID
FROM screen_an_grass_roots_org_monthly
WHERE DEL_FLAG = 0
AND PID = #{agencyId}

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

Loading…
Cancel
Save