Browse Source

Merge remote-tracking branch 'remotes/origin/dev_ylfn' into 烟台master

dev
jianjun 3 years ago
parent
commit
58698ec4fd
  1. 8
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.23__party_publish_Time.sql
  2. 10
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  3. 7
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
  4. 23
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PartyMeetingMessageMQMsg.java
  5. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java
  6. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  7. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  8. 24
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java
  9. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/WorkdiaryServiceRecordExcel.java
  10. 59
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/converter/WorkDiaryServiceEasyExcelDateConverter.java
  11. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  12. 42
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java
  13. 36
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoPublishIcPartyActTask.java
  14. 31
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EnterprisePatrolRemindTask.java
  15. 37
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/NoticePartyActAutoPublishTask.java
  16. 35
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcUpdateYlfnTask.java
  17. 7
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java
  18. 12
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  19. 104
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/IcMessageDTO.java
  20. 66
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/IcMessageFormDTO.java
  21. 19
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/IcMessageListFormDTO.java
  22. 18
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadIcMessageFormDTO.java
  23. 12
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java
  24. 11
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java
  25. 105
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/IcMessageController.java
  26. 27
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/IcMessageDao.java
  27. 74
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/IcMessageEntity.java
  28. 78
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/IcMessageService.java
  29. 116
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/IcMessageServiceImpl.java
  30. 11
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
  31. 20
      epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.19__create_ic_message.sql
  32. 2
      epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.20__alter_ic_message.sql
  33. 40
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/IcMessageDao.xml
  34. 2
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRuleDTO.java
  35. 25
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PartyPointFormDTO.java
  36. 3
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointModifyFormDTO.java
  37. 21
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PartyPointRecordResultDTO.java
  38. 33
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PartyPointResultDTO.java
  39. 6
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointAdditiveRuleController.java
  40. 15
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
  41. 3
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveRuleDao.java
  42. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java
  43. 1
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
  44. 17
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java
  45. 9
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveRuleService.java
  46. 15
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
  47. 10
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java
  48. 182
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java
  49. 124
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
  50. 25
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml
  51. 42
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml
  52. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  53. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  54. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java
  55. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java
  56. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  57. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
  58. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  59. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java
  60. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  61. 44
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java
  62. 35
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
  63. 12
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java
  64. 21
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerParaResDTO.java
  65. 13
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerParameterController.java
  66. 9
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java
  67. 24
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java
  68. 3
      epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.9__party_helper_param.sql
  69. 9
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java
  70. 14
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java
  71. 18
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/YlfnValueResultDTO.java
  72. 3
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  73. 5
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  74. 6
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java
  75. 8
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java
  76. 11
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java
  77. 33
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java
  78. 4
      epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.38__ylfnv.sql
  79. 5
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml
  80. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java
  81. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java
  82. 1
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java
  83. 1
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResult2DTO.java
  84. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java
  85. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java
  86. 1
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java
  87. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java
  88. 28
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  89. 19
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  90. 28
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  91. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  92. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java
  93. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java
  94. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  95. 137
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  96. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java
  97. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java
  98. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/ResiGroupMemberService.java
  99. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  100. 8
      epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.26__add_party_org_.sql

8
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.23__party_publish_Time.sql

@ -0,0 +1,8 @@
INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458000894500866', 'icpartyact_auto_publish_time', '党组织活动自动发布时间', '党组织活动自动发布时间', 35, 0, 0, '1', '2022-08-19 10:45:54', '1', '2022-08-19 10:46:11');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458233091170305', 1560458000894500866, '活动开始前1天', '1', '0', '活动开始前1天', 1, 0, 0, '1', '2022-08-19 10:46:49', '1', '2022-08-19 10:46:49');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458276439302146', 1560458000894500866, '活动开始前3天', '3', '0', '活动开始前3天', 2, 0, 0, '1', '2022-08-19 10:47:00', '1', '2022-08-19 10:47:00');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458332076744705', 1560458000894500866, '活动开始前5天', '5', '0', '活动开始前5天', 3, 0, 0, '1', '2022-08-19 10:47:13', '1', '2022-08-19 10:47:13');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458388007788545', 1560458000894500866, '活动开始前7天', '7', '0', '活动开始前7天', 4, 0, 0, '1', '2022-08-19 10:47:26', '1', '2022-08-19 10:47:26');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1561627442626142210', 1560458000894500866, '现在发布', '0', '0', '', 5, 0, 0, '1', '2022-08-22 16:12:51', '1', '2022-08-22 16:12:51');

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

@ -98,4 +98,14 @@ public interface ConsomerGroupConstants {
* 创建党员居民信息消费者组将user库的党员信息同步到partymember库的党员表
*/
String CREATE_RESI_PARTYMEMBER_SYNC_GROUP = "create_resi_sync_group";
/**
* 党建小助手监听器分组
*/
String PARTY_MEETING_MESSAGE = "party_meeting_message";
/**
* 党建积分操作消费组
*/
String PARTY_BUILDING_GROUP = "party_building_group";
}

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

@ -84,4 +84,11 @@ public interface TopicConstants {
* 居民的党员信息
*/
String PARTYMEMBER_RESI = "partymember_resi";
/**
* 消息-党建小助手
*/
String IC_MESSAGE = "ic_message";
String PARTY_BUILDING = "party_building";
}

23
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PartyMeetingMessageMQMsg.java

@ -0,0 +1,23 @@
package com.epmet.commons.rocketmq.messages;
import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 党建小助手发布活动活动到期提醒活动发布提醒推送MQ
* @author sun
*/
@Data
public class PartyMeetingMessageMQMsg extends MqBaseFormDTO implements Serializable {
//客户Id
private String customerId;
//活动/日程Id
private String icPartyActId;
//动作类型 发布活动:publish 提前提醒:remind 日程通知:notify
private String type;
}

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java

@ -19,6 +19,12 @@ public enum EventEnum {
TOPIC_SHIFTED_TO_PROJECT("topic_to_project","resi_group","话题被转为项目"),
LEADER_RESOLVE_TOPIC("leader_resolve_topic","resi_group","组长解决组内话题"),
FINISH_USER_DEMAND("finish_user_demand","community_service","服务完成"),
ZBWYH("参加支部委员会","part_member", "支部委员会活动签到"),
ZBDYDH("参加支部党员大会","part_member", "支部党员大会活动签到"),
DXZH("参加党小组会","part_member", "党小组会活动签到"),
DANGKE ("参加党课","part_member", "党课活动签到"),
ZTDR("参加主题党日","part_member", "主题党日活动签到"),
WMFWHD("参加为民服务活动","part_member", "为民服务活动活动签到"),
;
private String eventClass;

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

@ -85,6 +85,7 @@ public enum EpmetErrorCode {
BUILDING_NAME_EXITED(8215,"楼栋名称已存在"),
DOOR_NAME_EXITED(8216,"门牌号已存在"),
NEIGHBOOR_NAME_EXITED(8217,"小区名称已存在"),
BUILDING_NAME_EXITED_IN_GRID(8218,"小区下该楼栋已存在于其他网格"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),

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

@ -55,6 +55,7 @@ public class DateUtils {
public final static String DATE_TIME_PATTERN_END_WITH_MINUTE = "yyyy-MM-dd HH:mm";
public static final String DATE_PATTERN_YYYYMMDD = "yyyyMMdd";
public static final String DATE_PATTERN_YYYYMMDDHHMM = "yyyyMMddHHmm";
public static final String DATE_NAME_PATTERN = "yyyy年MM月dd日";
public static final String MONTH_NAME_PATTERN = "yyyy年MM月";
public static final String DATE_PATTERN_YYYY = "yyyy";
@ -1070,4 +1071,10 @@ public class DateUtils {
return cal.getTime();
}
public static Date calDateBaseDay(Date date, int day) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, day);
return calendar.getTime();
}
}

24
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java

@ -1,10 +1,15 @@
package com.epmet.commons.tools.utils;
import com.epmet.commons.tools.enums.IdCardTypeEnum;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.DateTimeException;
import java.time.LocalDate;
import java.time.Period;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -50,6 +55,7 @@ public class IdCardRegexUtils {
private String birthdayMonth;
private String birthdayDay;
private String sex;
private Integer age;
}
/**
@ -116,7 +122,17 @@ public class IdCardRegexUtils {
String month = matcher.group("month");
String day = matcher.group("day");
String sex = matcher.group("sex");
return new ParsedContent(year, month, day, sex);
// ------- 年龄Start----------
Integer age;
try {
LocalDate birthday = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day));
age = Period.between(birthday, LocalDate.now()).getYears();
} catch (DateTimeException e) {
throw new EpmetException("身份证号解析年龄失败:" + ExceptionUtils.getErrorStackTrace(e));
}
// ------- 年龄End----------
return new ParsedContent(year, month, day, sex, age);
}
// 其他类型暂时不可解析
@ -130,4 +146,10 @@ public class IdCardRegexUtils {
public IdCardTypeEnum getTypeEnum() {
return idCardType;
}
public static void main(String[] args) {
IdCardRegexUtils parse = IdCardRegexUtils.parse("370282198801303017");
ParsedContent parsedResult = parse.getParsedResult();
System.out.println(parsedResult);
}
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/WorkdiaryServiceRecordExcel.java

@ -7,6 +7,7 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.poi.excel.converter.EasyExcelDateConverter;
import com.epmet.dto.result.WorkdiaryServiceRecordDTO;
import com.epmet.excel.converter.WorkDiaryServiceEasyExcelDateConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -63,10 +64,8 @@ public class WorkdiaryServiceRecordExcel {
@NotNull(message = "服务时间必填")
@ColumnWidth(20)
@ExcelProperty(value = "服务时间")
//@DateTimeFormat("yyyy-MM-dd")
//@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private String serviceTime;
@ExcelProperty(value = "服务时间", converter = WorkDiaryServiceEasyExcelDateConverter.class)
private Date serviceTime;
@ColumnWidth(20)
@ExcelProperty(value = "备注")
@ -74,6 +73,6 @@ public class WorkdiaryServiceRecordExcel {
public WorkdiaryServiceRecordExcel(WorkdiaryServiceRecordDTO dto) {
BeanUtil.copyProperties(dto, this);
this.serviceTime = DateUtils.format(dto.getServiceTime());
//this.serviceTime = DateUtils.format(dto.getServiceTime());
}
}

59
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/converter/WorkDiaryServiceEasyExcelDateConverter.java

@ -0,0 +1,59 @@
package com.epmet.excel.converter;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.Date;
/**
* 框架easyexcel
* 目的工作日志(服务)对服务时间日期类型的转换
*/
public class WorkDiaryServiceEasyExcelDateConverter implements Converter<Date> {
private static final String PATTERN_YYYY_MM_DD = "yyyy-MM-dd";
/**
* excel内容转化为java时间
* @param cellData
* @param contentProperty
* @param globalConfiguration
* @return
* @throws Exception
*/
public Date convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
if (cellData.getType() == CellDataTypeEnum.NUMBER) {
// 数字类型,是1900-01-03到excel中数据日期的天数差值
LocalDateTime localDate = LocalDateTime.of(1900, 1, 1, 0, 0, 0)
// 不知为何,这个日期差值,多了2天,需要减去
.minus(2L, ChronoUnit.DAYS)
.plus(cellData.getNumberValue().longValue(), ChronoUnit.DAYS);
return Date.from(localDate.atZone(ZoneId.systemDefault()).toInstant());
} else {
// 字符串,正常格式化
Date dateData = new SimpleDateFormat(PATTERN_YYYY_MM_DD).parse(cellData.getStringValue());
return dateData;
}
}
/**
* java日期转为excel内容
* @param value
* @param contentProperty
* @param globalConfiguration
* @return
* @throws Exception
*/
public WriteCellData<?> convertToExcelData(Date value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
String dataStr = new SimpleDateFormat(PATTERN_YYYY_MM_DD).format(value);
return new WriteCellData(dataStr);
}
}

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -1394,8 +1394,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
break;
case UserDemandConstant.IC_USER_VOLUNTEER:
resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserName(icUerInfoMap.get(resDto.getServerId()).getName());
resDto.setServiceUserMobile(icUerInfoMap.get(resDto.getServerId()).getMobile());
resDto.setServiceUserName(MapUtils.isNotEmpty(icUerInfoMap) && icUerInfoMap.containsKey(resDto.getServerId()) ? icUerInfoMap.get(resDto.getServerId()).getName() : StrConstant.EPMETY_STR);
resDto.setServiceUserMobile(MapUtils.isNotEmpty(icUerInfoMap) && icUerInfoMap.containsKey(resDto.getServerId()) ? icUerInfoMap.get(resDto.getServerId()).getMobile() : StrConstant.EPMETY_STR);
break;
default:
log.warn("serviceType 错误");
@ -1468,7 +1468,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if (CollectionUtils.isNotEmpty(icUserIdList)) {
Result<List<IcResiUserDTO>> icUserInfoRes = epmetUserOpenFeignClient.getListIcResiUserDTO(new ArrayList<>(icUserIdList));
if (!icUserInfoRes.success() || CollectionUtils.isEmpty(icUserInfoRes.getData())) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询居民信息志愿者信息异常");
// throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询居民信息志愿者信息异常");
log.warn("查询居民信息志愿者信息异常:icUserIdList:"+JSON.toJSONString(icUserIdList));
return icUserInfoMap;
}
icUserInfoMap = icUserInfoRes.getData().stream().collect(Collectors.toMap(IcResiUserDTO::getId, o -> o, (o1, o2) -> o1));
}
@ -1522,8 +1524,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
case UserDemandConstant.IC_USER_VOLUNTEER:
Map<String, IcResiUserDTO> icUserInfoMap = getIcVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId())));
resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserName(icUserInfoMap.get(resDto.getServerId()).getName());
resDto.setServiceUserMobile(icUserInfoMap.get(resDto.getServerId()).getMobile());
resDto.setServiceUserName(MapUtils.isNotEmpty(icUserInfoMap) && icUserInfoMap.containsKey(resDto.getServerId()) ? icUserInfoMap.get(resDto.getServerId()).getName() : StrConstant.EPMETY_STR);
resDto.setServiceUserMobile(MapUtils.isNotEmpty(icUserInfoMap) && icUserInfoMap.containsKey(resDto.getServerId()) ? icUserInfoMap.get(resDto.getServerId()).getMobile() : StrConstant.EPMETY_STR);
break;
default:
log.warn("serviceType 错误");

42
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java

@ -480,26 +480,26 @@ public class WorkdiaryServiceRecordServiceImpl extends BaseServiceImpl<Workdiary
}
// ---------服务时间 Start 使用正则处理---------
String serviceTimeStr = row.getServiceTime();
String year;
String month;
String day;
Matcher stm = WORKDIARY_SERVICE_TIME_REGEX.matcher(serviceTimeStr);
if (stm.matches()) {
year = stm.group("year");
month = stm.group("month");
day = stm.group("day");
} else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"服务时间格式不正确",
"服务时间格式不正确");
}
year = String.format("%04d", Integer.valueOf(year));
month = String.format("%02d", Integer.valueOf(month));
day = String.format("%02d", Integer.valueOf(day));
Date serviceTime = DateUtils.parseDate(String.format("%s-%s-%s", year, month, day), DateUtils.DATE_PATTERN);
//String serviceTimeStr = row.getServiceTime();
//String year;
//String month;
//String day;
//Matcher stm = WORKDIARY_SERVICE_TIME_REGEX.matcher(serviceTimeStr);
//if (stm.matches()) {
// year = stm.group("year");
// month = stm.group("month");
// day = stm.group("day");
//} else {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
// "服务时间格式不正确",
// "服务时间格式不正确");
//}
//
//year = String.format("%04d", Integer.valueOf(year));
//month = String.format("%02d", Integer.valueOf(month));
//day = String.format("%02d", Integer.valueOf(day));
//
//Date serviceTime = DateUtils.parseDate(String.format("%s-%s-%s", year, month, day), DateUtils.DATE_PATTERN);
// ---------服务时间 End---------
@ -516,7 +516,7 @@ public class WorkdiaryServiceRecordServiceImpl extends BaseServiceImpl<Workdiary
row.getApplicantAddress(),
row.getApplicantMobile(),
row.getServiceContent(),
serviceTime,
row.getServiceTime(),
row.getPrincipalName(),
row.getRemark());

36
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoPublishIcPartyActTask.java

@ -0,0 +1,36 @@
package com.epmet.task;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @Description
* @Author yzm
* @Date 2022/8/22 15:13
*/
@Slf4j
@Component("autoPublishIcPartyActTask")
public class AutoPublishIcPartyActTask implements ITask {
@Autowired
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
/**
* 活动时间2022-08-15 10:30 选择的是提前3天自动发布
* 本任务是自动发布活动
* //2022-8-9号 8:00 收到一个:您有一个活动3天后即将自动发布
*
* @param params 参数多参数使用JSON数据
*/
@Override
public void run(String params) {
Result result=resiPartyMemberOpenFeignClient.autoPublishIcPartyAct();
if(result.success()){
log.info("autoPublishIcPartyActTask执行成功");
}else{
log.info("autoPublishIcPartyActTask执行失败");
}
}
}

31
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EnterprisePatrolRemindTask.java

@ -0,0 +1,31 @@
package com.epmet.task;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.GovOrgOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/9/6 17:35
*/
@Component("enterprisePatrolRemindTask")
@Slf4j
public class EnterprisePatrolRemindTask implements ITask {
@Resource
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public void run(String params) {
log.info("EnterprisePatrolRemindTask定时任务正在执行,参数为:{}", params);
Result result = govOrgOpenFeignClient.sendEnterprisePatrolRemindMessage();
if (result.success()) {
log.info("EnterprisePatrolRemindTask定时任务执行成功");
} else {
log.error("EnterprisePatrolRemindTask定时任务执行失败:" + result.getMsg());
}
}
}

37
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/NoticePartyActAutoPublishTask.java

@ -0,0 +1,37 @@
package com.epmet.task;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @Description
* @Author yzm
* @Date 2022/8/22 15:07
*/
@Slf4j
@Component("noticePartyActAutoPublishTask")
public class NoticePartyActAutoPublishTask implements ITask {
@Autowired
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
/**
* 活动时间2022-08-15 10:30 选择的是提前3天自动发布
* //2022-8-12 10:30自动发布,收到消息:您有一个活动已经发布
* 本任务是通知2022-8-9号 8:00 收到一个您有一个活动3天后即将自动发布
*
* @param params 参数多参数使用JSON数据
*/
@Override
public void run(String params) {
Result result=resiPartyMemberOpenFeignClient.noticePartyActAutoPublishTask();
if(result.success()){
log.info("noticePartyActAutoPublishTask执行成功");
}else{
log.info("noticePartyActAutoPublishTask执行失败");
}
}
}

35
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcUpdateYlfnTask.java

@ -0,0 +1,35 @@
package com.epmet.task.ic;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.task.ITask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* desc:定时弥补数据 保证数据的一致性
*/
@Slf4j
@Component("icUpdateYlfnTask")
public class IcUpdateYlfnTask implements ITask {
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* 执行定时任务接口
*
* @param params 参数多参数使用JSON数据
*/
@Override
public void run(String params) {
Result result = epmetUserOpenFeignClient.updateYlfn();
if (result.success()) {
log.info("icUpdateYlfnTask定时任务正在执行定时任务执行成功");
} else {
log.warn("icUpdateYlfnTask定时任务正在执行定时任务执行失败:" + result.getMsg());
}
}
}

7
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java

@ -57,4 +57,11 @@ public interface SmsTemplateConstant {
* ${name}给您指派了一个新的需求请服务完成后尽快反馈谢谢合作
*/
String DEMAND_SERVICE_TEM="SMS_247645013";
/**
* 模板名称: 数字社区-企事业单位复巡查消息提醒模板
* 模板CODE: SMS_251056077
* 模板内容: ${name}最近一次巡查结果不合格请在${date}再次巡查
*/
String ENTERPRISE_PATROL_TEM="SMS_251056077";
}

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

@ -170,4 +170,16 @@ public interface SystemMessageType {
*/
String PARTYMEMBER_RESI_IMPORT = "partymember_resi_import";
/**
* 党建小助手消息
*/
String PARTY_MEETING_MESSAGE = "party_meeting_message";
String ZBWYH = "参加支部委员会";
String ZBDYDH = "参加支部党员大会";
String DXZH = "参加党小组会";
String DANGKE = "参加党课";
String ZTDR = "参加主题党日";
String WMFWHD = "参加为民服务活动";
}

104
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/IcMessageDTO.java

@ -0,0 +1,104 @@
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 2022-08-19
*/
@Data
public class IcMessageDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* app=resi时此列为gridId,其他情况暂定 *
*/
private String gridId;
/**
* 被通知的用户id
*/
private String userId;
/**
* 消息通知对象居民端用户resi政府端工作人员gov运营端工作人员oper
*/
private String app;
/**
* 消息分类 党建活动party_act 党建日程party_schedule
*/
private String messageType;
/**
* 消息类型对应的业务Id
*/
private String targetId;
/**
* 消息标题
*/
private String title;
/**
* 消息通知内容
*/
private String messageContent;
/**
* read已读unread未读
*/
private String readFlag;
/**
* 删除标记 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人(发布消息的人)
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 调用者
*/
private String referer;
}

66
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/IcMessageFormDTO.java

@ -0,0 +1,66 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class IcMessageFormDTO implements Serializable {
private static final long serialVersionUID = 2697079163476964749L;
/**
* 客户id
*/
@NotBlank(message = "客户id不能为空")
private String customerId;
/**
* app=resi时此列为gridId,其他情况暂定 *
*/
private String gridId;
/**
* 对应用户id
*/
@NotBlank(message = "通知用户id为空")
private String userId;
/**
* 消息通知对象居民端用户resi政府端工作人员gov运营端工作人员oper
*/
@NotBlank(message = "消息通知对象不能为空")
private String app;
/**
* 消息标题
*/
@NotBlank(message = "消息标题不能为空")
private String title;
/**
* 消息通知内容
*/
@NotBlank(message = "通知内容不能为空")
private String messageContent;
/**
* read已读unread未读
*/
@NotBlank(message = "readFlag不能为空")
private String readFlag;
/**
* 调用者 分内部调用和外部调用内部调用值为空外部默认为外挂-站内信
*/
private String referer;
/**
* 消息分类:info-上传下达消息 详见UserMessageTypeConstant
*/
private String messageType;
/**
* 消息对应的业务id,比如message_type=info时此列存储的是消息id,可跳转到消息详情
*/
private String targetId;
}

19
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/IcMessageListFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class IcMessageListFormDTO implements Serializable {
private static final long serialVersionUID = 2697079163476964749L;
private Integer pageNo = 1;
private Integer pageSize = 20;
private Boolean isPage = true;
//token中信息
private String customerId;
private String userId;
}

18
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadIcMessageFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
@Data
public class ReadIcMessageFormDTO implements Serializable {
private static final long serialVersionUID = 2697079163476964749L;
/**
* 消息Id
*/
private String id;
//token中信息
private String customerId;
private String userId;
}

12
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java

@ -1,6 +1,7 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.SysSmsDTO;
import com.epmet.dto.form.*;
@ -127,4 +128,15 @@ public interface EpmetMessageOpenFeignClient {
@PostMapping(value = "message/sms/send-msg", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result sendMsg(@RequestBody List<SendSmsFormDTO> formDTO);
/**
* @Author sun
* @Description 党建小助手-批量插入未读消息
**/
@PostMapping(value = "message/icMessage/saveicmessagelist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result saveIcMessageList(List<UserMessageFormDTO> msgList);
@PostMapping(value = "message/icMessage/unreadcount/{userId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<Integer> unReadCount(@PathVariable("userId") String userId);
}

11
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java

@ -78,4 +78,15 @@ public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeig
public Result sendMsg(List<SendSmsFormDTO> formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendMsg",formDTO);
}
@Override
public Result saveIcMessageList(List<UserMessageFormDTO> msgList) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveIcMessageList", msgList);
}
@Override
public Result<Integer> unReadCount(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "unReadCount", userId);
}
}

105
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/IcMessageController.java

@ -0,0 +1,105 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.IcMessageFormDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.ReadIcMessageFormDTO;
import com.epmet.service.IcMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 用户消息表(党建小助手)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-19
*/
@RestController
@RequestMapping("icMessage")
public class IcMessageController {
@Autowired
private IcMessageService icMessageService;
@RequestMapping("list")
public Result<PageData<IcMessageDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcMessageListFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<PageData<IcMessageDTO>>().ok(icMessageService.list(formDTO));
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcMessageDTO> get(@PathVariable("id") String id){
IcMessageDTO data = icMessageService.get(id);
return new Result<IcMessageDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcMessageDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icMessageService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcMessageDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icMessageService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icMessageService.delete(ids);
return new Result();
}
/**
* @Author sun
* @Description 批量插入未读消息
**/
@PostMapping("saveicmessagelist")
public Result saveIcMessageList(@RequestBody List<IcMessageFormDTO> msgList) {
icMessageService.saveIcMessageList(msgList);
return new Result();
}
/**
* @Author sun
* @Description 单条或批量修改已读
**/
@PostMapping("read")
public Result read(@LoginUser TokenDto tokenDto, @RequestBody ReadIcMessageFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icMessageService.read(formDTO);
return new Result();
}
@PostMapping("unreadcount/{userId}")
public Result<Integer> unReadCount(@PathVariable ("userId") String userId) {
return new Result<Integer>().ok(icMessageService.unReadCount(userId));
}
}

27
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/IcMessageDao.java

@ -0,0 +1,27 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.ReadIcMessageFormDTO;
import com.epmet.entity.IcMessageEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户消息表(党建小助手)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-19
*/
@Mapper
public interface IcMessageDao extends BaseDao<IcMessageEntity> {
List<IcMessageDTO> selectMessageList(IcMessageListFormDTO formDTO);
void upByUserId(ReadIcMessageFormDTO formDTO);
Integer selectUnReadCount(@Param("userId") String userId);
}

74
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/IcMessageEntity.java

@ -0,0 +1,74 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 用户消息表(党建小助手)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_message")
public class IcMessageEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* app=resi时此列为gridId,其他情况暂定 *
*/
private String gridId;
/**
* 被通知的用户id
*/
private String userId;
/**
* 消息通知对象居民端用户resi政府端工作人员gov运营端工作人员oper
*/
private String app;
/**
* 消息分类 党建活动party_act 党建日程party_schedule
*/
private String messageType;
/**
* 消息类型对应的业务Id
*/
private String targetId;
/**
* 消息标题
*/
private String title;
/**
* 消息通知内容
*/
private String messageContent;
/**
* read已读unread未读
*/
private String readFlag;
/**
* 调用者
*/
private String referer;
}

78
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/IcMessageService.java

@ -0,0 +1,78 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.IcMessageFormDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.ReadIcMessageFormDTO;
import com.epmet.entity.IcMessageEntity;
import java.util.List;
import java.util.Map;
/**
* 用户消息表(党建小助手)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-19
*/
public interface IcMessageService extends BaseService<IcMessageEntity> {
/**
* 默认查询
*
* @param formDTO
* @return java.util.List<IcMessageDTO>
* @author generator
* @date 2022-08-19
*/
PageData<IcMessageDTO> list(IcMessageListFormDTO formDTO);
/**
* 单条查询
*
* @param id
* @return IcMessageDTO
* @author generator
* @date 2022-08-19
*/
IcMessageDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-08-19
*/
void save(IcMessageDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-08-19
*/
void update(IcMessageDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-08-19
*/
void delete(String[] ids);
void saveIcMessageList(List<IcMessageFormDTO> msgList);
void read(ReadIcMessageFormDTO formDTO);
Integer unReadCount(String userId);
}

116
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/IcMessageServiceImpl.java

@ -0,0 +1,116 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcMessageDao;
import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.IcMessageFormDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.IcMoveInListFormDTO;
import com.epmet.dto.form.ReadIcMessageFormDTO;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcMoveInListResultDTO;
import com.epmet.entity.IcMessageEntity;
import com.epmet.service.IcMessageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.MapUtils;
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.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 用户消息表(党建小助手)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-19
*/
@Service
public class IcMessageServiceImpl extends BaseServiceImpl<IcMessageDao, IcMessageEntity> implements IcMessageService {
@Override
public PageData<IcMessageDTO> list(IcMessageListFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<IcMessageDTO> list = baseDao.selectMessageList(formDTO);
PageInfo<IcMessageDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
private QueryWrapper<IcMessageEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcMessageEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcMessageDTO get(String id) {
IcMessageEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcMessageDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcMessageDTO dto) {
IcMessageEntity entity = ConvertUtils.sourceToTarget(dto, IcMessageEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcMessageDTO dto) {
IcMessageEntity entity = ConvertUtils.sourceToTarget(dto, IcMessageEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void saveIcMessageList(List<IcMessageFormDTO> msgList) {
List<IcMessageEntity> entityList = ConvertUtils.sourceToTarget(msgList, IcMessageEntity.class);
insertBatch(entityList);
}
@Override
public void read(ReadIcMessageFormDTO formDTO) {
//id入参有值就按id修改,没值就按用户修改
if(StringUtils.isNotBlank(formDTO.getId())){
IcMessageEntity entity = new IcMessageEntity();
entity.setId(formDTO.getId());
entity.setReadFlag("read");
updateById(entity);
return;
}
//批量修改某个人消息列表
baseDao.upByUserId(formDTO);
}
@Override
public Integer unReadCount(String userId) {
return baseDao.selectUnReadCount(userId);
}
}

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

@ -237,6 +237,17 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.PARTYMEMBER_RESI_IMPORT:
topic=TopicConstants.PARTYMEMBER_RESI;
break;
case SystemMessageType.PARTY_MEETING_MESSAGE:
topic=TopicConstants.IC_MESSAGE;
break;
case SystemMessageType.ZBWYH:
case SystemMessageType.ZBDYDH:
case SystemMessageType.DXZH:
case SystemMessageType.DANGKE:
case SystemMessageType.ZTDR:
case SystemMessageType.WMFWHD:
topic=TopicConstants.PARTY_BUILDING;
break;
default:
logger.error("getTopicByMsgType msgType:{} is not support for any topic", msgType);
}

20
epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.19__create_ic_message.sql

@ -0,0 +1,20 @@
CREATE TABLE `ic_message` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`customer_id` varchar(64) NOT NULL COMMENT '客户id',
`grid_id` varchar(64) NOT NULL DEFAULT '*' COMMENT '暂定 *',
`user_id` varchar(64) NOT NULL COMMENT '被通知的用户id',
`app` varchar(32) NOT NULL COMMENT '消息通知对象:居民端用户resi、政府端工作人员gov、运营端工作人员oper',
`message_type` varchar(32) DEFAULT NULL COMMENT '消息分类 党建小助手:party',
`target_id` varchar(64) DEFAULT NULL COMMENT '消息类型对应的业务Id',
`title` varchar(255) NOT NULL COMMENT '消息标题',
`message_content` varchar(3096) NOT NULL COMMENT '消息通知内容',
`read_flag` varchar(32) NOT NULL DEFAULT 'unread' COMMENT 'read已读、unread未读',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人(发布消息的人)',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
`REFERER` varchar(20) DEFAULT NULL COMMENT '调用者',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='用户消息表(党建小助手)';

2
epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.20__alter_ic_message.sql

@ -0,0 +1,2 @@
ALTER TABLE epmet_message.`ic_message`
MODIFY COLUMN `message_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '消息分类 \r\n党建活动:party_act \r\n党建日程:party_schedule \r\n' AFTER `app`;

40
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/IcMessageDao.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcMessageDao">
<select id="selectMessageList" resultType="com.epmet.dto.IcMessageDTO">
SELECT
*
FROM
ic_message
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND user_id = #{userId}
ORDER BY CREATED_TIME desc
</select>
<update id="upByUserId" parameterType="com.epmet.dto.form.ReadIcMessageFormDTO">
UPDATE ic_message
SET read_flag = 'read',
updated_by = #{userId},
updated_time = NOW()
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND user_id = #{userId}
</update>
<select id="selectUnReadCount" resultType="java.lang.Integer">
SELECT
COUNT(id)
FROM
ic_message
WHERE
del_flag = '0'
AND read_flag = 'unread'
AND user_id = #{userId}
</select>
</mapper>

2
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRuleDTO.java

@ -98,5 +98,5 @@ public class PointAdditiveRuleDTO implements Serializable {
* 更新时间
*/
private Date updatedTime;
private String editFlag;
}

25
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PartyPointFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/8/22 15:57
*/
@Data
public class PartyPointFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -4811220825653023328L;
private String customerId;
private String userId;
private String year;
private String quarter;
private String month;
private String type;
private String dateType;
private String startDate;
private String endDate;
}

3
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointModifyFormDTO.java

@ -4,6 +4,7 @@ import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @program: epmet-cloud
@ -59,5 +60,7 @@ public class PointModifyFormDTO implements Serializable {
*/
private Integer pointValue;
List<String> customerIdList;
}

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

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/8/25 9:20
*/
@Data
public class PartyPointRecordResultDTO implements Serializable {
private static final long serialVersionUID = -1480768520576719171L;
/**
* 日期 yyyy-MM-dd 字符串
* */
private String date;
private List<PartyPointResultDTO> dailyList;
}

33
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PartyPointResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/8/22 15:59
*/
@Data
public class PartyPointResultDTO implements Serializable {
private static final long serialVersionUID = -3208641116926725011L;
private String title;
/**
* 日期yyyy-MM-dd
*/
private String date;
/**
* 时间hh:mm
*/
private String time;
private String point;
private String actId;
private String actTopic;
private String actType;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date actDate;
private String actAddress;
}

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

@ -185,4 +185,10 @@ public class PointAdditiveRuleController {
dto.setCustomerId(tokenDto.getCustomerId());
return pointAdditiveRuleService.modify(dto);
}
@PostMapping("initPartyRole")
public Result initPartyBuilidingRole(@RequestBody PointModifyFormDTO dto) {
pointAdditiveRuleService.initPartyBuilidingRole(dto.getCustomerIdList());
return new Result();
}
}

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

@ -255,4 +255,19 @@ public class ResiPointController {
ValidatorUtils.validateEntity(pageUserParam, CommonPageUserFormDTO.PageUserGroup.class);
return new Result<List<PointAdditiveRecordResultDTO>>().ok(pointAdditiveRecordService.getRecords(pageUserParam));
}
/**
* 党建积分
* @Param tokenDto
* @Param formDTO
* @Return {@link Result< PageData< PartyPointResultDTO>>}
* @Author zhaoqifeng
* @Date 2022/8/23 14:12
*/
@PostMapping("pagePartyPoint")
public Result<List<PartyPointRecordResultDTO>> pagePartyPoint(@LoginUser TokenDto tokenDto, @RequestBody PartyPointFormDTO formDTO ){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<PartyPointRecordResultDTO>>().ok(pointActionLogService.pagePartyPoint(formDTO));
}
}

3
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveRuleDao.java

@ -8,6 +8,7 @@ import com.epmet.dto.form.List4treeFormDTO;
import com.epmet.dto.form.SubmitRewardFormDTO;
import com.epmet.dto.result.List4ApplyResultDTO;
import com.epmet.entity.PointAdditiveRuleEntity;
import com.epmet.entity.PointRuleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -87,4 +88,6 @@ public interface PointAdditiveRuleDao extends BaseDao<PointAdditiveRuleEntity> {
* @return com.epmet.dto.PointAdditiveRuleDTO
*/
PointAdditiveRuleDTO selectRuledetail(@Param("ruleId") String ruleId);
PointRuleEntity selectByRoleName(@Param("customerId") String customerId, @Param("roleName") String roleName);
}

4
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java

@ -19,7 +19,9 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcResiPointPageFormDTO;
import com.epmet.dto.form.PartyPointFormDTO;
import com.epmet.dto.result.MyPointTaskResultDTO;
import com.epmet.dto.result.PartyPointResultDTO;
import com.epmet.dto.result.ResiPointLogPeriodResultDTO;
import com.epmet.dto.result.ResiPointPageResDTO;
import com.epmet.entity.UserPointActionLogEntity;
@ -73,4 +75,6 @@ public interface UserPointActionLogDao extends BaseDao<UserPointActionLogEntity>
@Param("dateId")String dateId);
List<ResiPointPageResDTO> selectPageResiPoin(IcResiPointPageFormDTO formDTO);
List<PartyPointResultDTO> getPagePartyPoint(PartyPointFormDTO formDTO);
}

1
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java

@ -22,6 +22,7 @@ public class RocketMQConsumerRegister extends MQAbstractRegister {
register(consumerProperties, ConsomerGroupConstants.RESI_GROUP_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.RESI_GROUP, "*", new PointListener(userPointActionLogService));
register(consumerProperties, ConsomerGroupConstants.EPMET_HEART_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.EPMET_HEART, "*", new PointListener(userPointActionLogService));
register(consumerProperties, ConsomerGroupConstants.COMMUNITY_SERVICE_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.COMMUNITY_SERVICE, "*", new PointListener(userPointActionLogService));
register(consumerProperties, ConsomerGroupConstants.PARTY_BUILDING_GROUP, MessageModel.CLUSTERING, TopicConstants.PARTY_BUILDING, "*", new PointListener(userPointActionLogService));
// ...其他监听器类似
}

17
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java

@ -113,6 +113,15 @@ public class PointListener implements MessageListenerConcurrently {
//给需求服务方(志愿者)发放积分
grantServerPoint(msg);
break;
case SystemMessageType.ZBWYH:
case SystemMessageType.ZBDYDH:
case SystemMessageType.DXZH:
case SystemMessageType.DANGKE:
case SystemMessageType.ZTDR:
case SystemMessageType.WMFWHD:
partyAct(msg);
default:
break;
}
} catch (RenException e) {
@ -218,6 +227,14 @@ public class PointListener implements MessageListenerConcurrently {
});
}
private void partyAct(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
});
}
/**
* 需求完成给志愿者发放积分
* @param msg

9
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveRuleService.java

@ -151,4 +151,13 @@ public interface PointAdditiveRuleService extends BaseService<PointAdditiveRuleE
* @return com.epmet.commons.tools.utils.Result
*/
Result modify(PointModifyFormDTO dto);
/**
* 客户初始化党建活动积分规则
* @Param customerIdList
* @Return
* @Author zhaoqifeng
* @Date 2022/8/26 13:40
*/
void initPartyBuilidingRole(List<String> customerIdList);
}

15
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java

@ -24,9 +24,8 @@ import com.epmet.dto.UserPointActionLogDTO;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.form.IcResiPointPageFormDTO;
import com.epmet.dto.form.MyPointTaskFormDTO;
import com.epmet.dto.result.MyPointTaskResultDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointPageResDTO;
import com.epmet.dto.form.PartyPointFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.UserPointActionLogEntity;
import dto.form.SendPointFormDTO;
@ -159,4 +158,14 @@ public interface UserPointActionLogService extends BaseService<UserPointActionLo
* @return
*/
PageData<ResiPointPageResDTO> pageUserPoint(IcResiPointPageFormDTO formDTO);
/**
* 党建积分
*
* @Param formDTO
* @Return {@link PageData< PartyPointResultDTO>}
* @Author zhaoqifeng
* @Date 2022/8/22 16:04
*/
List<PartyPointRecordResultDTO> pagePartyPoint(PartyPointFormDTO formDTO);
}

10
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -127,11 +128,10 @@ public class BizPointUserTotalDetailServiceImpl extends BaseServiceImpl<BizPoint
*/
@Override
public BizPointUserTotalDetailDTO getDataByObject(String type, String objectId, String userId) {
QueryWrapper<BizPointUserTotalDetailEntity> wrapper = new QueryWrapper<>();
wrapper.eq("BIZ_TYPE", type)
.eq("OBJECT_ID", objectId)
.eq("USER_ID", userId)
.eq("DEL_FLAG", NumConstant.ZERO_STR);
LambdaQueryWrapper<BizPointUserTotalDetailEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BizPointUserTotalDetailEntity::getBizType, type)
.eq(StringUtils.isNotBlank(objectId), BizPointUserTotalDetailEntity::getObjectId, objectId)
.eq(BizPointUserTotalDetailEntity::getUserId, userId);
BizPointUserTotalDetailEntity entity = baseDao.selectOne(wrapper);
return ConvertUtils.sourceToTarget(entity, BizPointUserTotalDetailDTO.class);
}

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

@ -1,16 +1,19 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.common.enu.PointAddRuleEnum;
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.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SystemMessageType;
import com.epmet.dao.PointAdditiveRuleDao;
import com.epmet.dao.PointApplyDao;
import com.epmet.dto.CategorydetailResultDTO;
@ -27,7 +30,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 附加积分规则
@ -200,7 +205,25 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
@Override
public Result<List<PointAdditiveRuleDTO>> list4tree(List4treeFormDTO dto) {
LambdaQueryWrapper<PointAdditiveRuleEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, dto.getCustomerId());
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "党建活动");
PointAdditiveRuleEntity rule = baseDao.selectOne(wrapper);
List<PointAdditiveRuleDTO> result = baseDao.selectList4tree(dto);
if (CollectionUtils.isNotEmpty(result)) {
result.forEach(item -> {
if (null != rule) {
if (item.getId().equals(rule.getId()) || item.getPid().equals(rule.getId())) {
item.setEditFlag(NumConstant.ZERO_STR);
} else {
item.setEditFlag(NumConstant.ONE_STR);
}
} else {
item.setEditFlag(NumConstant.ONE_STR);
}
});
}
return new Result<List<PointAdditiveRuleDTO>>().ok(result);
}
@ -267,4 +290,161 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
return new Result().ok("修改成功!");
}
/**
* 客户初始化党建活动积分规则
*
* @param customerIdList
* @Param customerIdList
* @Return
* @Author zhaoqifeng
* @Date 2022/8/26 13:40
*/
@Override
public void initPartyBuilidingRole(List<String> customerIdList) {
customerIdList.forEach(customerId -> {
//党建积分
LambdaQueryWrapper<PointAdditiveRuleEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "党建积分");
PointAdditiveRuleEntity djjf = baseDao.selectOne(wrapper);
if (null == djjf) {
djjf = new PointAdditiveRuleEntity();
djjf.setCustomerId(customerId);
djjf.setType("category");
djjf.setApplyFlag(NumConstant.ONE_STR);
djjf.setCategoryCode("party_building");
djjf.setCategoryName("党建积分");
djjf.setPid(NumConstant.ZERO_STR);
djjf.setPids("");
baseDao.insert(djjf);
}
//党建活动
wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "党建活动");
PointAdditiveRuleEntity djhd = baseDao.selectOne(wrapper);
if (null == djhd) {
djhd = new PointAdditiveRuleEntity();
djhd.setCustomerId(customerId);
djhd.setType("category");
djhd.setApplyFlag(NumConstant.ONE_STR);
djhd.setCategoryCode("party_building");
djhd.setCategoryName("党建活动");
djhd.setPid(djjf.getId());
djhd.setPids(djjf.getId());
baseDao.insert(djhd);
}
//支部委员会
wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.ZBWYH);
PointAdditiveRuleEntity zbdyh = baseDao.selectOne(wrapper);
if (null == zbdyh) {
zbdyh = new PointAdditiveRuleEntity();
zbdyh.setCustomerId(customerId);
zbdyh.setType("rule");
zbdyh.setApplyFlag(NumConstant.ONE_STR);
zbdyh.setCategoryCode("party_building");
zbdyh.setRuleName(SystemMessageType.ZBWYH);
zbdyh.setPid(djhd.getId());
zbdyh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
zbdyh.setPointValue(10);
baseDao.insert(zbdyh);
}
//支部党员大会
wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.ZBDYDH);
PointAdditiveRuleEntity zbdydh = baseDao.selectOne(wrapper);
if (null == zbdydh) {
zbdydh = new PointAdditiveRuleEntity();
zbdydh.setCustomerId(customerId);
zbdydh.setType("rule");
zbdydh.setApplyFlag(NumConstant.ONE_STR);
zbdydh.setCategoryCode("party_building");
zbdydh.setRuleName(SystemMessageType.ZBDYDH);
zbdydh.setPid(djhd.getId());
zbdydh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
zbdydh.setPointValue(20);
baseDao.insert(zbdydh);
}
//党小组会
wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.DXZH);
PointAdditiveRuleEntity dxzh = baseDao.selectOne(wrapper);
if (null == dxzh) {
dxzh = new PointAdditiveRuleEntity();
dxzh.setCustomerId(customerId);
dxzh.setType("rule");
dxzh.setApplyFlag(NumConstant.ONE_STR);
dxzh.setCategoryCode("party_building");
dxzh.setRuleName(SystemMessageType.DXZH);
dxzh.setPid(djhd.getId());
dxzh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
dxzh.setPointValue(10);
baseDao.insert(dxzh);
}
//党课
wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.DANGKE);
PointAdditiveRuleEntity dk = baseDao.selectOne(wrapper);
if (null == dk) {
dk = new PointAdditiveRuleEntity();
dk.setCustomerId(customerId);
dk.setType("rule");
dk.setApplyFlag(NumConstant.ONE_STR);
dk.setCategoryCode("party_building");
dk.setRuleName(SystemMessageType.DANGKE);
dk.setPid(djhd.getId());
dk.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
dk.setPointValue(15);
baseDao.insert(dk);
}
//主题党日
wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.ZTDR);
PointAdditiveRuleEntity ztdr = baseDao.selectOne(wrapper);
if (null == ztdr) {
ztdr = new PointAdditiveRuleEntity();
ztdr.setCustomerId(customerId);
ztdr.setType("rule");
ztdr.setApplyFlag(NumConstant.ONE_STR);
ztdr.setCategoryCode("party_building");
ztdr.setRuleName(SystemMessageType.ZTDR);
ztdr.setPid(djhd.getId());
ztdr.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
ztdr.setPointValue(15);
baseDao.insert(ztdr);
}
//为民服务活动
wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.WMFWHD);
PointAdditiveRuleEntity wmfwhd = baseDao.selectOne(wrapper);
if (null == wmfwhd) {
wmfwhd = new PointAdditiveRuleEntity();
wmfwhd.setCustomerId(customerId);
wmfwhd.setType("rule");
wmfwhd.setApplyFlag(NumConstant.ONE_STR);
wmfwhd.setCategoryCode("party_building");
wmfwhd.setRuleName(SystemMessageType.WMFWHD);
wmfwhd.setPid(djhd.getId());
wmfwhd.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
wmfwhd.setPointValue(15);
baseDao.insert(wmfwhd);
}
});
}
}

124
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dao.PointAdditiveRuleDao;
import com.epmet.dao.UserPointActionLogDao;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.dto.BizPointUserTotalDetailDTO;
@ -38,15 +39,15 @@ import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.form.IcResiPointPageFormDTO;
import com.epmet.dto.form.MyPointTaskFormDTO;
import com.epmet.dto.result.MyPointTaskResultDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointLogPeriodResultDTO;
import com.epmet.dto.result.ResiPointPageResDTO;
import com.epmet.dto.form.PartyPointFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.PointRuleEntity;
import com.epmet.entity.UserPointActionLogEntity;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import com.epmet.entity.UserPointTotalEntity;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import com.epmet.service.*;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
@ -56,14 +57,15 @@ import com.github.pagehelper.PageInfo;
import com.google.common.collect.Maps;
import dto.form.SendPointFormDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@ -89,6 +91,10 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
private BizPointUserTotalDetailService bizPointUserTotalDetailService;
@Autowired
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Resource
private PointAdditiveRuleDao pointAdditiveRuleDao;
@Resource
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
@Override
public PageData<UserPointActionLogDTO> page(Map<String, Object> params) {
@ -207,6 +213,9 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
throw new RenException("无法识别事件类型与积分规则");
}
PointRuleEntity ruleInfo = pointRuleService.getByEventCodeAndCustomerId(event.getCustomerId(),eventCode);
if ("party_building".equals(event.getEventClass())) {
ruleInfo = pointAdditiveRuleDao.selectByRoleName(event.getCustomerId(), eventCode);
}
if(null != ruleInfo && StringUtils.equals(NumConstant.ONE_STR,ruleInfo.getEnabledFlag())){
Date dateCheck = null;
Calendar calendar = Calendar.getInstance();
@ -338,6 +347,9 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
if (("resi_group").equals(event.getEventClass())) {
action.setBizType("group");
action.setObjectId(event.getGroupId());
} else if ("party_building".equals(event.getEventClass())) {
action.setBizType("party_building");
action.setObjectId(event.getSourceId());
} else {
action.setBizType("activity");
action.setObjectId(event.getSourceId());
@ -406,6 +418,26 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
bizPointTotalDetailService.update(totalDetailDTO);
}
} else if ("party_building".equals(event.getEventClass())){
//个人小组积分
BizPointUserTotalDetailDTO userTotalDetailDTO = bizPointUserTotalDetailService.getDataByObject("party_building", null,
event.getUserId());
Integer userTotal = getUserTotalByObject("party_building", null, event.getUserId());
if (null == userTotalDetailDTO) {
userTotalDetailDTO = new BizPointUserTotalDetailDTO();
userTotalDetailDTO.setCustomerId(event.getCustomerId());
userTotalDetailDTO.setAgencyId(event.getAgencyId());
userTotalDetailDTO.setGridId(event.getGridId());
userTotalDetailDTO.setUserId(event.getUserId());
userTotalDetailDTO.setBizType("party_building");
userTotalDetailDTO.setObjectId(event.getSourceId());
userTotalDetailDTO.setTotalPoint(userTotal);
bizPointUserTotalDetailService.save(userTotalDetailDTO);
} else {
userTotalDetailDTO.setTotalPoint(userTotal);
userTotalDetailDTO.setUpdatedTime(new Date());
bizPointUserTotalDetailService.update(userTotalDetailDTO);
}
}
@ -507,7 +539,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
QueryWrapper<UserPointActionLogEntity> wrapper = new QueryWrapper<>();
wrapper.select("IFNULL(SUM(POINT), 0) as POINT")
.eq("BIZ_TYPE", type)
.eq("OBJECT_ID", objectId)
.eq(StringUtils.isNotBlank(objectId), "OBJECT_ID", objectId)
.eq("USER_ID", userId)
.eq("ACTION_FLAG", "plus")
.eq("DEL_FLAG", NumConstant.ZERO_STR);
@ -579,6 +611,86 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
/**
* 党建积分
*
* @param formDTO
* @Param formDTO
* @Return {@link List< PartyPointRecordResultDTO >}
* @Author zhaoqifeng
* @Date 2022/8/22 16:04
*/
@Override
public List<PartyPointRecordResultDTO> pagePartyPoint(PartyPointFormDTO formDTO) {
List<PartyPointRecordResultDTO> result = new LinkedList<>();
if (StringUtils.isNotBlank(formDTO.getYear())) {
if (StringUtils.isNotBlank(formDTO.getQuarter())) {
if (StringUtils.isNotBlank(formDTO.getMonth())) {
formDTO.setStartDate(formDTO.getYear().concat(formDTO.getMonth()));
formDTO.setDateType(NumConstant.TWO_STR);
} else {
switch (formDTO.getQuarter()) {
case NumConstant.ONE_STR:
formDTO.setStartDate(formDTO.getYear().concat("01"));
formDTO.setEndDate(formDTO.getYear().concat("03"));
break;
case NumConstant.TWO_STR:
formDTO.setStartDate(formDTO.getYear().concat("04"));
formDTO.setEndDate(formDTO.getYear().concat("06"));
break;
case NumConstant.THREE_STR:
formDTO.setStartDate(formDTO.getYear().concat("07"));
formDTO.setEndDate(formDTO.getYear().concat("09"));
break;
case NumConstant.FOUR_STR:
formDTO.setStartDate(formDTO.getYear().concat("10"));
formDTO.setEndDate(formDTO.getYear().concat("12"));
break;
default:
break;
}
formDTO.setDateType(NumConstant.THREE_STR);
}
} else if (StringUtils.isNotBlank(formDTO.getMonth())) {
formDTO.setStartDate(formDTO.getYear().concat(formDTO.getMonth()));
formDTO.setDateType(NumConstant.TWO_STR);
} else {
formDTO.setStartDate(formDTO.getYear());
formDTO.setDateType(NumConstant.ONE_STR);
}
} else {
formDTO.setDateType(NumConstant.FOUR_STR);
}
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<PartyPointResultDTO> list =baseDao.getPagePartyPoint(formDTO);
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
Result<IcPartyActDetailResDTO> actInfo = resiPartyMemberOpenFeignClient.actDetail(item.getActId());
if (actInfo.success() && null != actInfo.getData()) {
item.setActType(actInfo.getData().getActTypeName());
item.setActAddress(actInfo.getData().getAddress());
item.setActDate(actInfo.getData().getHoldTime());
item.setActTopic(actInfo.getData().getTopic());
}
});
Map<String,List<PartyPointResultDTO>> map =
list.stream().collect(Collectors.groupingBy(PartyPointResultDTO::getDate));
Map<String, List<PartyPointResultDTO>> sortedMap = Maps.newLinkedHashMap();
map.entrySet().stream().sorted(Map.Entry.<String, List<PartyPointResultDTO>>comparingByKey().reversed())
.forEachOrdered(e -> sortedMap.put(e.getKey(), e.getValue()));
sortedMap.forEach((key, value) -> {
PartyPointRecordResultDTO o = new PartyPointRecordResultDTO();
o.setDate(key);
o.setDailyList(value);
result.add(o);
});
}
return result;
}
/**
* 需求完成给志愿者发放积分
* @param list

25
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml

@ -122,6 +122,31 @@
WHERE DEL_FLAG='0'
AND ID=#{ruleId}
</select>
<select id="selectByRoleName" resultType="com.epmet.entity.PointRuleEntity">
SELECT
a.ID,
a.RULE_NAME,
a.RULE_NAME AS RULE_DESC,
a.POINT_VALUE AS POINT,
"time" AS POINT_UNIT,
"1" AS ENABLED_FLAG,
- 1 AS UP_LIMIT,
"plus" AS OPERATE_TYPE,
"unlimit" AS RULE_PERIOD
FROM
point_additive_rule a
INNER JOIN point_additive_rule b ON a.PID = b.ID
AND b.DEL_FLAG = '0'
AND b.TYPE = 'category'
AND b.CATEGORY_CODE = 'party_building'
AND b.CATEGORY_NAME = '党建活动'
WHERE
a.DEL_FLAG = '0'
AND a.CATEGORY_CODE = 'party_building'
AND a.TYPE = 'rule'
AND a.CUSTOMER_ID = #{customerId}
AND a.RULE_NAME = #{roleName}
</select>
</mapper>

42
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml

@ -157,5 +157,47 @@
</if>
ORDER BY temp.sort ASC
</select>
<select id="getPagePartyPoint" resultType="com.epmet.dto.result.PartyPointResultDTO">
SELECT
OBJECT_ID AS actId,
EVENT_NAME AS title,
CASE
ACTION_FLAG
WHEN 'plus' THEN
concat( '+', POINT ) ELSE POINT
END AS point,
DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) AS date,
DATE_FORMAT( CREATED_TIME, '%H:%i' ) AS time
FROM
USER_POINT_ACTION_LOG
WHERE
DEL_FLAG = '0'
AND BIZ_TYPE = 'party_building'
AND USER_ID = #{userId}
AND CUSTOMER_ID = #{customerId}
<if test='null != type and "" != type'>
AND SOURCE_TYPE = #{type}
</if>
<if test='"1" == dateType'>
<if test="startDate != null and startDate != '' ">
AND DATE_FORMAT(CREATED_TIME,'%Y') = #{startDate}
</if>
</if>
<if test='"2" == dateType'>
<if test="startDate != null and startDate != '' ">
AND DATE_FORMAT(CREATED_TIME,'%Y%m') = #{startDate}
</if>
</if>
<if test='"3" == dateType'>
<if test="startDate != null and startDate != '' ">
AND DATE_FORMAT(CREATED_TIME,'%Y%m') &gt;= #{startDate}
</if>
<if test="endDate != null and endDate != '' ">
AND DATE_FORMAT(CREATED_TIME,'%Y%m') &lt;= #{endDate}
</if>
</if>
ORDER BY
CREATED_TIME DESC
</select>
</mapper>

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

@ -712,4 +712,7 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/department/notsyncdept")
Result<CheckStaffInfoResultDTO> notSyncDept(@RequestBody CheckStaffInfoFormDTO formDTO);
@PostMapping("/gov/org/enterprise/sendEnterprisePatrolRemindMessage")
Result sendEnterprisePatrolRemindMessage();
}

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

@ -464,6 +464,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "notSyncDept", formDTO);
}
@Override
public Result sendEnterprisePatrolRemindMessage() {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "sendEnterprisePatrolRemindMessage", null);
}
@Override
public Result<List<CustomerGridStaffListResultDTO>> gridStaff(CustomerGridStaffListFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaffList", dto);

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java

@ -25,5 +25,6 @@ public interface ImportErrorMsgConstants {
String HOUSE_ERROR_NAME = "导入失败的列表-房屋";
String BUILDING_ERROR_NAME = "导入失败的列表-楼栋";
String NEIGHBORHOOD_ERROR_NAME = "导入失败的列表-小区";
String BUILDING_NAME_EXITED_IN_GRID = "小区下该楼栋已存在于其他网格";
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java

@ -301,4 +301,18 @@ public class IcEnterpriseController implements ResultDataResolver {
icEnterpriseService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),tokenDto.getCustomerId(),tokenDto.getUserId());
return new Result();
}
/**
* 复查消息提醒
*
* @Param
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/9/6 17:31
*/
@PostMapping("sendEnterprisePatrolRemindMessage")
public Result sendEnterprisePatrolRemindMessage() {
icEnterpriseService.sendEnterprisePatrolRemindMessage();
return new Result();
}
}

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

@ -67,6 +67,15 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
List<BaseInfoFamilyBuildingResultDTO> baseInfoFamilyBuilding(@Param("neighborHoodId")String neighborHoodId);
Integer checkBuildName(@Param("neighborHoodId") String neighborHoodId,@Param("buildingName")String buildingName, @Param("buildingId")String buildingId);
Integer checkBuildNameV2(@Param("agencyId") String agencyId,
@Param("neighborHoodName") String neighborHoodName,
@Param("buildingName")String buildingName,
@Param("buildingId")String buildingId);
Integer checkBuildNameV3(@Param("agencyId") String agencyId,
@Param("gridId") String gridId,
@Param("neighborHoodName") String neighborHoodName,
@Param("buildingName")String buildingName,
@Param("buildingId")String buildingId);
List<BuildingResultDTO> buildingListByIds(@Param("buildingIdList") List<String> buildingIdList);
IPage<BuildingResultDTO> buildingListByIds(IPage<IcBuildingEntity> page,@Param("buildingIdList") List<String> buildingIdList);

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java

@ -210,6 +210,13 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
}
public void fillData(ImportGeneralDTO dto, String orgType){
int count = icBuildingDao.checkBuildNameV3(dto.getAgencyId(), dto.getGridId(), dto.getNeighborHoodName(), dto.getBuildingName(), null);
if (count > 0){
// 说明数据库已存在此楼栋,不需添加
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.BUILDING_NAME_EXITED_IN_GRID);
return;
}
if (orgType.equals(CustomerGridConstant.GRID) || orgType.equals(CustomerGridConstant.AGENCY)){
List<String> gridIds = new ArrayList<>();
if (orgType.equals(CustomerGridConstant.GRID)){

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java

@ -3,12 +3,12 @@ package com.epmet.model;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.constant.ImportErrorMsgConstants;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.IcHouseDTO;
@ -489,6 +489,13 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
}
public void fillData(ImportGeneralDTO dto, String orgType){
int count = icBuildingDao.checkBuildNameV3(dto.getAgencyId(), dto.getGridId(), dto.getNeighborHoodName(), dto.getBuildingName(), null);
if (count > 0){
// 说明数据库已存在此楼栋,不需添加
nums.add(num);
disposeErrorMsg(info, ImportErrorMsgConstants.BUILDING_NAME_EXITED_IN_GRID);
return;
}
if (orgType.equals(CustomerGridConstant.GRID) || orgType.equals(CustomerGridConstant.AGENCY)){
List<String> gridIds = new ArrayList<>();
if (orgType.equals(CustomerGridConstant.GRID)){

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java

@ -68,4 +68,14 @@ public interface IcEnterpriseService extends BaseService<IcEnterpriseEntity> {
PageData<EnterpriseDetailDTO> list(EnterprisePageFormDTO formDTO);
void execAsyncExcelImport(Path fileSavePath, String taskId, String customerId, String userId);
/**
* 复查消息提醒
*
* @Param
* @Return
* @Author zhaoqifeng
* @Date 2022/9/6 17:30
*/
void sendEnterprisePatrolRemindMessage();
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -102,9 +102,15 @@ public class BuildingServiceImpl implements BuildingService {
public void addBuilding(String customerId, IcBulidingAddFormDTO formDTO) {
//同一小区下不能存在楼栋名字一样的
Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(), formDTO.getBuildingName(), null);
if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg());
}
IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId());
count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood.getNeighborHoodName(), formDTO.getBuildingName(), null);
if (null != count && count > 0) {
throw new EpmetException(EpmetErrorCode.BUILDING_NAME_EXITED_IN_GRID.getCode());
}
//楼栋编码不可重复
if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getCoding())){
IcBuildingEntity isHaveCoding = icBuildingDao.selectByCoding(formDTO.getCoding(),null);
@ -475,6 +481,11 @@ public class BuildingServiceImpl implements BuildingService {
if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg());
}
IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId());
count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood.getNeighborHoodName(), formDTO.getBuildingName(), formDTO.getBuildingId());
if (null != count && count > 0) {
throw new EpmetException(EpmetErrorCode.BUILDING_NAME_EXITED_IN_GRID.getCode());
}
IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId());
if (!icBuilding.getNeighborHoodId().equals(formDTO.getNeighborHoodId())) {
//更新对应房屋小区id

44
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java

@ -19,15 +19,14 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.*;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.dto.form.EnterpriseFormDTO;
import com.epmet.dto.form.EnterprisePageFormDTO;
import com.epmet.dto.form.EnterprisePatrolFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcEnterpriseEntity;
import com.epmet.entity.IcEnterprisePatrolAttachmentEntity;
@ -36,6 +35,7 @@ import com.epmet.excel.EnterpriseImportExcelDTO;
import com.epmet.excel.handler.IcEnterpriseExcelImportListener;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.CoverageService;
import com.epmet.service.IcEnterpriseService;
@ -55,14 +55,12 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -90,6 +88,8 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
private CoverageService coverageService;
@Autowired
private CustomerGridDao customerGridDao;
@Resource
private EpmetMessageOpenFeignClient messageOpenFeignClient;
/**
* 企事业单位巡查新增/编辑
@ -400,6 +400,34 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
}
@Override
public void sendEnterprisePatrolRemindMessage() {
//一天后
Date afterThreeDayDate=DateUtils.calDateBaseDay(new Date(), NumConstant.ONE);
String dateId= DateUtils.format(afterThreeDayDate, DateUtils.DATE_PATTERN_YYYYMMDD);
LambdaQueryWrapper<IcEnterprisePatrolRecordEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.apply("DATE_FORMAT(REVIEW_TIME,'%Y%m%d') = " + dateId);
List<IcEnterprisePatrolRecordEntity> list = enterprisePatrolRecordDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
List<SendSmsFormDTO> smsList=new ArrayList<>();
list.forEach(item -> {
IcEnterpriseEntity enterprise = baseDao.selectById(item.getEnterpriseId());
if (null != enterprise) {
SendSmsFormDTO sms = new SendSmsFormDTO();
sms.setCustomerId(item.getCustomerId());
sms.setMobile(item.getMobile());
sms.setAliyunTemplateCode(SmsTemplateConstant.ENTERPRISE_PATROL_TEM);
Map<String, String> paramMap = new HashMap<>();
paramMap.put("name",enterprise.getPlaceOrgName());
paramMap.put("date",DateUtils.format(item.getReviewTime(),DateUtils.DATE_PATTERN));
sms.setParamMap(paramMap);
smsList.add(sms);
}
});
messageOpenFeignClient.sendMsg(smsList);
}
}
private CustomerStaffInfoCacheResult queryCurrentStaff(String customerId, String userId) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId);
if (null == staffInfo) {

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

@ -247,6 +247,41 @@
</if>
</select>
<select id="checkBuildNameV2" parameterType="map" resultType="java.lang.Integer">
SELECT
COUNT( a.ID )
FROM
ic_building a
INNER JOIN ic_neighbor_hood b ON a.NEIGHBOR_HOOD_ID = b.ID
AND b.DEL_FLAG = '0'
AND b.AGENCY_ID = #{agencyId}
AND b.NEIGHBOR_HOOD_NAME = #{neighborHoodName}
WHERE
a.DEL_FLAG = '0'
AND a.BUILDING_NAME = #{buildingName}
<if test=" null != buildingId and buildingId.trim() != ''">
and a.ID !=#{buildingId}
</if>
</select>
<select id="checkBuildNameV3" parameterType="map" resultType="java.lang.Integer">
SELECT
COUNT( a.ID )
FROM
ic_building a
INNER JOIN ic_neighbor_hood b ON a.NEIGHBOR_HOOD_ID = b.ID
AND b.DEL_FLAG = '0'
AND b.AGENCY_ID = #{agencyId}
AND b.GRID_ID != #{gridId}
AND b.NEIGHBOR_HOOD_NAME = #{neighborHoodName}
WHERE
a.DEL_FLAG = '0'
AND a.BUILDING_NAME = #{buildingName}
<if test=" null != buildingId and buildingId.trim() != ''">
and a.ID !=#{buildingId}
</if>
</select>
<select id="buildingListByIds" resultType="com.epmet.dto.result.BuildingResultDTO">
select
a.ID as buildingId,

12
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java

@ -79,6 +79,12 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
if (null == result.getData() || result.getData().size() < NumConstant.ONE) {
return;
}
// 根据编码长度判断 grid_level
// 14位 =》06 社区、村
// 9位= 》04 乡镇
// 6位 -》03 县
// 19位 =>07网格
// 2.封装数据
List<GridInfoPingyinEntity> gridInfoList = new ArrayList<>();
result.getData().forEach(ag -> {
@ -176,6 +182,12 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
return;
}
// 根据编码长度判断 grid_level
// 14位 =》06 社区、村
// 9位= 》04 乡镇
// 6位 -》03 县
// 19位 =>07网格
// 2.封装数据
List<GridInfoPingyinEntity> gridInfoList = new ArrayList<>();
result.getData().forEach(ag -> {

21
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerParaResDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author yzm
* @Date 2022/9/8 10:44
*/
@Data
public class CustomerParaResDTO implements Serializable {
/**
* 开启open
* 关闭closed
* 没有数据默认开启
*/
private String govPartyHelper;
}

13
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerParameterController.java

@ -1,9 +1,12 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CrmParameterFormDTO;
import com.epmet.dto.result.CrmParameterResultDTO;
import com.epmet.dto.result.CustomerParaResDTO;
import com.epmet.service.CustomerParameterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -50,4 +53,14 @@ public class CustomerParameterController {
return new Result();
}
/**
* 查询客户定制化参数
* 比如党建小助手是否开启
* @param tokenDto
* @return
*/
@PostMapping("customize")
public Result<CustomerParaResDTO> queryCustomerCustomize(@LoginUser TokenDto tokenDto){
return new Result<CustomerParaResDTO>().ok(parameterService.queryCustomerCustomize(tokenDto.getCustomerId()));
}
}

9
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java

@ -4,6 +4,7 @@ import com.epmet.dto.form.CrmParameterFormDTO;
import com.epmet.dto.form.FootBarPatternFormDTO;
import com.epmet.dto.form.FootBarPatternQueryFormDTO;
import com.epmet.dto.result.CrmParameterResultDTO;
import com.epmet.dto.result.CustomerParaResDTO;
import com.epmet.dto.result.FootBarPatternQueryResultDTO;
import java.util.List;
@ -49,4 +50,12 @@ public interface CustomerParameterService {
* @date 2021/7/27 17:24
*/
void saveFootBarPattern(FootBarPatternFormDTO formDTO);
/**
* 查询客户定制化参数
* 比如党建小助手是否开启
* @param customerId
* @return
*/
CustomerParaResDTO queryCustomerCustomize(String customerId);
}

24
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
@ -10,6 +11,7 @@ import com.epmet.dto.form.FootBarPatternFormDTO;
import com.epmet.dto.form.FootBarPatternQueryFormDTO;
import com.epmet.dto.result.CheckFloatFootBarResultDTO;
import com.epmet.dto.result.CrmParameterResultDTO;
import com.epmet.dto.result.CustomerParaResDTO;
import com.epmet.dto.result.FootBarPatternQueryResultDTO;
import com.epmet.entity.CustomerParameterEntity;
import com.epmet.feign.OperCustomizeOpenFeignClient;
@ -146,5 +148,27 @@ public class CustomerParameterServiceImpl implements CustomerParameterService {
}
}
/**
* 查询客户定制化参数
* 比如党建小助手是否开启
*
* @param customerId
* @return
*/
@Override
public CustomerParaResDTO queryCustomerCustomize(String customerId) {
CustomerParaResDTO resDTO = new CustomerParaResDTO();
resDTO.setGovPartyHelper("open");
LambdaQueryWrapper<CustomerParameterEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CustomerParameterEntity::getCustomerId, customerId)
.eq(CustomerParameterEntity::getParameterKey, "gov_party_helper")
.last("limit 1");
CustomerParameterEntity customerParameterEntity = parameterDao.selectOne(queryWrapper);
if (null != customerParameterEntity) {
resDTO.setGovPartyHelper(customerParameterEntity.getParameterValue());
}
return resDTO;
}
}

3
epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.9__party_helper_param.sql

@ -0,0 +1,3 @@
INSERT INTO `epmet_oper_crm`.`customer_parameter` ( `ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_SWITCH`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` )
VALUES
( '5ce6f22c-2f22-11ed-bb6b-0050568f8cf7', 'default', 'gov_party_helper', '工作端党建小助手是否开启?', 'on', 'open', '开启:open;关闭:closed;不配置,默认是开启', 0, 0, 'APP_USER', '2022-09-08 11:03:35', 'APP_USER', '2022-09-08 11:03:45' );

9
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java

@ -74,5 +74,12 @@ public class IcResiCategoryStatsConfigFormDTO implements Serializable {
private Integer level2;
private Integer level3;
/**
* 自动匹配开启1不匹配0
*/
private String autoMatching;
/**
* 育龄妇女年龄范围英文逗号隔开的数字例如18,49
*/
private String ylfnValue;
}

14
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java

@ -44,7 +44,10 @@ public class IcResiCategoryStatsConfigResultDTO implements Serializable {
*/
private String label;
/**
* 列名
*/
private String columnName;
/**
* 管理平台分类图标
@ -84,4 +87,13 @@ public class IcResiCategoryStatsConfigResultDTO implements Serializable {
* 等级3阈值
*/
private Integer level3;
/**
* 自动匹配开启1不匹配0
*/
private String autoMatching;
/**
* 育龄妇女年龄范围英文逗号隔开的数字例如18,49
*/
private String ylfnValue;
}

18
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/YlfnValueResultDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/9/8 15:43
*/
@Data
public class YlfnValueResultDTO implements Serializable {
private static final long serialVersionUID = -1416102274320519092L;
private String customerId;
private Integer min;
private Integer max;
}

3
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -178,5 +178,6 @@ public interface OperCustomizeOpenFeignClient {
*/
@PostMapping("/oper/customize/icformitemoptions/getItemConditions")
Result<Map<String, String>> getOptionsMap(@RequestBody IcFormOptionsQueryFormDTO input);
@PostMapping("/oper/customize/icresicategorystatsconfig/getYlfnValue")
Result<List<YlfnValueResultDTO>> getYlfnValue();
}

5
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -142,4 +142,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getOptionsMap", input);
}
@Override
public Result<List<YlfnValueResultDTO>> getYlfnValue() {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getYlfnValue", null);
}
}

6
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java

@ -26,6 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.YlfnValueResultDTO;
import com.epmet.excel.IcResiCategoryStatsConfigExcel;
import com.epmet.service.IcResiCategoryStatsConfigService;
import org.springframework.beans.factory.annotation.Autowired;
@ -96,4 +97,9 @@ public class IcResiCategoryStatsConfigController {
return new Result<List<IcResiCategoryStatsConfigDTO>>().ok(icResiCategoryStatsConfigService.getCategoryList(dto));
}
@PostMapping("getYlfnValue")
public Result<List<YlfnValueResultDTO>> getYlfnValue() {
return new Result<List<YlfnValueResultDTO>>().ok(icResiCategoryStatsConfigService.getYlfnValue());
}
}

8
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java

@ -80,4 +80,12 @@ public class IcResiCategoryStatsConfigEntity extends BaseEpmetEntity {
*/
private Integer sort;
/**
* 自动匹配开启1不匹配0
*/
private String autoMatching;
/**
* 育龄妇女年龄范围英文逗号隔开的数字例如18,49
*/
private String ylfnValue;
}

11
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.YlfnValueResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import java.util.List;
@ -111,4 +112,14 @@ public interface IcResiCategoryStatsConfigService extends BaseService<IcResiCate
*/
List<CustomerCategoryShowAndWarnListResultDTO> getCustomerCategoryShowAndWarnList(String customerId);
/**
* 获取育龄妇女配置
*
* @Param
* @Return {@link List< YlfnValueResultDTO>}
* @Author zhaoqifeng
* @Date 2022/9/8 15:50
*/
List<YlfnValueResultDTO> getYlfnValue();
}

33
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java

@ -22,11 +22,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcResiCategoryStatsConfigDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.YlfnValueResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import com.epmet.redis.IcResiCategoryStatsConfigRedis;
import com.epmet.service.IcResiCategoryStatsConfigService;
@ -37,6 +40,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
/**
* 居民类别配置表
@ -137,4 +141,33 @@ public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl<IcResi
return new ArrayList<>();
}
/**
* 获取育龄妇女配置
*
* @Param
* @Return {@link List< YlfnValueResultDTO >}
* @Author zhaoqifeng
* @Date 2022/9/8 15:50
*/
@Override
public List<YlfnValueResultDTO> getYlfnValue() {
LambdaQueryWrapper<IcResiCategoryStatsConfigEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiCategoryStatsConfigEntity::getAutoMatching, NumConstant.ONE_STR);
wrapper.eq(IcResiCategoryStatsConfigEntity::getColumnName, "IS_YLFN");
wrapper.isNotNull(IcResiCategoryStatsConfigEntity::getYlfnValue);
wrapper.ne(IcResiCategoryStatsConfigEntity::getYlfnValue,StrConstant.EPMETY_STR);
List<IcResiCategoryStatsConfigEntity> list = baseDao.selectList(wrapper);
if(CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(item -> {
YlfnValueResultDTO dto = new YlfnValueResultDTO();
dto.setCustomerId(item.getCustomerId());
String[] ages = item.getYlfnValue().split(StrConstant.COMMA);
dto.setMin(Integer.valueOf(ages[0]));
dto.setMax(Integer.valueOf(ages[1]));
return dto;
}).collect(Collectors.toList());
}
}

4
epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.38__ylfnv.sql

@ -0,0 +1,4 @@
alter table ic_resi_category_stats_config
add COLUMN `AUTO_MATCHING` varchar(1) NOT NULL DEFAULT '0' COMMENT '自动匹配:开启1;不匹配:0' after SORT;
alter table ic_resi_category_stats_config add COLUMN `YLFN_VALUE` varchar(32) DEFAULT NULL COMMENT '育龄妇女年龄范围,英文逗号隔开的数字例如:18,49' after AUTO_MATCHING;

5
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml

@ -26,6 +26,7 @@
select
a.ID as id,
a.LABEL as label,
a.COLUMN_NAME as columnName,
a.MANAGEMENT_ICON as managementIcon,
a.DATA_ICON as dataIcon,
a.HOUSE_SHOW_ICON as houseShowIcon,
@ -34,7 +35,9 @@
b.LEVEL_1 as level1,
b.LEVEL_2 as level2,
b.LEVEL_3 as level3,
b.WARN
b.WARN,
a.AUTO_MATCHING as autoMatching,
a.YLFN_VALUE as ylfnValue
from
ic_resi_category_stats_config a
left join ic_resi_category_warn_config b on a.TABLE_NAME = b.TABLE_NAME and a.COLUMN_NAME = b.COLUMN_NAME and b.DEL_FLAG =0 and b.CUSTOMER_ID = #{customerId}

6
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java

@ -66,6 +66,12 @@ public class ResiGroupDTO implements Serializable {
*/
private String gridId;
/**
* 所属党组织
*/
private String partyOrgId;
private String partyOrgPids;
/**
* 状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
Ps: 如果一个小组被拒绝当前小组的状态将永久停留在审核未通过

6
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java

@ -17,6 +17,8 @@ public class ApplyCreateGroupFormDTO implements Serializable {
private static final long serialVersionUID = 1570620480398949075L;
public interface AddUserInternalGroup {
}
public interface AddPartyOrgGroup {
}
/**
* 添加用户操作的用户可见异常分组
* 该分组用于校验需要返回给前端错误信息提示的列需要继承CustomerClientShowGroup
@ -69,6 +71,10 @@ public class ApplyCreateGroupFormDTO implements Serializable {
@NotBlank(message = "app不能为空",groups ={AddUserInternalGroup.class})
private String app;
@NotBlank(message = "所属党组织不能为空",groups ={AddPartyOrgGroup.class})
private String partyOrgId;
private String partyOrgPids;
/**
* 小组是否允许参观:允许open;不允许closed
*/

1
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java

@ -35,5 +35,6 @@ public class EditGroupFormDTO {
@NotBlank(message = "组介绍不能为空", groups = { SubmitGroupEditVG.class })
@Length(max = 500, message = "组介绍长度不能超过500个字", groups = { SubmitGroupEditVG.class })
private String groupIntroduction;
private String partyOrgId;
}

1
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResult2DTO.java

@ -67,5 +67,6 @@ public class ApplyingGroupDetailResult2DTO implements Serializable {
* 未读已读标识 unread read
* */
private String readFlag;
private String partyOrgName;
}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java

@ -77,4 +77,6 @@ public class ApplyingGroupDetailResultDTO implements Serializable {
* */
private String operationId;
private String partyOrgId;
}

4
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java

@ -26,4 +26,8 @@ public class GroupDetailResultDTO {
private String leaderId;
/** 当前用户是否是群主 */
private String groupLeaderFlag;
/**
* 所属党组织
*/
private String partyOrgId;
}

1
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java

@ -39,4 +39,5 @@ public class GroupEditionDetailResultDTO implements Serializable {
* 群主的昵称 xx路-xx先生/女士
*/
private String groupLeaderName;
private String partyOrgName;
}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java

@ -43,6 +43,8 @@ public class ResiGroupMemberDTO implements Serializable {
* 用户id来源于customer_user.id
*/
private String customerUserId;
private String customerUserName;
private String customerUserMobile;
/**
* 小组id: 来源于resi_group表id

28
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.*;
@ -13,12 +14,14 @@ import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.*;
import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallbackFactory;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -320,4 +323,29 @@ public interface ResiGroupOpenFeignClient {
*/
@PostMapping("/resi/group/group/list-groups-by-member")
Result<List<GroupDetailResultDTO>> listGroupsByMember(@RequestBody GroupsByMemberFormDTO formDTO);
/**
* 获取客户下支部小组根据所属党组织分组
*
* @Param
* @Return {@link Result<Map<String, List<IcPartyOrgTreeDTO>>>}
* @Author zhaoqifeng
* @Date 2022/8/16 14:04
*/
@PostMapping("/resi/group/group/getBranchGroupList")
Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList();
/**
* @Author sun
* @Description 查询小组成员列表
**/
@PostMapping("/resi/group/member/groupmemberlist")
Result<List<ResiGroupMemberDTO>> groupMemberList(@RequestBody List<String> groupIdList);
/**
* @Author sun
* @Description 查询支部下党小组列表
**/
@PostMapping("/resi/group/group/partygrouplist/{partyOrgId}")
Result<List<ResiGroupDTO>> partyGroupList(@PathVariable String partyOrgId);
}

19
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.*;
@ -13,9 +14,11 @@ import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.*;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -234,4 +237,20 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
public Result<List<GroupDetailResultDTO>> listGroupsByMember(GroupsByMemberFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listGroupsByMember", formDTO);
}
@Override
public Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList() {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getBranchGroupList", null);
}
@Override
public Result<List<ResiGroupMemberDTO>> groupMemberList(List<String> groupIdList) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "groupMemberList", groupIdList);
}
@Override
public Result<List<ResiGroupDTO>> partyGroupList(String partyOrgId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "partyGroupList", partyOrgId);
}
}

28
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -34,12 +34,14 @@ import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.form.ResiIdentityFormDTO;
import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import com.epmet.resi.group.enums.SearchScopeTypeEnum;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -399,7 +401,7 @@ public class ResiGroupController {
@PostMapping("submit-edit")
public Result submitGroupEdit(@RequestBody EditGroupFormDTO form, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(form, EditGroupFormDTO.SubmitGroupEditVG.class);
resiGroupService.submitGroupEdit(form.getGroupId(), form.getGroupName(), form.getGroupHeadPhoto(), form.getGroupIntroduction(), tokenDto.getUserId());
resiGroupService.submitGroupEdit(form.getGroupId(), form.getGroupName(), form.getGroupHeadPhoto(), form.getGroupIntroduction(), tokenDto.getUserId(), form.getPartyOrgId());
return new Result();
}
@ -649,4 +651,28 @@ public class ResiGroupController {
List<GroupDetailResultDTO> groups = resiGroupService.listGroupsByMember(userId, gridId);
return new Result<List<GroupDetailResultDTO>>().ok(groups);
}
/**
* 获取客户下支部小组根据所属党组织分组
*
* @Param tokenDto
* @Return {@link Result< Map< String, List< IcPartyOrgTreeDTO>>>}
* @Author zhaoqifeng
* @Date 2022/8/16 14:02
*/
@PostMapping("getBranchGroupList")
public Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList(@LoginUser TokenDto tokenDto) {
return new Result<Map<String, List<IcPartyOrgTreeDTO>>>().ok(resiGroupService.getBranchGroupList(tokenDto.getCustomerId()));
}
/**
* @Author sun
* @Description 查询支部下党小组列表
**/
@PostMapping("partygrouplist/{partyOrgId}")
Result<List<ResiGroupDTO>> partyGroupList(@PathVariable String partyOrgId){
return new Result<List<ResiGroupDTO>>().ok(resiGroupService.partyGroupList(partyOrgId));
}
}

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java

@ -346,4 +346,6 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @date 2021.09.08 14:00:52
*/
List<GroupDetailResultDTO> listGroupsByMember(@Param("memberUserId") String memberUserId, @Param("gridId") String gridId);
List<ResiGroupMemberDTO> getMembersByGroup(@Param("ids")List<String> ids);
}

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java

@ -52,6 +52,12 @@ public class GroupEditSubmitRecordEntity extends BaseEpmetEntity {
*/
private String gridId;
/**
* 所属党组织
*/
private String partyOrgId;
private String partyOrgPids;
/**
* 头像
*/

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java

@ -62,6 +62,12 @@ public class ResiGroupEntity extends BaseEpmetEntity {
*/
private String gridId;
/**
* 所属党组织
*/
private String partyOrgId;
private String partyOrgPids;
/**
* 状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
Ps: 如果一个小组被拒绝当前小组的状态将永久停留在审核未通过

14
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java

@ -30,6 +30,7 @@ import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import java.util.HashMap;
import java.util.List;
@ -310,7 +311,7 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
GroupDetailResultDTO getGroupDetail(String groupId);
void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId);
void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId, String partyOrgId);
/**
* @Description 工作端 查询组变更待审核列表
@ -471,4 +472,15 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
* @date 2021.09.08 13:59:31
*/
List<GroupDetailResultDTO> listGroupsByMember(String memberUserId, String gridId);
/**
* 获取客户下支部小组根据所属党组织分组
* @Param customerId
* @Return {@link Map< String, List<IcPartyOrgTreeDTO>>}
* @Author zhaoqifeng
* @Date 2022/8/15 16:49
*/
Map<String, List<IcPartyOrgTreeDTO>> getBranchGroupList(String customerId);
List<ResiGroupDTO> partyGroupList(String partyOrgId);
}

137
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg;
import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
@ -43,6 +44,7 @@ import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.form.*;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.UserInfoResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
@ -83,6 +85,9 @@ import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import com.epmet.resi.group.dto.member.result.GroupAchievementDTO;
import com.epmet.resi.group.enums.SearchScopeTypeEnum;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
@ -97,6 +102,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@ -120,7 +126,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@Autowired
private ResiGroupOperationService resiGroupOperationService;
@Autowired
@Resource
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
@ -144,10 +150,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@Autowired
private ResiGroupMemberRedis resiGroupMemberRedis;
@Autowired
@Resource
private GovOrgFeignClient govOrgFeignClient;
@Autowired
@Resource
private EpmetMessageFeignClient epmetMessageFeignClient;
@Autowired
@ -181,6 +187,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@Autowired
private ResiGroupAchievementStatsService resiGroupAchievementStatsService;
@Resource
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
@Override
public PageData<ResiGroupDTO> page(Map<String, Object> params) {
@ -457,6 +465,19 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode());
}
}
if (StringUtils.isNotBlank(applyCreateGroupFormDTO.getPartyOrgId())) {
Result<Map<String, IcPartyOrgDTO>> partyOrgResult = resiPartyMemberOpenFeignClient.getPartyOrgList();
if (!partyOrgResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取党组织信息失败", "获取党组织信息失败");
}
if (partyOrgResult.getData().containsKey(applyCreateGroupFormDTO.getPartyOrgId())) {
applyCreateGroupFormDTO.setPartyOrgPids(partyOrgResult.getData().get(applyCreateGroupFormDTO.getPartyOrgId()).getOrgPids().concat(StrConstant.COLON).concat(applyCreateGroupFormDTO.getPartyOrgId()));
} else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所选党组织不存在", "所选党组织不存在");
}
}
String roleName = "";
if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){
roleName = ModuleConstant.PARTYMEMBER;
@ -586,6 +607,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupEntity.setState(GroupStateConstant.GROUP_UNDER_AUDITTING);
resiGroupEntity.setVisitSwitch(StringUtils.isNotBlank(applyCreateGroupFormDTO.getVisitSwitch()) ? applyCreateGroupFormDTO.getVisitSwitch() : GroupStateConstant.CLOSED);
resiGroupEntity.setGroupType(applyCreateGroupFormDTO.getGroupType());
resiGroupEntity.setPartyOrgId(applyCreateGroupFormDTO.getPartyOrgId());
resiGroupEntity.setPartyOrgPids(applyCreateGroupFormDTO.getPartyOrgPids());
return resiGroupEntity;
}
@ -1041,7 +1064,20 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
detail.setLeaderId(null);
detail.setOperationId(null);
return new Result<ApplyingGroupDetailResult2DTO>().ok(ConvertUtils.sourceToTarget(detail, ApplyingGroupDetailResult2DTO.class));
ApplyingGroupDetailResult2DTO result = ConvertUtils.sourceToTarget(detail, ApplyingGroupDetailResult2DTO.class);
if (StringUtils.isNotBlank(detail.getPartyOrgId())) {
Result<Map<String, IcPartyOrgDTO>> partyOrgResult = resiPartyMemberOpenFeignClient.getPartyOrgList();
if (!partyOrgResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取党组织信息失败", "获取党组织信息失败");
}
if (partyOrgResult.getData().containsKey(detail.getPartyOrgId())) {
result.setPartyOrgName(partyOrgResult.getData().get(detail.getPartyOrgId()).getPartyOrgName());
}
}
return new Result<ApplyingGroupDetailResult2DTO>().ok(result);
}
@Override
@ -1438,6 +1474,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
// 1.拼装组基本信息
GroupEditSubmitRecordEntity ler = groupEditSubmitRecordDao.getLatestEditSubmitRecord(groupId);
ResiGroupEntity group = baseDao.selectById(groupId);
if (null != group) {
groupDetail.setGroupType(group.getGroupType());
}
if (ler != null) {
groupDetail.setAuditStatus(ler.getAuditStatus());
@ -1449,13 +1489,14 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
groupDetail.setGroupHeadPhoto(ler.getGroupHeadPhoto());
groupDetail.setGroupName(ler.getGroupName());
groupDetail.setGroupIntroduction(ler.getGroupIntroduction());
groupDetail.setPartyOrgId(ler.getPartyOrgId());
} else {
// 不在审核中,直接显示组信息
ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(groupId);
if (resiGroupEntity == null) {
return null;
}
groupDetail.setPartyOrgId(resiGroupEntity.getPartyOrgId());
groupDetail.setGroupHeadPhoto(resiGroupEntity.getGroupHeadPhoto());
groupDetail.setGroupName(resiGroupEntity.getGroupName());
groupDetail.setGroupIntroduction(resiGroupEntity.getGroupIntroduction());
@ -1486,7 +1527,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
}
@Override
public void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId) {
public void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId, String partyOrgId) {
// 1.判断小组是否存在,判断是否已经在"待审核"状态
ResiGroupEntity group = resiGroupDao.selectById(groupId);
if (group == null) {
@ -1518,6 +1559,18 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
// 达到最大编辑次数了
throw new RenException(EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getCode(), EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getMsg());
}
String partyOrgPids = null;
if (StringUtils.isNotBlank(partyOrgId)) {
Result<Map<String, IcPartyOrgDTO>> partyOrgResult = resiPartyMemberOpenFeignClient.getPartyOrgList();
if (!partyOrgResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取党组织信息失败", "获取党组织信息失败");
}
if (partyOrgResult.getData().containsKey(partyOrgId)) {
partyOrgPids = partyOrgResult.getData().get(partyOrgId).getOrgPids().concat(StrConstant.COLON).concat(partyOrgId);
} else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所选党组织不存在", "所选党组织不存在");
}
}
// 3.内容检查
scanGroupEditContent(groupName, groupIntroduction, groupHeadPhoto);
@ -1537,6 +1590,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
editRecord.setGroupName(groupName);
editRecord.setReadFlag(ReadFlagConstant.UN_READ);
editRecord.setMessageText(messageText);
editRecord.setPartyOrgId(partyOrgId);
editRecord.setPartyOrgPids(partyOrgPids);
if (groupEditSubmitRecordDao.insert(editRecord) == 0) {
throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), EpmetErrorCode.GROUP_EDIT_ERROR.getMsg());
@ -1713,6 +1768,16 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
} else {
result.setGroupLeaderName(resiGroupRedis.getFullName(edit.getCreatedBy()));
}
if (StringUtils.isNotBlank(edit.getPartyOrgId())) {
Result<Map<String, IcPartyOrgDTO>> partyOrgResult = resiPartyMemberOpenFeignClient.getPartyOrgList();
if (!partyOrgResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取党组织信息失败", "获取党组织信息失败");
}
if (partyOrgResult.getData().containsKey(edit.getPartyOrgId())) {
result.setPartyOrgName(partyOrgResult.getData().get(edit.getPartyOrgId()).getPartyOrgName());
}
}
return result;
}
@ -1863,4 +1928,64 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
public List<GroupDetailResultDTO> listGroupsByMember(String memberUserId, String gridId) {
return baseDao.listGroupsByMember(memberUserId, gridId);
}
/**
* 获取客户下支部小组根据所属党组织分组
*
* @param customerId
* @Param customerId
* @Return {@link Map< String, List<IcPartyOrgTreeDTO >>}
* @Author zhaoqifeng
* @Date 2022/8/15 16:49
*/
@Override
public Map<String, List<IcPartyOrgTreeDTO>> getBranchGroupList(String customerId) {
LambdaQueryWrapper<ResiGroupEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ResiGroupEntity::getCustomerId, customerId);
wrapper.eq(ResiGroupEntity::getGroupType, ModuleConstant.GROUP_TYPE_BRANCH);
List<ResiGroupEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(entityList)) {
return Collections.emptyMap();
}
List<String> groupIds = entityList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<ResiGroupMemberDTO> membersByGroup = baseDao.getMembersByGroup(groupIds);
Result<List<UserBaseInfoResultDTO>> listResult = epmetUserOpenFeignClient.queryUserBaseInfo(membersByGroup.stream().map(m -> m.getCustomerUserId()).collect(Collectors.toList()));
if (!listResult.success()){
throw new EpmetException("查询居民信息失败...");
}
membersByGroup.stream().forEach(m -> listResult.getData().stream().filter(u -> u.getUserId().equals(m.getCustomerUserId())).forEach(u -> {
m.setCustomerUserMobile(u.getMobile());
m.setCustomerUserName(u.getRealName());
}));
List<IcPartyOrgTreeDTO> list = entityList.stream().filter(i -> StringUtils.isNotBlank(i.getPartyOrgId())).map(item -> {
IcPartyOrgTreeDTO dto = new IcPartyOrgTreeDTO();
dto.setId(item.getId());
dto.setOrgPids(item.getPartyOrgPids());
dto.setPid(item.getPartyOrgId());
dto.setPartyOrgType(NumConstant.SIX_STR);
dto.setPartyOrgName(item.getGroupName());
return dto;
}).collect(Collectors.toList());
list.stream().forEach(l -> membersByGroup.stream().filter(m -> m.getResiGroupId().equals(l.getId())).forEach(m -> {
l.setPrincipal(m.getCustomerUserName());
l.setPrincipalMobile(m.getCustomerUserMobile());
}));
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.groupingBy(IcPartyOrgTreeDTO::getPid));
}
@Override
public List<ResiGroupDTO> partyGroupList(String partyOrgId) {
LambdaQueryWrapper<ResiGroupEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ResiGroupEntity::getPartyOrgId, partyOrgId);
wrapper.eq(ResiGroupEntity::getDelFlag, NumConstant.ZERO_STR);
List<ResiGroupEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(entityList)) {
return new ArrayList<>();
}
return ConvertUtils.sourceToTarget(entityList, ResiGroupDTO.class);
}
}

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/ResiGroupMemberController.java

@ -24,16 +24,14 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.modules.member.service.GroupMemeberOperationService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.form.*;
import com.epmet.resi.group.dto.member.result.ApplyingMemberResultDTO;
import com.epmet.resi.group.dto.member.result.GridVotableCountResultDTO;
import com.epmet.resi.group.dto.member.result.GroupMemberListResultDTO;
import com.epmet.resi.group.dto.member.result.JoinGroupApplyRealTimeResultDTO;
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 java.util.List;
@ -206,4 +204,10 @@ public class ResiGroupMemberController {
ValidatorUtils.validateEntity(param);
return new Result<JoinGroupApplyRealTimeResultDTO>().ok(operationService.applyEnterByLink(param));
}
@PostMapping("groupmemberlist")
public Result<List<ResiGroupMemberDTO>> groupMemberList(@RequestBody List<String> groupIdList){
return new Result<List<ResiGroupMemberDTO>>().ok(resiGroupMemberService.groupMemberList(groupIdList));
}
}

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java

@ -181,4 +181,6 @@ public interface ResiGroupMemberDao extends BaseDao<ResiGroupMemberEntity> {
int countAllMembers(@Param("customerId") String customerId, @Param("groupId") String groupId);
int exitGroupById(@Param("id") String id, @Param("updatedBy") String updatedBy);
List<ResiGroupMemberDTO> groupMemberList(@Param("groupIdList") List<String> groupIdList);
}

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/ResiGroupMemberService.java

@ -262,4 +262,6 @@ public interface ResiGroupMemberService extends BaseService<ResiGroupMemberEntit
* @return com.epmet.resi.group.dto.member.ResiGroupMemberDTO
*/
ResiGroupMemberDTO getMemberInfo(String groupId, String userId);
List<ResiGroupMemberDTO> groupMemberList(List<String> groupIdList);
}

5
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

@ -1036,4 +1036,9 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
return targetObject;
}
@Override
public List<ResiGroupMemberDTO> groupMemberList(List<String> groupIdList) {
return baseDao.groupMemberList(groupIdList);
}
}

8
epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.26__add_party_org_.sql

@ -0,0 +1,8 @@
ALTER TABLE `epmet_resi_group`.`resi_group`
ADD COLUMN `PARTY_ORG_ID` varchar(64) NULL COMMENT '党支部ID' AFTER `CUSTOMER_ID`,
ADD COLUMN `PARTY_ORG_PIDS` varchar(255) NULL COMMENT '党支部的所有上级ID' AFTER `PARTY_ORG_ID`;
ALTER TABLE `epmet_resi_group`.`group_edit_submit_record`
ADD COLUMN `PARTY_ORG_ID` varchar(64) NULL COMMENT '党支部ID' AFTER `GRID_ID`,
ADD COLUMN `PARTY_ORG_PIDS` varchar(255) NULL COMMENT '党支部的所有上级ID' AFTER `PARTY_ORG_ID`;

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

Loading…
Cancel
Save