Browse Source

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

# Conflicts:
#	epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
dev
yinzuomei 4 years ago
parent
commit
3e88c025c0
  1. 7
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  2. 10
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
  3. 19
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java
  4. 28
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java
  5. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java
  6. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java
  7. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java
  8. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
  9. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
  10. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java
  11. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java
  12. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
  13. 25
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
  14. 25
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
  15. 18
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
  16. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java
  17. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java
  18. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java
  19. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java
  20. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java
  21. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java
  22. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java
  23. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
  24. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  25. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  26. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  27. 52
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  28. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  29. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java
  30. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java
  31. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java
  32. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
  33. 32
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/ServerSatisfactionCalEventListener.java
  34. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
  35. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  36. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  37. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
  38. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  39. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  40. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  41. 39
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  42. 284
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  43. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  44. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  45. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml
  46. 13
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  47. 6
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
  48. 1
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
  49. 17
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java
  50. 6
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
  51. 65
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java

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

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

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

@ -55,9 +55,10 @@ 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";
/**
* 爱心互助
@ -68,4 +69,9 @@ public interface TopicConstants {
* 楼院小组
*/
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/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;

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
*/

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;
/**
* 乐观锁
*/

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

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

@ -6,12 +6,26 @@ 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;
/**
* 完成了XXX的需求
*/
private String remark;
private String firstCategoryName;
private String categoryCode;
}

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-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";
}

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

@ -76,4 +76,6 @@ public interface UserDemandConstant {
String DEMAND_PUBLISHER="publisher";
String DEMAND_SERVER="server";
String GRANT_POINT_REMARK="完成了%s的需求";
}

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();
}

33
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;
@ -191,16 +195,37 @@ public class IcUserDemandRecController {
FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setPartyUnitId(finishResultDTO.getServerId());
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()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// todo
// 志愿者发放积分
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());
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();
}

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

@ -1,11 +1,14 @@
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.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;
@ -24,6 +27,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;
@ -122,16 +126,37 @@ public class ResiDemandController {
FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) {
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setPartyUnitId(finishResultDTO.getServerId());
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()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// todo
// 志愿者发放积分
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());
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();
}

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));
}
}

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

@ -85,7 +85,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);
/**
* 居民端-需求大厅未处理处理中已完成

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
*/

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);
}

5
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);
/**
* 居民端-需求大厅未处理处理中已完成

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);
}

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

7
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);

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

@ -451,6 +451,13 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
finishResultDTO.setCategoryCode(entity.getCategoryCode());
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()));
}
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName()));
// 5、如果是居民端用户提出的需求,发消息:您提出的需求已完成,请进行服务评价。
sendDemandUserFinished(entity);
return finishResultDTO;
@ -906,15 +913,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);
}
@ -1072,6 +1080,12 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
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()));
}
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName()));
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自XXX(需求人姓名)的评价,请查看。
sendVolunnterEvaluated(entity);
return finishResultDTO;

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

284
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,15 +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.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;
@ -39,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;
/**
* 描述一下
@ -54,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}")
@ -95,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
@ -182,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 第一次发布
@ -207,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
@ -718,7 +758,10 @@ public class WorkActServiceImpl implements WorkActService {
if (wxmpMsg.success()) {
logger.info("给审核通过的用户推送微信订阅消息成功");
}
}
//取消活动,删除ic_party_activity对应的活动
icPartyActivityService.deleteByActId(formDTO.getActId());
}
@ -730,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));
@ -739,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;
}
@ -783,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;
}
@ -795,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();
@ -851,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;
}
@ -1096,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);
}
}
/**
@ -1189,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);
}
}
/**
@ -1199,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");
@ -1215,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;
}
@ -1276,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();
}
}

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

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

@ -397,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,
@ -411,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>

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

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

@ -134,14 +134,14 @@ public interface SystemMessageType {
* 发布话题
*/
String PUBLISH_ONE_TOPIC = "publish_one_topic";
/**
* 对小组内话题进行15字以上评论
*/
String PARTICIPATE_ONE_TOPIC = "participate_one_topic";
/**
* 话题被转为议题(小组中发布的话题被组长转为议题)
*/
String TOPIC_TO_ISSUE = "topic_to_issue";
/**
* 对小组内话题进行15字以上评论
*/
String PARTICIPATE_ONE_TOPIC = "participate_one_topic";
/**
* 转话题为议题(将自建小组中话题转为议题)
*/
@ -154,4 +154,9 @@ public interface SystemMessageType {
* 组长解决组内话题
*/
String LEADER_RESOLVE_TOPIC = "leader_resolve_topic";
/**
* 完成用户需求需求人提交评价
*/
String FINISH_USER_DEMAND="finish_user_demand";
}

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

@ -209,7 +209,7 @@ 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:
@ -226,6 +226,10 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.ACTIVE_INSERT_LIVE:
topic = TopicConstants.EPMET_HEART;
break;
//社区服务相关积分
case SystemMessageType.FINISH_USER_DEMAND:
topic=TopicConstants.COMMUNITY_SERVICE;
break;
default:
logger.error("getTopicByMsgType msgType:{} is not support for any topic", msgType);
}

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

@ -21,6 +21,7 @@ public class RocketMQConsumerRegister extends MQAbstractRegister {
// 客户初始化监听器注册
register(consumerProperties, ConsomerGroupConstants.RESI_GROUP_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.RESI_GROUP, "*", new PointListener(userPointActionLogService));
register(consumerProperties, ConsomerGroupConstants.EPMET_HEART_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.EPMET_HEART, "*", new PointListener(userPointActionLogService));
register(consumerProperties, ConsomerGroupConstants.COMMUNITY_SERVICE_POINT_OPERATION_GROUP, MessageModel.CLUSTERING, TopicConstants.COMMUNITY_SERVICE, "*", new PointListener(userPointActionLogService));
// ...其他监听器类似
}

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

@ -2,16 +2,13 @@ package com.epmet.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.service.UserPointActionLogService;
@ -23,8 +20,6 @@ import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.common.message.MessageExt;
import org.redisson.api.RLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.concurrent.TimeUnit;
@ -114,6 +109,10 @@ public class PointListener implements MessageListenerConcurrently {
case SystemMessageType.LEADER_RESOLVE_TOPIC:
leaderResolveTopic(msg);
break;
case SystemMessageType.FINISH_USER_DEMAND:
//给需求服务方(志愿者)发放积分
grantServerPoint(msg);
break;
}
} catch (RenException e) {
@ -219,6 +218,14 @@ public class PointListener implements MessageListenerConcurrently {
});
}
/**
* 需求完成给志愿者发放积分
* @param msg
*/
private void grantServerPoint(String msg) {
List<BasePointEventMsg> formDTO = JSON.parseArray(msg, BasePointEventMsg.class);
userPointActionLogService.grantServerPoint(formDTO);
}
/**
* @description

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

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

@ -578,4 +578,69 @@ 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(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,grantPoint.getActionFlag())){
//减
if(grantPoint.getPoint() > NumConstant.ZERO){
//保证负数
grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG);
}
}else{
//加
if(grantPoint.getPoint() < NumConstant.ZERO){
//保证正数
grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG);
}
}
//1.新增用户积分行为记录
UserPointActionLogEntity action = new UserPointActionLogEntity();
action.setCustomerId(grantPoint.getCustomerId());
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);
});
}
}
Loading…
Cancel
Save