Browse Source

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

master
jianjun 4 years ago
parent
commit
541ebe42b0
  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. 18
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  14. 20
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
  15. 19
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java
  16. 28
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java
  17. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java
  18. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java
  19. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java
  20. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictTreeResultDTO.java
  21. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
  22. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java
  23. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeStringNode.java
  24. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  25. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml
  26. 2
      epmet-module/data-report/data-report-server/pom.xml
  27. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java
  28. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
  29. 7
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java
  30. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
  31. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java
  32. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java
  33. 23
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandRelFormDTO.java
  34. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java
  35. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java
  36. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
  37. 25
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
  38. 25
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
  39. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java
  40. 8
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
  41. 22
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
  42. 18
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/UserDemandRelResDTO.java
  43. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java
  44. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java
  45. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java
  46. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java
  47. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java
  48. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java
  49. 8
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  50. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  51. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java
  52. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
  53. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  54. 54
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  55. 93
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  56. 52
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  57. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java
  58. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  59. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java
  60. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java
  61. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java
  62. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java
  63. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
  64. 32
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/ServerSatisfactionCalEventListener.java
  65. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
  66. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  67. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  68. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandSatisfactionService.java
  69. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
  70. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java
  71. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  72. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  73. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  74. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  75. 301
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  76. 144
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java
  77. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  78. 39
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  79. 330
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  80. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.5__activity.sql
  81. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  82. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  83. 53
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  84. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml
  85. 6
      epmet-module/epmet-job/epmet-job-server/pom.xml
  86. 31
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluateDemandTask.java
  87. 50
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  88. 4
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java
  89. 21
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
  90. 16
      epmet-module/epmet-point/epmet-point-server/pom.xml
  91. 28
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
  92. 243
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java
  93. 6
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
  94. 55
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
  95. 4
      epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml
  96. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordMiniFormDTO.java
  97. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterDetailFormDTO.java
  98. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java
  99. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java
  100. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java

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)
@NotNull(message="{id.require}", groups = UpdateGroup.class)
private Long id;
private String id;
@NotNull(message="{sysdict.type.require}", groups = DefaultGroup.class)
private Long dictTypeId;
@ -42,14 +42,16 @@ public class SysDictDataDTO implements Serializable {
private String dictValue;
private String dictPValue;
private String remark;
@Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class)
private Integer sort;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Date createDate;
private Date createdTime;
@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)
@NotNull(message="{id.require}", groups = UpdateGroup.class)
private Long id;
private String id;
@NotBlank(message="{sysdict.type.require}", groups = DefaultGroup.class)
private String dictType;
@ -47,8 +47,8 @@ public class SysDictTypeDTO implements Serializable {
private Integer sort;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Date createDate;
private Date createdTime;
@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.dto.form.DictListFormDTO;
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.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO;
@ -88,6 +89,16 @@ public interface EpmetAdminOpenFeignClient {
@PostMapping("/sys/dict/data/dictmap/{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")
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.dto.form.DictListFormDTO;
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.utils.ModuleUtils;
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);
}
@Override
public Result<List<DictTreeResultDTO>> dictTree(String dictType) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictTree", dictType);
}
@Override
public Result<List<DictListResultDTO>> dictList(DictListFormDTO 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.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
@ -150,6 +151,15 @@ public class SysDictDataController {
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

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.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.entity.DictData;
import com.epmet.entity.SysDictDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -30,4 +31,6 @@ public interface SysDictDataDao extends BaseDao<SysDictDataEntity> {
List<DictData> getDictDataList();
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;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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.EqualsAndHashCode;
import java.util.Date;
/**
* 数据字典
*
@ -25,8 +23,10 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("sys_dict_data")
public class SysDictDataEntity extends BaseEntity {
public class SysDictDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ID_WORKER_STR)
private String id;
/**
* 字典类型ID
*/
@ -39,6 +39,10 @@ public class SysDictDataEntity extends BaseEntity {
* 字典值
*/
private String dictValue;
/**
* 父级字典值 顶级0
*/
private String dictPValue;
/**
* 备注
*/
@ -47,14 +51,4 @@ public class SysDictDataEntity extends BaseEntity {
* 排序
*/
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;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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.EqualsAndHashCode;
import java.util.Date;
/**
* 字典类型
*
@ -25,8 +23,11 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("sys_dict_type")
public class SysDictTypeEntity extends BaseEntity {
public class SysDictTypeEntity extends BaseEpmetEntity {
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;
/**
* 更新者
*/
@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.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.page.PageData;
import com.epmet.dto.SysDictDataDTO;
@ -87,4 +88,6 @@ public interface SysDictDataService extends BaseService<SysDictDataEntity> {
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.epmet.commons.mybatis.service.impl.BaseServiceImpl;
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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.TreeUtils;
import com.epmet.dao.SysDictDataDao;
import com.epmet.dto.SysDictDataDTO;
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));
}
@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
a.sort ASC
</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>

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

@ -41,10 +41,24 @@ public interface ConsomerGroupConstants {
*/
String PROJECT_OPERATION_LOG_GROUP = "project_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";
/**
* 社区服务(原居民需求)积分操作消费组
*/
String COMMUNITY_SERVICE_POINT_OPERATION_GROUP = "community_service_point_operation_group";
/**
* 开放的对接数据(中间库) 组织变更事件监听器分组
*/
@ -73,5 +87,5 @@ public interface ConsomerGroupConstants {
/**
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度
*/
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
String USER_DEMAND_FINISH_GROUP = "user_demand_finish_group";
}

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

@ -55,7 +55,23 @@ public interface TopicConstants {
String IC_RESI_USER = "ic_resi_user";
/**
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度
* 需求完成
* 1如果服务方是区域化党建单位重新计算这个单位的满意度
*/
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
String USER_DEMAND = "user_demand";
/**
* 爱心互助
*/
String EPMET_HEART = "epmet_heart";
/**
* 楼院小组
*/
String RESI_GROUP = "resi_group";
/**
* 社区服务原居民需求
*/
String COMMUNITY_SERVICE="community_service";
}

19
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java

@ -1,19 +0,0 @@
package com.epmet.commons.rocketmq.messages;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度,或者直接计算整个客户
*/
@Data
public class CalPartyUnitSatisfactionFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
@NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class)
private String customerId;
private String partyUnitId;
}

28
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.commons.rocketmq.messages;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度,或者直接计算整个客户
*/
@Data
public class ServerSatisfactionCalFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
@NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class)
private String customerId;
/**
* 服务方id可以值区域化党建单位id
* 后面也可以是社会组织社区自组织id...
*/
private String serverId;
/**
* 服务方类型志愿者volunteer社会组织social_org社区自组织community_org区域党建单位party_unit
*/
@NotBlank(message = "serviceType不能为空",groups = AddUserInternalGroup.class)
private String serviceType;
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java

@ -17,4 +17,6 @@ public interface MqConstant {
* 减分标识 minus
*/
String MINUS="minus";
String SOURCE_TYPE_DEMAND="demand";
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java

@ -92,4 +92,6 @@ public class BasePointEventMsg implements Serializable {
private String eventTag;
private String eventClass;
private String objectId;
private String eventName;
}

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 String label;
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;
}

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

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

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

@ -18,6 +18,7 @@ public enum EventEnum {
SHIFT_TOPIC_TO_ISSUE("shift_topic_to_issue","resi_group","转话题为议题(将自建小组中话题转为议题)"),
TOPIC_SHIFTED_TO_PROJECT("topic_to_project","resi_group","话题被转为项目"),
LEADER_RESOLVE_TOPIC("leader_resolve_topic","resi_group","组长解决组内话题"),
FINISH_USER_DEMAND("finish_user_demand","community_service","服务完成"),
;
private String eventClass;

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;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;

19
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

@ -27,25 +27,12 @@
ca.level,
ca.area_code,
ca.parent_area_code,
( CASE WHEN ca.longitude is null THEN
( SELECT longitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE ca.longitude
END
) longitude,
( CASE WHEN ca.latitude is null THEN
( SELECT latitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE ca.latitude
END
) latitude
IFNULL(ca.longitude, cc.longitude) longitude,
IFNULL(ca.latitude, cc.latitude) latitude
FROM
customer_staff_agency csa
INNER JOIN customer_agency ca ON csa.agency_id = ca.id
INNER JOIN customer_agency cc ON cc.pid = '0' AND ca.customer_id = cc.customer_id
WHERE
csa.del_flag = '0'
AND ca.del_flag = '0'

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

@ -2,7 +2,7 @@ version: "3.7"
services:
data-report-server:
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:
- "8108:8108"
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"
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>
<parent>

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java

@ -44,6 +44,27 @@ public class ActInfoDTO implements Serializable {
*/
private String customerId;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
private String unitName;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
private String serviceMatterName;
/**
* 活动标题
*/

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java

@ -58,6 +58,11 @@ public class IcPartyActivityDTO implements Serializable {
*/
private String pids;
/**
* act_info表ID
*/
private String actId;
/**
* 单位ID
*/

7
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java

@ -145,6 +145,11 @@ public class IcUserDemandRecDTO implements Serializable {
*/
private Boolean evaluateFlag;
/**
* 奖励积分
*/
private Integer awardPoint;
/**
* 删除标识0.未删除 1.已删除
*/
@ -175,4 +180,6 @@ public class IcUserDemandRecDTO implements Serializable {
*/
private Date updatedTime;
private String serverId;
private String serviceType;
}

20
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java

@ -179,6 +179,26 @@ public class LatestActInfoDTO implements Serializable {
*/
private Boolean auditSwitch;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 乐观锁
*/

20
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AutoEvaluateDemandFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 自动评价参数
*/
@Data
public class AutoEvaluateDemandFormDTO implements Serializable {
private String customerId;
private Integer exceedValue;
/**
* day
* minute
*/
private String type;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java

@ -41,4 +41,7 @@ public class EvaluateDemandFormDTO implements Serializable {
private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
// 政府端:gov、居民端:resi、运营端:oper
@NotBlank(message = "app不能为空", groups = AddUserInternalGroup.class)
private String app;
}

23
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandRelFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form.demand;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 当前用户与需求消息的关系
*/
@Data
public class UserDemandRelFormDTO implements Serializable {
private static final long serialVersionUID = 948510931204329428L;
public interface AddInternalGroup {
}
@NotBlank(message = "需求id不能为空",groups = AddInternalGroup.class)
private String demandRecId;
@NotBlank(message = "userId不能为空",groups = AddInternalGroup.class)
private String userId;
}

1
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java

@ -21,4 +21,5 @@ public class ActIdFormDTO implements Serializable {
*/
@NotBlank(message = "活动id不能为空", groups = { ActIdFormDTO.AddUserInternalGroup.class })
private String actId;
private String customerId;
}

1
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java

@ -23,4 +23,5 @@ public class ActPreviewFormDTO implements Serializable {
*/
@NotBlank(message = "活动草稿id不能为空", groups = {UserInternalGroup.class})
private String actDraftId;
private String customerId;
}

20
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java

@ -161,4 +161,24 @@ public class DraftActInfoFormDTO implements Serializable {
*/
private String sponsorTel;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType = "heart";
/**
* 联建单位
*/
private String unitId;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
}

25
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java

@ -25,6 +25,8 @@ public class PublishActInfoFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface AddPartyActivityGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@ -189,4 +191,27 @@ public class PublishActInfoFormDTO implements Serializable {
*/
@NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class})
private String sponsorTel;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType = "heart";
/**
* 联建单位
*/
@NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
private String unitId;
/**
* 活动目标
*/
@NotBlank(message = "活动目标不能为空", groups = {AddPartyActivityGroup.class})
private String target;
/**
* 服务事项
*/
@NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
private String serviceMatter;
}

25
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java

@ -24,6 +24,8 @@ public class RePublishFormDTO implements Serializable {
private static final long serialVersionUID = -959956652123514886L;
public interface AddUserInternalGroup {
}
public interface AddPartyActivityGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@ -195,4 +197,27 @@ public class RePublishFormDTO implements Serializable {
*/
@NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class})
private String sponsorTel;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType = "heart";
/**
* 联建单位
*/
@NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
private String unitId;
/**
* 活动目标
*/
@NotBlank(message = "活动目标不能为空", groups = {AddPartyActivityGroup.class})
private String target;
/**
* 服务事项
*/
@NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
private String serviceMatter;
}

11
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java

@ -56,6 +56,17 @@ public class DemandDetailResDTO implements Serializable {
*/
private String serviceAddress;
// 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择
private String serviceLocation;
// 门牌号详细地址
private String locationDetail;
// 经度,需求人是ic的居民时,取所住楼栋的中心点位
private String longitude;
// 纬度,需求人是ic的居民时,取所住楼栋的中心点位
private String latitude;
/**
* 实际服务开始时间
*/

8
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java

@ -131,4 +131,12 @@ public class DemandRecResultDTO implements Serializable {
* 服务地点
*/
private String serviceAddress;
// 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择
private String serviceLocation;
// 门牌号详细地址
private String locationDetail;
// 经度,需求人是ic的居民时,取所住楼栋的中心点位
private String longitude;
// 纬度,需求人是ic的居民时,取所住楼栋的中心点位
private String latitude;
}

22
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java

@ -6,12 +6,30 @@ import java.io.Serializable;
/**
* 完成需求时是否需要计算 区域化党建单位的满意度
*
*/
@Data
public class FinishResultDTO implements Serializable {
/**
* 服务方id可以值区域化党建单位id也可以是社会组织社区自组织id爱心互助的志愿者用户id
*/
private String serverId;
/**
* 服务方类型志愿者volunteer社会组织social_org社区自组织community_org区域党建单位party_unit
*/
private String serviceType;
private Boolean grantPoint;
/**
* 奖励积分只有服务方是志愿者且积分大于0时才发放积分
*/
private Integer awardPoint;
/**
* 1已评价0未评价;评价后ic_user_satisfaction表有记录
*/
private Boolean evaluateFlag;
/**
* 完成了XXX的需求
*/
private String remark;
private String firstCategoryName;
private String categoryCode;
}

18
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/UserDemandRelResDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.result.demand;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
/**
* 当前用户与需求消息的关系
*/
@AllArgsConstructor
@Data
public class UserDemandRelResDTO implements Serializable {
private static final long serialVersionUID = -9007483306143283653L;
// 需求发布人:publisher ;服务人:server
private String identity;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java

@ -89,4 +89,25 @@ public class ActPreviewResultDTO implements Serializable {
* 活动详情
*/
private List<ActPreviewContentResultDTO> actContent;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
private String unitName;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
private String serviceMatterName;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java

@ -147,4 +147,25 @@ public class CanceledActDetailResultDTO implements Serializable {
* 活动签到打卡半径(单位)
*/
private Integer signInRadius;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
private String unitName;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
private String serviceMatterName;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java

@ -136,4 +136,25 @@ public class FinishedActDetailResultDTO implements Serializable {
* 活动签到打卡半径(单位)
*/
private Integer signInRadius;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
private String unitName;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
private String serviceMatterName;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java

@ -131,4 +131,25 @@ public class InProgressActDetailResultDTO implements Serializable {
* 活动签到打卡半径(单位)
*/
private Integer signInRadius;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
private String unitName;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
private String serviceMatterName;
}

20
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java

@ -166,4 +166,24 @@ public class LatestDraftActInfoResultDTO implements Serializable {
* 活动内容-
*/
private List<ActDraftContentDTOResultDTO> actContent;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType = "heart";
/**
* 联建单位
*/
private String unitId;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java

@ -148,4 +148,25 @@ public class ReEditActInfoResultDTO implements Serializable {
* 活动详情
*/
private List<ActPreviewContentResultDTO> actContent;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
private String unitName;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
private String serviceMatterName;
}

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

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
@ -67,4 +68,11 @@ public interface EpmetHeartOpenFeignClient {
*/
@PostMapping("/heart/resi/volunteer/page")
Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input);
/**
* 服务方填写实际服务时间并点击确认后 7天内需求人未作出评价默认完成情况为已完成五星好评为服务方发放积分
* @return
*/
@PostMapping("/heart/residemand/autoevaluate")
Result AutoEvaluateDemand(@RequestBody AutoEvaluateDemandFormDTO formDTO);
}

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

@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
@ -60,4 +61,14 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(VolunteerCommonFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryVolunteerPage", input);
}
/**
* 服务方填写实际服务时间并点击确认后 7天内需求人未作出评价默认完成情况为已完成五星好评为服务方发放积分
*
* @return
*/
@Override
public Result AutoEvaluateDemand(AutoEvaluateDemandFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "autoEvaluate",formDTO);
}
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java

@ -161,4 +161,12 @@ public interface ActConstant {
String HANDLED="handled";
String RESET="reset";
/**
* 活动类型-爱心互助
*/
String HEART = "heart";
/**
* 活动类型-联建活动
*/
String PARTY = "party";
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java

@ -32,7 +32,7 @@ public interface UserDemandConstant {
*/
String STAFF="staff";
String RESI="resi";
String SYS="sys";
/**
* 创建需求create;撤销需求cancel;指派assign;接单take_order;完成finish;评价evaluate
@ -73,4 +73,13 @@ public interface UserDemandConstant {
*/
String DEMAND_EVALUATED=" 您收到来自%s的评价,请查看。";
String DEMAND_CANCELED=" %s的需求已取消,请查看。";
String DEMAND_PUBLISHER="publisher";
String DEMAND_SERVER="server";
String GRANT_POINT_REMARK="完成了%s的需求:%s";
String DEFAULT_EVALUATE_REMARK="此用户没有填写内容,由系统默认评分";
// 完成结果:已解决 resolved,未解决 unresolved
String RESOLVED="resolved";
}

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

@ -17,7 +17,7 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
@ -189,8 +189,8 @@ public class IcPartyUnitController {
* @return
*/
@PostMapping("cal-partyunit-satisfation")
public Result calPartyUnitSatisfation(@RequestBody CalPartyUnitSatisfactionFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,CalPartyUnitSatisfactionFormDTO.AddUserInternalGroup.class);
public Result calPartyUnitSatisfation(@RequestBody ServerSatisfactionCalFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ServerSatisfactionCalFormDTO.AddUserInternalGroup.class);
icPartyUnitService.calPartyUnitSatisfation(formDTO);
return new Result();
}

54
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -17,9 +17,12 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -41,6 +44,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@ -189,18 +193,42 @@ public class IcUserDemandRecController {
formDTO.setUserType(UserDemandConstant.STAFF);
ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.IcShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setPartyUnitId(finishResultDTO.getServerId());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// todo
// 志愿者发放积分
if(finishResultDTO.getEvaluateFlag()){
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){
ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setServerId(finishResultDTO.getServerId());
mqMsg.setServiceType(finishResultDTO.getServiceType());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && null != finishResultDTO.getAwardPoint() && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// 志愿者发放积分
List<BasePointEventMsg> actPointEventMsgList = new ArrayList<>();
BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
actPointEventMsg.setCustomerId(formDTO.getCustomerId());
actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
actPointEventMsg.setSourceId(formDTO.getDemandRecId());
actPointEventMsg.setUserId(finishResultDTO.getServerId());
actPointEventMsg.setActionFlag(MqConstant.PLUS);
actPointEventMsg.setIsCommon(false);
actPointEventMsg.setRemark(finishResultDTO.getRemark());
actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
actPointEventMsgList.add(actPointEventMsg);
SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
sendMsgForm.setContent(actPointEventMsgList);
sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
if (!mqResult.success()) {
log.error(String.format("demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId()));
}
}
}
return new Result();
}

93
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java

@ -1,21 +1,27 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.IcUserDemandRecService;
import com.epmet.service.IcUserDemandSatisfactionService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -24,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@ -41,6 +48,8 @@ public class ResiDemandController {
private IcUserDemandRecService icUserDemandRecService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private IcUserDemandSatisfactionService demandSatisfactionService;
/**
* 居民端-需求大厅未处理处理中已完成
@ -98,7 +107,11 @@ public class ResiDemandController {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setType(UserDemandConstant.FINISHED);
formDTO.setUserType(UserDemandConstant.RESI);
if (AppClientConstant.APP_GOV.equals(tokenDto.getApp())) {
formDTO.setUserType(UserDemandConstant.STAFF);
} else if (AppClientConstant.APP_RESI.equals(tokenDto.getApp())) {
formDTO.setUserType(UserDemandConstant.RESI);
}
ValidatorUtils.validateEntity(formDTO, FinishStaffFromDTO.ResiShowGroup.class, FinishStaffFromDTO.AddUserInternalGroup.class);
icUserDemandRecService.finish(formDTO);
return new Result();
@ -117,20 +130,45 @@ public class ResiDemandController {
public Result evaluate(@LoginUser TokenDto tokenDto, @RequestBody EvaluateDemandFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setApp(tokenDto.getApp());
ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) {
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setPartyUnitId(finishResultDTO.getServerId());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// todo
// 志愿者发放积分
if(finishResultDTO.getEvaluateFlag()){
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) {
ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setServerId(finishResultDTO.getServerId());
mqMsg.setServiceType(finishResultDTO.getServiceType());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && null != finishResultDTO.getAwardPoint() && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// 志愿者发放积分
List<BasePointEventMsg> actPointEventMsgList = new ArrayList<>();
BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
actPointEventMsg.setCustomerId(formDTO.getCustomerId());
actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
actPointEventMsg.setSourceId(formDTO.getDemandRecId());
actPointEventMsg.setUserId(finishResultDTO.getServerId());
actPointEventMsg.setActionFlag(MqConstant.PLUS);
actPointEventMsg.setIsCommon(false);
actPointEventMsg.setRemark(finishResultDTO.getRemark());
actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName());
actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode());
actPointEventMsg.setPoint(finishResultDTO.getAwardPoint());
actPointEventMsgList.add(actPointEventMsg);
SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
sendMsgForm.setContent(actPointEventMsgList);
sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
if (!mqResult.success()) {
log.error(String.format("需求评价完成:demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId()));
}
}
}
return new Result();
}
@ -161,7 +199,7 @@ public class ResiDemandController {
* @return
*/
@PostMapping("mydemand")
public Result<List<ResiClientMyDemandResDTO>> queryMyDemand(@LoginUser TokenDto tokenDto, @RequestBody ResiClientMyDemandFormDTO formDTO){
public Result<List<ResiClientMyDemandResDTO>> queryMyDemand(@LoginUser TokenDto tokenDto,@RequestBody ResiClientMyDemandFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class);
@ -201,4 +239,29 @@ public class ResiDemandController {
return new Result<DemandRecId>().ok(icUserDemandRecService.saveOrUpdateDemand(formDTO));
}
/**
* 当前用户与需求消息的关系
* 需求发布人publisher 服务人server
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("user-demand-rel")
public Result<UserDemandRelResDTO> queryUserDemandRel(@LoginUser TokenDto tokenDto, @RequestBody UserDemandRelFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, UserDemandRelFormDTO.AddInternalGroup.class);
return new Result<UserDemandRelResDTO>().ok(icUserDemandRecService.queryUserDemandRel(formDTO));
}
/**
* 服务方填写实际服务时间并点击确认后 7天内需求人未作出评价默认完成情况为已完成五星好评为服务方发放积分
*
* @return
*/
@PostMapping("autoevaluate")
public Result autoEvaluate(@RequestBody AutoEvaluateDemandFormDTO formDTO){
demandSatisfactionService.evaluateDemandAuto(formDTO);
return new Result();
}
}

52
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java

@ -1,7 +1,10 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.ActConstant;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.work.*;
import com.epmet.service.WorkActService;
@ -69,6 +72,23 @@ public class WorkActController {
return new Result<PublishActResultDTO>().ok(workActService.publishAct(formDTO));
}
@PostMapping("publishV2")
public Result<PublishActResultDTO> publishActV2(@RequestBody PublishActInfoFormDTO formDTO) {
if (ActConstant.HEART.equals(formDTO.getActType())) {
ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class);
} else {
ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class,
PublishActInfoFormDTO.AddUserInternalGroup.class, PublishActInfoFormDTO.AddPartyActivityGroup.class);
}
for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) {
ValidatorUtils.validateEntity(actContentFormDTO,
PublishActContentFormDTO.UserShowGroup.class,
PublishActContentFormDTO.UserInternalGroup.class
);
}
return new Result<PublishActResultDTO>().ok(workActService.publishActV2(formDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.InProgressActResultDTO>
* @param formDTO
@ -130,9 +150,9 @@ public class WorkActController {
* @Date 2020/7/26 18:00
**/
@PostMapping("canceleddetail")
public Result<CanceledActDetailResultDTO> canceledDetail(@RequestBody ActIdFormDTO actIdFormDTO) {
public Result<CanceledActDetailResultDTO> canceledDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO actIdFormDTO) {
ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<CanceledActDetailResultDTO>().ok(workActService.canceledDetail(actIdFormDTO.getActId()));
return new Result<CanceledActDetailResultDTO>().ok(workActService.canceledDetail(tokenDto.getCustomerId(), actIdFormDTO.getActId()));
}
/**
@ -158,8 +178,9 @@ public class WorkActController {
* @Date 2020/7/26 21:01
**/
@PostMapping("finisheddetail")
public Result<FinishedActDetailResultDTO> finishedDeatil(@RequestBody ActIdFormDTO formDTO) {
public Result<FinishedActDetailResultDTO> finishedDeatil(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<FinishedActDetailResultDTO>().ok(workActService.finishedDeatil(formDTO));
}
@ -171,9 +192,10 @@ public class WorkActController {
* @Date 2020/7/26 21:33
**/
@PostMapping("inprogressdetail")
public Result<InProgressActDetailResultDTO> inProgressDetail(@RequestBody ActIdFormDTO formDTO) {
public Result<InProgressActDetailResultDTO> inProgressDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<InProgressActDetailResultDTO>().ok(workActService.inProgressDetail(formDTO.getActId()));
return new Result<InProgressActDetailResultDTO>().ok(workActService.inProgressDetail(tokenDto.getCustomerId(), formDTO.getActId()));
}
/**
@ -229,9 +251,9 @@ public class WorkActController {
* @Date 2020/7/27 13:36
**/
@PostMapping("getactinfo")
public Result<ReEditActInfoResultDTO> getActInfo(@RequestBody ActIdFormDTO formDTO){
public Result<ReEditActInfoResultDTO> getActInfo(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<ReEditActInfoResultDTO>().ok(workActService.getActInfo(formDTO.getActId()));
return new Result<ReEditActInfoResultDTO>().ok(workActService.getActInfo(tokenDto.getCustomerId(), formDTO.getActId()));
}
/**
@ -253,5 +275,21 @@ public class WorkActController {
return new Result<PublishActResultDTO>().ok(workActService.rePublish(rePublishFormDTO));
}
@PostMapping("republishV2")
public Result<PublishActResultDTO> rePublishV2(@RequestBody RePublishFormDTO rePublishFormDTO) {
if (ActConstant.HEART.equals(rePublishFormDTO.getActType())) {
ValidatorUtils.validateEntity(rePublishFormDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class);
} else {
ValidatorUtils.validateEntity(rePublishFormDTO, RePublishFormDTO.AddUserShowGroup.class, RePublishFormDTO.AddUserInternalGroup.class);
}
for (PublishActContentFormDTO actContentFormDTO : rePublishFormDTO.getActContent()) {
ValidatorUtils.validateEntity(actContentFormDTO,
PublishActContentFormDTO.UserShowGroup.class,
PublishActContentFormDTO.UserInternalGroup.class
);
}
return new Result<PublishActResultDTO>().ok(workActService.rePublishV2(rePublishFormDTO));
}
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java

@ -1,5 +1,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.work.*;
@ -82,8 +84,9 @@ public class WorkActDraftController {
* @Date 2020/7/21 17:24
**/
@PostMapping("preview")
public Result<ActPreviewResultDTO> previewActDetail(@RequestBody ActPreviewFormDTO formDTO){
public Result<ActPreviewResultDTO> previewActDetail(@LoginUser TokenDto tokenDto, @RequestBody ActPreviewFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ActPreviewFormDTO.UserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
ActPreviewResultDTO resultDTO=workActDraftService.previewActDetail(formDTO);
return new Result<ActPreviewResultDTO>().ok(resultDTO);
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.demand.IcResiUserDemandFromDTO;
import com.epmet.dto.form.demand.PageListAnalysisFormDTO;
import com.epmet.dto.form.demand.UserDemandPageFormDTO;
@ -85,7 +86,9 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
@Param("startDateId") String startDateId,
@Param("endDateId") String endDateId);
List<ServiceStatDTO> selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId);
List<ServiceStatDTO> selectGroupByServer(@Param("customerId") String customerId,
@Param("serverId") String serverId,
@Param("serviceType") String serviceType);
/**
* 居民端-需求大厅未处理处理中已完成
@ -109,4 +112,10 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
List<ResiClientMyDemandResDTO> queryMyDemandForResiClient(@Param("gridId") String gridId,
@Param("type")String type,
@Param("demandUserId")String demandUserId);
List<IcUserDemandRecDTO> selectNoEvaluate(@Param("customerId")String customerId,
@Param("exceedValue")Integer exceedValue,
@Param("type")String type);
int evaluate(@Param("demandRecId")String demandRecId, @Param("finishResult")String finishResult);
}

21
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java

@ -18,7 +18,6 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -217,4 +216,24 @@ public class ActInfoEntity extends BaseEpmetEntity {
*/
private Boolean summaryFlag;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java

@ -53,6 +53,11 @@ public class IcPartyActivityEntity extends BaseEpmetEntity {
*/
private String pids;
/**
* act_info表ID
*/
private String actId;
/**
* 单位ID
*/

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java

@ -50,7 +50,7 @@ public class IcUserDemandSatisfactionEntity extends BaseEpmetEntity {
private String demandRecId;
/**
* 当前操作用户属于哪个端工作端staff居民端resi
* 当前操作用户属于哪个端工作端staff居民端resi;系统操作:sys
*/
private String userType;

20
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java

@ -182,4 +182,24 @@ public class LatestActInfoEntity extends BaseEpmetEntity {
* 数据库新增ACT_INFO_ID字段act_info.id
*/
private String actInfoId;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java

@ -4,7 +4,7 @@ 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.PartyUnitSatisfactionCalEventListener;
import com.epmet.mq.listener.ServerSatisfactionCalEventListener;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import org.springframework.stereotype.Component;
@ -20,11 +20,11 @@ public class RocketMQConsumerRegister extends MQAbstractRegister {
public void registerAllListeners(String env, MQConsumerProperties consumerProperties) {
// 客户初始化监听器注册
register(consumerProperties,
ConsomerGroupConstants.CAL_PARTY_UNIT_SATISFACTION,
ConsomerGroupConstants.USER_DEMAND_FINISH_GROUP,
MessageModel.CLUSTERING,
TopicConstants.CAL_PARTY_UNIT_SATISFACTION,
TopicConstants.USER_DEMAND,
"*",
new PartyUnitSatisfactionCalEventListener());
new ServerSatisfactionCalEventListener());
// ...其他监听器类似
}

32
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java → epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/ServerSatisfactionCalEventListener.java

@ -2,13 +2,14 @@ package com.epmet.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.distributedlock.DistributedLock;
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.SpringContextUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.service.IcPartyUnitService;
import org.apache.commons.lang.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
@ -22,13 +23,7 @@ import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @Description 计算区域化党建单位群众满意度=分数相加 需求的总个数
* @author wxz
* @date 2021.10.13 15:21:48
*/
public class PartyUnitSatisfactionCalEventListener implements MessageListenerConcurrently {
public class ServerSatisfactionCalEventListener implements MessageListenerConcurrently {
private Logger logger = LoggerFactory.getLogger(getClass());
private RedisUtils redisUtils;
@ -57,23 +52,28 @@ public class PartyUnitSatisfactionCalEventListener implements MessageListenerCon
String tags = messageExt.getTags();
String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL);
logger.info("【计算区域化党建单位群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags);
CalPartyUnitSatisfactionFormDTO obj = JSON.parseObject(msg, CalPartyUnitSatisfactionFormDTO.class);
logger.info("【需求完成计算服务方群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags);
ServerSatisfactionCalFormDTO obj = JSON.parseObject(msg, ServerSatisfactionCalFormDTO.class);
DistributedLock distributedLock = null;
RLock lock = null;
try {
distributedLock = SpringContextUtils.getBean(DistributedLock.class);
lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()),
lock = distributedLock.getLock(String.format("lock:user_demand:%s", obj.getCustomerId()),
30L, 30L, TimeUnit.SECONDS);
//待执行方法
SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj);
switch (tags) {
case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION:
//区域化党建单位-计算群众满意度
SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj);
break;
//后面社会组织、社区自组织可能都会计算....先预备着
}
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【计算区域化党建单位群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
logger.error("【需求完成计算服务方群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
} catch (Exception e) {
// 不是我们自己抛出的异常,可以让MQ重试
logger.error("【计算区域化党建单位群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
logger.error("【需求完成计算服务方群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
throw e;
} finally {
distributedLock.unLock(lock);
@ -83,7 +83,7 @@ public class PartyUnitSatisfactionCalEventListener implements MessageListenerCon
try {
removePendingMqMsgCache(pendingMsgLabel);
} catch (Exception e) {
logger.error("【计算区域化党建单位群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
logger.error("【需求完成计算服务方群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
}

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

@ -117,4 +117,22 @@ public interface IcPartyActivityService extends BaseService<IcPartyActivityEntit
* @Date 2021/12/9 16:24
*/
PageData<IcPartyActivityDTO> getActivityList(TokenDto tokenDto, PartyActivityFormDTO formDTO);
/**
* 根据爱心活动ID获取联建活动
* @Param actId
* @Return {@link IcPartyActivityDTO}
* @Author zhaoqifeng
* @Date 2021/12/23 16:13
*/
IcPartyActivityDTO getActivityByActId(String actId);
/**
* 根据爱心活动ID删除联建活动
* @Param actId
* @Return {@link IcPartyActivityDTO}
* @Author zhaoqifeng
* @Date 2021/12/23 16:13
*/
void deleteByActId(String actId);
}

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -18,8 +18,8 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -147,7 +147,7 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
* 计算区域化党建单位的群众满意度
* @param formDTO
*/
void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO);
void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO);
List<IcPartyUnitEntity> queryListById(List<String> partyUnitIds);
}

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -141,10 +141,11 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* 计算出服务方评价总分服务的需求个数
*
* @param customerId
* @param partyUnitId
* @param serverId
* @param serviceType
* @return
*/
List<ServiceStatDTO> groupByPartyUnit(String customerId, String partyUnitId);
List<ServiceStatDTO> groupByServer(String customerId, String serverId,String serviceType);
/**
* 居民端-需求大厅未处理处理中已完成
@ -204,4 +205,13 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return
*/
DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO);
/**
* 当前用户与需求消息的关系 需求发布人publisher 服务人server
*
* @param formDTO
* @return
*/
UserDemandRelResDTO queryUserDemandRel(UserDemandRelFormDTO formDTO);
}

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandSatisfactionService.java

@ -0,0 +1,14 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.entity.IcUserDemandSatisfactionEntity;
public interface IcUserDemandSatisfactionService extends BaseService<IcUserDemandSatisfactionEntity> {
/**
*
* @param formDTO
* @return
*/
void evaluateDemandAuto(AutoEvaluateDemandFormDTO formDTO);
}

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java

@ -38,7 +38,7 @@ public interface WorkActService {
* @Date 2020/7/21 18:33
**/
PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO);
PublishActResultDTO publishActV2(PublishActInfoFormDTO formDTO);
/**
* @return com.epmet.dto.result.work.InProgressActResultDTO
* @param formDTO
@ -82,7 +82,7 @@ public interface WorkActService {
* @description 已取消-活动详情
* @Date 2020/7/26 18:00
**/
CanceledActDetailResultDTO canceledDetail(String actId);
CanceledActDetailResultDTO canceledDetail(String customerId, String actId);
/**
* @return void
@ -109,7 +109,7 @@ public interface WorkActService {
* @description 进行中-活动详情
* @Date 2020/7/26 21:34
**/
InProgressActDetailResultDTO inProgressDetail(String actId);
InProgressActDetailResultDTO inProgressDetail(String customerId, String actId);
/**
* @return void
@ -136,7 +136,7 @@ public interface WorkActService {
* @description 重新编辑-获取活动详情
* @Date 2020/7/27 13:36
**/
ReEditActInfoResultDTO getActInfo(String actId);
ReEditActInfoResultDTO getActInfo(String customerId, String actId);
/**
* @return com.epmet.dto.result.work.PublishActResultDTO
@ -146,6 +146,6 @@ public interface WorkActService {
* @Date 2020/7/27 13:55
**/
PublishActResultDTO rePublish(RePublishFormDTO rePublishFormDTO);
PublishActResultDTO rePublishV2(RePublishFormDTO rePublishFormDTO);
void testGrantPoint(TestGrantFormDTO formDTO);
}

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

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -401,7 +401,10 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
@Override
public List<IcCommunitySelfOrganizationEntity> queryListById(List<String> communityOrgIds) {
return baseDao.selectBatchIds(communityOrgIds);
if(CollectionUtils.isNotEmpty(communityOrgIds)){
return baseDao.selectBatchIds(communityOrgIds);
}
return Collections.EMPTY_LIST;
}
}

34
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -382,6 +382,40 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
return new PageData<>(dtoList, pageInfo.getTotal());
}
/**
* 根据爱心活动ID获取联建活动
*
* @param actId
* @Param actId
* @Return {@link IcPartyActivityDTO}
* @Author zhaoqifeng
* @Date 2021/12/23 16:13
*/
@Override
public IcPartyActivityDTO getActivityByActId(String actId) {
LambdaQueryWrapper<IcPartyActivityEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyActivityEntity::getActId, actId);
IcPartyActivityEntity entity = baseDao.selectOne(wrapper);
return ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class);
}
/**
* 根据爱心活动ID删除联建活动
*
* @param actId
* @Param actId
* @Return {@link IcPartyActivityDTO}
* @Author zhaoqifeng
* @Date 2021/12/23 16:13
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByActId(String actId) {
LambdaQueryWrapper<IcPartyActivityEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyActivityEntity::getActId, actId);
baseDao.delete(wrapper);
}
/**
* 近30天开始时间和结束时间 精确到秒
* @Param formDTO

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

@ -22,7 +22,7 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
@ -440,10 +440,11 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
* 总分需求个数
* @param formDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO) {
public void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO) {
log.info("收到消息内容啦...." + JSON.toJSONString(formDTO));
List<ServiceStatDTO> list = icUserDemandRecService.groupByPartyUnit(formDTO.getCustomerId(), formDTO.getPartyUnitId());
List<ServiceStatDTO> list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(),formDTO.getServiceType());
for (ServiceStatDTO serviceStatDTO : list) {
if (0 != serviceStatDTO.getDemandCount()) {
BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP);
@ -454,7 +455,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Override
public List<IcPartyUnitEntity> queryListById(List<String> partyUnitIds) {
return baseDao.selectBatchIds(partyUnitIds);
if(CollectionUtils.isNotEmpty(partyUnitIds)){
return baseDao.selectBatchIds(partyUnitIds);
}
return Collections.EMPTY_LIST;
}
private String getServiceMatter(Map<String, String> map, String matter) {

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java

@ -270,7 +270,10 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
@Override
public List<IcSocietyOrgEntity> queryListById(List<String> socialOrgIds) {
return baseDao.selectBatchIds(socialOrgIds);
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(socialOrgIds)){
return baseDao.selectBatchIds(socialOrgIds);
}
return Collections.EMPTY_LIST;
}
}

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

@ -27,10 +27,15 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
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.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserDemandConstant;
import com.epmet.constant.UserMessageTypeConstant;
@ -56,6 +61,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -96,6 +102,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private IcCommunitySelfOrganizationService communitySelfOrganizationService;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Autowired
private IcUserDemandSatisfactionService icUserDemandSatisfactionService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Override
public IcUserDemandRecDTO get(String id) {
@ -266,7 +281,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
Map<String,String> userInfoMap=new HashMap<>();
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
@ -358,6 +373,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//待处理+已派单才可以指派
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可指派",entity.getStatus()),"当前状态,不可指派");
}
if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType()) && formDTO.getServerId().equals(entity.getDemandUserId())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("居民端用户上报的需求【%s】,需求人与服务方(志愿者)不能同为一人", entity.getId()), "需求人与服务方不能同为一人");
}
//1、修改主表
//置为已派单
entity.setStatus(UserDemandConstant.ASSIGNED);
@ -394,53 +412,65 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
@Override
public FinishResultDTO finish(FinishStaffFromDTO formDTO) {
IcUserDemandRecEntity entity = checkFinishPreCondition(formDTO.getDemandRecId());
//1、插入完成操作日志
IcUserDemandOperateLogEntity logEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class);
logEntity.setActionCode(UserDemandConstant.FINISH);
logEntity.setOperateTime(new Date());
operateLogDao.insert(logEntity);
//2、更新服务记录,记录实际开始,实际结束时间
//查询服务记录
IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId());
if(null==serviceEntity){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "服务记录不存在", EpmetErrorCode.SERVER_ERROR.getMsg());
}
serviceEntity.setServiceStartTime(formDTO.getServiceStartTime());
serviceEntity.setServiceEndTime(formDTO.getServiceEndTime());
demandServiceDao.updateById(serviceEntity);
// 3、pc完成情况:完成+评价
FinishResultDTO finishResultDTO=new FinishResultDTO();
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
Date nowDate=new Date();
if(!UserDemandConstant.FINISHED.equals(entity.getStatus())){
//1、插入完成操作日志
IcUserDemandOperateLogEntity logEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class);
logEntity.setActionCode(UserDemandConstant.FINISH);
logEntity.setOperateTime(nowDate);
operateLogDao.insert(logEntity);
//1.2、更新服务记录,记录实际开始,实际结束时间
serviceEntity.setServiceStartTime(formDTO.getServiceStartTime());
serviceEntity.setServiceEndTime(formDTO.getServiceEndTime());
demandServiceDao.updateById(serviceEntity);
//1.3、修改主表状态为已完成
entity.setStatus(UserDemandConstant.FINISHED);
}
// 2、pc完成情况:完成+评价
if(UserDemandConstant.FINISH_AND_EVALUATE.equals(formDTO.getType())){
//3.1、插入评价得分记录
//2.1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(logEntity.getOperateTime());
satisfactionEntity.setEvaluateTime(nowDate);
satisfactionEntity.setRemark(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandSatisfactionDao.insert(satisfactionEntity);
// 3.2插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity=ConvertUtils.sourceToTarget(logEntity,IcUserDemandOperateLogEntity.class);
// 2.2插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
evaluateEntity.setOperateTime(nowDate);
evaluateEntity.setId(null);
operateLogDao.insert(evaluateEntity);
//3.4更新主表已评价标识,是否解决标识。
//2.3更新主表已评价标识,是否解决标识。
entity.setEvaluateFlag(true);
entity.setFinishResult(formDTO.getFinishResult());
//3.5如果需求是志愿者完成的,发送消息:您收到来自XXX的评价,请查看。
//2.4如果需求是志愿者完成的,发送消息:您收到来自XXX的评价,请查看。
sendVolunnterEvaluated(entity);
}
//4、修改主表状态为已完成
entity.setStatus(UserDemandConstant.FINISHED);
finishResultDTO.setAwardPoint(entity.getAwardPoint());
finishResultDTO.setCategoryCode(entity.getCategoryCode());
finishResultDTO.setEvaluateFlag(entity.getEvaluateFlag());
if(StringUtils.isBlank(entity.getParentCode())||NumConstant.ZERO_STR.equals(entity.getParentCode())){
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getCategoryCode()));
}else{
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getParentCode()));
}
String content = entity.getContent().length() > 100 ? entity.getContent().substring(0, 99) : entity.getContent();
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content));
}
baseDao.updateById(entity);
FinishResultDTO finishResultDTO=new FinishResultDTO();
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
// 5、如果是居民端用户提出的需求,发消息:您提出的需求已完成,请进行服务评价。
sendDemandUserFinished(entity);
return finishResultDTO;
@ -457,14 +487,14 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if (null == entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
}
if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){
/*if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){
//已经完成
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务已完成,不可重复提交", "服务已完成,不可重复提交");
}
if (!UserDemandConstant.ASSIGNED.equals(entity.getStatus()) && !UserDemandConstant.HAVE_ORDER.equals(entity.getStatus())) {
//已指派、已抢单的才可以完成
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可点击服务完成",entity.getStatus()), "当前状态,不能确认服务完成");
}
}*/
return entity;
}
@ -734,7 +764,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
Map<String,String> userInfoMap=new HashMap<>();
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
@ -896,15 +926,16 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
* 计算出服务方评价总分服务的需求个数
*
* @param customerId
* @param partyUnitId
* @param serverId
* @param serviceType
* @return
*/
@Override
public List<ServiceStatDTO> groupByPartyUnit(String customerId, String partyUnitId) {
if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(partyUnitId)){
public List<ServiceStatDTO> groupByServer(String customerId, String serverId,String serviceType) {
if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(serverId)){
return new ArrayList<>();
}
return baseDao.selectGroupByPartyUnit(customerId,partyUnitId);
return baseDao.selectGroupByServer(customerId,serverId,serviceType);
}
@ -1028,19 +1059,27 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价");
}
// todo 只有需求人才可以评价
//用户输入的完成情况,走内容审核
textScan(formDTO.getFinishDesc());
//当前操作用户是工作端用户还是居民端用户
String userType = "";
if (AppClientConstant.APP_GOV.equals(formDTO.getApp())) {
userType = UserDemandConstant.STAFF;
} else if (AppClientConstant.APP_RESI.equals(formDTO.getApp())) {
userType = UserDemandConstant.RESI;
}
// 1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(new Date());
satisfactionEntity.setUserType(UserDemandConstant.RESI);
satisfactionEntity.setUserType(userType);
satisfactionEntity.setRemark(formDTO.getFinishDesc());
demandSatisfactionDao.insert(satisfactionEntity);
// 2、插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandOperateLogEntity.class);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
evaluateEntity.setOperateTime(satisfactionEntity.getEvaluateTime());
evaluateEntity.setUserType(UserDemandConstant.RESI);
evaluateEntity.setUserType(userType);
operateLogDao.insert(evaluateEntity);
// 3、更新主表已评价标识,是否解决标识。
@ -1054,7 +1093,16 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自山东路-张先生的评价,请查看。
finishResultDTO.setEvaluateFlag(entity.getEvaluateFlag());
if(StringUtils.isBlank(entity.getParentCode())||NumConstant.ZERO_STR.equals(entity.getParentCode())){
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getCategoryCode()));
}else{
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getParentCode()));
}
String content = entity.getContent().length() > 100 ? entity.getContent().substring(0, 99) : entity.getContent();
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content));
finishResultDTO.setCategoryCode(entity.getCategoryCode());
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自XXX(需求人姓名)的评价,请查看。
sendVolunnterEvaluated(entity);
return finishResultDTO;
}
@ -1073,7 +1121,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
queryWrapper.orderByDesc("WANT_SERVICE_TIME");
queryWrapper.last("limit 5");
queryWrapper.select("DISTINCT CATEGORY_CODE");
return baseDao.selectList(queryWrapper).stream().map(o->o.toString()).collect(Collectors.toList());
return baseDao.selectObjs(queryWrapper).stream().map(o->o.toString()).collect(Collectors.toList());
}
/**
@ -1091,48 +1139,50 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
List<ResiClientMyDemandResDTO> list=result.getList();
if (CollectionUtils.isNotEmpty(list)) {
//1、服务方(社会组织、社区自组织、区域化党建单位)单位名称,负责人姓名,负责人手机号
List<String> partyUnitIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
List<String> partyUnitIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map<String, IcPartyUnitEntity> partyUnitMap =getPartyUnitMap(partyUnitIds);
List<String> socialOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
List<String> socialOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map<String, IcSocietyOrgEntity> socialOrgMap=getSocialOrgMap(socialOrgIds);
List<String> communityOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
List<String> communityOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap=getCommunityOrgMap(communityOrgIds);
//2、志愿者姓名、手机号
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet());
Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet());
Map<String,UserBaseInfoResultDTO> userInfoMap=getVolunteerMap(userIdList);
for (ResiClientMyDemandResDTO resDto : list) {
//3、查询分类名称
IcResiDemandDictEntity demandDict = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode());
resDto.setCategoryName(null != demandDict ? demandDict.getCategoryName() : StrConstant.EPMETY_STR);
switch (resDto.getServiceType())
{
case UserDemandConstant.PARTY_UNIT:
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
break;
case UserDemandConstant.SOCIAL_ORG:
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
break;
case UserDemandConstant.COMMUNITY_ORG:
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
break;
case UserDemandConstant.VOLUNTEER:
resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
break;
default:
log.warn("serviceType 错误");
break;
if(StringUtils.isNotBlank(resDto.getServiceType())){
switch (resDto.getServiceType())
{
case UserDemandConstant.PARTY_UNIT:
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
break;
case UserDemandConstant.SOCIAL_ORG:
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
break;
case UserDemandConstant.COMMUNITY_ORG:
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
break;
case UserDemandConstant.VOLUNTEER:
resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
break;
default:
log.warn("serviceType 错误");
break;
}
}
}
}
@ -1208,34 +1258,36 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}
//2、志愿者(姓名、手机号
//3、区域化党建单位、社会组织、社区自组织 设置负责人和手机
switch (resDto.getServiceType()) {
case UserDemandConstant.PARTY_UNIT:
Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
break;
case UserDemandConstant.SOCIAL_ORG:
Map<String, IcSocietyOrgEntity> socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
break;
case UserDemandConstant.COMMUNITY_ORG:
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
break;
case UserDemandConstant.VOLUNTEER:
Map<String, UserBaseInfoResultDTO> userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId())));
resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
break;
default:
log.warn("serviceType 错误");
break;
if(StringUtils.isNotBlank(resDto.getServiceType())){
switch (resDto.getServiceType()) {
case UserDemandConstant.PARTY_UNIT:
Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
break;
case UserDemandConstant.SOCIAL_ORG:
Map<String, IcSocietyOrgEntity> socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
break;
case UserDemandConstant.COMMUNITY_ORG:
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
break;
case UserDemandConstant.VOLUNTEER:
Map<String, UserBaseInfoResultDTO> userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId())));
resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
break;
default:
log.warn("serviceType 错误");
break;
}
}
return resDto;
}
@ -1250,6 +1302,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
*/
@Override
public DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO) {
//需求内容走内容审核
textScan(formDTO.getContent());
Date now = new Date();
DemandRecId resultDto = new DemandRecId();
resultDto.setDemandRecId(formDTO.getDemandRecId());
@ -1312,6 +1366,25 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return resultDto;
}
/**
* 需求内容服务评价-完成情况走内容审核
* @param content
*/
private void textScan(String content) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(content);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg());
}
}
}
/**
* 我的需求被抢单->您提出的需求将由青岛亿联科技有限公司为您解决请查看
@ -1359,6 +1432,14 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
} else if (UserDemandConstant.COMMUNITY_ORG.equals(serviceType)) {
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(serverId));
serviceName = MapUtils.isNotEmpty(communityOrgMap) ? communityOrgMap.get(serverId).getOrganizationName() : StrConstant.EPMETY_STR;
}else if(UserDemandConstant.VOLUNTEER.equals(serviceType)){
//如果指派给了志愿者-》您提出的需求将由XX为您解决,请查看
UserResiInfoListFormDTO userResiInfoListFormDTO=new UserResiInfoListFormDTO();
userResiInfoListFormDTO.setUserIdList(Arrays.asList(serverId));
Result<List<UserResiInfoResultDTO>> userRes = epmetUserOpenFeignClient.getUserResiInfoList(userResiInfoListFormDTO);
if(userRes.success()){
serviceName=userRes.getData().get(NumConstant.ZERO).getRealName();
}
}
if (StringUtils.isNotBlank(serviceName)) {
UserMessageFormDTO userMessage = new UserMessageFormDTO();
@ -1443,5 +1524,29 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
messageOpenFeignClient.saveUserMessage(userMessage);
}
}
/**
* 当前用户与需求消息的关系 需求发布人publisher 服务人server
*
* @param formDTO
* @return
*/
@Override
public UserDemandRelResDTO queryUserDemandRel(UserDemandRelFormDTO formDTO) {
UserDemandRelResDTO res = new UserDemandRelResDTO("");
IcUserDemandRecEntity origin = baseDao.selectById(formDTO.getDemandRecId());
if (null != origin && formDTO.getUserId().equals(origin.getDemandUserId())) {
res.setIdentity(UserDemandConstant.DEMAND_PUBLISHER);
return res;
}
IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(formDTO.getDemandRecId());
if (null != serviceEntity && formDTO.getUserId().equals(serviceEntity.getServerId())) {
res.setIdentity(UserDemandConstant.DEMAND_SERVER);
}
return res;
}
}

144
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandSatisfactionServiceImpl.java

@ -0,0 +1,144 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dao.IcUserDemandOperateLogDao;
import com.epmet.dao.IcUserDemandRecDao;
import com.epmet.dao.IcUserDemandSatisfactionDao;
import com.epmet.dao.IcUserDemandServiceDao;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.entity.IcUserDemandOperateLogEntity;
import com.epmet.entity.IcUserDemandSatisfactionEntity;
import com.epmet.entity.IcUserDemandServiceEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandSatisfactionService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
public class IcUserDemandSatisfactionServiceImpl extends BaseServiceImpl<IcUserDemandSatisfactionDao, IcUserDemandSatisfactionEntity> implements IcUserDemandSatisfactionService {
@Autowired
private IcUserDemandRecDao icUserDemandRecDao;
@Autowired
private IcUserDemandOperateLogDao operateLogDao;
@Autowired
private IcUserDemandServiceDao demandServiceDao;
@Autowired
private IcResiDemandDictService demandDictService;
@Autowired
private IcPartyUnitService icPartyUnitService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
*
* @param formDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void evaluateDemandAuto(AutoEvaluateDemandFormDTO formDTO) {
if (null == formDTO.getExceedValue()) {
formDTO.setExceedValue(NumConstant.SEVEN);
formDTO.setType("day");
}
// 查询完成后,超过7天未评价的记录
List<IcUserDemandRecDTO> list=icUserDemandRecDao.selectNoEvaluate(formDTO.getCustomerId(),formDTO.getExceedValue(),formDTO.getType());
if(CollectionUtils.isEmpty(list)){
return;
}
Date nowDate=new Date();
for(IcUserDemandRecDTO demand:list){
//4、返回服务方,志愿者发放积分,区域化党建单位,计算群众满意度
IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(demand.getId());
if(null==serviceEntity){
continue;
}
if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){
ServerSatisfactionCalFormDTO satisfactionCalFormDTO=new ServerSatisfactionCalFormDTO();
satisfactionCalFormDTO.setCustomerId(demand.getCustomerId());
satisfactionCalFormDTO.setServiceType(serviceEntity.getServiceType());
satisfactionCalFormDTO.setServerId(serviceEntity.getServerId());
icPartyUnitService.calPartyUnitSatisfation(satisfactionCalFormDTO);
} else if (UserDemandConstant.VOLUNTEER.equals(serviceEntity.getServiceType()) && null != demand.getAwardPoint() && demand.getAwardPoint() > NumConstant.ZERO) {
List<BasePointEventMsg> actPointEventMsgList = new ArrayList<>();
BasePointEventMsg actPointEventMsg = new BasePointEventMsg();
actPointEventMsg.setCustomerId(demand.getCustomerId());
actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND);
actPointEventMsg.setSourceId(demand.getId());
actPointEventMsg.setUserId(serviceEntity.getServerId());
actPointEventMsg.setActionFlag(MqConstant.PLUS);
actPointEventMsg.setIsCommon(false);
String content = demand.getContent().length() > 100 ? demand.getContent().substring(0, 99) : demand.getContent();
actPointEventMsg.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,demand.getDemandUserName(),content));
actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag());
actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass());
if(StringUtils.isBlank(demand.getParentCode())||NumConstant.ZERO_STR.equals(demand.getParentCode())){
actPointEventMsg.setEventName(demandDictService.getCategoryName(demand.getCustomerId(),demand.getCategoryCode()));
}else{
actPointEventMsg.setEventName(demandDictService.getCategoryName(demand.getCustomerId(),demand.getParentCode()));
}
actPointEventMsg.setObjectId(demand.getCategoryCode());
actPointEventMsg.setPoint(demand.getAwardPoint());
actPointEventMsgList.add(actPointEventMsg);
SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO();
sendMsgForm.setContent(actPointEventMsgList);
sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND);
Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
if (!mqResult.success()) {
log.warn(String.format("需求自动评价志愿者发放积分失败:demandRecId:%s,消息体:%s", demand.getId(), JSON.toJSONString(sendMsgForm)));
continue;
}
}
// 1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity = new IcUserDemandSatisfactionEntity();
satisfactionEntity.setCustomerId(demand.getCustomerId());
satisfactionEntity.setDemandRecId(demand.getId());
satisfactionEntity.setEvaluateTime(nowDate);
satisfactionEntity.setUserType(UserDemandConstant.SYS);
satisfactionEntity.setUserId(Constant.APP_USER_FLAG);
satisfactionEntity.setScore(new BigDecimal(NumConstant.FIVE_STR));
satisfactionEntity.setRemark(UserDemandConstant.DEFAULT_EVALUATE_REMARK);
baseDao.insert(satisfactionEntity);
// 2、插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity = new IcUserDemandOperateLogEntity();
evaluateEntity.setCustomerId(demand.getCustomerId());
evaluateEntity.setDemandRecId(demand.getId());
evaluateEntity.setUserType(UserDemandConstant.SYS);
evaluateEntity.setUserId(Constant.APP_USER_FLAG);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
evaluateEntity.setOperateTime(nowDate);
operateLogDao.insert(evaluateEntity);
// 3、更新主表已评价标识,是否解决标识。
icUserDemandRecDao.evaluate(demand.getId(),UserDemandConstant.RESOLVED);
}
}
}

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.SendMqMsgUtils;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.SystemMessageType;
import com.epmet.dao.VolunteerInfoDao;
import com.epmet.dto.CustomerAgencyDTO;
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.SendVerificationCodeFormDTO;
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.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
@ -196,11 +198,11 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
}
private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){
MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO();
//MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO();
//mq的事件类型
mqBaseMsgDTO.setEventClass(EventEnum.REGISTER_VOLUNTEER.getEventClass());
//mqBaseMsgDTO.setEventClass(EventEnum.REGISTER_VOLUNTEER.getEventClass());
//事件code
mqBaseMsgDTO.setEventTag(EventEnum.REGISTER_VOLUNTEER.getEventTag());
//mqBaseMsgDTO.setEventTag(EventEnum.REGISTER_VOLUNTEER.getEventTag());
List<BasePointEventMsg> actPointEventMsgList=new ArrayList<>();
BasePointEventMsg actPointEventMsg=new BasePointEventMsg();
actPointEventMsg.setCustomerId(formDTO.getCustomerId());
@ -211,8 +213,14 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
actPointEventMsg.setIsCommon(false);
actPointEventMsgList.add(actPointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList));
Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
//mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList));
//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()){
logger.error("志愿者认证事件发送失败");
}

39
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -3,15 +3,16 @@ package com.epmet.service.impl;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.LatestActContentDTO;
import com.epmet.dto.LatestActInfoDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.work.ActPreviewFormDTO;
import com.epmet.dto.form.work.DraftActContentFormDTO;
import com.epmet.dto.form.work.DraftActInfoFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.work.*;
import com.epmet.service.LatestActContentService;
import com.epmet.service.LatestActInfoService;
import com.epmet.service.WorkActDraftService;
import com.epmet.service.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -19,9 +20,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 工作端活动草稿
@ -38,6 +42,15 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
private LatestActInfoService latestActInfoService;
@Autowired
private LatestActContentService latestActContentService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
/**
* 服务事项code
*/
private static final String SERVICE_MATTER_CODE = "1010";
/**
* @return com.epmet.dto.form.work.PublishActInitResultDTO
@ -126,6 +139,20 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
if (null != actContent && actContent.size() > 0) {
actPreviewResultDTO.setActContent(actContent);
}
if (StringUtils.isNotBlank(actPreviewResultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
actPreviewResultDTO.setServiceMatterName(categoryMap.get(actPreviewResultDTO.getServiceMatter()));
}
if (StringUtils.isNotBlank(actPreviewResultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(actPreviewResultDTO.getUnitId());
actPreviewResultDTO.setUnitName(unitDTO.getUnitName());
}
}
return actPreviewResultDTO;
}
@ -258,6 +285,12 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
latestActInfoDTO.setVolunteerLimit(formDTO.getVolunteerLimit());
//审核开关:1报名人员需要人工审核0不需要
latestActInfoDTO.setAuditSwitch(formDTO.getAuditSwitch());
latestActInfoDTO.setActType(formDTO.getActType());
latestActInfoDTO.setUnitId(formDTO.getUnitId());
latestActInfoDTO.setTarget(formDTO.getTarget());
latestActInfoDTO.setServiceMatter(formDTO.getServiceMatter());
return latestActInfoDTO;
}

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

@ -6,9 +6,7 @@ import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
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.RenException;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
@ -17,17 +15,20 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ActConstant;
import com.epmet.constant.ActMessageConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.*;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.ActSponsorResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.work.*;
import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
@ -41,12 +42,10 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
* 描述一下
@ -56,7 +55,7 @@ import java.util.UUID;
*/
@Service
public class WorkActServiceImpl implements WorkActService {
private Logger logger = LogManager.getLogger(WorkActServiceImpl.class);
private final Logger logger = LogManager.getLogger(WorkActServiceImpl.class);
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
@ -97,9 +96,19 @@ public class WorkActServiceImpl implements WorkActService {
private UserKindnessTimeLogDao userKindnessTimeLogDao;
@Autowired
private LatestActInfoDao latestActInfoDao;
@Resource
private IcPartyActivityService icPartyActivityService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
/**
* 服务事项code
*/
private static final String SERVICE_MATTER_CODE = "1010";
/**
* @return void
* @author yinzuomei
* @description 发布活动-删除历史活动草稿
* @Date 2020/7/20 18:15
@ -184,9 +193,55 @@ public class WorkActServiceImpl implements WorkActService {
return publishActResultDTO;
}
@Override
@Transactional(rollbackFor = Exception.class)
public PublishActResultDTO publishActV2(PublishActInfoFormDTO formDTO) {
//构造属性保存活动属性,活动内容
ActInfoEntity actInfoEntity=this.constructActInfo(formDTO);
//校验参数
//校验 活动报名截止时间应该大于当前时间
if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){
throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg());
}
this.checkPublishFormDTO(actInfoEntity);
PublishActResultDTO publishActResultDTO=new PublishActResultDTO();
//内容审核(活动标题、招募要求、活动内容图文)
this.auditAct(formDTO);
logger.info("发布活动,审核成功");
actInfoDao.insert(actInfoEntity);
//如果用户之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
if(StringUtils.isNotBlank(formDTO.getActDraftId())){
logger.info("更新latest_act_info表的act_info_id字段");
latestActInfoDao.updateActInfoId(formDTO.getActDraftId(),actInfoEntity.getId());
}
List<ActContentEntity> actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId());
for(ActContentEntity actContentEntity:actContentEntityList){
actContentDao.insert(actContentEntity);
}
//插入一条操作日志
ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity();
actOperationRecEntity.setActId(actInfoEntity.getId());
actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH);
actOperationRecEntity.setNoticeUser(false);
actOperationRecEntity.setRemark(StrConstant.EPMETY_STR);
actOperationRecDao.insert(actOperationRecEntity);
//删除所有的草稿
this.deleteDraft();
publishActResultDTO.setActId(actInfoEntity.getId());
//添加信息到ic_party_activity
if (ActConstant.PARTY.equals(formDTO.getActType())) {
IcPartyActivityEntity activity = getPartyActivityEntity(formDTO, actInfoEntity);
icPartyActivityService.insert(activity);
}
return publishActResultDTO;
}
/**
* @return void
* @param actInfoEntity
* @author yinzuomei
* @description 第一次发布
@ -209,23 +264,6 @@ public class WorkActServiceImpl implements WorkActService {
}
}
public static void main(String[] args) {
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date yesterDate=format.parse("2020-07-26 13:00:00");
Date today=format.parse("2020-07-27 13:00:00");
Date tommorrow=format.parse("2020-07-28 13:00:00");
Date today1=format.parse("2020-07-27 13:00:00");
System.out.println(yesterDate.compareTo(today));
System.out.println(tommorrow.compareTo(today));
System.out.println(today.compareTo(today1));
} catch (ParseException e) {
e.printStackTrace();
}
}
/**
* @return void
* @param formDTO
@ -720,7 +758,10 @@ public class WorkActServiceImpl implements WorkActService {
if (wxmpMsg.success()) {
logger.info("给审核通过的用户推送微信订阅消息成功");
}
}
//取消活动,删除ic_party_activity对应的活动
icPartyActivityService.deleteByActId(formDTO.getActId());
}
@ -732,7 +773,7 @@ public class WorkActServiceImpl implements WorkActService {
* @Date 2020/7/26 18:00
**/
@Override
public CanceledActDetailResultDTO canceledDetail(String actId) {
public CanceledActDetailResultDTO canceledDetail(String customerId, String actId) {
CanceledActDetailResultDTO canceledActDetailResultDTO=actInfoDao.selectCanceledActInfo(actId);
if(null!=canceledActDetailResultDTO){
canceledActDetailResultDTO.setActContent(actContentDao.selectByActId(actId));
@ -741,6 +782,20 @@ public class WorkActServiceImpl implements WorkActService {
}else{
canceledActDetailResultDTO.setIsMyPublish(false);
}
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter()));
}
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(canceledActDetailResultDTO.getUnitId());
canceledActDetailResultDTO.setUnitName(unitDTO.getUnitName());
}
}
return canceledActDetailResultDTO;
}
@ -785,6 +840,20 @@ public class WorkActServiceImpl implements WorkActService {
}else{
resultDTO.setIsMyPublish(false);
}
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId());
resultDTO.setUnitName(unitDTO.getUnitName());
}
}
return resultDTO;
}
@ -797,7 +866,7 @@ public class WorkActServiceImpl implements WorkActService {
* @Date 2020/7/26 21:34
**/
@Override
public InProgressActDetailResultDTO inProgressDetail(String actId) {
public InProgressActDetailResultDTO inProgressDetail(String customerId, String actId) {
InProgressActDetailResultDTO resultDTO = actInfoDao.selectInProgressDetail(actId);
if (null != resultDTO) {
Date nowDate=new Date();
@ -853,6 +922,19 @@ public class WorkActServiceImpl implements WorkActService {
}else{
resultDTO.setIsMyPublish(false);
}
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId());
resultDTO.setUnitName(unitDTO.getUnitName());
}
}
return resultDTO;
}
@ -917,11 +999,11 @@ public class WorkActServiceImpl implements WorkActService {
String opAgencyId=userResult.getData().getId();
//备注
String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_REMARK,actInfoDTO.getTitle());
MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO();
//MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO();
//mq的事件类型
mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
//mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
//事件code
mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
//mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
List<BasePointEventMsg> basePointEventMsgArrayList=new ArrayList<>();
for(ActUserRelationEntity actUserRelationEntity:actUserRelationEntityList){
BasePointEventMsg basePointEventMsg=new BasePointEventMsg();
@ -937,15 +1019,22 @@ public class WorkActServiceImpl implements WorkActService {
basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId());
basePointEventMsgArrayList.add(basePointEventMsg);
}
mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
//mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
//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.setActId(actInfoDTO.getId());
actGrantPointLogEntity.setCustomerId(actInfoDTO.getCustomerId());
actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId());
actGrantPointLogEntity.setRemark(remark);
actGrantPointLogEntity.setReward(actInfoDTO.getReward());
actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO));
actGrantPointLogEntity.setSendMsg(JSON.toJSONString(systemMsgFormDTO));
actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result));
actGrantPointLogDao.insert(actGrantPointLogEntity);
if(!result.success()){
@ -958,11 +1047,11 @@ public class WorkActServiceImpl implements WorkActService {
//查询当前用户所属组织信息
Result<CustomerAgencyDTO> userResult = govOrgOpenFeignClient.getAgencyByStaff(loginUserUtil.getLoginUserId());
String opAgencyId = userResult.getData().getId();
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
//MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
//mq的事件类型
mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
//mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
//事件code
mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
//mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
List<BasePointEventMsg> basePointEventMsgArrayList = new ArrayList<>();
BasePointEventMsg basePointEventMsg = new BasePointEventMsg();
basePointEventMsg.setOpAgencyId(opAgencyId);
@ -976,9 +1065,16 @@ public class WorkActServiceImpl implements WorkActService {
basePointEventMsg.setSourceId(formDTO.getSourceId());
basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId());
basePointEventMsgArrayList.add(basePointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
logger.info("发送消息入参:"+JSON.toJSON(mqBaseMsgDTO));
Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
//mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
//logger.info("发送消息入参:"+JSON.toJSON(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));
ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity();
actGrantPointLogEntity.setActId(formDTO.getSourceId());
@ -986,7 +1082,7 @@ public class WorkActServiceImpl implements WorkActService {
actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId());
actGrantPointLogEntity.setRemark(formDTO.getRemark());
actGrantPointLogEntity.setReward(formDTO.getReward());
actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO));
actGrantPointLogEntity.setSendMsg(JSON.toJSONString(msgForm));
actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result));
actGrantPointLogDao.insert(actGrantPointLogEntity);
if (!result.success()) {
@ -1084,6 +1180,15 @@ public class WorkActServiceImpl implements WorkActService {
//拒绝发放积分总人数
actStatisticalDTO.setDenyRewardUserNum(actUserRelationDao.selectCountByReward(actId,ActConstant.ACT_USER_STATUS_DENY));
actStatisticalService.save(actStatisticalDTO);
//保存服务人数
IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId);
if (null != dto) {
IcPartyActivityEntity actInfoEntity = new IcPartyActivityEntity();
actInfoEntity.setId(dto.getId());
actInfoEntity.setPeopleCount(actStatisticalDTO.getSignedInUserNum());
icPartyActivityService.updateById(actInfoEntity);
}
}
/**
@ -1177,6 +1282,15 @@ public class WorkActServiceImpl implements WorkActService {
//更新act_info表的SUMMARY_FLAG=true
actInfoDTO.setSummaryFlag(true);
actInfoService.update(actInfoDTO);
//保存活动结果
IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(formDTO.getActId());
if (null != dto) {
IcPartyActivityEntity actInfoEntity = new IcPartyActivityEntity();
actInfoEntity.setId(dto.getId());
actInfoEntity.setResult(getContent(formDTO.getActSummary()));
icPartyActivityService.updateById(actInfoEntity);
}
}
/**
@ -1187,7 +1301,7 @@ public class WorkActServiceImpl implements WorkActService {
* @Date 2020/7/27 13:36
**/
@Override
public ReEditActInfoResultDTO getActInfo(String actId) {
public ReEditActInfoResultDTO getActInfo(String customerId, String actId) {
ActInfoDTO actInfoDTO=actInfoService.get(actId);
if(null==actInfoDTO){
logger.error("act_info is null");
@ -1203,6 +1317,21 @@ public class WorkActServiceImpl implements WorkActService {
resultDTO.setActId(actId);
List<ActPreviewContentResultDTO> actContent=actContentDao.selectByActId(actId);
resultDTO.setActContent(actContent);
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId());
resultDTO.setUnitName(unitDTO.getUnitName());
}
return resultDTO;
}
@ -1264,5 +1393,108 @@ public class WorkActServiceImpl implements WorkActService {
return publishActResultDTO;
}
@Override
@Transactional(rollbackFor = Exception.class)
public PublishActResultDTO rePublishV2(RePublishFormDTO rePublishFormDTO) {
ActInfoDTO originalActInfo=actInfoService.get(rePublishFormDTO.getActId());
if(null==originalActInfo){
logger.error("act_info is null");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
if(!originalActInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
}
if(!ActConstant.ACT_STATUS_PUBLISHED.equals(originalActInfo.getActStatus())){
throw new RenException("只有进行中的活动才可以编辑");
}
//构造属性保存活动属性,活动内容
ActInfoEntity newActInfoEntity=this.constructRePublishActInfo(rePublishFormDTO);
//校验参数
this.checkPublishFormDTO(newActInfoEntity);
PublishActResultDTO publishActResultDTO=new PublishActResultDTO();
//内容审核(活动标题、招募要求、活动内容图文)
this.auditRePublishAct(rePublishFormDTO);
logger.info("重新发布活动,审核成功");
newActInfoEntity.setId(rePublishFormDTO.getActId());
actInfoDao.updateById(newActInfoEntity);
//删除原来的
actContentDao.updateDelFlagByActId(rePublishFormDTO.getActId());
//插入编辑后的活动详情
List<ActContentEntity> actContentEntityList=this.constructActContent(rePublishFormDTO.getActContent(),rePublishFormDTO.getActId());
for(ActContentEntity actContentEntity:actContentEntityList){
actContentDao.insert(actContentEntity);
}
//插入一条操作日志
ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity();
actOperationRecEntity.setActId(rePublishFormDTO.getActId());
actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_UPDATE);
actOperationRecEntity.setNoticeUser(rePublishFormDTO.getNoticePassedPeople());
actOperationRecEntity.setRemark(StrConstant.EPMETY_STR);
actOperationRecDao.insert(actOperationRecEntity);
//删除所有的草稿
this.deleteDraft();
publishActResultDTO.setActId(rePublishFormDTO.getActId());
//发送消息通知-暂时不做了,前端默认串的是不通知
//如果用户在重新发布之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
if(StringUtils.isNotBlank(rePublishFormDTO.getActDraftId())){
latestActInfoDao.updateActInfoId(rePublishFormDTO.getActDraftId(),newActInfoEntity.getId());
}
//添加信息到ic_party_activity
if (ActConstant.PARTY.equals(rePublishFormDTO.getActType())) {
IcPartyActivityDTO activityDTO = icPartyActivityService.getActivityByActId(newActInfoEntity.getId());
if (null != activityDTO) {
IcPartyActivityEntity activity = getPartyActivityEntity(ConvertUtils.sourceToTarget(rePublishFormDTO, PublishActInfoFormDTO.class), newActInfoEntity);
activity.setId(activityDTO.getId());
icPartyActivityService.updateById(activity);
}
}
return publishActResultDTO;
}
/**
* 构建联建活动对象
* @Param formDTO
* @Return {@link IcPartyActivityEntity}
* @Author zhaoqifeng
* @Date 2021/12/23 14:32
*/
private IcPartyActivityEntity getPartyActivityEntity(PublishActInfoFormDTO formDTO, ActInfoEntity actInfoEntity) {
IcPartyActivityEntity entity = new IcPartyActivityEntity();
entity.setCustomerId(actInfoEntity.getCustomerId());
entity.setAgencyId(actInfoEntity.getSponsorId());
Result<CustomerAgencyDTO> result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId());
if(result.success()&&null!=result.getData()){
entity.setPids(result.getData().getPids());
}else{
logger.warn("根据agencyId查询组织信息失败,agencyId={}",formDTO.getSponsorId());
}
entity.setActId(actInfoEntity.getId());
entity.setUnitId(actInfoEntity.getUnitId());
entity.setServiceMatter(actInfoEntity.getServiceMatter());
entity.setTitle(actInfoEntity.getTitle());
entity.setTarget(actInfoEntity.getTarget());
entity.setContent(getContent(formDTO.getActContent()));
entity.setPeopleCount(NumConstant.ZERO);
entity.setActivityTime(actInfoEntity.getActStartTime());
entity.setAddress(actInfoEntity.getActAddress());
entity.setLongitude(actInfoEntity.getActLongitude().toPlainString());
entity.setLatitude(actInfoEntity.getActLatitude().toPlainString());
return entity;
}
private String getContent(List<PublishActContentFormDTO> actContent) {
AtomicReference<String> content = new AtomicReference<>("");
actContent.forEach(i -> {
if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(i.getContentType())) {
content.set(content.get().concat("<p>").concat(i.getContent()).concat("</p>"));
} else {
content.set(content.get().concat("<p>").concat("<img src=\"").concat(i.getContent()).concat("\"/>").concat("</p>"));
}
});
return content.get();
}
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.5__activity.sql

@ -0,0 +1,9 @@
ALTER TABLE `epmet_heart`.`act_info`
ADD COLUMN `ACT_TYPE` varchar(10) NULL COMMENT '活动类型 爱心活动heart 联建活动party' AFTER `CUSTOMER_ID`,
ADD COLUMN `UNIT_ID` varchar(64) NULL COMMENT '联建单位ID' AFTER `ACT_TYPE`,
ADD COLUMN `SERVICE_MATTER` varchar(64) NULL COMMENT '服务事项' AFTER `UNIT_ID`,
ADD COLUMN `TARGET` varchar(100) NULL COMMENT '活动目标' AFTER `TITLE`;
ALTER TABLE `epmet_heart`.`ic_party_activity`
ADD COLUMN `ACT_ID` varchar(64) NULL COMMENT 'act_info表ID' AFTER `PIDS`;

18
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -645,7 +645,11 @@
ai.SIGN_IN_START_TIME as signInStartTime,
ai.SIGN_IN_END_TIME as signInEndTime,
ai.SIGN_IN_ADDRESS as signInAddress,
ai.SIGN_IN_RADIUS as signInRadius
ai.SIGN_IN_RADIUS as signInRadius,
ai.ACT_TYPE,
ai.UNIT_ID,
ai.SERVICE_MATTER,
ai.TARGET
FROM
act_info ai
WHERE
@ -678,7 +682,11 @@
ai.SIGN_IN_START_TIME as signInStartTime,
ai.SIGN_IN_END_TIME as signInEndTime,
ai.SIGN_IN_ADDRESS as signInAddress,
ai.SIGN_IN_RADIUS as signInRadius
ai.SIGN_IN_RADIUS as signInRadius,
ai.ACT_TYPE,
ai.UNIT_ID,
ai.SERVICE_MATTER,
ai.TARGET
FROM
act_info ai
WHERE
@ -717,7 +725,11 @@
ai.SIGN_IN_START_TIME as signInStartTime,
ai.SIGN_IN_END_TIME as signInEndTime,
ai.SIGN_IN_ADDRESS as signInAddress,
ai.SIGN_IN_RADIUS as signInRadius
ai.SIGN_IN_RADIUS as signInRadius,
ai.ACT_TYPE,
ai.UNIT_ID,
ai.SERVICE_MATTER,
ai.TARGET
FROM
act_info ai
WHERE

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

@ -259,7 +259,7 @@
<!-- 查询分类信息,限制未被禁用的 -->
<select id="selectListByCodes" parameterType="map" resultType="com.epmet.dto.result.demand.DemandCategoryResDTO">
select
ID,
ID as categoryId,
CATEGORY_CODE,
PARENT_CODE,
CATEGORY_NAME,

53
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -207,7 +207,11 @@
END
) as epmetUserId,
r.AWARD_POINT as awardPoint,
concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress
concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress,
r.SERVICE_LOCATION,
r.LOCATION_DETAIL,
r.LONGITUDE,
r.LATITUDE
FROM
ic_user_demand_rec r
left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )
@ -253,7 +257,7 @@
) as serviceName,
s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime,
IFNULL(s.remark,'') as finishDesc,
IFNULL(sa.remark,'') as finishDesc,
'' AS serviceShowName,
s.id as serviceId,
(
@ -393,7 +397,8 @@
</select>
<select id="selectGroupByPartyUnit" parameterType="map" resultType="com.epmet.dto.result.demand.ServiceStatDTO">
<!-- 服务评价后 ,计算服务方(区域化党建单位、社会组织、社区自组织)群众满意度 -->
<select id="selectGroupByServer" parameterType="map" resultType="com.epmet.dto.result.demand.ServiceStatDTO">
SELECT
S.SERVER_ID AS serverId,
SUM( M.SCORE ) AS totalScore,
@ -407,9 +412,9 @@
AND r.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND r.`STATUS` = 'finished'
and s.SERVICE_TYPE ='party_unit'
<if test="null !=partyUnitId and partyUnitId!='' ">
and s.server_id=#{partyUnitId}
and s.SERVICE_TYPE=#{serviceType}
<if test="null !=serverId and serverId!='' ">
and s.server_id=#{serverId}
</if>
group by s.SERVER_ID
</select>
@ -476,7 +481,7 @@
WHERE
r.DEL_FLAG = '0'
AND r.GRID_ID = #{gridId}
AND R.DEMAND_USER_ID !=#{demandUserId}
AND R.DEMAND_USER_ID =#{demandUserId}
<if test="null !=type and type =='unprocessed' ">
AND r.`STATUS` = 'pending'
</if>
@ -491,4 +496,38 @@
</if>
order by r.WANT_SERVICE_TIME asc
</select>
<select id="selectNoEvaluate" resultType="com.epmet.dto.IcUserDemandRecDTO">
SELECT
r.*,
s.SERVER_ID,
s.SERVICE_TYPE
FROM
ic_user_demand_rec r
INNER JOIN ic_user_demand_service s ON ( r.id = s.demand_rec_id )
WHERE
r.DEL_FLAG = '0'
AND r.`STATUS` = 'finished'
AND r.EVALUATE_FLAG = '0'
and s.SERVICE_START_TIME is not NULL
and s.SERVICE_END_TIME is not null
<if test="null !=type and type =='day' ">
and timestampdiff(day,s.UPDATED_TIME,now()) &gt; #{exceedValue}
</if>
<if test="null !=type and type =='minute' ">
and timestampdiff(MINUTE,s.UPDATED_TIME,now()) &gt; #{exceedValue}
</if>
<if test="null !=customerId and customerId !='' ">
AND r.customer_id =#{customerId}
</if>
</select>
<!-- 更新主表为已评价, 是否解决 -->
<update id="evaluate" parameterType="map">
update ic_user_demand_rec
set EVALUATE_FLAG='1',
FINISH_RESULT=#{finishResult},
UPDATED_TIME=NOW()
where id=#{demandRecId}
</update>
</mapper>

6
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml

@ -113,7 +113,11 @@
lai.REQUIREMENT AS requirement,
lai.SPONSOR_NAME AS sponsorName,
lai.SPONSOR_CONTACTS AS sponsorContacts,
lai.SPONSOR_TEL AS sponsorTel
lai.SPONSOR_TEL AS sponsorTel,
lai.ACT_TYPE,
lai.UNIT_ID,
lai.SERVICE_MATTER,
lai.TARGET
FROM
latest_act_info lai
WHERE

6
epmet-module/epmet-job/epmet-job-server/pom.xml

@ -90,6 +90,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

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

@ -0,0 +1,31 @@
package com.epmet.task;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author yinzuomei
* @dscription 每天晚上23:50执行需求已完成未评分的自动评分=发放积分计算满意度
*/
@Slf4j
@Component("autoEvaluateDemandTask")
public class AutoEvaluateDemandTask implements ITask {
@Autowired
private EpmetHeartOpenFeignClient heartOpenFeignClient;
@Override
public void run(String params) {
AutoEvaluateDemandFormDTO formDTO = new AutoEvaluateDemandFormDTO();
if (StringUtils.isNotBlank(params)) {
formDTO = JSON.parseObject(params, AutoEvaluateDemandFormDTO.class);
}
Result result = heartOpenFeignClient.AutoEvaluateDemand(formDTO);
}
}

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

@ -104,4 +104,54 @@ public interface SystemMessageType {
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度
*/
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";
/**
* 话题被转为议题(小组中发布的话题被组长转为议题)
*/
String TOPIC_TO_ISSUE = "topic_to_issue";
/**
* 对小组内话题进行15字以上评论
*/
String PARTICIPATE_ONE_TOPIC = "participate_one_topic";
/**
* 转话题为议题(将自建小组中话题转为议题)
*/
String SHIFT_TOPIC_TO_ISSUE = "shift_topic_to_issue";
/**
* 话题被转为项目
*/
String TOPIC_TO_PROJECT = "topic_to_project";
/**
* 组长解决组内话题
*/
String LEADER_RESOLVE_TOPIC = "leader_resolve_topic";
/**
* 完成用户需求需求人提交评价
*/
String FINISH_USER_DEMAND="finish_user_demand";
}

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 })
private Object content;
@NotNull(message = "pendingMsgLabel不能为空", groups = { AckMsgByMQ.class })
private String pendingMsgLabel;
//@NotNull(message = "pendingMsgLabel不能为空", groups = { AckMsgByMQ.class })
//private String pendingMsgLabel;
}

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

@ -193,7 +193,26 @@ public class SystemMessageServiceImpl implements SystemMessageService {
topic = TopicConstants.IC_RESI_USER;
break;
case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION:
topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION;
topic=TopicConstants.USER_DEMAND;
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;
//社区服务相关积分
case SystemMessageType.FINISH_USER_DEMAND:
topic=TopicConstants.COMMUNITY_SERVICE;
break;
}
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.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>
</profile>
<profile>
@ -210,6 +214,10 @@
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<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>
</profile>
<profile>
@ -253,6 +261,10 @@
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.10.161:9876</rocketmq.nameserver>
</properties>
</profile>
<profile>
@ -296,6 +308,10 @@
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c</dingTalk.robot.webHook>
<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>
</profile>
</profiles>

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

@ -0,0 +1,28 @@
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));
register(consumerProperties, ConsomerGroupConstants.COMMUNITY_SERVICE_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.COMMUNITY_SERVICE, "*", new PointListener(userPointActionLogService));
// ...其他监听器类似
}
}

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

@ -0,0 +1,243 @@
package com.epmet.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
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.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.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 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;
case SystemMessageType.FINISH_USER_DEMAND:
//给需求服务方(志愿者)发放积分
grantServerPoint(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);
});
}
/**
* 需求完成给志愿者发放积分
* @param msg
*/
private void grantServerPoint(String msg) {
List<BasePointEventMsg> formDTO = JSON.parseArray(msg, BasePointEventMsg.class);
userPointActionLogService.grantServerPoint(formDTO);
}
/**
* @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);
}
}

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

@ -119,6 +119,12 @@ public interface UserPointActionLogService extends BaseService<UserPointActionLo
**/
void grantPoint(List<SendPointFormDTO> grantPointParam);
/**
* 需求完成-志愿者发放积分
* @param grantPointParam
*/
void grantServerPoint(List<BasePointEventMsg> grantPointParam);
/**
* @Description 通过事件推送进行积分加减
* @param event

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

@ -578,4 +578,59 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectPageResiPoin(formDTO));
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
/**
* 需求完成给志愿者发放积分
* @param list
*/
@Override
public void grantServerPoint(List<BasePointEventMsg> list){
if (CollectionUtils.isEmpty(list)){
return;
}
list.forEach(grantPoint->{
if (null != grantPoint.getPoint()) {
//1.新增用户积分行为记录
UserPointActionLogEntity action = new UserPointActionLogEntity();
action.setCustomerId(grantPoint.getCustomerId());
action.setBizType("community_service");
action.setPoint(grantPoint.getPoint());
//完成了XXX的需求
action.setEventStatement(grantPoint.getRemark());
//需求分类表中一级分类的名称
action.setEventId(EventEnum.FINISH_USER_DEMAND.getEventTag());
action.setActionFlag(grantPoint.getActionFlag());
action.setUserId(grantPoint.getUserId());
action.setCreatedBy(grantPoint.getOperatorId());
action.setUpdatedBy(grantPoint.getOperatorId());
action.setSourceType(grantPoint.getSourceType());
action.setSourceId(grantPoint.getSourceId());
// 需求所属分类编码,对应objectId
action.setObjectId(grantPoint.getObjectId());
//需求所属分类-一级分类名称
action.setEventName(grantPoint.getEventName());
baseDao.insert(action);
//2.新增/修改用户积分日统计
DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date());
UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal, UserPointStatisticalDailyEntity.class);
statistical.setPointChange(grantPoint.getPoint());
statistical.setActionFlag(grantPoint.getActionFlag());
statistical.setCustomerId(grantPoint.getCustomerId());
statistical.setUserId(grantPoint.getUserId());
statistical.setCreatedBy(grantPoint.getOperatorId());
statistical.setUpdatedBy(grantPoint.getOperatorId());
userPointStatisticalDailyService.insertOrUpdate(statistical);
//3.新增/修改用户积分日统计
UserPointTotalEntity point = new UserPointTotalEntity();
point.setCustomerId(grantPoint.getCustomerId());
point.setUserId(grantPoint.getUserId());
point.setTotalPoint(grantPoint.getPoint());
point.setUsablePoint(grantPoint.getPoint());
point.setUsedPoint(NumConstant.ZERO);
point.setCreatedBy(grantPoint.getOperatorId());
point.setUpdatedBy(grantPoint.getOperatorId());
userPointTotalService.insertOrUpdate(point);
}
});
}
}

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

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

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordMiniFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/24 10:38 上午
* @DESC
*/
@Data
public class AppointmentRecordMiniFormDTO implements Serializable {
private static final long serialVersionUID = -2963684994195809536L;
public interface AppointmentRecordMiniForm{}
@NotBlank(message = "gridId不能为空",groups = AppointmentRecordMiniForm.class)
private String gridId;
}

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterDetailFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/28 5:05 下午
* @DESC
*/
@Data
public class PartyServiceCenterDetailFormDTO implements Serializable {
private static final long serialVersionUID = 8849427528238500433L;
public interface PartyServiceCenterDetailForm{}
@NotBlank(message = "partyServiceCenterId不能为空",groups = PartyServiceCenterDetailForm.class)
private String partyServiceCenterId;
}

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java

@ -47,6 +47,8 @@ public class AppointmentRecordResultDTO implements Serializable {
*/
private List<String> appointmentTime;
private String appointmentDate;
@JsonIgnore
private String timeId;
@ -58,5 +60,6 @@ public class AppointmentRecordResultDTO implements Serializable {
this.remark = "";
this.appointmentTime = new ArrayList<>();
this.recordId = "";
this.appointmentDate = "";
}
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java

@ -34,9 +34,13 @@ public class GridBaseInfoResultDTO implements Serializable {
*/
private String code = "";
/**
* 编码
* 网格类型 字典表value值
*/
private String gridType = "";
/**
* 网格类型 字典表label值
*/
private String gridTypeName = "";
/**
* 负责人
*/

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java

@ -70,9 +70,13 @@ public class GridDetailResultDTO implements Serializable {
*/
private String code = "";
/**
* 网格类型
* 网格类型 字典表value值
*/
private String gridType = "";
/**
* 网格类型 字典表label值
*/
private String gridTypeName = "";
/**
* 负责人
*/

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

Loading…
Cancel
Save