Browse Source

Merge branches 'dev' and 'wxz_senseless_deploy' of http://git.elinkit.com.cn:7070/r/epmet-cloud into wxz_senseless_deploy

dev_shibei_match
wxz 4 years ago
parent
commit
c4ab98fd12
  1. 142
      epmet-auth/src/main/java/com/epmet/controller/WxController.java
  2. 6
      epmet-commons/epmet-commons-tools/pom.xml
  3. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
  4. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  5. 12
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  6. 12
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java
  7. 42
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java
  8. 9
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java
  9. 67
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/CustomerDataManageFormDTO.java
  10. 57
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/CustomerDataManageResultDTO.java
  11. 27
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java
  12. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java
  13. 35
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java
  14. 27
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
  15. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java
  16. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java
  17. 55
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java
  18. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
  19. 338
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  20. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java
  21. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  22. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java
  23. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
  24. 63
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  25. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  26. 201
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  27. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml
  28. 41
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml
  29. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  30. 1
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java
  31. 6
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java
  32. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  33. 16
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  34. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  35. 34
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  36. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java
  37. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  38. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java
  39. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java
  40. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml
  41. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  42. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  43. 170
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java
  44. 8
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java
  45. 11
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java
  46. 12
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/StaffMessageResultDTO.java
  47. 8
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml
  48. 31
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  49. 1
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java
  50. 5
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/BizPointUserTotalDetailDTO.java
  51. 46
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java
  52. 15
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java
  53. 49
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java
  54. 21
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GridPointRankResultDTO.java
  55. 21
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java
  56. 22
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyPointRankResultDTO.java
  57. 59
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java
  58. 42
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
  59. 23
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/BizPointTotalDetailDao.java
  60. 9
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java
  61. 25
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java
  62. 34
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java
  63. 285
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java
  64. 182
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
  65. 46
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/BizPointTotalDetailDao.xml
  66. 90
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml
  67. 21
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  68. 18
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java
  69. 17
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgFormDTO.java
  70. 31
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java
  71. 27
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java
  72. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  73. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  74. 27
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  75. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
  76. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  77. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  78. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
  79. 49
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  80. 51
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  81. 35
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  82. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java
  83. 39
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  84. 23
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java
  85. 22
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/AttachmentDTO.java
  86. 56
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ExternalLinkDTO.java
  87. 117
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java
  88. 104
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java
  89. 91
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java
  90. 112
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java
  91. 96
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java
  92. 91
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java
  93. 96
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java
  94. 91
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java
  95. 58
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ModuleDTO.java
  96. 49
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java
  97. 61
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideAddFormDTO.java
  98. 56
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java
  99. 28
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java
  100. 21
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java

142
epmet-auth/src/main/java/com/epmet/controller/WxController.java

@ -0,0 +1,142 @@
package com.epmet.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Enumeration;
/**
* desc:微信配置测试
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-08
*/
@RestController
@RequestMapping("wechat")
public class WxController {
private static Logger log = LoggerFactory.getLogger(WxController.class);
@RequestMapping("check")
public void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
System.out.println("========WechatController========= ");
Enumeration pNames = request.getParameterNames();
while (pNames.hasMoreElements()) {
String name = (String) pNames.nextElement();
String value = request.getParameter(name);
// out.print(name + "=" + value);
String log = "name =" + name + " value =" + value;
}
String signature = request.getParameter("signature");/// 微信加密签名
String timestamp = request.getParameter("timestamp");/// 时间戳
String nonce = request.getParameter("nonce"); /// 随机数
String echostr = request.getParameter("echostr"); // 随机字符串
response.reset();
PrintWriter out = response.getWriter();
// if (this.checkSignature(signature, timestamp, nonce)) {
// out.print(echostr);
// }
out.close();
out = null;
}
/**
* 校验签名
*/
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;
}
}

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

@ -163,6 +163,12 @@
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>io.github.wnjustdoit</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.6.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java

@ -160,4 +160,15 @@ public interface Constant {
// resi_footbar_highlight_num
// gov_footbar_highlight_num
String FOOTBAR_HIGHLIGHT_NUM="_footbar_highlight_num";
/**
* 未被禁用标识
* */
String ENABLE = "enable";
/**
* 被禁用标识
* */
String DISABLE = "disable";
}

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

@ -74,6 +74,8 @@ public enum EpmetErrorCode {
AREA_CODE_ALREADY_EXISTS(8208,"组织区划已被占用,请重新选择"),
AGENCY_NAME_ALREADY_EXISTS(8209,"当前组织名称已存在,请重新修改"),
SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"),
HAVE_GUIDE_CANNOT_DEL(8211,"当前分类已经存在办事指南,不允许删除"),
GUIDE_CATEGORY_NAME_EXITS(8212,"分类已存在"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),
@ -155,7 +157,8 @@ public enum EpmetErrorCode {
EXISTED_SPECIAL_PROJECT(8807, "已经添加过此专题"),
CAN_NOT_DEL_SPECIAL_PROJECT(8808, "您没有权限删除此专题"),
TAG_NOT_EXIST(8809,"标签不存在"),
GUIDE_IS_NULL(8810,"指南内容不能为空"),
GUIDE_IS_NOT_YOURS(8811,"只能删除自己创建的指南"),
//公众号 865..开头的码
PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"),
SELECT_CUSTOMER_ERROR(8652,"未查询到注册客户信息"),

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

@ -522,4 +522,16 @@ public class RedisKeys {
public static String getCustomerStaffInfoKey(String customerId, String staffId) {
return rootPrefix.concat("gov:staff:").concat(customerId).concat(StrConstant.COLON).concat(staffId);
}
/**
* @description 网格信息
*
* @param gridId
* @return
* @author wxz
* @date 2021.09.08 11:03:48
*/
public static String getGridInfoKey(String gridId) {
return rootPrefix.concat("gov:grid:").concat(gridId);
}
}

12
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java

@ -0,0 +1,12 @@
package com.epmet.commons.tools.redis.common.bean;
import lombok.Data;
@Data
public class GridInfoCache {
private String gridId;
private String gridNamePath;
private String customerId;
private String pid;
private String pids;
}

42
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java

@ -14,11 +14,13 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@ -80,4 +82,44 @@ public class ExcelUtils {
exportExcel(response, fileName, targetList, targetClass);
}
public static void exportExcelToTargetDisposeAll(HttpServletResponse response, String fileName, Collection<?> sourceList,
Class<?> targetClass) throws Exception {
if (!CollectionUtils.isEmpty(sourceList)){
List<Object> targetList = new ArrayList<>(sourceList.size());
for(Object source : sourceList){
Object target = targetClass.newInstance();
BeanUtils.copyProperties(source, target);
targetList.add(target);
}
exportExcelDispose(response, fileName, targetList, targetClass);
}else {
exportExcelDispose(response, fileName, new ArrayList<>(), targetClass);
}
}
public static void exportExcelDispose(HttpServletResponse response, String fileName, Collection<?> list,
Class<?> pojoClass) throws IOException {
if(StringUtils.isBlank(fileName)){
//当前日期
fileName = DateUtils.format(new Date());
}
ExportParams params = new ExportParams(fileName,fileName);
Workbook workbook = ExcelExportUtil.exportExcel(params, pojoClass, list);
Sheet sheet1 = workbook.getSheetAt(0);
sheet1.setDefaultColumnWidth(50*256);
sheet1.setDefaultRowHeight((short)(2*256));
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
fileName = fileName + ".xls";
response.setHeader("Content-Disposition",
"attachment;filename=" +fileName);
ServletOutputStream out = response.getOutputStream();
workbook.write(out);
out.flush();
out.close();
}
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java → epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java

@ -1,4 +1,4 @@
package com.epmet.util;
package com.epmet.commons.tools.utils;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
@ -31,6 +31,7 @@ public class Pinyin4jUtil {
duoyinMap.put('均',new String[]{"jun"});
duoyinMap.put('会', new String[]{"hui"});
duoyinMap.put('属', new String[]{"shu"});
duoyinMap.put('调', new String[]{"diao"});
}
/**
@ -42,7 +43,6 @@ public class Pinyin4jUtil {
*/
public static String getFirstSpellPinYin(String src, boolean isFullSpell) {
String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1));
System.out.println(targetStr);
String[] split = targetStr.split(",");
if (split.length > 1) {
targetStr = split[0];
@ -59,7 +59,6 @@ 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);
String[] split = targetStr.split(",");
if (split.length > 1) {
targetStr = split[0];
@ -139,8 +138,8 @@ public class Pinyin4jUtil {
} else if (((int) c >= 65 && (int) c <= 90)
|| ((int) c >= 97 && (int) c <= 122)) {//英文
temp[i] = new String[]{String.valueOf(srcChar[i])};
} else {
temp[i] = new String[]{""};
} else {//非汉字全盘返回即可
temp[i] = new String[]{String.valueOf(srcChar[i])};
}
}
String[] pingyinArray = exchange(temp);

67
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/CustomerDataManageFormDTO.java

@ -0,0 +1,67 @@
package com.epmet.dataaggre.dto.datastats.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/9/10 11:04 上午
* @DESC
*/
@Data
public class CustomerDataManageFormDTO implements Serializable {
private static final long serialVersionUID = 6462094914874831738L;
public interface CustomerDataManageForm{}
/**
* 客户ID
*/
@NotBlank(message = "客户ID不能为空",groups = CustomerDataManageForm.class)
private String customerId;
/**
* 组织ID
*/
@NotBlank(message = "组织ID不能为空",groups = CustomerDataManageForm.class)
private String agencyId;
/**
* 区间:Interval 截止:end
*/
@NotBlank(message = "type不能为空",groups = CustomerDataManageForm.class)
private String type;
/**
* 开始时间yyyymmdd
*/
private String startTime;
/**
* 结束时间yyyymmdd
*/
@NotBlank(message = "结束时间不能为空",groups = CustomerDataManageForm.class)
private String endTime;
private Integer pageNo = 1;
private Integer pageSize = 20;
/**
* 是否分页true分 false不分
*/
@NotNull(message = "是否分页不能为空",groups = CustomerDataManageForm.class)
private Boolean isPage;
//组织或网格Id集合
private List<String> idList;
//按起始时间还是结束时间查数据【start end】
private String sourceType;
//数据类型【组织agency 网格grid】
private String dataType;
}

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

@ -0,0 +1,57 @@
package com.epmet.dataaggre.dto.datastats.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 运营情况数据导出-接口返参
* @Auth sun
*/
@Data
public class CustomerDataManageResultDTO {
List<CustomerDataManage> list = new ArrayList<>();
private Integer total;
@Data
public static class CustomerDataManage {
//组织、网格Id
private String orgId;
//组织、网格名称
private String orgName;
//用户数
private Integer userCount = 0;
//居民数
private Integer residentCount = 0;
//党员数
private Integer partyMemberCount = 0;
//小组数
private Integer groupCount = 0;
//话题数
private Integer topicCount = 0;
//议题数
private Integer issueCount = 0;
//项目数
private Integer projectCount = 0;
//结案项目数
private Integer closedProjectCount = 0;
//巡查人数
private Integer patrolPeopleCount = 0;
//巡查次数
private Integer patrolCount = 0;
//巡查时长
private String patrolDuration;
//未转换前的巡查时长
private Integer patrolDurationInteger = 0;
//数据对应dateId
@JsonIgnore
private String dateId;
@JsonIgnore
private String staffId;
}
}

27
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java

@ -0,0 +1,27 @@
package com.epmet.dataaggre.dto.evaluationindex;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author sun
* @Description 根据组织Id判断查询直属下级组织/网格列表组织存在子客户的查询包含子客户组织数据
*/
@Data
public class ScreenAgencyOrGridListDTO implements Serializable {
private static final long serialVersionUID = 6328123559936824470L;
//组织级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city,省级:province)
private String level;
//直属下级组织或网格集合
private List<AgencyGrid> agencyGridList;
@Data
public static class AgencyGrid {
//组织id
private String orgId;
//组织名称
private String orgName;
}
}

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java

@ -45,6 +45,8 @@ public class OrgStaffListFormDTO implements Serializable {
private List<String> staffIds;
//token中用户Id
private String staffId;
//人员是否禁用【未禁用enable,已禁用disabled】
private String enableFlag = "enable";
public interface OrgStaff extends CustomerClientShowGroup {}
}

35
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java

@ -1,18 +1,21 @@
package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.excel.CustomerDataManageExcel;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author sun
@ -215,4 +218,28 @@ public class DataStatsController {
return new Result<GovrnRatioResultDTO>().ok(dataStatsService.governRatio(formDTO));
}
/**
* @Description 客户数据管理导出
* @Param formDTO
* @Param response
* @author zxc
* @date 2021/9/10 3:52 下午
*/
@PostMapping("operateexport")
public void CustomerDataManage(@RequestBody CustomerDataManageFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO, CustomerDataManageFormDTO.CustomerDataManageForm.class);
dataStatsService.CustomerDataManage(formDTO,response);
}
/**
* @Param formDTO
* @Description 运营情况数据查询
* @author sun
*/
@PostMapping("operatedata")
public Result<CustomerDataManageResultDTO> operatedata(@RequestBody CustomerDataManageFormDTO formDTO) throws ParseException {
ValidatorUtils.validateEntity(formDTO, CustomerDataManageFormDTO.CustomerDataManageForm.class);
return new Result<CustomerDataManageResultDTO>().ok(dataStatsService.operateExport(formDTO));
}
}

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

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.datastats;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.result.*;
@ -308,4 +309,30 @@ public interface DataStatsDao {
* @author sun
*/
List<GridMemberPatrolListResultDTO> selectGirdMemberPatrol(GridMemberPatrolListFormDTO formDTO);
/**
* @Description 直属组织或网格下注册用户数据
* @author sun
*/
List<CustomerDataManageResultDTO.CustomerDataManage> regUserList(CustomerDataManageFormDTO formDTO);
/**
* @Description 直属组织或网格下群组数据
* @author sun
*/
List<CustomerDataManageResultDTO.CustomerDataManage> groupList(CustomerDataManageFormDTO formDTO);
/**
* @Description 直属组织或网格下话题数据
* @author sun
*/
List<CustomerDataManageResultDTO.CustomerDataManage> topicList(CustomerDataManageFormDTO formDTO);
/**
* @Description 直属组织或网格下议题数据
* @author sun
*/
List<CustomerDataManageResultDTO.CustomerDataManage> issueList(CustomerDataManageFormDTO formDTO);
/**
* @Description 直属组织或网格下项目数据
* @author sun
*/
List<CustomerDataManageResultDTO.CustomerDataManage> projectList(CustomerDataManageFormDTO formDTO);
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java

@ -19,6 +19,8 @@ package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO;
import com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult;
import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -43,4 +45,10 @@ public interface StatsStaffPatrolRecordDailyDao extends BaseDao<StatsStaffPatrol
* @return
*/
List<PatrolDailySumResult> getPatrolSumList(@Param("agencyFullIdList") List<String> agencyFullIdList, @Param("startDateId") String startDateId, @Param("endDateId") String endDateId);
/**
* @Description 直属组织或网格下巡查数据
* @author sun
*/
List<CustomerDataManageResultDTO.CustomerDataManage> patrolList(CustomerDataManageFormDTO formDTO);
}

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

@ -95,4 +95,12 @@ public interface EvaluationIndexDao {
*/
List<ScreenCustomerAgencyDTO> getSubAgencyListByAgency(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List<String> list);
/**
* @Description 根据组织ID查询组织名
* @Param agencyId
* @author zxc
* @date 2021/9/10 3:54 下午
*/
String selectAgencyNameByAgencyId(@Param("agencyId")String agencyId);
}

55
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java

@ -0,0 +1,55 @@
package com.epmet.dataaggre.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2021/9/10 10:15 上午
* @DESC
*/
@Data
public class CustomerDataManageExcel {
@Excel(name = "组织")
private String orgName;
@Excel(name = "用户数")
private Integer userCount;
@Excel(name = "居民数")
private Integer residentCount;
@Excel(name = "党员数")
private Integer partyMemberCount;
@Excel(name = "小组数")
private Integer groupCount;
@Excel(name = "话题数")
private Integer topicCount;
@Excel(name = "议题数")
private Integer issueCount;
@Excel(name = "项目数")
private Integer projectCount;
@Excel(name = "结案项目数")
private Integer closedProjectCount;
@Excel(name = "巡查人数")
private Integer patrolPeopleCount;
@Excel(name = "巡查次数")
private Integer patrolCount;
@Excel(name = "巡查时长")
private String patrolDuration;
/**
* 未转换前的巡查时长
*/
private Integer patrolDurationInteger;
}

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

@ -9,6 +9,8 @@ import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.List;
/**
@ -229,4 +231,20 @@ public interface DataStatsService {
* @author sun
*/
List<GridMemberPatrolListResultDTO> getGirdMemberPatrol(GridMemberPatrolListFormDTO formDTO);
/**
* @Description 客户数据管理导出
* @Param formDTO
* @Param response
* @author zxc
* @date 2021/9/10 3:52 下午
*/
void CustomerDataManage(CustomerDataManageFormDTO formDTO, HttpServletResponse response) throws Exception;
/**
* @Description 运营情况数据查询
* @author sun
*/
CustomerDataManageResultDTO operateExport(CustomerDataManageFormDTO formDTO) throws ParseException;
}

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

@ -2,47 +2,53 @@
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.OrgLevelEnum;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.constant.OrgConstant;
import com.epmet.dataaggre.dao.datastats.DataStatsDao;
import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.constant.OrgConstant;
import com.epmet.dataaggre.dao.datastats.DataStatsDao;
import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
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.epmetuser.result.PatrolDailySumResult;
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.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
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.govorg.result.GridMemberDataAnalysisResultDTO;
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;
import com.epmet.dataaggre.excel.CustomerDataManageExcel;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
* @Author sun
@ -1841,4 +1847,264 @@ public class DataStatsServiceImpl implements DataStatsService {
return dataStatsDao.selectGirdMemberPatrol(formDTO);
}
/**
* @Description 客户数据管理导出
* @Param formDTO
* @Param response
* @author zxc
* @date 2021/9/10 3:52 下午
*/
@Override
public void CustomerDataManage(CustomerDataManageFormDTO formDTO, HttpServletResponse response) throws Exception {
List<CustomerDataManageResultDTO.CustomerDataManage> result = operateExport(formDTO).getList();
if (!CollectionUtils.isEmpty(result)){
CustomerDataManageResultDTO.CustomerDataManage c = new CustomerDataManageResultDTO.CustomerDataManage();
c.setOrgName("合计");
c.setUserCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getUserCount)));
c.setResidentCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getResidentCount)));
c.setPartyMemberCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPartyMemberCount)));
c.setGroupCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getGroupCount)));
c.setTopicCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getTopicCount)));
c.setIssueCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getIssueCount)));
c.setProjectCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getProjectCount)));
c.setClosedProjectCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getClosedProjectCount)));
c.setPatrolPeopleCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolPeopleCount)));
c.setPatrolCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolCount)));
c.setPatrolDurationInteger(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolDurationInteger)));
c.setPatrolDuration(getHm(c.getPatrolDurationInteger()));
result.add(c);
}
String fileName = excelName(formDTO);
ExcelUtils.exportExcelToTargetDisposeAll(response,fileName,result, CustomerDataManageExcel.class);
}
/**
* @Description 秒转换时分
* @Param seconds
* @author zxc
* @date 2021/9/13 10:03 上午
*/
public String getHm(Integer seconds){
String result = "0分钟";
if (seconds >= NumConstant.SIXTY) {
Integer hours = seconds / 3600;
Integer minutes = seconds % 3600 / 60;
result = (hours < NumConstant.ONE ? "" : hours + "小时") + (minutes < NumConstant.ONE ? "" : minutes + "分钟");
}else if (seconds < NumConstant.SIXTY && seconds > NumConstant.ZERO){
result = "1分钟";
}
return result;
}
/**
* @Description 表头获取
* @Param formDTO
* @author zxc
* @date 2021/9/13 10:02 上午
*/
public String excelName(CustomerDataManageFormDTO formDTO){
StringBuffer s = new StringBuffer();
String agencyName = indexService.selectAgencyNameByAgencyId(formDTO.getAgencyId());
s.append(agencyName);
if (StringUtils.isNotBlank(formDTO.getStartTime())){
String startTime = formDTO.getStartTime();
String sYear = startTime.substring(0, 4);
String sMonth = startTime.substring(4, 6);
String sDay = startTime.substring(6, 8);
String endTime = formDTO.getEndTime();
String eYear = endTime.substring(0, 4);
String eMonth = endTime.substring(4, 6);
String eDay = endTime.substring(6, 8);
s.append(sYear).append("年").append(sMonth).append("月").append(sDay).append("日-")
.append(eYear).append("年").append(eMonth).append("月").append(eDay).append("日区间新增值");
}else {
String endTime = formDTO.getEndTime();
String eYear = endTime.substring(0, 4);
String eMonth = endTime.substring(4, 6);
String eDay = endTime.substring(6, 8);
s.append(eYear).append("年").append(eMonth).append("月").append(eDay).append("日截止累计值");
}
return s.toString();
}
/**
* @Param formDTO
* @Description 运营情况数据查询
* @author sun
*/
@Override
public CustomerDataManageResultDTO operateExport(CustomerDataManageFormDTO formDTO) throws ParseException {
CustomerDataManageResultDTO resultDTO = new CustomerDataManageResultDTO();
List<CustomerDataManageResultDTO.CustomerDataManage> dataManageList = new ArrayList<>();
//1.必要参数校验及处理
if ("Interval".equals(formDTO.getType()) && StringUtils.isEmpty(formDTO.getStartTime())) {
throw new RenException("请选择开始时间或查询累计值");
}
//入参有开始时间的则需要减去一天
if (StringUtils.isNotBlank(formDTO.getStartTime())) {
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
Date date = format.parse(formDTO.getStartTime());
Date yesterday = DateUtils.addDateDays(date, -1);
formDTO.setStartTime(format.format(yesterday));
}
//2.查询组织信息,判断查询下级组织还是网格数据
ScreenAgencyOrGridListDTO agencyGrid = indexService.getSubAgencyOrGridList(formDTO.getAgencyId());
if (null == agencyGrid) {
return new CustomerDataManageResultDTO();
}
//组织或网格Id集合
List<String> idList = agencyGrid.getAgencyGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList());
formDTO.setDataType(!"community".equals(agencyGrid.getLevel()) ? "agency" : "grid");
formDTO.setIdList(idList);
resultDTO.setTotal(idList.size());
//3.查询截止日期用户、群组、话题、议题、项目、巡查数据
formDTO.setSourceType("end");
List<CustomerDataManageResultDTO.CustomerDataManage> userEnd = dataStatsDao.regUserList(formDTO);
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> uEndMap = new HashMap<>();
userEnd.stream().forEach(u->uEndMap.put(u.getOrgId(),u));
List<CustomerDataManageResultDTO.CustomerDataManage> groupEnd = dataStatsDao.groupList(formDTO);
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> gEndMap = new HashMap<>();
groupEnd.stream().forEach(u->gEndMap.put(u.getOrgId(),u));
List<CustomerDataManageResultDTO.CustomerDataManage> topicEnd = dataStatsDao.topicList(formDTO);
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> tEndMap = new HashMap<>();
topicEnd.stream().forEach(u->tEndMap.put(u.getOrgId(),u));
List<CustomerDataManageResultDTO.CustomerDataManage> issueEnd = dataStatsDao.issueList(formDTO);
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> iEndMap = new HashMap<>();
issueEnd.stream().forEach(u->iEndMap.put(u.getOrgId(),u));
List<CustomerDataManageResultDTO.CustomerDataManage> projectEnd = dataStatsDao.projectList(formDTO);
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> pEndMap = new HashMap<>();
projectEnd.stream().forEach(u->pEndMap.put(u.getOrgId(),u));
//巡查数据不区分区间差值,只计算累计值,人员做去重处理且是有巡查记录的人员
List<CustomerDataManageResultDTO.CustomerDataManage> patrolEnd = statsStaffPatrolRecordDailyService.patrolList(formDTO);
//4.判断是否需要查询起始日期用户、群组、话题、议题、项目、巡查数据
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> uStartMap = new HashMap<>();
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> gStartMap = new HashMap<>();
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> tStartMap = new HashMap<>();
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> iStartMap = new HashMap<>();
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> pStartMap = new HashMap<>();
if ("Interval".equals(formDTO.getType())) {
formDTO.setSourceType("start");
List<CustomerDataManageResultDTO.CustomerDataManage> userStart = dataStatsDao.regUserList(formDTO);
userStart.stream().forEach(u->uStartMap.put(u.getOrgId(),u));
List<CustomerDataManageResultDTO.CustomerDataManage> groupStart = dataStatsDao.groupList(formDTO);
groupStart.stream().forEach(u->gStartMap.put(u.getOrgId(),u));
List<CustomerDataManageResultDTO.CustomerDataManage> topicStart = dataStatsDao.topicList(formDTO);
topicStart.stream().forEach(u->tStartMap.put(u.getOrgId(),u));
List<CustomerDataManageResultDTO.CustomerDataManage> issueStart = dataStatsDao.issueList(formDTO);
issueStart.stream().forEach(u->iStartMap.put(u.getOrgId(),u));
List<CustomerDataManageResultDTO.CustomerDataManage> projectStart = dataStatsDao.projectList(formDTO);
projectStart.stream().forEach(u->pStartMap.put(u.getOrgId(),u));
}
//5.封装数据
agencyGrid.getAgencyGridList().forEach(org -> {
CustomerDataManageResultDTO.CustomerDataManage dto = new CustomerDataManageResultDTO.CustomerDataManage();
dto.setOrgId(org.getOrgId());
dto.setOrgName(org.getOrgName());
int user = 0;
int resi = 0;
int part = 0;
if(uEndMap.containsKey(org.getOrgId())){
user = uEndMap.get(org.getOrgId()).getUserCount();
resi = uEndMap.get(org.getOrgId()).getResidentCount();
part = uEndMap.get(org.getOrgId()).getPartyMemberCount();
if ("Interval".equals(formDTO.getType())&&uStartMap.containsKey(org.getOrgId())) {
user = user - uStartMap.get(org.getOrgId()).getUserCount();
resi = resi - uStartMap.get(org.getOrgId()).getResidentCount();
part = part - uStartMap.get(org.getOrgId()).getPartyMemberCount();
}
}
int group = 0;
if(gEndMap.containsKey(org.getOrgId())){
group = gEndMap.get(org.getOrgId()).getGroupCount();
if ("Interval".equals(formDTO.getType())&&gStartMap.containsKey(org.getOrgId())) {
group = group - gStartMap.get(org.getOrgId()).getGroupCount();
}
}
int topic = 0;
if(tEndMap.containsKey(org.getOrgId())){
topic = tEndMap.get(org.getOrgId()).getTopicCount();
if ("Interval".equals(formDTO.getType())&&tStartMap.containsKey(org.getOrgId())) {
topic = topic - tStartMap.get(org.getOrgId()).getTopicCount();
}
}
int issue = 0;
if(iEndMap.containsKey(org.getOrgId())){
issue = iEndMap.get(org.getOrgId()).getIssueCount();
if ("Interval".equals(formDTO.getType())&&iStartMap.containsKey(org.getOrgId())) {
issue = issue - iStartMap.get(org.getOrgId()).getIssueCount();
}
}
int project = 0;
int closed = 0;
if(pEndMap.containsKey(org.getOrgId())){
project = pEndMap.get(org.getOrgId()).getProjectCount();
closed = pEndMap.get(org.getOrgId()).getClosedProjectCount();
if ("Interval".equals(formDTO.getType())&&pStartMap.containsKey(org.getOrgId())) {
project = project - pStartMap.get(org.getOrgId()).getProjectCount();
closed = closed - pStartMap.get(org.getOrgId()).getClosedProjectCount();
}
}
int patro = 0;
int patroCount = 0;
String patrolDuration = "";
int patrolDurationInteger = 0;
HashSet set = new HashSet();
for (CustomerDataManageResultDTO.CustomerDataManage u : patrolEnd) {
if ("community".equals(agencyGrid.getLevel()) && org.getOrgId().equals(u.getOrgId())) {
patroCount += u.getPatrolCount();
patrolDurationInteger += u.getPatrolDurationInteger();
set.add(u.getStaffId());
}
if (!"community".equals(agencyGrid.getLevel()) && u.getOrgId().contains(org.getOrgId())) {
patroCount += u.getPatrolCount();
patrolDurationInteger += u.getPatrolDurationInteger();
set.add(u.getStaffId());
}
}
patro = set.size();
Integer minutes = patrolDurationInteger / 60;
patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟");
dto.setUserCount(user);
dto.setResidentCount(resi);
dto.setPartyMemberCount(part);
dto.setGroupCount(group);
dto.setTopicCount(topic);
dto.setIssueCount(issue);
dto.setProjectCount(project);
dto.setClosedProjectCount(closed);
dto.setPatrolPeopleCount(patro);
dto.setPatrolCount(patroCount);
dto.setPatrolDuration(patrolDuration);
dto.setPatrolDurationInteger(patrolDurationInteger);
dataManageList.add(dto);
});
//6.默认按用户总数降序
Collections.sort(dataManageList, new Comparator<CustomerDataManageResultDTO.CustomerDataManage>() {
@Override
public int compare(CustomerDataManageResultDTO.CustomerDataManage o1, CustomerDataManageResultDTO.CustomerDataManage o2) {
return o2.getUserCount().compareTo(o1.getUserCount());
}
});
//7.物理分页并返回
if (formDTO.getIsPage()) {
int firstIndex = (formDTO.getPageNo() - 1) * formDTO.getPageSize();
int lastIndex = formDTO.getPageNo() * formDTO.getPageSize();
List<CustomerDataManageResultDTO.CustomerDataManage> list = dataManageList.subList((firstIndex > dataManageList.size() ? dataManageList.size() : firstIndex), (lastIndex > dataManageList.size() ? dataManageList.size() : lastIndex));
resultDTO.setList(list);
return resultDTO;
}
resultDTO.setList(dataManageList);
return resultDTO;
}
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java

@ -18,6 +18,8 @@
package com.epmet.dataaggre.service.epmetuser;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO;
import com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult;
import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity;
@ -40,4 +42,9 @@ public interface StatsStaffPatrolRecordDailyService extends BaseService<StatsSta
*/
List<PatrolDailySumResult> getPatrolSumList(List<String> agencyList, String startDateId, String endDateId);
/**
* @Description 直属组织或网格下巡查数据
* @author sun
*/
List<CustomerDataManageResultDTO.CustomerDataManage> patrolList(CustomerDataManageFormDTO formDTO);
}

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

@ -598,6 +598,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
log.error("getStaffInfo have any agency staffId:{}",staffId);
return null;
}
result.setAgencyId(agencyDTO.getId());
result.setAgencyName(agencyDTO.getOrganizationName());
StaffOrgRelationResultDTO fromOrgTypeDto = govOrgService.getStaffFromOrgType(staffId);
String fromOrgType = OrgTypeEnum.AGENCY.getCode();

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

@ -4,6 +4,8 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmetuser.StatsStaffPatrolRecordDailyDao;
import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO;
import com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult;
import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity;
import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService;
@ -36,4 +38,13 @@ public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl<Stat
return baseDao.getPatrolSumList(agencyFullIdList,startDateId,endDateId);
}
/**
* @Description 直属组织或网格下巡查数据
* @author sun
*/
@Override
public List<CustomerDataManageResultDTO.CustomerDataManage> patrolList(CustomerDataManageFormDTO formDTO) {
return baseDao.patrolList(formDTO);
}
}

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

@ -2,6 +2,7 @@ package com.epmet.dataaggre.service.evaluationindex;
import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO;
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
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;
@ -71,4 +72,18 @@ public interface EvaluationIndexService {
*/
List<ScreenCustomerAgencyDTO> getSubAgencyListByAgency(String agencyId);
/**
* @Description 根据组织ID查询组织名
* @Param agencyId
* @author zxc
* @date 2021/9/10 3:54 下午
*/
String selectAgencyNameByAgencyId(String agencyId);
/**
* @Description 根据组织Id判断查询直属下级组织/网格列表组织存在子客户的查询包含子客户组织数据
* @author sun
*/
ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String agencyId);
}

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

@ -2,10 +2,12 @@ package com.epmet.dataaggre.service.evaluationindex.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao;
import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO;
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
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;
@ -143,4 +145,65 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
}
}
/**
* @Description 根据组织ID查询组织名
* @Param agencyId
* @author zxc
* @date 2021/9/10 3:54 下午
*/
@Override
public String selectAgencyNameByAgencyId(String agencyId) {
return evaluationIndexDao.selectAgencyNameByAgencyId(agencyId);
}
/**
* @Description 根据组织Id判断查询直属下级组织/网格列表组织存在子客户的查询包含子客户组织数据
* @author sun
*/
@Override
public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String agencyId) {
ScreenAgencyOrGridListDTO resultDTO = new ScreenAgencyOrGridListDTO();
List<ScreenAgencyOrGridListDTO.AgencyGrid> agencyGridList = new ArrayList<>();
//1.查询组织信息
ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId);
if (dto == null) {
log.error(String.format("组织信息不存在,组织Id->%s"), agencyId);
return new ScreenAgencyOrGridListDTO();
}
//2.根据组织级别判断查询直属组织或网格列表
List<ScreenCustomerAgencyDTO> agencyList = new ArrayList<>();
List<ScreenCustomerGridDTO> gridList = new ArrayList<>();
List<ScreenAgencyOrGridListDTO.AgencyGrid> finalAgencyGridList = agencyGridList;
if (!"community".equals(dto.getLevel())) {
//2-1.直属下级组织列表
//2.判断客户是否存在子客户
List<String> list = customerRelation.haveSubCustomer(dto.getCustomerId());
if (!CollectionUtils.isNotEmpty(list)) {
agencyList = evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null);
} else {
list.add(dto.getCustomerId());
agencyList = evaluationIndexDao.getSubAgencyListByAgency(null, dto.getAreaCode(), list);
}
agencyList.forEach(gr->{
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getAgencyId());
org.setOrgName(gr.getAgencyName());
finalAgencyGridList.add(org);
});
} else {
//2-2.直属下级网格列表
gridList = evaluationIndexDao.getSubGridList(agencyId);
gridList.forEach(gr->{
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getGridId());
org.setOrgName(gr.getGridName());
finalAgencyGridList.add(org);
});
}
resultDTO.setLevel(dto.getLevel());
resultDTO.setAgencyGridList(agencyGridList);
return resultDTO;
}
}

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

@ -3,8 +3,10 @@ package com.epmet.dataaggre.service.govorg.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.govorg.*;
@ -28,10 +30,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -393,6 +392,13 @@ public class GovOrgServiceImpl implements GovOrgService {
staffIds.removeIf(s->s.equals(formDTO.getStaffId()));
}
//是否具有超级管理员或管理员角色
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
Map<String,String> roleMap = staffInfoCache.getRoleMap();
if (roleMap.containsKey("root_manager") || roleMap.containsKey("manager")) {
formDTO.setEnableFlag("disabled");
}
//2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】
List<ListStaffResultDTO> staffList = epmetUserService.getStaffInfoList(formDTO);

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

@ -797,4 +797,205 @@
GROUP BY staff_id
</select>
<select id="regUserList" resultType="com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO$CustomerDataManage">
SELECT
t.orgId, t.dateId, t.userCount, t.partyMemberCount,t.residentCount
FROM
(
SELECT DISTINCT
date_id dateId, reg_total userCount, partymember_total partyMemberCount, (reg_total - partymember_total) residentCount
<choose>
<when test='dataType == "agency"'>
, agency_id orgId
FROM fact_reg_user_agency_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND agency_id IN (" separator="," close=")">
#{id}
</foreach>
</when>
<otherwise>
, grid_id orgId
FROM fact_reg_user_grid_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND grid_id IN (" separator="," close=")">
#{id}
</foreach>
</otherwise>
</choose>
<if test='sourceType != "" and sourceType == "start" and startTime != "" and startTime != null '>
AND date_id <![CDATA[>=]]> #{startTime}
ORDER BY date_id ASC
</if>
<if test='sourceType != "" and sourceType == "end" and endTime != "" and endTime != null '>
AND date_id <![CDATA[<=]]> #{endTime}
ORDER BY date_id DESC
</if>
<choose>
<when test='dataType == "agency"'>, agency_id ASC</when>
<otherwise>, grid_id ASC</otherwise>
</choose>
) t
GROUP BY t.orgId
</select>
<select id="groupList" resultType="com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO$CustomerDataManage">
SELECT
t.orgId, t.dateId, t.groupCount
FROM
(
SELECT DISTINCT
date_id dateId, group_total groupCount
<choose>
<when test='dataType == "agency"'>
, agency_id orgId
FROM fact_group_total_agency_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND agency_id IN (" separator="," close=")">
#{id}
</foreach>
</when>
<otherwise>
, grid_id orgId
FROM fact_group_total_grid_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND grid_id IN (" separator="," close=")">
#{id}
</foreach>
</otherwise>
</choose>
<if test='sourceType != "" and sourceType == "start" and startTime != "" and startTime != null '>
AND date_id <![CDATA[>=]]> #{startTime}
ORDER BY date_id ASC
</if>
<if test='sourceType != "" and sourceType == "end" and endTime != "" and endTime != null '>
AND date_id <![CDATA[<=]]> #{endTime}
ORDER BY date_id DESC
</if>
<choose>
<when test='dataType == "agency"'>, agency_id ASC</when>
<otherwise>, grid_id ASC</otherwise>
</choose>
) t
GROUP BY t.orgId
</select>
<select id="topicList" resultType="com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO$CustomerDataManage">
SELECT
t.orgId, t.dateId, t.topicCount
FROM
(
SELECT DISTINCT
date_id dateId, topic_total topicCount
<choose>
<when test='dataType == "agency"'>
, agency_id orgId
FROM fact_topic_hotdiscuss_agency_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND agency_id IN (" separator="," close=")">
#{id}
</foreach>
</when>
<otherwise>
, grid_id orgId
FROM fact_topic_hotdiscuss_grid_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND grid_id IN (" separator="," close=")">
#{id}
</foreach>
</otherwise>
</choose>
<if test='sourceType != "" and sourceType == "start" and startTime != "" and startTime != null '>
AND date_id <![CDATA[>=]]> #{startTime}
ORDER BY date_id ASC
</if>
<if test='sourceType != "" and sourceType == "end" and endTime != "" and endTime != null '>
AND date_id <![CDATA[<=]]> #{endTime}
ORDER BY date_id DESC
</if>
<choose>
<when test='dataType == "agency"'>, agency_id ASC</when>
<otherwise>, grid_id ASC</otherwise>
</choose>
) t
GROUP BY t.orgId
</select>
<select id="issueList" resultType="com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO$CustomerDataManage">
SELECT
t.orgId, t.dateId, t.issueCount
FROM
(
SELECT DISTINCT
date_id dateId, issue_total issueCount
<choose>
<when test='dataType == "agency"'>
, agency_id orgId
FROM fact_issue_agency_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND agency_id IN (" separator="," close=")">
#{id}
</foreach>
</when>
<otherwise>
, grid_id orgId
FROM fact_issue_grid_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND grid_id IN (" separator="," close=")">
#{id}
</foreach>
</otherwise>
</choose>
<if test='sourceType != "" and sourceType == "start" and startTime != "" and startTime != null '>
AND date_id <![CDATA[>=]]> #{startTime}
ORDER BY date_id ASC
</if>
<if test='sourceType != "" and sourceType == "end" and endTime != "" and endTime != null '>
AND date_id <![CDATA[<=]]> #{endTime}
ORDER BY date_id DESC
</if>
<choose>
<when test='dataType == "agency"'>, agency_id ASC</when>
<otherwise>, grid_id ASC</otherwise>
</choose>
) t
GROUP BY t.orgId
</select>
<select id="projectList" resultType="com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO$CustomerDataManage">
SELECT
t.orgId, t.dateId, t.projectCount, t.closedProjectCount
FROM
(
SELECT DISTINCT
date_id dateId, project_total projectCount, closed_total closedProjectCount
<choose>
<when test='dataType == "agency"'>
, agency_id orgId
FROM fact_agency_project_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND agency_id IN (" separator="," close=")">
#{id}
</foreach>
</when>
<otherwise>
, grid_id orgId
FROM fact_grid_project_daily
WHERE del_flag = '0'
<foreach collection="idList" item="id" open="AND grid_id IN (" separator="," close=")">
#{id}
</foreach>
</otherwise>
</choose>
<if test='sourceType != "" and sourceType == "start" and startTime != "" and startTime != null '>
AND date_id <![CDATA[>=]]> #{startTime}
ORDER BY date_id ASC
</if>
<if test='sourceType != "" and sourceType == "end" and endTime != "" and endTime != null '>
AND date_id <![CDATA[<=]]> #{endTime}
ORDER BY date_id DESC
</if>
<choose>
<when test='dataType == "agency"'>, agency_id ASC</when>
<otherwise>, grid_id ASC</otherwise>
</choose>
) t
GROUP BY t.orgId
</select>
</mapper>

11
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml

@ -61,7 +61,7 @@
SELECT DISTINCT<!-- 没有这个去重会改变最终的结果顺序,至于为什么还不清楚 -->
sr.staff_id,
cs.created_time,
case when gsr.role_key =
case when cs.enable_flag = 'enable' AND gsr.role_key =
<choose>
<when test="orgType != null and orgType == 'agency' ">
'agency_leader'
@ -73,9 +73,14 @@
'grid_manager'
</otherwise>
</choose>
then 1 else 0 end is_first<!-- 有单位领导角色的人赋值为1,没有的赋值为0 -->
then 0
when cs.enable_flag = 'enable' AND gsr.role_key != 'agency_leader'
then 1 else 2 end is_first<!-- 未禁用有相应角色人员赋值0,未禁用无相应角色人员赋值1,禁用人员赋值2 -->
FROM staff_role sr
INNER JOIN customer_staff cs ON sr.staff_id = cs.user_id
<if test="enableFlag != null and enableFlag != '' and enableFlag == 'enable' ">
AND cs.enable_flag = 'enable' <!-- 非超级管理员、管理员只允许查看未禁用人员信息 -->
</if>
INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id AND gsr.customer_id = #{customerId}
WHERE
sr.del_flag = '0'
@ -100,7 +105,7 @@
</choose>
) t
GROUP BY t.staff_id
ORDER BY t.is_first <![CDATA[<>]]> 1, t.created_time desc<!-- 标注有单位领导角色的人不参与排序也就是默认拍在前边,再按创建时间降序 -->
ORDER BY t.is_first <![CDATA[<>]]> 0, t.is_first asc, t.created_time desc<!-- 标注有相应角色的人不参与排序也就是默认拍在前边,没有相对于角色的排在后边,禁用人员排在最后 -->
LIMIT #{pageNo}, #{pageSize}
</select>

41
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml

@ -15,4 +15,45 @@
</foreach>
</select>
<select id="patrolList" resultType="com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO$CustomerDataManage">
SELECT
t.dateId, t.orgId, t.staffId, sum(t.patrol_total) patrolCount, SUM(t.total_time) patrolDurationInteger
FROM (
SELECT
date_id dateId, grid_id, staff_id staffId, patrol_total , total_time
<choose>
<when test='dataType == "agency"'>
, grid_pids orgId
</when>
<otherwise>
, grid_id orgId
</otherwise>
</choose>
FROM
stats_staff_patrol_record_daily
WHERE del_flag = '0'
AND patrol_total > 0
<choose>
<when test='dataType == "agency"'>
<foreach collection="idList" item="id" open="AND (" close=")" separator=" OR ">
grid_pids like concat('%', #{id}, '%')
</foreach>
</when>
<otherwise>
<foreach collection="idList" item="id" open="AND grid_id IN (" separator="," close=")">
#{id}
</foreach>
</otherwise>
</choose>
<if test='type != "" and type == "Interval" and startTime != "" and startTime != null '>
AND date_id <![CDATA[>=]]> #{startTime}
</if>
<if test='endTime != "" and endTime != null '>
AND date_id <![CDATA[<=]]> #{endTime}
</if>
) t
GROUP BY t.grid_id, t.staffId
</select>
</mapper>

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

@ -175,4 +175,11 @@
</if>
</select>
<!-- 根据组织ID查询组织名 -->
<select id="selectAgencyNameByAgencyId" resultType="java.lang.String">
SELECT AGENCY_NAME FROM screen_customer_agency
WHERE AGENCY_ID = #{agencyId}
AND DEL_FLAG = 0
</select>
</mapper>

1
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java

@ -21,6 +21,7 @@ public class ScreenProjectDistributionFormDTO implements Serializable {
/**
* 如果为空返回全部可选值1:红色事件2黄色事件3绿色事件
* all:全部
*/
@NotBlank(message = "level不能为空")
private String level;

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

@ -37,4 +37,10 @@ public class ScreenProjectDistributionResultDTO implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date projectCreateTime;
/**
* 分类名称 add 21.09.9
*/
private String categoryName;
}

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

@ -464,6 +464,8 @@ public class AgencyServiceImpl implements AgencyService {
pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON));
}else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){
pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA));
} else if (customerAgencyDTO.getPid().equals(customerAgencyDTO.getPids())) {
pidList.add(customerAgencyDTO.getPids());
}
if(!CollectionUtils.isEmpty(pidList)){
//单客户,存在上级时查询...

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

@ -1,6 +1,7 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -11,6 +12,7 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.UserDTO;
import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.form.screen.ColorProjectTotalFormDTO;
@ -23,7 +25,6 @@ import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.project.CustomerProjectCategoryDTO;
import com.epmet.project.dto.form.CategoryTopAppealFormDTO;
import com.epmet.project.dto.result.CategoryTopAppealResultDTO;
@ -60,8 +61,6 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
@Autowired
private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
/**
@ -85,6 +84,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
/**
* @Description 中央区事件分析-项目分布
* 2021-06-03 修改查询红黄绿事件事件范围为一个月
* 2021-09-09大屏新增普通事件列表首次查询平阴整个客户下近30天内的项目展示分类名称前端截取第一个-之前的文字颜色等级项目标题点击8个街道联动
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
@ -117,9 +117,13 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
CustomerAgencyUserRoleFormDTO userRoleFormDTO = new CustomerAgencyUserRoleFormDTO();
userRoleFormDTO.setCustomerId(formDTO.getCustomerId());
userRoleFormDTO.setStaffId(item.getReportUserId());
Map<String, String> staffRoleMap = CustomerStaffRedis.getStaffRoleMap(formDTO.getCustomerId(), item.getReportUserId());
if (!CollectionUtils.isEmpty(staffRoleMap)){
item.setReportUserRoleSet(staffRoleMap.keySet());
//只有工作端的用户才调用此接口
Result<UserDTO> userDTOResult = userOpenFeignClient.queryUserClient(item.getReportUserId());
if (userDTOResult.success() && null != userDTOResult.getData() && AppClientConstant.APP_GOV.equals(userDTOResult.getData().getFromApp())) {
Map<String, String> staffRoleMap = CustomerStaffRedis.getStaffRoleMap(formDTO.getCustomerId(), item.getReportUserId());
if (!CollectionUtils.isEmpty(staffRoleMap)) {
item.setReportUserRoleSet(staffRoleMap.keySet());
}
}
}

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -282,6 +282,7 @@
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
and sca.IS_DISPLAY='1'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
AND sca.PARENT_AREA_CODE = #{areaCode}
@ -296,6 +297,7 @@
FROM
screen_customer_grid m
where m.DEL_FLAG = '0'
and m.IS_DISPLAY='1'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
and m.AREA_CODE=#{areaCode}

34
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -12,13 +12,14 @@
longitude AS longitude,
latitude AS latitude,
PROJECT_CREATE_TIME AS projectCreateTime,
CUSTOMER_ID AS customerId
CUSTOMER_ID AS customerId,
ALL_CATEGORY_NAME as categoryName
FROM
screen_project_data
WHERE
del_flag = '0'
AND UNIX_TIMESTAMP(CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL 1 MONTH))
<if test="level != null and level.trim()!=''">
<if test="level != null and level.trim()!='' and level !='all'">
and project_level = #{level}
</if>
<if test="ids != null">
@ -30,26 +31,23 @@
<if test="ids == null and agencyId != null">
and org_id = #{agencyId}
</if>
<choose>
<when test='level != null and "1" == level'>
and PROJECT_STATUS_CODE ='pending'
</when>
<when test='level != null and "2" == level'>
and PROJECT_STATUS_CODE ='pending'
</when>
<when test='level != null and "3" == level'>
and PROJECT_STATUS_CODE !='pending'
and DATE_SUB(CURDATE(), INTERVAL 30 DAY) &lt;= date(PROJECT_CREATE_TIME)
</when>
<otherwise>
and PROJECT_STATUS_CODE ='pending'
</otherwise>
</choose>
<if test='level != null and "1" == level'>
and PROJECT_STATUS_CODE ='pending'
</if>
<if test='level != null and "2" == level'>
and PROJECT_STATUS_CODE ='pending'
</if>
<if test='level != null and "3" == level'>
and PROJECT_STATUS_CODE !='pending'
and DATE_SUB(CURDATE(), INTERVAL 30 DAY) &lt;= date(PROJECT_CREATE_TIME)
</if>
order by PROJECT_CREATE_TIME desc
<if test='level != null and "3" == level'>
LIMIT #{pageSize}
</if>
<if test='level != null and "all" == level'>
LIMIT #{pageSize}
</if>
</select>
<select id="selectIdsByAreaCode" resultType="java.lang.String">
select agency_id as id from screen_customer_agency where del_flag = '0' and area_code like concat(#{areaCode},'%')

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java

@ -64,6 +64,6 @@ public interface FactGroupAgencyDailyDao extends BaseDao<FactGroupAgencyDailyEnt
* @Description 删除当天已存在数据
* @author zxc
*/
void deleteInsertAgencyDailyByDateId(@Param("dateId") String dateId, @Param("customerId") String customerId);
Integer deleteInsertAgencyDailyByDateId(@Param("dateId") String dateId, @Param("customerId") String customerId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java

@ -4,6 +4,7 @@ import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.Pinyin4jUtil;
import com.epmet.commons.tools.utils.UniqueIdGenerator;
import com.epmet.entity.evaluationindex.screen.IndexDictEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity;
@ -13,7 +14,6 @@ import com.epmet.service.evaluationindex.screen.IndexGroupDetailService;
import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService;
import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService;
import com.epmet.support.normalizing.Correlation;
import com.epmet.util.Pinyin4jUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java

@ -2,7 +2,7 @@ package com.epmet.model;
import com.alibaba.excel.annotation.ExcelProperty;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.util.Pinyin4jUtil;
import com.epmet.commons.tools.utils.Pinyin4jUtil;
import lombok.Data;
@Data

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java

@ -33,9 +33,11 @@ import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO;
import com.epmet.dto.stats.FactGroupAgencyDailyDTO;
import com.epmet.entity.stats.FactGroupAgencyDailyEntity;
import com.epmet.service.stats.FactGroupAgencyDailyService;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
@ -112,11 +114,16 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl<FactGroupAg
@Override
@Transactional(rollbackFor = Exception.class)
public void insertGroupAgencyDaily(List<AgencyGroupDailyResultDTO> agencyList,String customerId) {
if (agencyList.size() != NumConstant.ZERO){
baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId);
baseDao.insertGroupAgencyDaily(agencyList);
if (!CollectionUtils.isEmpty(agencyList)){
Integer delNum;
do {
delNum = baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId);
}while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND);
List<List<AgencyGroupDailyResultDTO>> partition = ListUtils.partition(agencyList, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
baseDao.insertGroupAgencyDaily(p);
});
}
}
/**

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml

@ -122,6 +122,7 @@
WHERE
date_id = #{dateId}
AND customer_id = #{customerId}
LIMIT 1000
</delete>
</mapper>

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -21,6 +21,7 @@ import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ActConstant;
import com.epmet.constant.ActMessageConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.UserMessageFormDTO;
@ -32,7 +33,6 @@ import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
import com.epmet.utils.ModuleConstant;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -694,6 +694,11 @@ public class WorkActServiceImpl implements WorkActService {
userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.ACT_CANCELED,
actInfoDTO.getTitle(),
formDTO.getCancelReason()));
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.HEART_CANCEL_ACT);
userMessageFormDTO.setTargetId(formDTO.getActId());
userMessageFormDTOS.add(userMessageFormDTO);
//2020.10.26 添加发送微信订阅消息功能 sun
WxSubscribeMessageFormDTO dto = new WxSubscribeMessageFormDTO();

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java

@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ActConstant;
import com.epmet.constant.ActMessageConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.ActInfoDao;
import com.epmet.dao.ActUserLogDao;
import com.epmet.dao.ActUserRelationDao;
@ -639,6 +640,11 @@ public class WorkActUserServiceImpl implements WorkActUserService {
} else if (ActConstant.ACT_USER_STATUS_REFUSED.equals(type)) {
userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.AUDIT_REFUSED, actInfo.getTitle(), actUserRelationEntity.getFailureReason()));
}
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.HEART_SIGIN_UP_RES);
userMessageFormDTO.setTargetId(actUserRelationEntity.getId());
Result result = epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO);
if (result.success()) {
logger.info("审核成功,已成功发送站内信");

170
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java

@ -16,9 +16,179 @@ public interface UserMessageTypeConstant {
/**
* 居民端提交热心居民申请通知网格长
* targetId:resi_warmhearted_apply.id
*/
String WARMHEARTED_APPLY="warmhearted_apply";
/**
* 工作端审核完热心居民申请通知居民结果
* targetId:resi_warmhearted_apply.id
*/
String WARMHEARTED_APPLY_RES="warmhearted_apply_res";
/**
* 居民端认证党员时补充信息填写完成提交后通知网格长人工审核党员申请
* targetId:partymember_info.id
*/
String PARTY_CERTIFY_APPLY="party_certify_apply";
/**
* 工作端审核居民是否是党员通知居民
* targetId:partymember_info.id
*/
String PARTY_CERTIFY_APPLY_RES="party_certify_apply_res";
/**
* 居民端用户申请创建小组提交小组信息后通知网格长
* targetId:resi_group.id
*/
String GROUP_CREATE_GROUP_APPLY="group_create_group_apply";
/**
* 工作端审核建群申请后通知建组人结果
* targetId:resi_group.id
*/
String GROUP_CREATE_GROUP_RES="group_create_group_res";
/**
* 居民单申请入群通知组长审核
* targetId:resi_group.id
*/
String GROUP_APPLY_ENTER="group_apply_enter";
/**
* 组长审核完入群申请通知居民结果
* targetId:resi_group.id
*/
String GROUP_APPLY_ENTER_RES="group_apply_enter_res";
/**
* 组员通过连接自动入组的通知组长
* targetId:resi_group.id
*/
String GROUP_ENTER_GROUP_BY_LINK_RES="group_enter_group_by_link_res";
/**
* 组内发布活动
* targetId:group_act_info.id
*/
String GROUP_ACT_PUBLISH="group_act_publish";
/**
* 组内发布活动,进行编辑
* targetId:group_act_info.id
*/
String GROUP_ACT_CHANGE="group_act_change";
/**
* 组内活动取消
* targetId:group_act_info.id
*/
String GROUP_ACT_CANCEL="group_act_cancel";
/**
* 工作端转交组长通知原组长
* targetId:resi_group.id
*/
String GROUP_ORIGINAL_LEADER_DOWN="group_original_leader_down";
/**
* 新任组长告诉他这个好消息
* targetId:resi_group.id
*/
String GROUP_NEW_LEADER_UP="group_new_leader_up";
/**
* 禁言组员
* targetId:resi_group.id
*/
String GROUP_SLIENT_MEMBER="group_slient_member";
/**
* 发布小组内通知
* targetId:notice.id
*/
String GROUP_MESSAGE_PUBLISH="group_message_publish";
/**
* 发布小组内通知
* targetId:notice.id
*/
String GROUP_MESSAGE_EDIT="group_message_edit";
/**
* 关闭议题时已解决或者无需解决通知议题发起人话题创建人
* targetId:issue.id
*/
String ISSUE_CLOSE_ISSUE="issue_close_issue";
/**
* 议题转项目时给话题创建人议题发起人勾选的工作人员分别推送消息
* targetId:居民端用户issue.id工作端project.id
*/
String ISSUE_SHIFT_PROJECT="issue_shift_project";
/**
* 项目流转
* targetId:project.id
*/
String PROJECT_TRANSFER="project_transfer";
/**
* 项目结案
* targetId:project.id
*/
String PROJECT_CLOSED="project_closed";
/**
* 项目退回
* targetId:project.id
*/
String PROJECT_RETURN="project_return";
/**
* 项目立项
* targetId:project.id
*/
String PROJECT_APPROVAL="project_approval";
/**
* 事件立项
* targetId:project.id
*/
String PROJECT_FROM_RESI_EVENT="project_from_resi_event";
/**
* 项目滞留超期提醒
*/
String PROJECT_REMIND="project_remind";
/**
* 发布党建声音
* targetId:article.DRAFT_ID
*/
String PARTY_VOICE_PUBLISH="party_voice_publish";
/**
* 爱心互助通过审核的用户发送消息
* targetId:act_info.id
*/
String HEART_CANCEL_ACT="heart_cancel_act";
/**
* 活动报名结果通知居民
* act_user_relation.id
*/
String HEART_SIGIN_UP_RES="heart_sigin_up_res";
/**
* 居民端提交徽章认证申请
* user_badge_certificate_record.id
*/
String BADGE_AUTH_APPLY="badge_auth_apply";
}

8
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java

@ -109,4 +109,12 @@ public class UserMessageDTO implements Serializable {
*/
private Date updatedTime;
/**
* 消息分类:info-上传下达消息 详见UserMessageTypeConstant
*/
private String messageType;
/**
* 消息对应的业务id,比如message_type=info时此列存储的是消息id,可跳转到消息详情
*/
private String targetId;
}

11
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java

@ -1,8 +1,6 @@
package com.epmet.dto.form;
import lombok.Builder;
import lombok.Data;
import net.bytebuddy.implementation.bind.annotation.Default;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@ -61,4 +59,13 @@ public class UserMessageFormDTO implements Serializable {
* 调用者 分内部调用和外部调用内部调用值为空外部默认为外挂-站内信
*/
private String referer;
/**
* 消息分类:info-上传下达消息 详见UserMessageTypeConstant
*/
private String messageType;
/**
* 消息对应的业务id,比如message_type=info时此列存储的是消息id,可跳转到消息详情
*/
private String targetId;
}

12
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/StaffMessageResultDTO.java

@ -35,5 +35,17 @@ public class StaffMessageResultDTO implements Serializable {
* 通知时间
*/
private Long createdTime;
/**
* 消息分类:info-上传下达消息 详见UserMessageTypeConstant
*/
private String messageType;
/**
* 消息对应的业务id,比如message_type=info时此列存储的是消息id,可跳转到消息详情
*/
private String targetId;
}

8
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml

@ -35,7 +35,9 @@
customer_id,
created_time,
grid_id,
message_content
message_content,
message_type,
target_id
FROM
user_message
WHERE
@ -66,7 +68,9 @@
title,
message_content as messageContent,
read_flag as readFlag,
unix_timestamp(CREATED_TIME) as createdTime
unix_timestamp(CREATED_TIME) as createdTime,
message_type AS messageType,
target_id AS targetId
from
user_message
where

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

@ -401,4 +401,35 @@ public class OssController {
return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId);
}
/**
* @Description 办事指南上传附件
* @Param file
* @Param customerId
* @Return {@link Result< UploadImgResultDTO>}
* @Author zhaoqifeng
* @Date 2021/9/8 17:14
*/
@PostMapping("upload-guide-file")
public Result<UploadImgResultDTO> uploadGuideFile(@RequestPart(value = "file") MultipartFile file, @RequestParam("customerId") String customerId) {
String fileName = file.getOriginalFilename();
String format = "-" + fileName.substring(fileName.lastIndexOf(".") + NumConstant.ONE) + "-";
format = format.toLowerCase();
// 体积限制
int sizeMb = 10;
// 大小限制10m
int sizeThreshold = sizeMb * 1024 * 1024;
if (file.getSize() > sizeThreshold) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode(),
EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg().concat(",限制在").concat(String.valueOf(sizeMb)).concat("M以内"));
}
// 格式限制,只允许png和jpeg
if (!ModuleConstant.GUIDE_FILE_DOC.contains(format)) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg());
}
return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId);
}
}

1
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -43,6 +43,7 @@ public interface ModuleConstant extends Constant {
* 项目附件-允许的文件类型
*/
String PROJECT_FILE_DOC = "-pdf-ppt-pptx-doc-docx-xls-xlsx-";
String GUIDE_FILE_DOC = "-pdf-doc-docx-xls-xlsx-";
/**
* 项目附件-允许的音频类型
*/

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

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -103,4 +104,6 @@ public class BizPointUserTotalDetailDTO implements Serializable {
*/
private Date updatedTime;
private String rank;
}

46
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java

@ -0,0 +1,46 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import javax.validation.constraints.Min;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/9/6 3:13 下午
* @DESC
*/
@Data
public class AllPartyFormDTO implements Serializable {
private static final long serialVersionUID = -600409785611581009L;
/**
* 页码
**/
private Integer pageNo = NumConstant.ONE;
/**
* 每页数据条数
**/
private Integer pageSize = NumConstant.TEN;
/**
* 本月 monthly 总排行 all;
* */
private String type;
/**
* 认证成功的党员 的用户ID
* */
private List<String> userIds;
/**
* 客户ID
*/
private String customerId;
}

15
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.sun.webkit.LoadListenerClient;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@ -17,8 +18,20 @@ public class GroupPointFormDTO implements Serializable {
public interface GroupPoint extends CustomerClientShowGroup {}
public interface GridRank extends CustomerClientShowGroup {}
public interface PointRank extends CustomerClientShowGroup {}
public interface GridScopeRank {}
public interface CustomerScopeRank {}
public interface MyGroupRank {}
@NotBlank(message = "小组Id不能为空", groups = {GroupPoint.class, GridRank.class})
private String groupId;
@NotBlank(message = "网格Id不能为空", groups = {GridRank.class})
@NotBlank(message = "网格Id不能为空", groups = {GridRank.class, PointRank.class, GridScopeRank.class, MyGroupRank.class})
private String gridId;
@NotBlank(message = "客户Id不能为空", groups = {CustomerScopeRank.class})
private String customerId;
/** 页码 */
private Integer pageNo = 1;
/** 单页条数 */
private Integer pageSize = 10;
}

49
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java

@ -0,0 +1,49 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/9/6 3:12 下午
* @DESC
*/
@Data
public class AllPartyResultDTO implements Serializable {
private static final long serialVersionUID = -5889648842876122793L;
/**
* 排序
**/
private Integer ranking;
/**
* 积分
**/
private Integer point;
/**
* 头像
**/
private String userHeadPhoto;
/**
* 名称
**/
private String realName;
/**
* 用户id
**/
private String userId;
public AllPartyResultDTO() {
this.point = NumConstant.ZERO;
this.userHeadPhoto = "";
this.realName = "";
this.userId = "";
}
}

21
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GridPointRankResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/9/10 14:11
*/
@NoArgsConstructor
@Data
public class GridPointRankResultDTO implements Serializable {
private static final long serialVersionUID = 3288606889536923166L;
private String gridName;
private String agencyRank;
private String customerRank;
}

21
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java

@ -35,4 +35,25 @@ public class GroupPointRankingResultDTO implements Serializable {
* 小组ID
*/
private String groupId;
/** 头像 */
private String groupHeadPhoto;
/** 类型 branch 支部小组;o */
private String groupType;
/** 所属网格id */
private String gridId;
/** 所属网格名称 */
private String gridNamePath;
/** 网格内排名 */
private Integer gridRanking;
/** 客户下总排名 */
private Integer customerRanking;
/** 我是否是组长 */
private String groupLeaderFlag;
}

22
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyPointRankResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/9/10 13:44
*/
@NoArgsConstructor
@Data
public class MyPointRankResultDTO implements Serializable {
private static final long serialVersionUID = -2438231097029179782L;
private String headPhoto;
private String gridRank;
private String customerRank;
private String userName;
}

59
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java

@ -1,6 +1,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -10,16 +11,20 @@ import com.epmet.dto.result.GroupPointRankingResultDTO;
import com.epmet.dto.result.GroupPointRuleResultDTO;
import com.epmet.dto.result.PointRankingResultDTO;
import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO;
import com.epmet.resi.group.enums.SearchScopeTypeEnum;
import com.epmet.service.BizPointTotalDetailService;
import com.epmet.service.BizPointUserTotalDetailService;
import com.epmet.service.PointRuleService;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotBlank;
import java.lang.management.MemoryManagerMXBean;
import java.util.List;
/**
@ -113,4 +118,58 @@ public class GroupPointController {
return new Result<BizPointTotalDetailDTO>().ok(result);
}
/**
* @description 小组排名- 网格范围内
*
* @param formDTO
* @return
* @author wxz
* @date 2021.09.07 13:35:45
*/
@PostMapping("grouppointranking/gridscope")
public Result<List<GroupPointRankingResultDTO>> listGroupPointRandingInGridScope(@RequestBody GroupPointFormDTO formDTO, @LoginUser TokenDto loginUser) {
ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.GridScopeRank.class);
String gridId = formDTO.getGridId();
Integer pageNo = formDTO.getPageNo();
Integer pageSize = formDTO.getPageSize();
List<GroupPointRankingResultDTO> page = bizPointTotalDetailService.listGroupPointRandingInPercificScope(SearchScopeTypeEnum.GRID, gridId,pageNo, pageSize, loginUser.getUserId());
return new Result<List<GroupPointRankingResultDTO>>().ok(page);
}
/**
* @description 小组排名- 客户范围内
*
* @param formDTO
* @return
* @author wxz
* @date 2021.09.08 09:18:37
*/
@PostMapping("grouppointranking/customerscope")
public Result<List<GroupPointRankingResultDTO>> listGroupPointRandingInCustomerScope(@RequestBody GroupPointFormDTO formDTO, @LoginUser TokenDto loginUser) {
ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.CustomerScopeRank.class);
String customerId = formDTO.getCustomerId();
Integer pageNo = formDTO.getPageNo();
Integer pageSize = formDTO.getPageSize();
List<GroupPointRankingResultDTO> page = bizPointTotalDetailService.listGroupPointRandingInPercificScope(SearchScopeTypeEnum.CUSTOMER, customerId, pageNo, pageSize, loginUser.getUserId());
return new Result<List<GroupPointRankingResultDTO>>().ok(page);
}
/**
* @description 小组排名- 列出我所在的小组的积分排名
*
* @param formDTO
* @return
* @author wxz
* @date 2021.09.08 13:31:09
*/
@PostMapping("grouppointranking/mygroups")
public Result<List<GroupPointRankingResultDTO>> listMyGroupPointRanding(@LoginUser TokenDto loginInfo, @RequestBody GroupPointFormDTO formDTO) {
String userId = loginInfo.getUserId();
ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.MyGroupRank.class);
String gridId = formDTO.getGridId();
List<GroupPointRankingResultDTO> list = bizPointTotalDetailService.listMyGroupPointRanding(userId, gridId);
return new Result<List<GroupPointRankingResultDTO>>().ok(list);
}
}

42
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java

@ -159,6 +159,18 @@ public class ResiPointController {
return new Result<List<ResiAroundPartyPointRankResultDTO>>().ok(resultDTOS);
}
/**
* @Description 全部党员积分排行
* @Param formDTO
* @author zxc
* @date 2021/9/6 3:30 下午
*/
@PostMapping("allparty")
public Result<List<AllPartyResultDTO>> allParty(@RequestBody AllPartyFormDTO formDTO,@LoginUser TokenDto tokenDto){
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<AllPartyResultDTO>>().ok(userPointStatisticalDailyService.allParty(formDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.MyPointTaskResultDTO>>
* @param tokenDto
@ -178,4 +190,34 @@ public class ResiPointController {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<MyPointTaskResultDTO>>().ok(pointActionLogService.queryMyPointTaskList(formDTO));
}
/**
* @Description 个人当月积分在网格和客户中的排名
* @Param tokenDto
* @Param formDTO
* @Return {@link Result< MyPointTaskResultDTO>}
* @Author zhaoqifeng
* @Date 2021/9/10 14:13
*/
@PostMapping("mypointrank")
public Result<MyPointRankResultDTO> myPointRank(@LoginUser TokenDto tokenDto, @RequestBody GroupPointFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.PointRank.class);
return new Result<MyPointRankResultDTO>().ok(userPointStatisticalDailyService.myPointRank(tokenDto, formDTO));
}
/**
* @Description 网格当月积分在组织和客户内排名
* @Param tokenDto
* @Param formDTO
* @Return {@link Result<GridPointRankResultDTO>}
* @Author zhaoqifeng
* @Date 2021/9/10 14:13
*/
@PostMapping("gridpointrank")
public Result<GridPointRankResultDTO> gridPointRank(@LoginUser TokenDto tokenDto, @RequestBody GroupPointFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.PointRank.class);
return new Result<GridPointRankResultDTO>().ok(userPointStatisticalDailyService.gridPointRank(tokenDto, formDTO));
}
}

23
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/BizPointTotalDetailDao.java

@ -40,4 +40,27 @@ public interface BizPointTotalDetailDao extends BaseDao<BizPointTotalDetailEntit
* @return com.epmet.dto.BizPointTotalDetailDTO
*/
BizPointTotalDetailDTO selectDataByObject(@Param("type")String type, @Param("objectId")String objectId);
/**
* @description 查询object在指定范围内的排名
*
* @param bizType
* @param groupId
* @param scope
* @return
* @author wxz
* @date 2021.09.08 17:36:17
*/
Integer getRanking(@Param("bizType") String bizType, @Param("groupId") String groupId, @Param("scope") String scope);
/**
* @description 搜索指定范围内最低名次
*
* @param scope
* @param scopeId
* @return
* @author wxz
* @date 2021.09.09 09:53:37
*/
Integer getMinRanking(@Param("bizType") String bizType,@Param("searchScope") String scope, @Param("searchScopeId") String scopeId);
}

9
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java

@ -18,7 +18,9 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.BizPointUserTotalDetailDTO;
import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO;
import com.epmet.dto.result.AllPartyResultDTO;
import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO;
import com.epmet.dto.result.ResiPointRankResultDTO;
import com.epmet.entity.UserPointStatisticalDailyEntity;
@ -73,6 +75,7 @@ public interface UserPointStatisticalDailyDao extends BaseDao<UserPointStatistic
* @Date 09:24 2020-12-29
**/
List<ResiAroundPartyPointRankResultDTO> selectListGridPartyRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO);
List<AllPartyResultDTO> selectListGridPartyNewRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO);
/**
* 身边党员-积分排行 按网格统计对本月党员增加的积分 进行排序
@ -82,4 +85,10 @@ public interface UserPointStatisticalDailyDao extends BaseDao<UserPointStatistic
* @Date 09:24 2020-12-29
**/
List<ResiAroundPartyPointRankResultDTO> selectListGridPartyRankByMonth(ResiAroundPartyPointRankFormDTO formDTO);
List<AllPartyResultDTO> selectListGridPartyNewRankByMonth(ResiAroundPartyPointRankFormDTO formDTO);
List<BizPointUserTotalDetailDTO> selectUserPointByMonth(@Param("customerId") String customerId, @Param("agencyId") String agencyId,
@Param("gridId") String gridId);
List<BizPointUserTotalDetailDTO> selectGridPointByMonth(@Param("customerId") String customerId, @Param("agencyId") String agencyId);
}

25
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java

@ -24,6 +24,7 @@ import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO;
import com.epmet.dto.result.GroupPointRankingResultDTO;
import com.epmet.entity.BizPointTotalDetailEntity;
import com.epmet.resi.group.enums.SearchScopeTypeEnum;
import java.util.List;
import java.util.Map;
@ -135,4 +136,28 @@ public interface BizPointTotalDetailService extends BaseService<BizPointTotalDet
* @return com.epmet.dto.BizPointTotalDetailDTO
*/
BizPointTotalDetailDTO getGroupPoint(GroupPointFormDTO formDTO);
/**
* @description 网格范围内查询小组排名
*
* @param searchScopeType 搜索小组的范围类型:GroupFormDTO.SearchScopeTypeEnum.GRID/GroupFormDTO.SearchScopeTypeEnum.CUSTOMER
* @param searchScopeId 搜索小组的范围id
* @param pageNo 页码默认0
* @param pageSize 单页条数默认10
* @return
* @author wxz
* @date 2021.09.07 14:18:08
*/
List<GroupPointRankingResultDTO> listGroupPointRandingInPercificScope(SearchScopeTypeEnum searchScopeType, String searchScopeId, Integer pageNo, Integer pageSize, String currentUserId);
/**
* @description 小组排名- 列出我所在的小组的积分排名
*
* @param userId
* @param gridId
* @return
* @author wxz
* @date 2021.09.08 13:34:49
*/
List<GroupPointRankingResultDTO> listMyGroupPointRanding(String userId, String gridId);
}

34
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java

@ -19,11 +19,13 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.UserPointStatisticalDailyDTO;
import com.epmet.dto.form.AllPartyFormDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import java.util.List;
@ -125,4 +127,32 @@ public interface UserPointStatisticalDailyService extends BaseService<UserPointS
* @Date 16:17 2020-12-28
**/
List<ResiAroundPartyPointRankResultDTO> listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO);
/**
* @Description 全部党员积分排行
* @Param formDTO
* @author zxc
* @date 2021/9/6 3:30 下午
*/
List<AllPartyResultDTO> allParty(AllPartyFormDTO formDTO);
/**
* @Description 个人当月积分在网格和客户中的排名
* @Param tokenDto
* @Param formDTO
* @Return {@link MyPointRankResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/10 14:18
*/
MyPointRankResultDTO myPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO);
/**
* @Description 网格当月积分在组织和客户内排名
* @Param tokenDto
* @Param formDTO
* @Return {@link GridPointRankResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/10 14:18
*/
GridPointRankResultDTO gridPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO);
}

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

@ -17,31 +17,50 @@
package com.epmet.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.BizPointTotalDetailDao;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.resi.group.dto.group.form.GroupFormDTO;
import com.epmet.resi.group.dto.group.form.GroupPointDetailFormDTO;
import com.epmet.resi.group.dto.group.form.GroupsByMemberFormDTO;
import com.epmet.resi.group.dto.group.result.GroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO;
import com.epmet.dto.result.GroupPointRankingResultDTO;
import com.epmet.entity.BizPointTotalDetailEntity;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.result.RankingResultDTO;
import com.epmet.resi.group.enums.SearchScopeTypeEnum;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.service.BizPointTotalDetailService;
import com.epmet.service.BizPointUserTotalDetailService;
import com.epmet.service.UserPointActionLogService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -57,7 +76,7 @@ import java.util.stream.Collectors;
* @since v1.0.0 2021-04-20
*/
@Service
public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTotalDetailDao, BizPointTotalDetailEntity> implements BizPointTotalDetailService {
public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTotalDetailDao, BizPointTotalDetailEntity> implements BizPointTotalDetailService, ResultDataResolver {
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@ -65,6 +84,10 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
private BizPointUserTotalDetailService bizPointUserTotalDetailService;
@Autowired
private UserPointActionLogService userPointActionLogService;
@Autowired
private RedisTemplate<String, ?> redisTemplate;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public PageData<BizPointTotalDetailDTO> page(Map<String, Object> params) {
@ -239,4 +262,264 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
return ConvertUtils.sourceToTarget(entity, BizPointTotalDetailDTO.class);
}
@Override
public List<GroupPointRankingResultDTO> listGroupPointRandingInPercificScope(SearchScopeTypeEnum searchScopeType, String searchScopeId,
Integer pageNo, Integer pageSize,
String currentUserId) {
// 1.查询有积分的小组得分排名
PageInfo<BizPointTotalDetailEntity> entityPageInfo = PageHelper.startPage(pageNo, pageSize).doSelectPageInfo(() -> {
LambdaQueryWrapper<BizPointTotalDetailEntity> query = new LambdaQueryWrapper<>();
if (SearchScopeTypeEnum.CUSTOMER == searchScopeType) {
query.eq(BizPointTotalDetailEntity::getCustomerId, searchScopeId);
} else if (SearchScopeTypeEnum.GRID == searchScopeType) {
query.eq(BizPointTotalDetailEntity::getGridId, searchScopeId);
}
query.eq(BizPointTotalDetailEntity::getBizType, "group");
query.orderByDesc(BizPointTotalDetailEntity::getTotalPoint);
baseDao.selectList(query);
});
List<BizPointTotalDetailEntity> groupList = entityPageInfo.getList();
List<String> groupIds = groupList.stream().map(g -> g.getObjectId()).collect(Collectors.toList());
// 2.将列表填充基本信息并且转换为dto
List<GroupPointRankingResultDTO> rankingInfoDTOs = convertGroupRankingInfoEntity2DTOs(groupIds, groupList, currentUserId);
Page page = new Page(pageNo, pageSize);
// 3.如果不满一页,则填充分数为0的
if (pageSize > groupIds.size()) {
// 查出网格下已有积分的小组id
LambdaQueryWrapper<BizPointTotalDetailEntity> query = new LambdaQueryWrapper<>();
if (SearchScopeTypeEnum.CUSTOMER == searchScopeType) {
query.eq(BizPointTotalDetailEntity::getCustomerId, searchScopeId);
} else if (SearchScopeTypeEnum.GRID == searchScopeType) {
query.eq(BizPointTotalDetailEntity::getGridId, searchScopeId);
}
query.eq(BizPointTotalDetailEntity::getBizType, "group");
query.select(BizPointTotalDetailEntity::getObjectId);
List<String> existingGroupIds = baseDao.selectObjs(query).stream().map(obj -> obj.toString()).collect(Collectors.toList());
int startRow = page.getStartRow() - existingGroupIds.size();
// 不足0的从0开始
startRow = Math.max(startRow, 0);
List<GroupPointRankingResultDTO> gap;
gap = fillGroupPageGap(existingGroupIds, searchScopeType, searchScopeId, startRow, pageSize - groupList.size(), currentUserId);
rankingInfoDTOs.addAll(gap);
}
// 4.排名填充。有积分的按照积分排序,分数一样的名次一样
Integer ranking = getStartRanking(rankingInfoDTOs, searchScopeType.getScopeType(), searchScopeId);
Integer prevPoint = null;
for (GroupPointRankingResultDTO g : rankingInfoDTOs) {
Integer point = Integer.valueOf(g.getPoint());
if (prevPoint != null && prevPoint > point) {
// 此举是为了在积分一样的情况下,给与相同的排名
ranking ++;
}
GridInfoCache gridInfo = getGridInfo(g.getGridId());
g.setGridId(g.getGridId());
if (gridInfo != null) {
g.setGridNamePath(gridInfo.getGridNamePath());
} else {
// todo 网格被删除了,应该怎么办?
g.setGridNamePath(" ");
}
g.setRanking(String.valueOf(ranking));
prevPoint = point;
}
return rankingInfoDTOs;
}
/**
* @description 获取起始排名
*
* @param points 积分信息分页列表
* @return
* @author wxz
* @date 2021.09.16 14:50:11
*/
private Integer getStartRanking(List<GroupPointRankingResultDTO> points, String scopeType, String scopeObjectId) {
if (CollectionUtils.isEmpty(points)) {
return 0;
}
GroupPointRankingResultDTO firstPoint = points.get(0);
if (firstPoint.getPoint().equals("0")) {
// 如果第一条积分就是0,那么查询出来有积分的组的最低名次+1(注意:point_total表不能有积分为0的记录,否则计算出来的名次会比实际名次+1)
Integer minRanking = baseDao.getMinRanking("group", scopeType, scopeObjectId);
return minRanking + 1;
} else {
return baseDao.getRanking("group", firstPoint.getGroupId(), scopeType);
}
}
/**
* @description 获取分页缺口group ranking信息
*
* @param startRow
* @param rowCount
* @return
* @author wxz
* @date 2021.09.07 16:30:28
*/
private List<GroupPointRankingResultDTO> fillGroupPageGap(List<String> existingGroupIds, SearchScopeTypeEnum searchScopeType,
String searchScopeObjectId, Integer startRow, Integer rowCount, String currentUserId) {
GroupFormDTO form = new GroupFormDTO();
form.setExcludeGroupIds(existingGroupIds);
form.setOrder(GroupFormDTO.OrderTypeEnum.DESC);
form.setSort(GroupFormDTO.SortTypeEnum.CREATE_TIME);
form.setStartRow(startRow);
form.setRowCount(rowCount);
form.setSearchScopeType(searchScopeType);
form.setSearchScopeObjectId(searchScopeObjectId);
Result<List<GroupDetailResultDTO>> result = resiGroupOpenFeignClient.listGroupDetailsExcludeGroupIds(form);
List<GroupDetailResultDTO> groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败");
if (CollectionUtils.isEmpty(groups)) {
return new ArrayList<>();
}
return groups.stream().map(g -> {
GroupPointRankingResultDTO dto = new GroupPointRankingResultDTO();
dto.setGroupType(g.getGroupType());
dto.setPoint("0");
dto.setGroupHeadPhoto(g.getGroupHeadPhoto());
dto.setGroupName(g.getGroupName());
dto.setGroupId(g.getGroupId());
dto.setGridId(g.getGridId());
dto.setGroupLeaderFlag(g.getLeaderId().equals(currentUserId) ? "leader" : "member");
return dto;
}).collect(Collectors.toList());
}
/**
* @description 将小组排名Entity转化为dto
*
* @param groupList
* @return
* @author wxz
* @date 2021.09.07 15:52:17
*/
private List<GroupPointRankingResultDTO> convertGroupRankingInfoEntity2DTOs(List<String> groupIds, List<BizPointTotalDetailEntity> groupList, String currentUserId) {
if (CollectionUtils.isEmpty(groupIds)) {
return new ArrayList<>();
}
// 查询这些小组的基本信息
Result<List<GroupDetailResultDTO>> listResult = resiGroupOpenFeignClient.listGroupDetailsByGroupIds(groupIds);
List<GroupDetailResultDTO> groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错");
// 将小组基本信息转化为map
HashMap<String, GroupDetailResultDTO> groupMap = new HashMap<>();
groupInfos.stream().forEach(g -> groupMap.put(g.getGroupId(), g));
// 将小组信息填充到排名列表中
List<GroupPointRankingResultDTO> rankingDTOs = groupList.stream().map(g -> {
GroupDetailResultDTO groupInfo = groupMap.get(g.getObjectId());
GroupPointRankingResultDTO dto = new GroupPointRankingResultDTO();
dto.setGroupId(g.getObjectId());
dto.setGroupName(groupInfo.getGroupName());
dto.setGroupType(groupInfo.getGroupType());
dto.setPoint(g.getTotalPoint().toString());
dto.setGroupHeadPhoto(groupInfo.getGroupHeadPhoto());
dto.setGridId(g.getGridId());
dto.setGroupLeaderFlag(groupInfo.getLeaderId().equals(currentUserId) ? "leader" : "member");
return dto;
}).collect(Collectors.toList());
return rankingDTOs;
}
/**
* @description 查询网格信息
*
* @param gridId
* @return
* @author wxz
* @date 2021.09.08 11:17:17
*/
public GridInfoCache getGridInfo(String gridId) {
HashOperations<String, String, Object> ope = redisTemplate.opsForHash();
Map<String, Object> entries = ope.entries(RedisKeys.getGridInfoKey(gridId));
if (entries.size() != 0) {
return BeanUtil.mapToBean(entries, GridInfoCache.class, true);
}
CustomerGridFormDTO form = new CustomerGridFormDTO();
form.setGridId(gridId);
Result<CustomerGridDTO> result = govOrgOpenFeignClient.getCustomerGridByGridId(form);
if (result == null || !result.success() || result.getData() == null) {
return null;
}
GridInfoCache cache = new GridInfoCache();
cache.setCustomerId(result.getData().getCustomerId());
cache.setGridId(result.getData().getId());
cache.setGridNamePath(result.getData().getGridName());
cache.setPid(result.getData().getPid());
cache.setPids(result.getData().getPids());
ope.putAll(RedisKeys.getGridInfoKey(gridId), BeanUtil.beanToMap(cache));
return cache;
}
@Override
public List<GroupPointRankingResultDTO> listMyGroupPointRanding(String userId, String gridId) {
// 1.查询网格内我所在的小组
GroupsByMemberFormDTO form = new GroupsByMemberFormDTO();
form.setGridId(gridId);
form.setUserId(userId);
List<GroupDetailResultDTO> groupList = getResultDataOrThrowsException(resiGroupOpenFeignClient.listGroupsByMember(form),
ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败");
if (CollectionUtils.isEmpty(groupList)) {
return new ArrayList();
}
// 2.填充分数和排名
GroupDetailResultDTO firstGroup = groupList.get(0);
// 网格和客户下,分别有多少个有积分的小组,后面用于给哪些没有任何积分记录的小组排名
Integer gridMinRanking = baseDao.getMinRanking("group", "grid", gridId);
Integer customerMinRanking = baseDao.getMinRanking("group", "customer", firstGroup.getCustomerId());
List<GroupPointRankingResultDTO> groupDtoList = groupList.stream().map(g -> {
// 积分
Integer point = 0;
// 网格内的排名
Integer gridRanking = null;
// 客户下的排名
Integer customerRanking = null;
LambdaQueryWrapper<BizPointTotalDetailEntity> query = new LambdaQueryWrapper<>();
query.eq(BizPointTotalDetailEntity::getBizType, "group");
query.eq(BizPointTotalDetailEntity::getObjectId, g.getGroupId());
BizPointTotalDetailEntity groupPoint = baseDao.selectOne(query);
if (groupPoint == null) {
// 该小组没有积分
gridRanking = gridMinRanking + 1;
customerRanking = customerMinRanking + 1;
} else {
// 该小组有积分
point = groupPoint.getTotalPoint();
gridRanking = baseDao.getRanking("group", g.getGroupId(), "grid");
customerRanking = baseDao.getRanking("group", g.getGroupId(), "customer");
}
GroupPointRankingResultDTO dto = new GroupPointRankingResultDTO();
dto.setGridId(g.getGridId());
dto.setGroupHeadPhoto(g.getGroupHeadPhoto());
dto.setGroupType(g.getGroupType());
dto.setGroupId(g.getGroupId());
dto.setGroupName(g.getGroupName());
dto.setPoint(point.toString());
dto.setGridRanking(gridRanking);
dto.setCustomerRanking(customerRanking);
dto.setGroupLeaderFlag(g.getGroupLeaderFlag());
return dto;
}).collect(Collectors.toList());
return groupDtoList;
}
}

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

@ -23,11 +23,17 @@ import com.epmet.common.enu.AroundPartyConstant;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.UserPointStatisticalDailyDao;
import com.epmet.dto.BizPointUserTotalDetailDTO;
import com.epmet.dto.UserPointStatisticalDailyDTO;
import com.epmet.dto.form.AllPartyFormDTO;
import com.epmet.dto.form.GroupPointFormDTO;
import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.*;
@ -41,12 +47,14 @@ import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
@ -292,6 +300,96 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
return resultDTOS;
}
/**
* @Description 全部党员积分排行
* @Param formDTO
* @author zxc
* @date 2021/9/6 3:30 下午
*/
@Override
public List<AllPartyResultDTO> allParty(AllPartyFormDTO formDTO) {
formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize());
Result<List<PartymemberInfoDTO>> partyMemberInfosResult = resiPartyMemberOpenFeignClient.getPartyMemberInfoByCustomerId(formDTO.getCustomerId());
if (!partyMemberInfosResult.success()){
throw new RenException("查询客户下的党员失败......");
}
if (CollectionUtils.isEmpty(partyMemberInfosResult.getData())){
return new ArrayList<>();
}
List<PartymemberInfoDTO> partyMemberInfos = partyMemberInfosResult.getData();
List<String> userIds = partyMemberInfos.stream().map(m -> m.getUserId()).collect(Collectors.toList());
ResiAroundPartyPointRankFormDTO selDto = ConvertUtils.sourceToTarget(formDTO, ResiAroundPartyPointRankFormDTO.class);
selDto.setUserIds(userIds);
List<AllPartyResultDTO> resultDTOS = new ArrayList<>();
if (AroundPartyConstant.ALL.equals(formDTO.getType())){
resultDTOS = baseDao.selectListGridPartyNewRankByUsablePoint(selDto);
}else if (AroundPartyConstant.MONTHLY.equals(formDTO.getType())){
resultDTOS = baseDao.selectListGridPartyNewRankByMonth(selDto);
}
List<ResiAroundPartyPointRankResultDTO> partyBaseInfo = getPartyBaseInfo(ConvertUtils.sourceToTarget(resultDTOS, ResiAroundPartyPointRankResultDTO.class));
List<AllPartyResultDTO> result = ConvertUtils.sourceToTarget(partyBaseInfo, AllPartyResultDTO.class);
return result;
}
/**
* @param tokenDto
* @param formDTO
* @Description 个人当月积分在网格和客户中的排名
* @Param tokenDto
* @Param formDTO
* @Return {@link MyPointRankResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/10 14:18
*/
@Override
public MyPointRankResultDTO myPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO) {
List<String> userIds = new ArrayList<>();
userIds.add(tokenDto.getUserId());
//获取我的个人信息
Result<List<UserBaseInfoResultDTO>> myInfoResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
if(!myInfoResult.success()){
throw new RenException(myInfoResult.getCode(), myInfoResult.getMsg());
}
MyPointRankResultDTO result = new MyPointRankResultDTO();
result.setHeadPhoto(myInfoResult.getData().get(0).getHeadImgUrl());
result.setUserName(myInfoResult.getData().get(0).getRealName());
//获取客户下用户积分
List<BizPointUserTotalDetailDTO> list = getUserPointList(tokenDto.getCustomerId(), null, null);
result.setCustomerRank(getRank(list, tokenDto.getUserId()));
//获取网格用户积分
List<BizPointUserTotalDetailDTO> gridRankList = getUserPointList(tokenDto.getCustomerId(), null, formDTO.getGridId());
result.setGridRank(getRank(gridRankList, tokenDto.getUserId()));
return result;
}
/**
* @param tokenDto
* @param formDTO
* @Description 网格当月积分在组织和客户内排名
* @Param tokenDto
* @Param formDTO
* @Return {@link GridPointRankResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/10 14:18
*/
@Override
public GridPointRankResultDTO gridPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO) {
GridPointRankResultDTO result = new GridPointRankResultDTO();
//获取网格信息
Result<GridInfoResultDTO> gridInfoResult = govOrgOpenFeignClient.queryGridInfo(formDTO.getGridId());
if (!gridInfoResult.success()) {
throw new RenException(gridInfoResult.getCode());
}
result.setGridName(gridInfoResult.getData().getParentAgencyName() + StrConstant.HYPHEN + gridInfoResult.getData().getGridName());
String agencyId = gridInfoResult.getData().getParentAgencyId();
//获取客户下用户积分
List<BizPointUserTotalDetailDTO> list = getGridPointList(tokenDto.getCustomerId(), null);
result.setCustomerRank(getGridRank(list, formDTO.getGridId()));
List<BizPointUserTotalDetailDTO> agencyPointList = getGridPointList(tokenDto.getCustomerId(), agencyId);
result.setAgencyRank(getGridRank(agencyPointList, formDTO.getGridId()));
return result;
}
/**
* 获取认证通过的党员的 用户id
*
@ -338,4 +436,88 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
}
return rankResultDTOS;
}
/**
* @Description 获取客户下用户的当月积分
*
* @Param customerId
* @Return {@link List<BizPointUserTotalDetailDTO>}
* @Author zhaoqifeng
* @Date 2021/9/10 15:04
*/
private List<BizPointUserTotalDetailDTO> getUserPointList(String customerId, String agencyId, String gridId) {
return baseDao.selectUserPointByMonth(customerId, agencyId, gridId);
}
private List<BizPointUserTotalDetailDTO> getGridPointList(String customerId, String agencyId) {
return baseDao.selectGridPointByMonth(customerId, agencyId);
}
private Boolean havePoint(List<BizPointUserTotalDetailDTO> list, String userId) {
Map<String, Integer> map = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getUserId, BizPointUserTotalDetailDTO::getTotalPoint));
String point = null == map.get(userId)?"0":Integer.toString(map.get(userId));
log.info("userPoint:" + point);
return null != map.get(userId);
}
private String getGridRank(List<BizPointUserTotalDetailDTO> list, String gridId) {
if (CollectionUtils.isEmpty(list)) {
return NumConstant.ONE_STR;
}
//如果当月网格没有积分变动,则积分为0
Map<String, Integer> map = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getGridId, BizPointUserTotalDetailDTO::getTotalPoint));
String points = null == map.get(gridId)?"0":Integer.toString(map.get(gridId));
log.info("gridPoint:" + points);
if (null == map.get(gridId)) {
BizPointUserTotalDetailDTO dto = new BizPointUserTotalDetailDTO();
dto.setGridId(gridId);
dto.setTotalPoint(NumConstant.ZERO);
list.add(dto);
}
//排序
list = list.stream().sorted(Comparator.comparing(BizPointUserTotalDetailDTO :: getTotalPoint).reversed()
.thenComparing(BizPointUserTotalDetailDTO::getGridId))
.collect(Collectors.toList());
AtomicInteger i = new AtomicInteger(1);
AtomicInteger point = new AtomicInteger(0);
list.forEach(item -> {
if (item.getTotalPoint().equals(point.get())) {
item.setRank(String.valueOf(i));
} else {
item.setRank(String.valueOf(i.getAndIncrement()));
}
point.set(item.getTotalPoint());
});
Map<String, String> rankMap = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getGridId, BizPointUserTotalDetailDTO::getRank));
return rankMap.get(gridId);
}
private String getRank(List<BizPointUserTotalDetailDTO> list, String userId) {
if (CollectionUtils.isEmpty(list)) {
return NumConstant.ONE_STR;
}
if (!havePoint(list, userId)) {
BizPointUserTotalDetailDTO dto = new BizPointUserTotalDetailDTO();
dto.setUserId(userId);
dto.setTotalPoint(NumConstant.ZERO);
list.add(dto);
}
//排序
list = list.stream().sorted(Comparator.comparing(BizPointUserTotalDetailDTO :: getTotalPoint).reversed()
.thenComparing(BizPointUserTotalDetailDTO::getUserId))
.collect(Collectors.toList());
AtomicInteger i = new AtomicInteger(1);
AtomicInteger point = new AtomicInteger(0);
list.forEach(item -> {
if (item.getTotalPoint().equals(point.get())) {
item.setRank(String.valueOf(i));
} else {
item.setRank(String.valueOf(i.getAndIncrement()));
}
point.set(item.getTotalPoint());
});
Map<String, String> map = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getUserId, BizPointUserTotalDetailDTO::getRank));
return map.get(userId);
}
}

46
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/BizPointTotalDetailDao.xml

@ -29,5 +29,51 @@
and OBJECT_ID = #{objectId}
</select>
<!--查询object在指定范围内的排名-->
<select id="getRanking" resultType="java.lang.Integer">
select count(distinct p_2.TOTAL_POINT) + 1 as ranking
from biz_point_total_detail point
inner join biz_point_total_detail p_2
on (point.BIZ_TYPE = p_2.BIZ_TYPE and p_2.DEL_FLAG = 0 and
point.TOTAL_POINT &lt; p_2.TOTAL_POINT
<if test="scope == 'grid'">
and point.GRID_ID = p_2.GRID_ID
</if>
<if test="scope == 'customer'">
and point.CUSTOMER_ID = p_2.CUSTOMER_ID
</if>
)
where
point.OBJECT_ID = #{groupId}
and point.BIZ_TYPE = #{bizType}
and point.DEL_FLAG = 0
</select>
<!--获取指定范围内最低排名。子查询是取最低分的那个对象出来-->
<select id="getMinRanking" resultType="java.lang.Integer">
select count(distinct p.TOTAL_POINT) + 1 as ranking
from biz_point_total_detail p
inner join
(select point.OBJECT_ID, point.BIZ_TYPE, point.GRID_ID, point.CUSTOMER_ID, point.TOTAL_POINT
from biz_point_total_detail point
where point.BIZ_TYPE = #{bizType}
and point.DEL_FLAG = 0
<if test="searchScope == 'grid'">
and point.GRID_ID = #{searchScopeId}
</if>
<if test="searchScope == 'customer'">
and point.CUSTOMER_ID = #{searchScopeId}
</if>
order by point.TOTAL_POINT asc limit 1) t
on (p.BIZ_TYPE = t.BIZ_TYPE
and p.TOTAL_POINT > t.TOTAL_POINT
<if test="searchScope == 'grid'">
and p.GRID_ID = t.GRID_ID
</if>
<if test="searchScope == 'customer'">
and p.CUSTOMER_ID = t.CUSTOMER_ID
</if>
)
</select>
</mapper>

90
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml

@ -184,4 +184,94 @@
ORDER BY P.point DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectListGridPartyNewRankByUsablePoint" resultType="com.epmet.dto.result.AllPartyResultDTO">
SET @curRank = #{pageNo};
SELECT
@curRank := @curRank + 1 AS ranking,
@point := IFNULL(p.USABLE_POINT, 0),
IFNULL(p.USABLE_POINT, 0) point,
p.USER_ID userId
FROM user_point_total p
<if test="null != userIds and userIds.size() > 0">
WHERE p.USER_ID IN
<foreach collection="userIds" item="userId" open="(" separator="," close=" )">
#{userId}
</foreach>
</if>
ORDER BY IFNULL(p.USABLE_POINT, 0) DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectListGridPartyNewRankByMonth" resultType="com.epmet.dto.result.AllPartyResultDTO">
SET @curRank = #{pageNo};
SELECT
@curRank := @curRank + 1 AS ranking,
@point := p.point,
P.userId,
P.point
FROM(
SELECT
pl.USER_ID userId,
SUM(PL.POINT) point
FROM user_point_action_log pl
WHERE pl.DEL_FLAG = '0' AND DATE_FORMAT(pl.CREATED_TIME, '%Y%m')= DATE_FORMAT( CURDATE( ) , '%Y%m' ) AND pl.action_flag = 'plus'
GROUP BY pl.USER_ID
) P
<if test="null != userIds and userIds.size() > 0">
WHERE userId IN
<foreach collection="userIds" item="userId" open="(" separator="," close=" )">
#{userId}
</foreach>
</if>
ORDER BY P.point DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectUserPointByMonth" resultType="com.epmet.dto.BizPointUserTotalDetailDTO">
SELECT
a.CUSTOMER_ID,
a.AGENCY_ID,
a.GRID_ID,
a.USER_ID,
SUM( POINT ) AS TOTAL_POINT
FROM
biz_point_user_total_detail a
INNER JOIN user_point_action_log b ON a.USER_ID = b.USER_ID
AND b.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( b.CREATED_TIME, '%Y%m' )= DATE_FORMAT( CURDATE( ), '%Y%m' )
AND b.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
AND a.CUSTOMER_ID = #{customerId}
<if test="null != agencyId and agencyId != ''">
AND a.AGENCY_ID = #{agencyId}
</if>
<if test="null != gridId and gridId != ''">
AND a.GRID_ID = #{gridId}
</if>
GROUP BY
a.USER_ID
</select>
<select id="selectGridPointByMonth" resultType="com.epmet.dto.BizPointUserTotalDetailDTO">
SELECT
a.CUSTOMER_ID,
a.AGENCY_ID,
a.GRID_ID,
SUM( POINT ) AS TOTAL_POINT
FROM
biz_point_user_total_detail a
INNER JOIN user_point_action_log b ON a.USER_ID = b.USER_ID
AND b.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( b.CREATED_TIME, '%Y%m' )= DATE_FORMAT( CURDATE( ), '%Y%m' )
AND b.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
AND a.CUSTOMER_ID = #{customerId}
<if test="null != agencyId and agencyId != ''">
AND a.AGENCY_ID = #{agencyId}
</if>
GROUP BY
a.GRID_ID
</select>
</mapper>

21
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.IssueConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.IssueDao;
import com.epmet.dao.IssueProcessDao;
import com.epmet.dao.IssueProjectRelationDao;
@ -755,6 +756,11 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
msgDTO.setMessageContent(messageContent);
msgDTO.setReadFlag(ReadFlagConstant.UN_READ);
msgDTO.setUserId(topicDTO.getCreatedBy());
//21.09.10:记录消息类型和对应的业务id
msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_CLOSE_ISSUE);
msgDTO.setTargetId(entity.getId());
msgList.add(msgDTO);
//话题人和议题人是同一个人时则只发送一条居民消息
if (!topicDTO.getCreatedBy().equals(entity.getCreatedBy())) {
@ -1067,11 +1073,21 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
msgDTO.setMessageContent(topicIssueMessage);
msgDTO.setReadFlag(ReadFlagConstant.UN_READ);
msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy());
//21.09.10:记录消息类型和对应的业务id
msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT);
msgDTO.setTargetId(entity.getId());
msgList.add(msgDTO);
//话题人和议题人是同一个人时则只发送一条居民消息
if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) {
UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, UserMessageFormDTO.class);
msgIssue.setUserId(entity.getCreatedBy());
//21.09.10:记录消息类型和对应的业务id
msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT);
msgDTO.setTargetId(entity.getId());
msgList.add(msgIssue);
}
//2:创建项目工作人员消息对象
@ -1088,6 +1104,11 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
msg.setMessageContent(projectStaffMessage);
msg.setReadFlag(ReadFlagConstant.UN_READ);
msg.setUserId(staff.getStaffId());
//21.09.10:记录消息类型和对应的业务id
msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT);
msgDTO.setTargetId(issueProjectResultDTO.getProjectId());
msgList.add(msg);
map.put(staff.getStaffId(),staff.getStaffId());
}

18
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/9/13 3:20 下午
* @DESC
*/
@Data
public class GetAgencyListFormDTO implements Serializable {
private static final long serialVersionUID = -5846836779036328298L;
private String customerId;
}

17
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgFormDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/9/7 15:41
*/
@Data
public class OrgFormDTO implements Serializable {
private static final long serialVersionUID = -5975063766883885089L;
private String orgId;
private String orgType;
}

31
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/9/8 15:06
*/
@Data
public class AgencyTreeResultDTO implements Serializable {
private static final long serialVersionUID = -311212619121062367L;
/**
* 机关组织Id
*/
private String agencyId;
/**
* 机关组织名称
*/
private String agencyName;
private String pid;
/**
* 下级机关组织
*/
private List<AgencyTreeResultDTO> subAgencyList;
}

27
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/9/8 15:11
*/
@Data
public class StaffOrgListResultDTO implements Serializable {
private static final long serialVersionUID = -7717333635633000120L;
/**
* 组织ID
*/
private String orgId;
/**
* 组织名称
*/
private String orgName;
/**
* 组织类型机关agency 网格grid 部门dept
*/
private String orgType;
}

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

@ -417,4 +417,14 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/customerstaffagency/queryOrgStaffs")
Result<Set<String>> queryOrgStaffs(@RequestBody OrgStaffFormDTO formDTO);
/**
* @Description 根据组织或网格或吧部门获取组织信息
* @Param formDTO
* @Return {@link Result<OrgResultDTO>}
* @Author zhaoqifeng
* @Date 2021/9/7 15:27
*/
@PostMapping("/gov/org/customeragency/getAgencyInfo")
Result<OrgResultDTO> getAgencyInfo(@RequestBody OrgFormDTO formDTO);
}

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

@ -248,6 +248,19 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryOrgStaffs", formDTO);
}
/**
* @param formDTO
* @Description 根据组织或网格或吧部门获取组织信息
* @Param formDTO
* @Return {@link Result<OrgResultDTO>}
* @Author zhaoqifeng
* @Date 2021/9/7 15:27
*/
@Override
public Result<OrgResultDTO> getAgencyInfo(OrgFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyInfo", formDTO);
}
@Override
public Result<String> selectPidsByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);

27
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -312,4 +312,31 @@ public class CustomerAgencyController {
return new Result<ExtStaffPermissionResultDTO>().ok(customerAgencyService.staffPermissionExt(tokenDto.getUserId()));
}
/**
* @Description 根据组织或网格或吧部门获取组织信息
* @Param formDTO
* @Return {@link Result<OrgResultDTO>}
* @Author zhaoqifeng
* @Date 2021/9/7 15:27
*/
@PostMapping("getAgencyInfo")
public Result<OrgResultDTO> getAgencyInfo(@RequestBody OrgFormDTO formDTO) {
return new Result<OrgResultDTO>().ok(customerAgencyService.getAgencyInfo(formDTO));
}
/**
* @Description 获取客户下组织树
* @Param tokenDTO
* @Return {@link Result< AgencyTreeResultDTO >}
* @Author zhaoqifeng
* @Date 2021/9/8 15:20
*/
@PostMapping("agencylist")
public Result<AgencyTreeResultDTO> getAgencyList(@LoginUser TokenDto tokenDTO,@RequestBody GetAgencyListFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getCustomerId())){
formDTO.setCustomerId(tokenDTO.getCustomerId());
}
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getAgencyList(formDTO));
}
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java

@ -195,4 +195,16 @@ public class StaffController {
return staffService.addStaffV2(fromDTO);
}
/**
* @Description 用户所属组织
* @Param tokenDto
* @Return {@link Result< StaffOrgListResultDTO>}
* @Author zhaoqifeng
* @Date 2021/9/8 16:55
*/
@PostMapping("orgList")
public Result<List<StaffOrgListResultDTO>> staffOrgList(@LoginUser TokenDto tokenDto) {
return new Result<List<StaffOrgListResultDTO>>().ok(staffService.staffOrgList(tokenDto));
}
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -239,4 +239,8 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @author sun
*/
OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType);
AgencyTreeResultDTO getAllAgency(@Param("customerId") String customerId);
List<AgencyTreeResultDTO> getSubAgencyList(@Param("pid") String pid);
}

19
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -19,6 +19,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.*;
@ -236,4 +237,22 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
OrganizeTreeResultDTO organizeTree(String agencyId);
void checkAgencyName(String agencyName,String customerId,String agencyId,String parentAgencyId);
/**
* 根据组织或网格或吧部门获取组织信息
* @Param formDTO
* @Return {@link OrgResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/7 15:28
*/
OrgResultDTO getAgencyInfo(OrgFormDTO formDTO);
/**
* @Description 获取客户下组织树
* @Param tokenDTO
* @Return {@link AgencyTreeResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/8 15:21
*/
AgencyTreeResultDTO getAgencyList(GetAgencyListFormDTO formDTO);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java

@ -129,4 +129,13 @@ public interface StaffService {
* @author sun
*/
Result addStaffV2(AddStaffV2FromDTO fromDTO);
/**
* @Description 工作人员所属组织
* @Param tokenDto
* @Return {@link StaffOrgListResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/8 16:57
*/
List<StaffOrgListResultDTO> staffOrgList(TokenDto tokenDto);
}

49
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -1075,4 +1075,53 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
}
/**
* 根据组织或网格或吧部门获取组织信息
*
* @param formDTO
* @Param formDTO
* @Return {@link OrgResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/7 15:28
*/
@Override
public OrgResultDTO getAgencyInfo(OrgFormDTO formDTO) {
return baseDao.selectAgencyDetail(formDTO.getOrgId(), formDTO.getOrgType());
}
/**
* @Description 获取客户下组织树
* @Param formDTO
* @Return {@link AgencyTreeResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/8 15:21
*/
@Override
public AgencyTreeResultDTO getAgencyList(GetAgencyListFormDTO formDTO) {
AgencyTreeResultDTO agency = baseDao.getAllAgency(formDTO.getCustomerId());
if (CollectionUtils.isEmpty(agency.getSubAgencyList())) {
agency.setSubAgencyList(null);
} else {
setAgencyList(agency.getSubAgencyList());
}
return agency;
}
/**
* @Description 组织树最后一级没有数据的话设null
* @Param agencyList
* @Return
* @Author zhaoqifeng
* @Date 2021/9/18 14:33
*/
private void setAgencyList(List<AgencyTreeResultDTO> agencyList) {
for (AgencyTreeResultDTO dto : agencyList) {
if (CollectionUtils.isEmpty(dto.getSubAgencyList())) {
dto.setSubAgencyList(null);
} else {
setAgencyList(dto.getSubAgencyList());
}
}
}
}

51
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -11,9 +11,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerStaffAgencyDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
@ -21,6 +19,7 @@ import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.feign.*;
import com.epmet.service.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -30,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@ -566,5 +566,52 @@ public class StaffServiceImpl implements StaffService {
return new Result();
}
/**
* @param tokenDto
* @Description 工作人员所属组织
* @Param tokenDto
* @Return {@link StaffOrgListResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/8 16:57
*/
@Override
public List<StaffOrgListResultDTO> staffOrgList(TokenDto tokenDto) {
//redis获取工作人员信息
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfoCache) {
return Collections.emptyList();
}
List<StaffOrgListResultDTO> list = new ArrayList<>();
//工作人员所在组织
StaffOrgListResultDTO agency = new StaffOrgListResultDTO();
agency.setOrgId(staffInfoCache.getAgencyId());
agency.setOrgName(staffInfoCache.getAgencyName());
agency.setOrgType(OrgInfoConstant.AGENCY);
list.add(agency);
//工作人员所在部门
if(CollectionUtils.isNotEmpty(staffInfoCache.getDeptList())) {
List<StaffOrgListResultDTO> deptList = staffInfoCache.getDeptList().stream().map(item -> {
StaffOrgListResultDTO dto = new StaffOrgListResultDTO();
dto.setOrgId(item.getId());
dto.setOrgName(item.getName());
dto.setOrgType(OrgInfoConstant.DEPT);
return dto;
}).collect(Collectors.toList());
list.addAll(deptList);
}
//工作人员所在网格
if(CollectionUtils.isNotEmpty(staffInfoCache.getGridList())) {
List<StaffOrgListResultDTO> gridList = staffInfoCache.getGridList().stream().map(item -> {
StaffOrgListResultDTO dto = new StaffOrgListResultDTO();
dto.setOrgId(item.getId());
dto.setOrgName(item.getName());
dto.setOrgType(OrgInfoConstant.GRID);
return dto;
}).collect(Collectors.toList());
list.addAll(gridList);
}
return list;
}
}

35
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -503,5 +503,40 @@
</otherwise>
</choose>
</select>
<resultMap id="BaseResultMap" type="com.epmet.dto.result.AgencyTreeResultDTO">
<result column="agencyId" property="agencyId"/>
<result column="agencyName" property="agencyName"/>
<result column="pid" property="pid"/>
</resultMap>
<resultMap id="NodeTreeResult" type="com.epmet.dto.result.AgencyTreeResultDTO"
extends="BaseResultMap">
<collection property="subAgencyList" column="agencyId" ofType="com.epmet.dto.result.AgencyTreeResultDTO"
javaType="java.util.ArrayList" select="getSubAgencyList">
</collection>
</resultMap>
<select id="getSubAgencyList" resultMap="NodeTreeResult">
select
ID AS agencyId,
ORGANIZATION_NAME AS agencyName,
PID
from customer_agency
where
DEL_FLAG = 0
AND PID= #{pid}
ORDER BY ID
</select>
<select id="getAllAgency" resultMap="NodeTreeResult">
select
ID AS agencyId,
ORGANIZATION_NAME AS agencyName,
PID
from
customer_agency
where
DEL_FLAG = 0
AND PID ='0'
AND CUSTOMER_ID = #{customerId}
</select>
</mapper>

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java

@ -36,10 +36,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.IpUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ProjectConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserMessageConstant;
import com.epmet.constant.*;
import com.epmet.dao.ProjectOrgRelationDao;
import com.epmet.dao.ProjectDao;
import com.epmet.dao.ProjectProcessDao;
@ -451,6 +448,11 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
msg.setMessageContent(projectStaffMessage);
msg.setReadFlag(ReadFlagConstant.UN_READ);
msg.setUserId(staff.getStaffId());
//21.09.10:记录消息类型和对应的业务id
msg.setMessageType(UserMessageTypeConstant.PROJECT_TRANSFER);
msg.setTargetId(formDTO.getProjectId());
msgList.add(msg);
map.put(staff.getStaffId(),staff.getStaffId());
}

39
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -31,10 +31,7 @@ import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ParameterKeyConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserMessageConstant;
import com.epmet.constant.*;
import com.epmet.dao.ProjectDao;
import com.epmet.dao.ProjectOrgRelationDao;
import com.epmet.dao.ProjectSatisfactionStatisticsDao;
@ -513,6 +510,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_CLOSED);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
@ -536,6 +538,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_CLOSED);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
@ -694,6 +701,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_CLOSED);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
@ -717,6 +729,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_CLOSED);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
@ -881,6 +898,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, projectEntity.getTitle()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_RETURN);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
messageFeignClient.saveUserMessageList(msgList);
//2020.10.26 添加项目退回给勾选人推送微信订阅消息 sun
@ -1705,6 +1727,10 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(title);
messageFormDTO.setMessageContent(msg);
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_REMIND);
msgList.add(messageFormDTO);
//10.29 项目滞留提醒添加推送微信消息 sun
@ -2056,6 +2082,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, projectEntity.getTitle()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_RETURN);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
messageFeignClient.saveUserMessageList(msgList);
//2020.10.26 添加项目退回给勾选人推送微信订阅消息 sun

23
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

@ -15,10 +15,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.IpUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ProjectConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserMessageConstant;
import com.epmet.constant.*;
import com.epmet.dao.ProjectOrgRelationDao;
import com.epmet.dao.ProjectProcessAttachmentDao;
import com.epmet.dao.ProjectProcessDao;
@ -488,7 +485,7 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
//4.推送站内信、微信、短信消息
//4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息
if (!shiftProjectMessage(formDTO).success()) {
if (!shiftProjectMessage(formDTO,projectEntity.getId()).success()) {
throw new RenException("项目立项,推送站内信失败");
}
@ -565,7 +562,7 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
* @Description 项目立项给勾选的工作人员推送站内信消息
* @author sun
*/
private Result shiftProjectMessage(ProjectApprovalFormDTO formDTO) {
private Result shiftProjectMessage(ProjectApprovalFormDTO formDTO,String projectId) {
List<UserMessageFormDTO> msgList = new ArrayList<>();
//1.创建项目工作人员消息对象
String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, formDTO.getTitle());
@ -581,6 +578,11 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
msg.setMessageContent(projectStaffMessage);
msg.setReadFlag(ReadFlagConstant.UN_READ);
msg.setUserId(staff.getStaffId());
//21.09.10:记录消息类型和对应的业务id
msg.setMessageType(UserMessageTypeConstant.PROJECT_APPROVAL);
msg.setTargetId(projectId);
msgList.add(msg);
map.put(staff.getStaffId(),staff.getStaffId());
}
@ -789,7 +791,7 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
//4.推送站内信、微信、短信消息
//4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息
if (!shiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle()).success()) {
if (!shiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle(),projectEntity.getId()).success()) {
throw new RenException("事件转为项目,推送站内信失败");
}
@ -919,7 +921,7 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
* @Description 项目立项给勾选的工作人员推送站内信消息
* @author yinzuomei
*/
private Result shiftProjectMessage(List<TickStaffFormDTO> staffList,String customerId,String title) {
private Result shiftProjectMessage(List<TickStaffFormDTO> staffList,String customerId,String title,String projectId) {
List<UserMessageFormDTO> msgList = new ArrayList<>();
//1.创建项目工作人员消息对象
String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, title);
@ -935,6 +937,11 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
msg.setMessageContent(projectStaffMessage);
msg.setReadFlag(ReadFlagConstant.UN_READ);
msg.setUserId(staff.getStaffId());
//21.09.10:记录消息类型和对应的业务id
msg.setTargetId(projectId);
msg.setMessageType(UserMessageTypeConstant.PROJECT_FROM_RESI_EVENT);
msgList.add(msg);
map.put(staff.getStaffId(),staff.getStaffId());
}

22
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/AttachmentDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/9/7 16:21
*/
@Data
public class AttachmentDTO implements Serializable {
private static final long serialVersionUID = 6505979559566901869L;
private String name;
private String format;
private String type;
private String url;
private Integer size;
private Integer duration;
}

56
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ExternalLinkDTO.java

@ -0,0 +1,56 @@
/**
* 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.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 指南外链表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-06
*/
@Data
public class ExternalLinkDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 链接说明
*/
private String description;
/**
* 外部链接
*/
private String externalLink;
/**
* 外部链接
*/
private Integer sort;
}

117
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java

@ -0,0 +1,117 @@
/**
* 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.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 办事指南附件
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-06
*/
@Data
public class GuideAttachmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 办事指南ID
*/
private String guideId;
/**
* 附件名
*/
private String attachmentName;
/**
* 文件大小 单位byte
*/
private Integer attachmentSize;
/**
* 文件格式 wordexcelpdf
*/
private String attachmentFormat;
/**
* 类型
*/
private String attachmentType;
/**
* 附件地址
*/
private String attachmentUrl;
/**
* 语音或视频时长
*/
private Integer duration;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

104
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java

@ -0,0 +1,104 @@
/**
* 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.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 指南分类
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-08
*/
@Data
public class GuideCategoryDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id产品默认配置此列存储default
*/
private String customerId;
/**
* 分类名,客户内唯一
*/
private String categoryName;
/**
* 分类编码分类名的全拼; eggongjijin
*/
private String categoryCode;
/**
* 排序
*/
private Integer sort;
/**
* 状态 禁用disable 启用enable
*/
private String status;
/**
* 删除标识 0未删除1已删除
*/
@JsonIgnore
private String delFlag;
/**
* 乐观锁
*/
@JsonIgnore
private Integer revision;
/**
* 创建人
*/
@JsonIgnore
private String createdBy;
/**
* 创建时间
*/
@JsonIgnore
private Date createdTime;
/**
* 更新人
*/
@JsonIgnore
private String updatedBy;
/**
* 更新时间
*/
@JsonIgnore
private Date updatedTime;
}

91
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java

@ -0,0 +1,91 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 指南收藏表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-06
*/
@Data
public class GuideCollectionDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 指南ID
*/
private String guideId;
/**
* 用户ID
*/
private String userId;
/**
* 用户所属客户端 居民端resi 工作端gov
*/
private String app;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

112
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java

@ -0,0 +1,112 @@
/**
* 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.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 办事指南表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-06
*/
@Data
public class GuideDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 发布单位类型 机关agency 网格grid 部门dept
*/
private String orgType;
/**
* 发布单位ID
*/
private String orgId;
/**
* 发布单位名称
*/
private String orgName;
/**
* 所属组织机构IDcustomer_agency.id
*/
private String pid;
/**
* 所有上级组织ID,英文:隔开
*/
private String pids;
/**
* 标题
*/
private String title;
/**
* 分类ID
*/
private String categoryCode;
/**
* 删除标识:0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

96
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java

@ -0,0 +1,96 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 指南外链表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-06
*/
@Data
public class GuideExternalLinkDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 指南ID
*/
private String guideId;
/**
* 链接说明
*/
private String description;
/**
* 外部链接
*/
private String externalLink;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

91
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java

@ -0,0 +1,91 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 指南模块关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-06
*/
@Data
public class GuideModuleDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 指南ID
*/
private String guideId;
/**
* 模块ID
*/
private String moduleId;
/**
*
*/
private String moduleContent;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

96
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java

@ -0,0 +1,96 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 指南模块字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-06
*/
@Data
public class GuideModuleDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 模块key
*/
private String moduleValue;
/**
* 模块名
*/
private String moduleName;
/**
* 排序
*/
private Integer sort;
/**
* 状态 禁用disable 启用enable
*/
private String status;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

91
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java

@ -0,0 +1,91 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 指南模块默认字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-06
*/
@Data
public class GuideModuleDictDefaultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 模块key
*/
private String moduleValue;
/**
* 模块名
*/
private String moduleName;
/**
* 排序
*/
private Integer sort;
/**
* 状态 禁用disable 启用enable
*/
private String status;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

58
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ModuleDTO.java

@ -0,0 +1,58 @@
/**
* 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.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 指南模块字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-09-06
*/
@Data
public class ModuleDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String guideModuleId;
/**
* 主键
*/
private String moduleId;
/**
* 模块key
*/
private String moduleValue;
/**
* 模块名
*/
private String moduleName;
/**
* 模块内容
*/
private String moduleContent;
}

49
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java

@ -0,0 +1,49 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 编辑禁用删除统一入参
* @Author yinzuomei
* @Date 2021/9/8 4:15 下午
*/
@Data
public class EditGuideCategoryFormDTO implements Serializable {
private static final long serialVersionUID = -6853534660181580456L;
public interface AddUserInternalGroup {
}
public interface StatusGroup {
}
public interface UpdateInfoGroup extends CustomerClientShowGroup {
}
public interface SaveInfoGroup extends CustomerClientShowGroup {
}
public interface DelGroup {
}
@NotBlank(message = "当前操作人id不能为空", groups = AddUserInternalGroup.class)
private String staffId;
@NotBlank(message = "客户id不能为空",groups = {DelGroup.class,UpdateInfoGroup.class,SaveInfoGroup.class})
private String customerId;
@NotBlank(message = "id不能为空", groups = {StatusGroup.class,DelGroup.class,UpdateInfoGroup.class})
private String id;
@NotBlank(message = "status不能为空", groups = StatusGroup.class)
private String status;
@NotBlank(message = "分类名称不能为空不能为空", groups = {UpdateInfoGroup.class,SaveInfoGroup.class})
@Length(max = 10, message = "分类名称最多填入10个字", groups = {UpdateInfoGroup.class,SaveInfoGroup.class})
private String categoryName;
}

61
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideAddFormDTO.java

@ -0,0 +1,61 @@
package com.epmet.dto.form;
import com.epmet.dto.AttachmentDTO;
import com.epmet.dto.ExternalLinkDTO;
import com.epmet.dto.ModuleDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/9/7 10:24
*/
@NoArgsConstructor
@Data
public class GuideAddFormDTO implements Serializable {
private static final long serialVersionUID = -7750999102010191460L;
/**
* 标题
*/
@NotBlank(message = "标题不能为空")
private String title;
/**
* 标题
*/
@NotBlank(message = "分类不能为空")
private String categoryCode;
/**
* 机关类型 机关agency 网格grid 部门dept
*/
@NotBlank(message = "所属机关类型不能为空")
private String orgType;
/**
* 所属机关
*/
@NotBlank(message = "所属机关ID不能为空")
private String orgId;
/**
* 所属机关
*/
@NotBlank(message = "所属机关名不能为空")
private String orgName;
/**
* 外部链接
*/
private List<ExternalLinkDTO> externalLinks;
/**
* 内容模块
*/
private List<ModuleDTO> moduleList;
/**
* 附件
*/
private List<AttachmentDTO> attachmentList;
}

56
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
/**
* @Description 分类排序入参DTO
* @Author yinzuomei
* @Date 2021/9/8 4:03 下午
*/
@Data
public class GuideCateOrderFormDTO implements Serializable {
private static final long serialVersionUID = 8671295475212569124L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "当前操作人id不能为空", groups = AddUserInternalGroup.class)
private String staffId;
@NotEmpty(message = "顺序不能为空", groups = {AddUserInternalGroup.class})
private List<OrderIndexDTO> orderList;
/**
* 排序索引号dto
*/
public static class OrderIndexDTO {
private String id;
private Integer orderIndex;
public OrderIndexDTO() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getOrderIndex() {
return orderIndex;
}
public void setOrderIndex(Integer orderIndex) {
this.orderIndex = orderIndex;
}
}
}

28
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 发布指南编辑指南查询指南列表 分类下拉框
* @Author yinzuomei
* @Date 2021/9/8 2:57 下午
*/
@Data
public class GuideCategoryDropDownFormDTO implements Serializable {
private static final long serialVersionUID = 9122708701080412461L;
public interface AddUserInternalGroup {
}
/**
* 新增指南saveorupdate查询指南列表query
*/
@NotBlank(message = "新增指南:saveorupdate;查询指南列表:query",groups = AddUserInternalGroup.class)
private String queryOrigin;
@NotBlank(message = "当前工作人员所属客户id不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

21
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 工作端PC或者运营端分页
* @Author yinzuomei
* @Date 2021/9/8 1:35 下午
*/
@Data
public class GuideCategoryPageFormDTO implements Serializable {
private static final long serialVersionUID = -7551388716349439643L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "客户id不能为空,运营端传default", groups = AddUserInternalGroup.class)
private String customerId;
}

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

Loading…
Cancel
Save