Browse Source

Merge remote-tracking branch 'origin/dev_remove_elinkcloud' into dev_ic_mp

# Conflicts:
#	epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
dev
wangxianzhang 4 years ago
parent
commit
8d019ff6f4
  1. 8
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictDataDTO.java
  2. 6
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java
  3. 11
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
  4. 6
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
  5. 10
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
  6. 3
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java
  7. 26
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictDataEntity.java
  8. 23
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictTypeEntity.java
  9. 3
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java
  10. 8
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java
  11. 27
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.8__add_dict_data_pid.sql
  12. 13
      epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
  13. 11
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  14. 10
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
  15. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
  16. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
  17. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
  18. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeStringNode.java
  19. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml
  20. 2
      epmet-module/data-report/data-report-server/pom.xml
  21. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java
  22. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  23. 46
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  24. 45
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  25. 4
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java
  26. 15
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
  27. 16
      epmet-module/epmet-point/epmet-point-server/pom.xml
  28. 27
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
  29. 236
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java
  30. 4
      epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml
  31. 31
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java
  32. 23
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  33. 27
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java
  34. 97
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  35. 18
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java
  36. 66
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolRoutineWorkFormDTO.java
  37. 38
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
  38. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkDao.java
  39. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkTypeDao.java
  40. 90
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
  41. 88
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkEntity.java
  42. 61
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkTypeEntity.java
  43. 37
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java
  44. 31
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkTypeService.java
  45. 162
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
  46. 36
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkTypeServiceImpl.java
  47. 35
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.20__user_routine_work.sql
  48. 27
      epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml
  49. 21
      epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkTypeDao.xml

8
epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictDataDTO.java

@ -32,7 +32,7 @@ public class SysDictDataDTO implements Serializable {
@Null(message="{id.null}", groups = AddGroup.class) @Null(message="{id.null}", groups = AddGroup.class)
@NotNull(message="{id.require}", groups = UpdateGroup.class) @NotNull(message="{id.require}", groups = UpdateGroup.class)
private Long id; private String id;
@NotNull(message="{sysdict.type.require}", groups = DefaultGroup.class) @NotNull(message="{sysdict.type.require}", groups = DefaultGroup.class)
private Long dictTypeId; private Long dictTypeId;
@ -42,14 +42,16 @@ public class SysDictDataDTO implements Serializable {
private String dictValue; private String dictValue;
private String dictPValue;
private String remark; private String remark;
@Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class)
private Integer sort; private Integer sort;
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Date createDate; private Date createdTime;
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Date updateDate; private Date updatedTime;
} }

6
epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/SysDictTypeDTO.java

@ -33,7 +33,7 @@ public class SysDictTypeDTO implements Serializable {
@Null(message="{id.null}", groups = AddGroup.class) @Null(message="{id.null}", groups = AddGroup.class)
@NotNull(message="{id.require}", groups = UpdateGroup.class) @NotNull(message="{id.require}", groups = UpdateGroup.class)
private Long id; private String id;
@NotBlank(message="{sysdict.type.require}", groups = DefaultGroup.class) @NotBlank(message="{sysdict.type.require}", groups = DefaultGroup.class)
private String dictType; private String dictType;
@ -47,8 +47,8 @@ public class SysDictTypeDTO implements Serializable {
private Integer sort; private Integer sort;
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Date createDate; private Date createdTime;
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Date updateDate; private Date updatedTime;
} }

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

@ -3,6 +3,7 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.DictListFormDTO; import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO; import com.epmet.dto.result.CorsConfigResultDTO;
@ -88,6 +89,16 @@ public interface EpmetAdminOpenFeignClient {
@PostMapping("/sys/dict/data/dictmap/{dictType}") @PostMapping("/sys/dict/data/dictmap/{dictType}")
Result<Map<String, String>> dictMap(@PathVariable("dictType") String dictType); Result<Map<String, String>> dictMap(@PathVariable("dictType") String dictType);
/**
* 字典数据查询通用接口
* @Param dictType
* @Return {@link Result< Map < String, String>>}
* @Author zhaoqifeng
* @Date 2021/11/19 17:36
*/
@PostMapping("/sys/dict/data/dictTree/{dictType}")
Result<List<DictTreeResultDTO>> dictTree(@PathVariable("dictType") String dictType);
@PostMapping("/sys/dict/data/dictlist") @PostMapping("/sys/dict/data/dictlist")
Result<List<DictListResultDTO>> dictList(@RequestBody DictListFormDTO formDTO); Result<List<DictListResultDTO>> dictList(@RequestBody DictListFormDTO formDTO);
} }

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

@ -3,6 +3,7 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.DictListFormDTO; import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -49,6 +50,11 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictMap", dictType); return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictMap", dictType);
} }
@Override
public Result<List<DictTreeResultDTO>> dictTree(String dictType) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictTree", dictType);
}
@Override @Override
public Result<List<DictListResultDTO>> dictList(DictListFormDTO formDTO) { public Result<List<DictListResultDTO>> dictList(DictListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictList", formDTO); return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictList", formDTO);

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

@ -10,6 +10,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.dto.form.DictListFormDTO; import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -150,6 +151,15 @@ public class SysDictDataController {
return new Result<List<DictListResultDTO>>().ok(sysDictDataService.dictList(formDTO.getDictType())); return new Result<List<DictListResultDTO>>().ok(sysDictDataService.dictList(formDTO.getDictType()));
} }
/**
* @Description 字典数据查询通用接口
* @Author sun
*/
@PostMapping("dictTree/{dictType}")
public Result<List<DictTreeResultDTO>> dictListTree(@PathVariable("dictType") String dictType) {
return new Result<List<DictTreeResultDTO>>().ok(sysDictDataService.dictListTree(dictType));
}
/** /**
* 字典数据查询通用接口 * 字典数据查询通用接口
* @Param dictType * @Param dictType

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

@ -10,6 +10,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.entity.DictData; import com.epmet.entity.DictData;
import com.epmet.entity.SysDictDataEntity; import com.epmet.entity.SysDictDataEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -30,4 +31,6 @@ public interface SysDictDataDao extends BaseDao<SysDictDataEntity> {
List<DictData> getDictDataList(); List<DictData> getDictDataList();
List<DictListResultDTO> selectDictList(String dictType); List<DictListResultDTO> selectDictList(String dictType);
List<DictTreeResultDTO> selectDictData(String dictType);
} }

26
epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictDataEntity.java

@ -8,15 +8,13 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* 数据字典 * 数据字典
* *
@ -25,8 +23,10 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper=false) @EqualsAndHashCode(callSuper=false)
@TableName("sys_dict_data") @TableName("sys_dict_data")
public class SysDictDataEntity extends BaseEntity { public class SysDictDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(type = IdType.ID_WORKER_STR)
private String id;
/** /**
* 字典类型ID * 字典类型ID
*/ */
@ -39,6 +39,10 @@ public class SysDictDataEntity extends BaseEntity {
* 字典值 * 字典值
*/ */
private String dictValue; private String dictValue;
/**
* 父级字典值 顶级0
*/
private String dictPValue;
/** /**
* 备注 * 备注
*/ */
@ -47,14 +51,4 @@ public class SysDictDataEntity extends BaseEntity {
* 排序 * 排序
*/ */
private Integer sort; private Integer sort;
/**
* 更新者
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Long updater;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateDate;
} }

23
epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysDictTypeEntity.java

@ -8,15 +8,13 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* 字典类型 * 字典类型
* *
@ -25,8 +23,11 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper=false) @EqualsAndHashCode(callSuper=false)
@TableName("sys_dict_type") @TableName("sys_dict_type")
public class SysDictTypeEntity extends BaseEntity { public class SysDictTypeEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(type = IdType.ID_WORKER_STR)
private String id;
/** /**
* 字典类型 * 字典类型
*/ */
@ -43,14 +44,4 @@ public class SysDictTypeEntity extends BaseEntity {
* 排序 * 排序
*/ */
private Integer sort; private Integer sort;
/**
* 更新者
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Long updater;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateDate;
} }

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

@ -10,6 +10,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.SysDictDataDTO; import com.epmet.dto.SysDictDataDTO;
@ -87,4 +88,6 @@ public interface SysDictDataService extends BaseService<SysDictDataEntity> {
Map<String, String> dictMap(String dictType); Map<String, String> dictMap(String dictType);
List<DictTreeResultDTO> dictListTree(String dictType);
} }

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

@ -13,9 +13,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.TreeUtils;
import com.epmet.dao.SysDictDataDao; import com.epmet.dao.SysDictDataDao;
import com.epmet.dto.SysDictDataDTO; import com.epmet.dto.SysDictDataDTO;
import com.epmet.entity.SysDictDataEntity; import com.epmet.entity.SysDictDataEntity;
@ -217,4 +219,10 @@ public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysD
return resultDTOList.stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel)); return resultDTOList.stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel));
} }
@Override
public List<DictTreeResultDTO> dictListTree(String dictType) {
List<DictTreeResultDTO> resultDTOList = baseDao.selectDictData(dictType);
return TreeUtils.buildTree(resultDTOList);
}
} }

27
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.8__add_dict_data_pid.sql

@ -0,0 +1,27 @@
-- 添加pid (dict_p_value) 让字典支持 树形结构
ALTER TABLE `epmet_admin`.`sys_dict_data`
ADD COLUMN `dict_p_value` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '父级value项;默认为0' AFTER `dict_value`;
ALTER TABLE `epmet_admin`.`sys_dict_data`
MODIFY COLUMN `dict_value` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典值' AFTER `dict_label`;
INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473150812296318978, 'patrol_work_type', '例行工作分类', '网格员巡查-例行工作事项分类', 13, 1067246875800000001, '2021-12-21 12:40:45', 12, '2021-12-21 17:37:12');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473151790785499137, 1473150812296318978, '重点巡查', '01', '0', '', 1, NULL, NULL, 1, '2021-12-21 14:17:14');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473175635001085953, 1473150812296318978, '出租房屋巡查', '0101', '01', '', 1, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473175848537296897, 1473150812296318978, '重点场所巡查', '0102', '01', '', 2, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473175904669667329, 1473150812296318978, '宗教活动', '0103', '01', '', 3, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473175977868660738, 1473150812296318978, '其他', '0199', '01', '', 99, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473151862784921602, 1473150812296318978, '特殊人群', '02', '0', '', 2, NULL, NULL, 1, '2021-12-21 14:17:24');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176029219524610, 1473150812296318978, '刑满释放人员', '0201', '02', '', 1, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176085809074178, 1473150812296318978, '社区矫正', '0202', '02', '', 2, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176129127845889, 1473150812296318978, '吸毒人员', '0203', '02', '', 3, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176201798356994, 1473150812296318978, '信访人员', '0204', '02', '', 4, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176249558896642, 1473150812296318978, '重点青少年', '0205', '02', '', 5, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176305758375937, 1473150812296318978, '精神障碍者', '0206', '02', '', 6, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473151924881592321, 1473150812296318978, '为民服务', '09', '0', '', 3, NULL, NULL, 1, '2021-12-21 14:20:06');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176393352220673, 1473150812296318978, '公共服务', '0901', '09', '', 1, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176479897489410, 1473150812296318978, '权益保障', '0902', '09', '', 2, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176534641545218, 1473150812296318978, '政策宣传', '0903', '09', '', 3, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176583006064641, 1473150812296318978, '便利服务', '0904', '09', '', 4, NULL, NULL, NULL, NULL);
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1473176670985785345, 1473150812296318978, '其他', '0999', '09', '', 99, NULL, NULL, NULL, NULL);

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

@ -19,5 +19,18 @@
ORDER BY ORDER BY
a.sort ASC a.sort ASC
</select> </select>
<select id="selectDictData" resultType="com.epmet.commons.tools.dto.result.DictTreeResultDTO">
SELECT
a.dict_value id,
a.dict_p_value pid,
a.dict_label name
FROM
sys_dict_data a
INNER JOIN sys_dict_type b ON a.dict_type_id = b.id
WHERE
b.dict_type = #{dictType}
ORDER BY
a.sort asc
</select>
</mapper> </mapper>

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

@ -41,10 +41,19 @@ public interface ConsomerGroupConstants {
*/ */
String PROJECT_OPERATION_LOG_GROUP = "project_operation_log_group"; String PROJECT_OPERATION_LOG_GROUP = "project_operation_log_group";
/** /**
* 积分操作消费组 * 积分操作日志消费组
*/ */
String POINT_OPERATION_LOG_GROUP = "point_operation_log_group"; String POINT_OPERATION_LOG_GROUP = "point_operation_log_group";
/**
* 爱心互助积分操作消费组
*/
String EPMET_HEART_POINT_OPERATION_GROUP = "epmet_heart_point_operation_group";
/**
* 楼院小组积分操作消费组
*/
String RESI_GROUP_POINT_OPERATION_GROUP = "resi_group_point_operation_group";
/** /**
* 开放的对接数据(中间库) 组织变更事件监听器分组 * 开放的对接数据(中间库) 组织变更事件监听器分组
*/ */

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

@ -58,4 +58,14 @@ public interface TopicConstants {
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度 * 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度
*/ */
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
/**
* 爱心互助
*/
String EPMET_HEART = "epmet_heart";
/**
* 楼院小组
*/
String RESI_GROUP = "resi_group";
} }

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

@ -14,4 +14,5 @@ public class DictListResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L; private static final long serialVersionUID = 8618231166600518980L;
private String label; private String label;
private String value; private String value;
private List<DictListResultDTO> children;
} }

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

@ -0,0 +1,20 @@
package com.epmet.commons.tools.dto.result;
import com.epmet.commons.tools.utils.TreeStringNode;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 字典数据查询-接口返参
* @Author sun
*/
@Data
public class DictTreeResultDTO extends TreeStringNode<DictTreeResultDTO> implements Serializable {
private static final long serialVersionUID = 3772355047088964759L;
/**
* 上级ID
*/
private String pid;
private String name;
}

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

@ -20,6 +20,7 @@ public enum DictTypeEnum {
USER_DEMAND_REPORT_TYPE("user_demand_report_type","居民需求上报类型",9), USER_DEMAND_REPORT_TYPE("user_demand_report_type","居民需求上报类型",9),
USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10), USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10),
AGE_GROUP("age_group", "年龄范围", 11), AGE_GROUP("age_group", "年龄范围", 11),
PATROL_WORK_TYPE("patrol_work_type", "例行工作分类", 13),
; ;
private final String code; private final String code;

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeStringNode.java

@ -8,6 +8,7 @@
package com.epmet.commons.tools.utils; package com.epmet.commons.tools.utils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;

2
epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
data-report-server: data-report-server:
container_name: data-report-server-prod container_name: data-report-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.195 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.196
ports: ports:
- "8108:8108" - "8108:8108"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

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

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.195</version> <version>0.3.196</version>
<artifactId>data-report-server</artifactId> <artifactId>data-report-server</artifactId>
<parent> <parent>

22
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java

@ -36,16 +36,19 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.dao.ActLivePicDao; import com.epmet.dao.ActLivePicDao;
import com.epmet.dao.ActLiveRecDao; import com.epmet.dao.ActLiveRecDao;
import com.epmet.dto.ActInfoDTO; import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.ActLivePicDTO; import com.epmet.dto.ActLivePicDTO;
import com.epmet.dto.ActLiveRecDTO; import com.epmet.dto.ActLiveRecDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; import com.epmet.dto.result.resi.ResiActLiveRecResultDTO;
import com.epmet.entity.ActLivePicEntity; import com.epmet.entity.ActLivePicEntity;
import com.epmet.entity.ActLiveRecEntity; import com.epmet.entity.ActLiveRecEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.ActLiveRecRedis; import com.epmet.redis.ActLiveRecRedis;
import com.epmet.service.ActInfoService; import com.epmet.service.ActInfoService;
@ -80,6 +83,9 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
@Autowired @Autowired
private ActInfoService actInfoService; private ActInfoService actInfoService;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Value("${openapi.scan.server.url}") @Value("${openapi.scan.server.url}")
private String scanApiUrl; private String scanApiUrl;
@ -226,11 +232,11 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
// 查询 活动信息 // 查询 活动信息
ActInfoDTO actInfoDTO = actInfoService.get(formDTO.getActId()); ActInfoDTO actInfoDTO = actInfoService.get(formDTO.getActId());
MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO();
//mq的事件类型 //mq的事件类型
mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_INSERT_LIVE.getEventClass()); //mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_INSERT_LIVE.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_INSERT_LIVE.getEventTag()); //mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_INSERT_LIVE.getEventTag());
List<BasePointEventMsg> actPointEventMsgList=new ArrayList<>(); List<BasePointEventMsg> actPointEventMsgList=new ArrayList<>();
BasePointEventMsg actPointEventMsg=new BasePointEventMsg(); BasePointEventMsg actPointEventMsg=new BasePointEventMsg();
actPointEventMsg.setCustomerId(formDTO.getCustomerId()); actPointEventMsg.setCustomerId(formDTO.getCustomerId());
@ -242,8 +248,14 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
actPointEventMsg.setSourceId(formDTO.getActId()); actPointEventMsg.setSourceId(formDTO.getActId());
actPointEventMsgList.add(actPointEventMsg); actPointEventMsgList.add(actPointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList));
Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); //Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
SystemMsgFormDTO msgForm = new SystemMsgFormDTO();
msgForm.setMessageType(SystemMessageType.ACTIVE_INSERT_LIVE);
msgForm.setContent(actPointEventMsgList);
Result result = messageOpenFeignClient.sendSystemMsgByMQ(msgForm);
if(!result.success()){ if(!result.success()){
logger.error("添加活动实况,事件发送失败"); logger.error("添加活动实况,事件发送失败");
} }

18
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -40,6 +40,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils;
import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.SystemMessageType;
import com.epmet.dao.VolunteerInfoDao; import com.epmet.dao.VolunteerInfoDao;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerGridDTO;
@ -49,6 +50,7 @@ import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.SendVerificationCodeFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO;
import com.epmet.dto.form.VolunteerRegResiFormDTO; import com.epmet.dto.form.VolunteerRegResiFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
@ -196,11 +198,11 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
} }
private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){ private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){
MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO();
//mq的事件类型 //mq的事件类型
mqBaseMsgDTO.setEventClass(EventEnum.REGISTER_VOLUNTEER.getEventClass()); //mqBaseMsgDTO.setEventClass(EventEnum.REGISTER_VOLUNTEER.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.REGISTER_VOLUNTEER.getEventTag()); //mqBaseMsgDTO.setEventTag(EventEnum.REGISTER_VOLUNTEER.getEventTag());
List<BasePointEventMsg> actPointEventMsgList=new ArrayList<>(); List<BasePointEventMsg> actPointEventMsgList=new ArrayList<>();
BasePointEventMsg actPointEventMsg=new BasePointEventMsg(); BasePointEventMsg actPointEventMsg=new BasePointEventMsg();
actPointEventMsg.setCustomerId(formDTO.getCustomerId()); actPointEventMsg.setCustomerId(formDTO.getCustomerId());
@ -211,8 +213,14 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
actPointEventMsg.setIsCommon(false); actPointEventMsg.setIsCommon(false);
actPointEventMsgList.add(actPointEventMsg); actPointEventMsgList.add(actPointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList));
Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); //Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
SystemMsgFormDTO msgForm = new SystemMsgFormDTO();
msgForm.setMessageType(SystemMessageType.REGISTER_VOLUNTEER);
msgForm.setContent(actPointEventMsgList);
Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm);
if(!result.success()){ if(!result.success()){
logger.error("志愿者认证事件发送失败"); logger.error("志愿者认证事件发送失败");
} }

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

@ -18,12 +18,10 @@ import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ActConstant; import com.epmet.constant.*;
import com.epmet.constant.ActMessageConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.*; import com.epmet.dao.*;
import com.epmet.dto.*; import com.epmet.dto.*;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO; import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.work.*; import com.epmet.dto.form.work.*;
@ -917,11 +915,11 @@ public class WorkActServiceImpl implements WorkActService {
String opAgencyId=userResult.getData().getId(); String opAgencyId=userResult.getData().getId();
//备注 //备注
String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_REMARK,actInfoDTO.getTitle()); String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_REMARK,actInfoDTO.getTitle());
MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO();
//mq的事件类型 //mq的事件类型
mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass()); //mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag()); //mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
List<BasePointEventMsg> basePointEventMsgArrayList=new ArrayList<>(); List<BasePointEventMsg> basePointEventMsgArrayList=new ArrayList<>();
for(ActUserRelationEntity actUserRelationEntity:actUserRelationEntityList){ for(ActUserRelationEntity actUserRelationEntity:actUserRelationEntityList){
BasePointEventMsg basePointEventMsg=new BasePointEventMsg(); BasePointEventMsg basePointEventMsg=new BasePointEventMsg();
@ -937,15 +935,22 @@ public class WorkActServiceImpl implements WorkActService {
basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId()); basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId());
basePointEventMsgArrayList.add(basePointEventMsg); basePointEventMsgArrayList.add(basePointEventMsg);
} }
mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO); //Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
SystemMsgFormDTO systemMsgFormDTO = new SystemMsgFormDTO();
systemMsgFormDTO.setMessageType(SystemMessageType.ACTIVE_SEND_POINT);
systemMsgFormDTO.setContent(basePointEventMsgArrayList);
Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(systemMsgFormDTO);
ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity(); ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity();
actGrantPointLogEntity.setActId(actInfoDTO.getId()); actGrantPointLogEntity.setActId(actInfoDTO.getId());
actGrantPointLogEntity.setCustomerId(actInfoDTO.getCustomerId()); actGrantPointLogEntity.setCustomerId(actInfoDTO.getCustomerId());
actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId()); actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId());
actGrantPointLogEntity.setRemark(remark); actGrantPointLogEntity.setRemark(remark);
actGrantPointLogEntity.setReward(actInfoDTO.getReward()); actGrantPointLogEntity.setReward(actInfoDTO.getReward());
actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO)); actGrantPointLogEntity.setSendMsg(JSON.toJSONString(systemMsgFormDTO));
actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result)); actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result));
actGrantPointLogDao.insert(actGrantPointLogEntity); actGrantPointLogDao.insert(actGrantPointLogEntity);
if(!result.success()){ if(!result.success()){
@ -958,11 +963,11 @@ public class WorkActServiceImpl implements WorkActService {
//查询当前用户所属组织信息 //查询当前用户所属组织信息
Result<CustomerAgencyDTO> userResult = govOrgOpenFeignClient.getAgencyByStaff(loginUserUtil.getLoginUserId()); Result<CustomerAgencyDTO> userResult = govOrgOpenFeignClient.getAgencyByStaff(loginUserUtil.getLoginUserId());
String opAgencyId = userResult.getData().getId(); String opAgencyId = userResult.getData().getId();
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
//mq的事件类型 //mq的事件类型
mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass()); //mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag()); //mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
List<BasePointEventMsg> basePointEventMsgArrayList = new ArrayList<>(); List<BasePointEventMsg> basePointEventMsgArrayList = new ArrayList<>();
BasePointEventMsg basePointEventMsg = new BasePointEventMsg(); BasePointEventMsg basePointEventMsg = new BasePointEventMsg();
basePointEventMsg.setOpAgencyId(opAgencyId); basePointEventMsg.setOpAgencyId(opAgencyId);
@ -976,9 +981,16 @@ public class WorkActServiceImpl implements WorkActService {
basePointEventMsg.setSourceId(formDTO.getSourceId()); basePointEventMsg.setSourceId(formDTO.getSourceId());
basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId()); basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId());
basePointEventMsgArrayList.add(basePointEventMsg); basePointEventMsgArrayList.add(basePointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
logger.info("发送消息入参:"+JSON.toJSON(mqBaseMsgDTO)); //logger.info("发送消息入参:"+JSON.toJSON(mqBaseMsgDTO));
Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); //Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
SystemMsgFormDTO msgForm = new SystemMsgFormDTO();
msgForm.setMessageType(SystemMessageType.ACTIVE_SEND_POINT);
msgForm.setContent(basePointEventMsgArrayList);
Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm);
logger.info("发送消息返参:"+JSON.toJSON(result)); logger.info("发送消息返参:"+JSON.toJSON(result));
ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity(); ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity();
actGrantPointLogEntity.setActId(formDTO.getSourceId()); actGrantPointLogEntity.setActId(formDTO.getSourceId());
@ -986,7 +998,7 @@ public class WorkActServiceImpl implements WorkActService {
actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId()); actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId());
actGrantPointLogEntity.setRemark(formDTO.getRemark()); actGrantPointLogEntity.setRemark(formDTO.getRemark());
actGrantPointLogEntity.setReward(formDTO.getReward()); actGrantPointLogEntity.setReward(formDTO.getReward());
actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO)); actGrantPointLogEntity.setSendMsg(JSON.toJSONString(msgForm));
actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result)); actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result));
actGrantPointLogDao.insert(actGrantPointLogEntity); actGrantPointLogDao.insert(actGrantPointLogEntity);
if (!result.success()) { if (!result.success()) {

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

@ -104,4 +104,49 @@ public interface SystemMessageType {
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度 * 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度
*/ */
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
/**
* 活动发放积分
*/
String ACTIVE_SEND_POINT = "active_send_point";
/**
* 认证志愿者
*/
String REGISTER_VOLUNTEER = "register_volunteer";
/**
* 添加活动实况
*/
String ACTIVE_INSERT_LIVE = "active_insert_live";
/**
* 拉新用户入组
*/
String INVITE_NEW_INTO_GROUP = "invite_new_into_group";
/**
* 邀请已注册的用户入组
*/
String INVITE_RESI_INTO_GROUP = "invite_resi_into_group";
/**
* 发布话题
*/
String PUBLISH_ONE_TOPIC = "publish_one_topic";
/**
* 对小组内话题进行15字以上评论
*/
String PARTICIPATE_ONE_TOPIC = "participate_one_topic";
/**
* 话题被转为议题(小组中发布的话题被组长转为议题)
*/
String TOPIC_TO_ISSUE = "topic_to_issue";
/**
* 转话题为议题(将自建小组中话题转为议题)
*/
String SHIFT_TOPIC_TO_ISSUE = "shift_topic_to_issue";
/**
* 话题被转为项目
*/
String TOPIC_TO_PROJECT = "topic_to_project";
/**
* 组长解决组内话题
*/
String LEADER_RESOLVE_TOPIC = "leader_resolve_topic";
} }

4
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java

@ -19,6 +19,6 @@ public class SystemMsgFormDTO {
@NotNull(message = "消息内容不能为空", groups = { SendMsgByMQ.class }) @NotNull(message = "消息内容不能为空", groups = { SendMsgByMQ.class })
private Object content; private Object content;
@NotNull(message = "pendingMsgLabel不能为空", groups = { AckMsgByMQ.class }) //@NotNull(message = "pendingMsgLabel不能为空", groups = { AckMsgByMQ.class })
private String pendingMsgLabel; //private String pendingMsgLabel;
} }

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

@ -195,6 +195,21 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION: case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION:
topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION; topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION;
break; break;
case SystemMessageType.INVITE_NEW_INTO_GROUP:
case SystemMessageType.INVITE_RESI_INTO_GROUP:
case SystemMessageType.PUBLISH_ONE_TOPIC:
case SystemMessageType.PARTICIPATE_ONE_TOPIC:
case SystemMessageType.TOPIC_TO_ISSUE:
case SystemMessageType.SHIFT_TOPIC_TO_ISSUE:
case SystemMessageType.TOPIC_TO_PROJECT:
case SystemMessageType.LEADER_RESOLVE_TOPIC:
topic = TopicConstants.RESI_GROUP;
break;
case SystemMessageType.ACTIVE_SEND_POINT:
case SystemMessageType.REGISTER_VOLUNTEER:
case SystemMessageType.ACTIVE_INSERT_LIVE:
topic = TopicConstants.EPMET_HEART;
break;
} }
return topic; return topic;
} }

16
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -167,6 +167,10 @@
<!--钉钉 机器人地址--> <!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook> <dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret> <dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
</properties> </properties>
</profile> </profile>
<profile> <profile>
@ -210,6 +214,10 @@
<!--钉钉 机器人地址--> <!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook> <dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret> <dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
</properties> </properties>
</profile> </profile>
<profile> <profile>
@ -253,6 +261,10 @@
<!--钉钉 机器人地址--> <!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook> <dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret> <dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.10.161:9876</rocketmq.nameserver>
</properties> </properties>
</profile> </profile>
<profile> <profile>
@ -296,6 +308,10 @@
<!--生产钉钉 机器人地址--> <!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c</dingTalk.robot.webHook> <dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1</dingTalk.robot.secret> <dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.11.187:9876;192.168.11.184:9876</rocketmq.nameserver>
</properties> </properties>
</profile> </profile>
</profiles> </profiles>

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

@ -0,0 +1,27 @@
package com.epmet.mq;
import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.rocketmq.register.MQAbstractRegister;
import com.epmet.commons.rocketmq.register.MQConsumerProperties;
import com.epmet.mq.listener.PointListener;
import com.epmet.service.UserPointActionLogService;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class RocketMQConsumerRegister extends MQAbstractRegister {
@Autowired
private UserPointActionLogService userPointActionLogService;
@Override
public void registerAllListeners(String env, MQConsumerProperties consumerProperties) {
// 客户初始化监听器注册
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));
// ...其他监听器类似
}
}

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

@ -0,0 +1,236 @@
package com.epmet.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.service.UserPointActionLogService;
import dto.form.SendPointFormDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.common.message.MessageExt;
import org.redisson.api.RLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @author wxz
* @Description 登录操作日志监听器
* @return
* @date 2021.06.07 16:12
*/
@Slf4j
public class PointListener implements MessageListenerConcurrently {
private RedisUtils redisUtils;
private UserPointActionLogService userPointActionLogService;
public PointListener(UserPointActionLogService userPointActionLogService) {
this.userPointActionLogService = userPointActionLogService;
}
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) {
if (redisUtils == null) {
redisUtils = SpringContextUtils.getBean(RedisUtils.class);
}
try {
msgs.forEach(msg -> consumeMessage(msg));
} catch (Exception e) {
log.error(ExceptionUtils.getErrorStackTrace(e));
return ConsumeConcurrentlyStatus.RECONSUME_LATER;
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
private void consumeMessage(MessageExt messageExt) {
String tags = messageExt.getTags();
String msg = new String(messageExt.getBody());
String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL);
log.info("【积分操作监听器】-收到消息内容:{}", msg);
DistributedLock distributedLock = null;
RLock lock = null;
try {
distributedLock = SpringContextUtils.getBean(DistributedLock.class);
lock = distributedLock.getLock("lock:point_operation", 30L, 30L, TimeUnit.SECONDS);
switch (tags) {
case SystemMessageType.PARTICIPATE_ONE_TOPIC:
resiGroupPointOpe(msg);
break;
case SystemMessageType.ACTIVE_SEND_POINT:
// 爱心活动积分发放
activeSendPoint(msg);
break;
case SystemMessageType.ACTIVE_INSERT_LIVE:
// 添加活动实况
activeInsertLive(msg);
break;
case SystemMessageType.REGISTER_VOLUNTEER:
// 注册志愿者
registerVolunteer(msg);
break;
case SystemMessageType.TOPIC_TO_ISSUE:
// 话题被组长转为议题
topicToIssue(msg);
break;
case SystemMessageType.TOPIC_TO_PROJECT:
// 话题转为项目
topicToProject(msg);
break;
case SystemMessageType.INVITE_RESI_INTO_GROUP:
inviteResiIntoGroup(msg);
break;
case SystemMessageType.INVITE_NEW_INTO_GROUP:
inviteNewIntoGroup(msg);
break;
case SystemMessageType.SHIFT_TOPIC_TO_ISSUE:
shiftTopicToIssue(msg);
break;
case SystemMessageType.PUBLISH_ONE_TOPIC:
publicOneTopic(msg);
break;
case SystemMessageType.LEADER_RESOLVE_TOPIC:
leaderResolveTopic(msg);
break;
}
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
log.error("【积分操作监听器】消费消息失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
} catch (Exception e) {
// 不是我们自己抛出的异常,可以让MQ重试
log.error("【积分操作监听器】消费消息失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
throw e;
} finally {
distributedLock.unLock(lock);
}
if (StringUtils.isNotBlank(pendingMsgLabel)) {
try {
removePendingMqMsgCache(pendingMsgLabel);
} catch (Exception e) {
log.error("【登录操作事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
}
private void leaderResolveTopic(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
});
}
private void publicOneTopic(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
});
}
private void shiftTopicToIssue(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
});
}
private void inviteNewIntoGroup(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
});
}
private void inviteResiIntoGroup(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
});
}
private void topicToProject(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
});
}
private void topicToIssue(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(obj.getEventTag(), obj);
});
}
private void registerVolunteer(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(EventEnum.REGISTER_VOLUNTEER.getEventTag(),obj);
});
}
private void activeInsertLive(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(EventEnum.ACTIVE_INSERT_LIVE.getEventTag(), obj);
});
}
private void activeSendPoint(String msg) {
List<SendPointFormDTO> formDTO = JSON.parseArray(msg, SendPointFormDTO.class);
userPointActionLogService.grantPoint(formDTO);
}
private void resiGroupPointOpe(String msg) {
List<BasePointEventMsg> formList = JSON.parseArray(msg, BasePointEventMsg.class);
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj);
});
}
/**
* @description
*
* @param pendingMsgLabel
* @return
* @author wxz
* @date 2021.10.14 16:32:32
*/
private void removePendingMqMsgCache(String pendingMsgLabel) {
String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel);
redisUtils.delete(key);
//logger.info("【登录操作事件监听器】删除pendingMsgLabel成功:{}", pendingMsgLabel);
}
}

4
epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml

@ -141,3 +141,7 @@ shutdown:
graceful: graceful:
enable: true #是否开启优雅停机 enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
rocketmq:
enable: @rocketmq.enable@
name-server: @rocketmq.nameserver@

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

@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.MqConstant;
@ -34,12 +35,15 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.IssueShareLinkRecordDTO; import com.epmet.dto.IssueShareLinkRecordDTO;
import com.epmet.dto.IssueShareLinkVisitRecordDTO; import com.epmet.dto.IssueShareLinkVisitRecordDTO;
import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.CommonDataFilterResultDTO; import com.epmet.dto.result.CommonDataFilterResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.feign.GovOrgFeignClient;
@ -120,6 +124,8 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb
private GovOrgFeignClient govOrgFeignClient; private GovOrgFeignClient govOrgFeignClient;
@Autowired @Autowired
private GroupInvitationService groupInvitationService; private GroupInvitationService groupInvitationService;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Override @Override
public PageData<GroupMemeberOperationDTO> page(Map<String, Object> params) { public PageData<GroupMemeberOperationDTO> page(Map<String, Object> params) {
@ -352,10 +358,13 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb
} }
//mq的事件类型 //mq的事件类型
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
//事件code //事件code
mqBaseMsgDTO.setEventTag(isNew ? EventEnum.INVITE_NEW_RESIDENT_INTO_GROUP.getEventTag() : EventEnum.INVITE_RESIDENT_INTO_GROUP.getEventTag()); //mqBaseMsgDTO.setEventTag(isNew ? EventEnum.INVITE_NEW_RESIDENT_INTO_GROUP.getEventTag() : EventEnum.INVITE_RESIDENT_INTO_GROUP.getEventTag());
mqBaseMsgDTO.setEventClass("resi_group"); //mqBaseMsgDTO.setEventClass("resi_group");
String eventTag = isNew ? SystemMessageType.INVITE_NEW_INTO_GROUP : SystemMessageType.INVITE_RESI_INTO_GROUP;
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); List<BasePointEventMsg> pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg(); BasePointEventMsg pointEventMsg = new BasePointEventMsg();
pointEventMsg.setCustomerId(resiGroupDTO.getCustomerId()); pointEventMsg.setCustomerId(resiGroupDTO.getCustomerId());
@ -368,8 +377,8 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb
pointEventMsg.setActionFlag(MqConstant.PLUS); pointEventMsg.setActionFlag(MqConstant.PLUS);
pointEventMsg.setIsCommon(false); pointEventMsg.setIsCommon(false);
pointEventMsg.setTargetDate(current); pointEventMsg.setTargetDate(current);
pointEventMsg.setEventTag(mqBaseMsgDTO.getEventTag()); pointEventMsg.setEventTag(eventTag);
pointEventMsg.setEventClass(mqBaseMsgDTO.getEventClass()); pointEventMsg.setEventClass(TopicConstants.RESI_GROUP);
//pointEventMsg.setRemark("通过".concat(StringUtils.equals(param.getShareLinkType(),"topic") //pointEventMsg.setRemark("通过".concat(StringUtils.equals(param.getShareLinkType(),"topic")
// ? "话题":"议题").concat("分享链接邀请").concat(isNew ? "新" : "").concat("用户进组")); // ? "话题":"议题").concat("分享链接邀请").concat(isNew ? "新" : "").concat("用户进组"));
@ -387,9 +396,15 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb
} }
pointEventMsgList.add(pointEventMsg); pointEventMsgList.add(pointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList));
Result sendResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); //Result sendResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
if(!sendResult.success()){
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.INVITE_NEW_INTO_GROUP);
form.setContent(pointEventMsgList);
Result sendMsgResult = messageOpenFeignClient.sendSystemMsgByMQ(form);
if(!sendMsgResult.success()){
log.error((isNew ? "拉新用户入组事件发送失败" : "邀请已注册用户入组事件发送失败").concat(",参数:{}"),JSON.toJSONString(param)); log.error((isNew ? "拉新用户入组事件发送失败" : "邀请已注册用户入组事件发送失败").concat(",参数:{}"),JSON.toJSONString(param));
} }
} }

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

@ -34,6 +34,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils;
import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserMessageTypeConstant; import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.IssueShareLinkVisitRecordDTO; import com.epmet.dto.IssueShareLinkVisitRecordDTO;
import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.CommonGridIdFormDTO;
@ -673,10 +674,13 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
} }
//mq的事件类型 //mq的事件类型
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
mqBaseMsgDTO.setEventClass("resi_group"); //mqBaseMsgDTO.setEventClass("resi_group");
//事件code //事件code
mqBaseMsgDTO.setEventTag(isNew ? EventEnum.INVITE_NEW_RESIDENT_INTO_GROUP.getEventTag() : EventEnum.INVITE_RESIDENT_INTO_GROUP.getEventTag()); //mqBaseMsgDTO.setEventTag(isNew ? EventEnum.INVITE_NEW_RESIDENT_INTO_GROUP.getEventTag() : EventEnum.INVITE_RESIDENT_INTO_GROUP.getEventTag());
String eventTag = isNew ? SystemMessageType.INVITE_NEW_INTO_GROUP : SystemMessageType.INVITE_RESI_INTO_GROUP;
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); List<BasePointEventMsg> pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg(); BasePointEventMsg pointEventMsg = new BasePointEventMsg();
pointEventMsg.setCustomerId(groupCache.getCustomerId()); pointEventMsg.setCustomerId(groupCache.getCustomerId());
@ -689,7 +693,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
pointEventMsg.setActionFlag(MqConstant.PLUS); pointEventMsg.setActionFlag(MqConstant.PLUS);
pointEventMsg.setIsCommon(false); pointEventMsg.setIsCommon(false);
pointEventMsg.setTargetDate(groupMemeberOperationDTO.getCreatedTime()); pointEventMsg.setTargetDate(groupMemeberOperationDTO.getCreatedTime());
pointEventMsg.setEventTag(mqBaseMsgDTO.getEventTag()); pointEventMsg.setEventTag(eventTag);
//pointEventMsg.setRemark("通过".concat(StringUtils.equals(groupMemeberOperationDTO.getEnterGroupType(),ModuleConstant.ENTER_GROUP_TYPE_TOPIC_LINK) //pointEventMsg.setRemark("通过".concat(StringUtils.equals(groupMemeberOperationDTO.getEnterGroupType(),ModuleConstant.ENTER_GROUP_TYPE_TOPIC_LINK)
//? "话题":"议题").concat("分享链接邀请").concat(isNew ? "新" : "").concat("用户进组")); //? "话题":"议题").concat("分享链接邀请").concat(isNew ? "新" : "").concat("用户进组"));
List<String> userParam = new LinkedList<>(); List<String> userParam = new LinkedList<>();
@ -707,8 +711,15 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
pointEventMsgList.add(pointEventMsg); pointEventMsgList.add(pointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList));
Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); //Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
sendMsgForm.setMessageType(eventTag);
sendMsgForm.setContent(pointEventMsgList);
Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
if(!result.success()){ if(!result.success()){
logger.error((isNew ? "拉新用户入组事件发送失败" : "邀请已注册用户入组事件发送失败").concat(",参数:{}"),JSON.toJSONString(agreeApplyFormDTO)); logger.error((isNew ? "拉新用户入组事件发送失败" : "邀请已注册用户入组事件发送失败").concat(",参数:{}"),JSON.toJSONString(agreeApplyFormDTO));
} }

27
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java

@ -40,10 +40,12 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils;
import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.result.CommonDataFilterResultDTO; import com.epmet.dto.result.CommonDataFilterResultDTO;
import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.UserInfoResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.modules.comment.entity.ResiTopicCommentEntity; import com.epmet.modules.comment.entity.ResiTopicCommentEntity;
import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.constant.ResiGroupRedisKeys;
import com.epmet.modules.constant.WxmpSubscribeConstant; import com.epmet.modules.constant.WxmpSubscribeConstant;
@ -127,6 +129,8 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
private NoticeCommentService noticeCommentService; private NoticeCommentService noticeCommentService;
@Autowired @Autowired
private ResiTopicCommentAttachmentService resiTopicCommentAttachmentService; private ResiTopicCommentAttachmentService resiTopicCommentAttachmentService;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Value("${openapi.scan.server.url}") @Value("${openapi.scan.server.url}")
private String scanApiUrl; private String scanApiUrl;
@ -266,11 +270,14 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
Integer commentCount = baseDao.selectCommentCountByUserId(tokenDto.getUserId()); Integer commentCount = baseDao.selectCommentCountByUserId(tokenDto.getUserId());
if (null == commentCount || commentCount <= NumConstant.THREE){ if (null == commentCount || commentCount <= NumConstant.THREE){
if (StringUtils.isNotBlank(commentContent) && commentContent.length() > NumConstant.FIFTEEN){ if (StringUtils.isNotBlank(commentContent) && commentContent.length() > NumConstant.FIFTEEN){
String eventClass = EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass();
String eventTag = EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag();
//mq的事件类型 //mq的事件类型
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
mqBaseMsgDTO.setEventClass(EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass()); //mqBaseMsgDTO.setEventClass(EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag()); //mqBaseMsgDTO.setEventTag(EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag());
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); List<BasePointEventMsg> pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg(); BasePointEventMsg pointEventMsg = new BasePointEventMsg();
String customerId = resiTopicdDao.selectCustomerIdByTopicId(resiCommentFormDTO.getTopicId()); String customerId = resiTopicdDao.selectCustomerIdByTopicId(resiCommentFormDTO.getTopicId());
@ -297,8 +304,8 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
// 加分 // 加分
pointEventMsg.setActionFlag(MqConstant.PLUS); pointEventMsg.setActionFlag(MqConstant.PLUS);
pointEventMsg.setIsCommon(false); pointEventMsg.setIsCommon(false);
pointEventMsg.setEventTag(mqBaseMsgDTO.getEventTag()); pointEventMsg.setEventTag(eventTag);
pointEventMsg.setEventClass(mqBaseMsgDTO.getEventClass()); pointEventMsg.setEventClass(eventClass);
//某某小组中评论话题“某某某…” //某某小组中评论话题“某某某…”
StringBuilder builder = new StringBuilder(groupRedis.get(topic.getGroupId()).getGroupName()).append("小组中评论"); StringBuilder builder = new StringBuilder(groupRedis.get(topic.getGroupId()).getGroupName()).append("小组中评论");
String content = CharMatcher.WHITESPACE.trimFrom(topic.getTopicContent()); String content = CharMatcher.WHITESPACE.trimFrom(topic.getTopicContent());
@ -317,8 +324,14 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
pointEventMsg.setRemark(builder.toString()); pointEventMsg.setRemark(builder.toString());
pointEventMsgList.add(pointEventMsg); pointEventMsgList.add(pointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); SystemMsgFormDTO msgForm = new SystemMsgFormDTO();
Result msgResult= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); msgForm.setMessageType(eventTag);
msgForm.setContent(pointEventMsgList);
Result msgResult = messageOpenFeignClient.sendSystemMsgByMQ(msgForm);
//mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList));
//Result msgResult= SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
if(!msgResult.success()){ if(!msgResult.success()){
logger.error(TopicConstant.COMMENT_TOPIC_FAILURE); logger.error(TopicConstant.COMMENT_TOPIC_FAILURE);
} }

97
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg; import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.MqConstant;
@ -45,6 +46,7 @@ import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.OrgInfoConstant; import com.epmet.constant.OrgInfoConstant;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.WxmpMessageConstant; import com.epmet.constant.WxmpMessageConstant;
import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IssueApplicationDTO; import com.epmet.dto.IssueApplicationDTO;
@ -414,10 +416,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
if (null != publishTopicCount && publishTopicCount <= NumConstant.THREE){ if (null != publishTopicCount && publishTopicCount <= NumConstant.THREE){
//mq的事件类型 //mq的事件类型
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
mqBaseMsgDTO.setEventClass(EventEnum.PUBLISH_ONE_TOPIC.getEventClass()); //mqBaseMsgDTO.setEventClass(EventEnum.PUBLISH_ONE_TOPIC.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.PUBLISH_ONE_TOPIC.getEventTag()); //mqBaseMsgDTO.setEventTag(EventEnum.PUBLISH_ONE_TOPIC.getEventTag());
String eventClass = TopicConstants.RESI_GROUP;
String eventTag = SystemMessageType.PUBLISH_ONE_TOPIC;
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); List<BasePointEventMsg> pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg(); BasePointEventMsg pointEventMsg = new BasePointEventMsg();
ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(resiTopicPublishFormDTO.getGroupId()); ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(resiTopicPublishFormDTO.getGroupId());
@ -449,13 +455,19 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
// 加分 // 加分
pointEventMsg.setActionFlag(MqConstant.PLUS); pointEventMsg.setActionFlag(MqConstant.PLUS);
pointEventMsg.setIsCommon(false); pointEventMsg.setIsCommon(false);
pointEventMsg.setEventTag(mqBaseMsgDTO.getEventTag()); pointEventMsg.setEventTag(eventTag);
pointEventMsg.setEventClass(mqBaseMsgDTO.getEventClass()); pointEventMsg.setEventClass(eventClass);
pointEventMsgList.add(pointEventMsg); pointEventMsgList.add(pointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList));
Result msgResult= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); //Result msgResult= SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
if(!msgResult.success()){
SystemMsgFormDTO msgFormDTO = new SystemMsgFormDTO();
msgFormDTO.setMessageType(eventTag);
msgFormDTO.setContent(pointEventMsgList);
Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgFormDTO);
if(!sendMsgResult.success()){
logger.error(TopicConstant.CREATE_TOPIC_FAILURE); logger.error(TopicConstant.CREATE_TOPIC_FAILURE);
} }
} }
@ -810,10 +822,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//mq的事件类型 //mq的事件类型
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
mqBaseMsgDTO.setEventClass("resi_group"); //mqBaseMsgDTO.setEventClass("resi_group");
//事件code 组长解决组内话题 //事件code 组长解决组内话题
mqBaseMsgDTO.setEventTag(EventEnum.LEADER_RESOLVE_TOPIC.getEventTag()); //mqBaseMsgDTO.setEventTag(EventEnum.LEADER_RESOLVE_TOPIC.getEventTag());
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); List<BasePointEventMsg> pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg(); BasePointEventMsg pointEventMsg = new BasePointEventMsg();
@ -840,8 +852,15 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
"已被解决"); "已被解决");
pointEventMsgList.add(pointEventMsg); pointEventMsgList.add(pointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList));
if (!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()) { //Result<String> result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
SystemMsgFormDTO msgFormDTO = new SystemMsgFormDTO();
msgFormDTO.setContent(pointEventMsgList);
msgFormDTO.setMessageType(SystemMessageType.LEADER_RESOLVE_TOPIC);
Result result = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgFormDTO);
if (!result.success()) {
log.error("组长解决话题事件发送失败,参数:{}", JSON.toJSONString(closeFormDTO)); log.error("组长解决话题事件发送失败,参数:{}", JSON.toJSONString(closeFormDTO));
} }
} }
@ -1931,15 +1950,22 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
).append("转为议题").toString()); ).append("转为议题").toString());
pointEventMsgList.add(pointEventMsg2); pointEventMsgList.add(pointEventMsg2);
pointEventMsgList.forEach(item -> { pointEventMsgList.forEach(item -> {
MqBaseMsgDTO msgDTO = new MqBaseMsgDTO(); //MqBaseMsgDTO msgDTO = new MqBaseMsgDTO();
msgDTO.setEventClass("resi_group"); //msgDTO.setEventClass("resi_group");
//事件code 因为楼院小组的事件回调统一入口,外层的EventTag不能够判断具体的事件 //事件code 因为楼院小组的事件回调统一入口,外层的EventTag不能够判断具体的事件
//因为可能会一次发送多个事件集合,需要对集合里的对象逐个判断 //因为可能会一次发送多个事件集合,需要对集合里的对象逐个判断
msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); //msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
List<BasePointEventMsg> msgList = new ArrayList<>(); List<BasePointEventMsg> msgList = new ArrayList<>();
msgList.add(item); msgList.add(item);
msgDTO.setMsg(JSON.toJSONString(msgList)); //msgDTO.setMsg(JSON.toJSONString(msgList));
if(!SendMqMsgUtils.sendMsg(msgDTO).success()){
SystemMsgFormDTO msgForm = new SystemMsgFormDTO();
msgForm.setMessageType(SystemMessageType.SHIFT_TOPIC_TO_ISSUE);
msgForm.setContent(msgList);
Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm);
//Result<String> sendMsgResult = SendMqMsgUtils.sendMsg(msgDTO);
if(!sendMsgResult.success()){
log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(topicTurnIssueFromDTO)); log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(topicTurnIssueFromDTO));
} }
}); });
@ -2104,15 +2130,22 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
).append("转为议题").toString()); ).append("转为议题").toString());
pointEventMsgList.add(pointEventMsg2); pointEventMsgList.add(pointEventMsg2);
pointEventMsgList.forEach(item -> { pointEventMsgList.forEach(item -> {
MqBaseMsgDTO msgDTO = new MqBaseMsgDTO(); //MqBaseMsgDTO msgDTO = new MqBaseMsgDTO();
msgDTO.setEventClass("resi_group"); //msgDTO.setEventClass("resi_group");
//事件code 因为楼院小组的事件回调统一入口,外层的EventTag不能够判断具体的事件 //事件code 因为楼院小组的事件回调统一入口,外层的EventTag不能够判断具体的事件
//因为可能会一次发送多个事件集合,需要对集合里的对象逐个判断 //因为可能会一次发送多个事件集合,需要对集合里的对象逐个判断
msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); //msgDTO.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
List<BasePointEventMsg> msgList = new ArrayList<>(); List<BasePointEventMsg> msgList = new ArrayList<>();
msgList.add(item); msgList.add(item);
msgDTO.setMsg(JSON.toJSONString(msgList)); //msgDTO.setMsg(JSON.toJSONString(msgList));
if(!SendMqMsgUtils.sendMsg(msgDTO).success()){
SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
sendMsgForm.setContent(msgList);
sendMsgForm.setMessageType(SystemMessageType.SHIFT_TOPIC_TO_ISSUE);
Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
//Result<String> sendMsgResult = SendMqMsgUtils.sendMsg(msgDTO);
if(!sendMsgResult.success()){
log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param)); log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param));
} }
}); });
@ -2462,10 +2495,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//某某小组中发布的话题“某某某…” (前十个字后面省略号) 被转为项目 //某某小组中发布的话题“某某某…” (前十个字后面省略号) 被转为项目
if(EventEnum.TOPIC_SHIFTED_TO_PROJECT == param.getEvent()){ if(EventEnum.TOPIC_SHIFTED_TO_PROJECT == param.getEvent()){
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
mqBaseMsgDTO.setEventClass("resi_group"); //mqBaseMsgDTO.setEventClass("resi_group");
mqBaseMsgDTO.setEventTag(EventEnum.TOPIC_SHIFTED_TO_PROJECT.getEventTag()); //mqBaseMsgDTO.setEventTag(EventEnum.TOPIC_SHIFTED_TO_PROJECT.getEventTag());
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); List<BasePointEventMsg> pointEventMsgList = new ArrayList<>();
//话题被转为项目 话题作者 //话题被转为项目 话题作者
@ -2493,8 +2526,16 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
+ (NumConstant.TEN > content.length() ? "\"" : "…\"") + (NumConstant.TEN > content.length() ? "\"" : "…\"")
).append("被转为项目").toString()); ).append("被转为项目").toString());
pointEventMsgList.add(pointEventMsg); pointEventMsgList.add(pointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList));
if(!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()){
//Result<String> sendMsgResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
sendMsgForm.setContent(pointEventMsgList);
sendMsgForm.setMessageType(SystemMessageType.TOPIC_TO_PROJECT);
Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
if(!sendMsgResult.success()){
log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param)); log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param));
} }
} }

18
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java

@ -38,7 +38,9 @@ import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.scan.result.VoiceResultDTO; import com.epmet.commons.tools.scan.result.VoiceResultDTO;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.*;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.UserInfoResultDTO;
import com.epmet.dto.result.CommonDataFilterResultDTO; import com.epmet.dto.result.CommonDataFilterResultDTO;
@ -1004,11 +1006,11 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
private void sendMqMsg(String userId, String customerId, Date targetDate, String groupName, String topicBreviary, String agencyId, private void sendMqMsg(String userId, String customerId, Date targetDate, String groupName, String topicBreviary, String agencyId,
String gridId, String groupId, String topicId) { String gridId, String groupId, String topicId) {
//6.发送积分 //6.发送积分
MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); //MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO();
//mq的事件类型 //mq的事件类型
mqBaseMsgDTO.setEventClass(EventEnum.PUBLISH_ONE_TOPIC.getEventClass()); //mqBaseMsgDTO.setEventClass(EventEnum.PUBLISH_ONE_TOPIC.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.PUBLISH_ONE_TOPIC.getEventTag()); //mqBaseMsgDTO.setEventTag(EventEnum.PUBLISH_ONE_TOPIC.getEventTag());
List<BasePointEventMsg> actPointEventMsgList=new ArrayList<>(); List<BasePointEventMsg> actPointEventMsgList=new ArrayList<>();
BasePointEventMsg actPointEventMsg=new BasePointEventMsg(); BasePointEventMsg actPointEventMsg=new BasePointEventMsg();
actPointEventMsg.setCustomerId(customerId); actPointEventMsg.setCustomerId(customerId);
@ -1026,8 +1028,14 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
actPointEventMsg.setEventClass(EventEnum.PUBLISH_ONE_TOPIC.getEventClass()); actPointEventMsg.setEventClass(EventEnum.PUBLISH_ONE_TOPIC.getEventClass());
actPointEventMsgList.add(actPointEventMsg); actPointEventMsgList.add(actPointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); //mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList));
Result mqResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); //Result mqResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
sendMsgForm.setContent(actPointEventMsgList);
sendMsgForm.setMessageType(SystemMessageType.PUBLISH_ONE_TOPIC);
Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
if(!mqResult.success()){ if(!mqResult.success()){
logger.error("发表话题积分添加失败"); logger.error("发表话题积分添加失败");
} }

66
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolRoutineWorkFormDTO.java

@ -0,0 +1,66 @@
package com.epmet.dto.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/10/19 10:41 上午
* @DESC
*/
@Data
public class PatrolRoutineWorkFormDTO implements Serializable {
private static final long serialVersionUID = 3411355616849866888L;
public interface AddOrUpdateForm {
}
private String customerId;
@NotBlank(message = "网格ID不能为空", groups = AddOrUpdateForm.class)
private String gridId;
@NotBlank(message = "事项名称不能为空", groups = AddOrUpdateForm.class)
private String title;
@NotEmpty(message = "例行工作类型不能为空", groups = AddOrUpdateForm.class)
private List<String> workTypeList;
@Range(min = 0, max = 1, message = "有无变动(异常)格式错误", groups = AddOrUpdateForm.class)
@NotNull(message = "有无变动(异常)不能为空", groups = AddOrUpdateForm.class)
private Integer isNormal;
@JsonFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "发生时间不能为空", groups = AddOrUpdateForm.class)
private String happenTime;
@NotBlank(message = "工作简介不能为空", groups = AddOrUpdateForm.class)
private String workContent;
@NotBlank(message = "工作地点不能为空", groups = AddOrUpdateForm.class)
private String address;
/**
* 基础信息ID相关信息暂时没有
*/
private String baseInfoId;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

38
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java

@ -0,0 +1,38 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.PatrolRoutineWorkFormDTO;
import com.epmet.service.PatrolRoutineWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-19
*/
@RestController
@RequestMapping("patrolroutinework")
public class PatrolRoutineWorkController {
@Autowired
private PatrolRoutineWorkService gridUserWorkService;
/**
* @Description 添加例行工作
* @param formDTO
* @author zxc
* @date 2021/10/19 1:35 下午
*/
@NoRepeatSubmit
@PostMapping("add")
public Result<Boolean> gridUserWork( @RequestBody PatrolRoutineWorkFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, PatrolRoutineWorkFormDTO.AddOrUpdateForm.class);
gridUserWorkService.add(formDTO);
return new Result().ok(true);
}
}

33
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.PatrolRoutineWorkEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 巡查例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-21
*/
@Mapper
public interface PatrolRoutineWorkDao extends BaseDao<PatrolRoutineWorkEntity> {
}

33
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/PatrolRoutineWorkTypeDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.PatrolRoutineWorkTypeEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 巡查例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-21
*/
@Mapper
public interface PatrolRoutineWorkTypeDao extends BaseDao<PatrolRoutineWorkTypeEntity> {
}

90
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java

@ -0,0 +1,90 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 网格员例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("patrol_routine_work")
public class GridUserWorkEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* gridId的PID
*/
private String pids;
/**
* 用户Id user.id 谁创建的
*/
private String userId;
/**
* 事项名称
*/
private String title;
/**
* 发生日期 格式为YYYY-MM-DD
*/
private Date happenTime;
/**
* 有无变动异常10
*/
private Integer isNormal;
/**
* 备注说明
*/
private String workContent;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

88
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkEntity.java

@ -0,0 +1,88 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 巡查例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("patrol_routine_work")
public class PatrolRoutineWorkEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 网格表Id(CUSTOMER_GRID.id)居民党员角色值为all热心居民角色对应的网格Id
*/
private String gridId;
/**
* 网格所有上级id
*/
private String pids;
/**
* 用户Id user.id
*/
private String userId;
/**
* 事项名称
*/
private String title;
/**
* 工作日期 格式为YYYY-MM-DD
*/
private String happenTime;
/**
* 有无变动异常10
*/
private Integer isNormal;
/**
* 工作内容
*/
private String workContent;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

61
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkTypeEntity.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 巡查例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("patrol_routine_work_type")
public class PatrolRoutineWorkTypeEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 例行工作Id
*/
private String routineWorkId;
/**
* 例行工作字典项值typepatrol_work_type
*/
private String workTypeCode;
/**
* 所有上级类别code组合
*/
private String allPCode;
}

37
epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java

@ -0,0 +1,37 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.PatrolRoutineWorkFormDTO;
import com.epmet.entity.PatrolRoutineWorkEntity;
/**
* 巡查例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-21
*/
public interface PatrolRoutineWorkService extends BaseService<PatrolRoutineWorkEntity> {
/**
* desc:添加例行工作
* @param formDTO
*/
void add(PatrolRoutineWorkFormDTO formDTO);
}

31
epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkTypeService.java

@ -0,0 +1,31 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.PatrolRoutineWorkTypeEntity;
/**
* 巡查例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-21
*/
public interface PatrolRoutineWorkTypeService extends BaseService<PatrolRoutineWorkTypeEntity> {
}

162
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java

@ -0,0 +1,162 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.PatrolRoutineWorkDao;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.PatrolRoutineWorkFormDTO;
import com.epmet.entity.PatrolRoutineWorkEntity;
import com.epmet.entity.PatrolRoutineWorkTypeEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.PatrolRoutineWorkService;
import com.epmet.service.PatrolRoutineWorkTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 巡查例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-21
*/
@Slf4j
@Service
public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineWorkDao, PatrolRoutineWorkEntity> implements PatrolRoutineWorkService {
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
PatrolRoutineWorkTypeService patrolRoutineWorkTypeService;
/**
* @param formDTO
* @Description 网格员例行工作
* @author zxc
* @date 2021/10/19 1:35 下午
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void add(PatrolRoutineWorkFormDTO formDTO) {
PatrolRoutineWorkEntity entity = ConvertUtils.sourceToTarget(formDTO, PatrolRoutineWorkEntity.class);
CustomerGridFormDTO gridFormDTO = new CustomerGridFormDTO();
gridFormDTO.setGridId(formDTO.getGridId());
Result<CustomerGridDTO> gridBaseInfoData = govOrgOpenFeignClient.getGridBaseInfoByGridId(gridFormDTO);
if (!gridBaseInfoData.success()) {
throw new EpmetException("查询网格基本信息失败......");
}
CustomerGridDTO gridBaseInfo = gridBaseInfoData.getData();
entity.setPids(gridBaseInfo.getPids());
entity.setUserId(loginUserUtil.getLoginUserId());
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
//entity.setUserId("loginUserUtil.getLoginUserId()");
//entity.setCustomerId("loginUserUtil.getLoginUserCustomerId()");
baseDao.insert(entity);
Result<List<DictTreeResultDTO>> mapResult = adminOpenFeignClient.dictTree(DictTypeEnum.PATROL_WORK_TYPE.getCode());
if (mapResult == null || !mapResult.success() || CollectionUtils.isEmpty(mapResult.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "例行工作类型字典获取失败!");
}
List<DictTreeResultDTO> dictTree = mapResult.getData();
Map<String, StringBuilder> pidsMap = new HashMap<>();
dictTree.forEach(dto -> buildAllParentIdPath(pidsMap, dto));
List<PatrolRoutineWorkTypeEntity> workTypeList = new ArrayList<>();
formDTO.getWorkTypeList().forEach(code -> {
PatrolRoutineWorkTypeEntity typeEntity = new PatrolRoutineWorkTypeEntity();
typeEntity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
typeEntity.setRoutineWorkId(entity.getId());
typeEntity.setWorkTypeCode(code);
StringBuilder pids = pidsMap.get(code);
typeEntity.setAllPCode(pids.length() == 0 ? NumConstant.ZERO_STR : pids.toString());
workTypeList.add(typeEntity);
});
patrolRoutineWorkTypeService.insertBatch(workTypeList);
}
/**
* desc:递归遍历树形结构 构建pids 根节点pids 为空字符串
*
* @param result 构建的结果
* @param crurent
*/
private static void buildAllParentIdPath(Map<String, StringBuilder> result, DictTreeResultDTO crurent) {
String id = crurent.getId();
String pid = crurent.getPid();
StringBuilder pidsPath = new StringBuilder();
StringBuilder pidSb = result.get(pid);
if (pidSb == null) {
pidSb = new StringBuilder();
} else if (pidSb.indexOf(pid) == -1) {
if (pidSb.length() > 0) {
pidSb.append(StrConstant.COLON);
}
pidSb.append(pid);
}
pidsPath.append(pidSb);
result.put(id, pidsPath);
log.debug("id:" + id + " pids:" + pidsPath.toString());
List<DictTreeResultDTO> children = crurent.getChildren();
if (children != null) {
crurent.getChildren().forEach(item -> buildAllParentIdPath(result, item));
}
}
public static void main(String[] args) {
String str = "[{\"id\":\"01\",\"pid\":\"0\",\"children\":[{\"id\":\"0101\",\"pid\":\"01\",\"children\":[{\"id\":\"010101\",\"pid\":\"0101\",\"children\":[],\"name\":\"出租房屋巡查\"}],\"name\":\"出租房屋巡查\"},{\"id\":\"0102\",\"pid\":\"01\",\"children\":[],\"name\":\"重点场所巡查\"},{\"id\":\"0103\",\"pid\":\"01\",\"children\":[],\"name\":\"宗教活动\"},{\"id\":\"0199\",\"pid\":\"01\",\"children\":[],\"name\":\"其他\"}],\"name\":\"重点巡查\"},{\"id\":\"02\",\"pid\":\"0\",\"children\":[{\"id\":\"0201\",\"pid\":\"02\",\"children\":[],\"name\":\"刑满释放人员\"},{\"id\":\"0202\",\"pid\":\"02\",\"children\":[],\"name\":\"社区矫正\"},{\"id\":\"0203\",\"pid\":\"02\",\"children\":[],\"name\":\"吸毒人员\"},{\"id\":\"0204\",\"pid\":\"02\",\"children\":[],\"name\":\"信访人员\"},{\"id\":\"0205\",\"pid\":\"02\",\"children\":[],\"name\":\"重点青少年\"},{\"id\":\"0206\",\"pid\":\"02\",\"children\":[],\"name\":\"精神障碍者\"}],\"name\":\"特殊人群\"},{\"id\":\"09\",\"pid\":\"0\",\"children\":[{\"id\":\"0901\",\"pid\":\"09\",\"children\":[],\"name\":\"公共服务\"},{\"id\":\"0902\",\"pid\":\"09\",\"children\":[],\"name\":\"权益保障\"},{\"id\":\"0903\",\"pid\":\"09\",\"children\":[],\"name\":\"政策宣传\"},{\"id\":\"0904\",\"pid\":\"09\",\"children\":[],\"name\":\"便利服务\"},{\"id\":\"0999\",\"pid\":\"09\",\"children\":[],\"name\":\"其他\"}],\"name\":\"为民服务\"}]";
List<DictTreeResultDTO> dtos = JSON.parseArray(str, DictTreeResultDTO.class);
Map<String, StringBuilder> result = new HashMap<>();
dtos.forEach(dto -> {
buildAllParentIdPath(result, dto);
});
System.out.println(result.get("010101"));
System.out.println(JSON.toJSONString(result));
}
}

36
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkTypeServiceImpl.java

@ -0,0 +1,36 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.PatrolRoutineWorkTypeDao;
import com.epmet.entity.PatrolRoutineWorkTypeEntity;
import com.epmet.service.PatrolRoutineWorkTypeService;
import org.springframework.stereotype.Service;
/**
* 巡查例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-21
*/
@Service
public class PatrolRoutineWorkTypeServiceImpl extends BaseServiceImpl<PatrolRoutineWorkTypeDao, PatrolRoutineWorkTypeEntity> implements PatrolRoutineWorkTypeService {
}

35
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.20__user_routine_work.sql

@ -0,0 +1,35 @@
CREATE TABLE `patrol_routine_work` (
`ID` varchar(64) NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id',
`GRID_ID` varchar(64) NOT NULL COMMENT '网格表Id(CUSTOMER_GRID.id)【居民党员角色值为all,热心居民角色对应的网格Id】',
`PIDS` varchar(512) NOT NULL COMMENT '网格所有上级id',
`USER_ID` varchar(64) NOT NULL COMMENT '用户Id user.id',
`TITLE` varchar(128) NOT NULL COMMENT '事项名称',
`HAPPEN_TIME` varchar(32) NOT NULL COMMENT '工作日期 格式为“YYYY-MM-DD”',
`IS_NORMAL` tinyint(1) NOT NULL COMMENT '有无变动(异常)1:是、0:否',
`WORK_CONTENT` varchar(1024) NOT NULL COMMENT '工作内容',
`LONGITUDE` varchar(32) DEFAULT '' COMMENT '经度',
`LATITUDE` varchar(32) DEFAULT '' COMMENT '纬度',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT 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 '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='巡查例行工作';
CREATE TABLE `patrol_routine_work_type` (
`ID` varchar(64) NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id',
`ROUTINE_WORK_ID` varchar(64) NOT NULL COMMENT '例行工作Id',
`WORK_TYPE_CODE` varchar(32) NOT NULL COMMENT '例行工作字典项值;type:patrol_work_type',
`ALL_P_CODE` varchar(256) NOT NULL COMMENT '所有上级类别code组合',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT 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 '更新时间',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_work_id` (`ROUTINE_WORK_ID`) USING BTREE COMMENT '主表id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='巡查例行工作分类';

27
epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml

@ -0,0 +1,27 @@
<?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.PatrolRoutineWorkDao">
<resultMap type="com.epmet.entity.PatrolRoutineWorkEntity" id="patrolRoutineWorkMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="pids" column="PIDS"/>
<result property="userId" column="USER_ID"/>
<result property="title" column="TITLE"/>
<result property="happenTime" column="HAPPEN_TIME"/>
<result property="isNormal" column="IS_NORMAL"/>
<result property="workContent" column="WORK_CONTENT"/>
<result property="longitude" column="LONGITUDE"/>
<result property="latitude" column="LATITUDE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

21
epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkTypeDao.xml

@ -0,0 +1,21 @@
<?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.PatrolRoutineWorkTypeDao">
<resultMap type="com.epmet.entity.PatrolRoutineWorkTypeEntity" id="patrolRoutineWorkTypeMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="routineWorkId" column="ROUTINE_WORK_ID"/>
<result property="workTypeCode" column="WORK_TYPE_CODE"/>
<result property="allPCode" column="ALL_P_CODE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>
Loading…
Cancel
Save