diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index 67bfc91273..9bbd564ea2 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/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"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index bf0c23abab..f4c2d45e89 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/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"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java deleted file mode 100644 index bfaf63703a..0000000000 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java +++ /dev/null @@ -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; -} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ServerSatisfactionCalFormDTO.java new file mode 100644 index 0000000000..998d1523cb --- /dev/null +++ b/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; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java index 8ccaba98b4..8d458c4a60 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java +++ b/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"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java index 9235fe77a7..ff2849d331 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java +++ b/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; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java index 44d229ec3b..3cccd74d7a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java +++ b/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; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java index a8c770f8e9..81edd97c20 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java +++ b/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 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java index 0d0824fdfd..e73c466837 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java +++ b/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; + /** * 乐观锁 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java index 632b567c11..4ba08831e9 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java index 57166c22f1..78bd1a6cd5 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java index 1d128594ff..f00ebe792f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java +++ b/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; + } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java index fae068b230..ef1f3c3e19 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java index dfd1aeed99..b093e9dcba 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java index db0bff7f8d..53ae15ba01 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java index eb6f07693c..5e3df9d139 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java +++ b/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 actContent; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + private String unitName; + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + private String serviceMatterName; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java index 3a19c7d4d4..3da7fade52 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java index e96026f842..3e4bfbdc9a 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java index cd2518f840..8dc4ad2fb2 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java index 7906c364d5..c4a250df92 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java +++ b/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 actContent; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType = "heart"; + + /** + * 联建单位 + */ + private String unitId; + + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java index 80f668afae..a360fd53c3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java +++ b/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 actContent; + + /** + * 活动类型爱心活动heart 联建活动party + */ + private String actType; + + /** + * 联建单位 + */ + private String unitId; + private String unitName; + /** + * 活动目标 + */ + private String target; + + /** + * 服务事项 + */ + private String serviceMatter; + private String serviceMatterName; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java index c5387c8ce4..9855cee625 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java +++ b/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"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java index 9b4cf5ee00..4a78599455 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java +++ b/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的需求"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 27f193b978..5aaf4863fb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/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(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 31c250bc83..2aec455511 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/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 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(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java index 329d03d55e..f870444ee9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java +++ b/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 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(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index fb0a64e4dc..1383924f57 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/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().ok(workActService.publishAct(formDTO)); } + @PostMapping("publishV2") + public Result 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().ok(workActService.publishActV2(formDTO)); + } + /** * @return com.epmet.commons.tools.utils.Result * @param formDTO @@ -130,9 +150,9 @@ public class WorkActController { * @Date 2020/7/26 18:00 **/ @PostMapping("canceleddetail") - public Result canceledDetail(@RequestBody ActIdFormDTO actIdFormDTO) { + public Result canceledDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO actIdFormDTO) { ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); - return new Result().ok(workActService.canceledDetail(actIdFormDTO.getActId())); + return new Result().ok(workActService.canceledDetail(tokenDto.getCustomerId(), actIdFormDTO.getActId())); } /** @@ -158,8 +178,9 @@ public class WorkActController { * @Date 2020/7/26 21:01 **/ @PostMapping("finisheddetail") - public Result finishedDeatil(@RequestBody ActIdFormDTO formDTO) { + public Result finishedDeatil(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(workActService.finishedDeatil(formDTO)); } @@ -171,9 +192,10 @@ public class WorkActController { * @Date 2020/7/26 21:33 **/ @PostMapping("inprogressdetail") - public Result inProgressDetail(@RequestBody ActIdFormDTO formDTO) { + public Result inProgressDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); - return new Result().ok(workActService.inProgressDetail(formDTO.getActId())); + + return new Result().ok(workActService.inProgressDetail(tokenDto.getCustomerId(), formDTO.getActId())); } /** @@ -229,9 +251,9 @@ public class WorkActController { * @Date 2020/7/27 13:36 **/ @PostMapping("getactinfo") - public Result getActInfo(@RequestBody ActIdFormDTO formDTO){ + public Result getActInfo(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); - return new Result().ok(workActService.getActInfo(formDTO.getActId())); + return new Result().ok(workActService.getActInfo(tokenDto.getCustomerId(), formDTO.getActId())); } /** @@ -253,5 +275,21 @@ public class WorkActController { return new Result().ok(workActService.rePublish(rePublishFormDTO)); } + @PostMapping("republishV2") + public Result 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().ok(workActService.rePublishV2(rePublishFormDTO)); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index 2ba049bd30..f03ece8c19 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -85,7 +85,9 @@ public interface IcUserDemandRecDao extends BaseDao { @Param("startDateId") String startDateId, @Param("endDateId") String endDateId); - List selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId); + List selectGroupByServer(@Param("customerId") String customerId, + @Param("serverId") String serverId, + @Param("serviceType") String serviceType); /** * 居民端-需求大厅(未处理、处理中、已完成) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java index e227b29ed5..191e639b24 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java +++ b/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; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java index 529bb4f34a..4919fdd133 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java +++ b/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 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java index 706cf0668b..491ed210f8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java index 3f599eefc0..2278c905e7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java +++ b/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()); // ...其他监听器类似 } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/ServerSatisfactionCalEventListener.java similarity index 77% rename from epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java rename to epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/ServerSatisfactionCalEventListener.java index b7c3abc938..606a3801c3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java +++ b/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)); } } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java index c3931bbd0b..c36db9b2d6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java @@ -117,4 +117,22 @@ public interface IcPartyActivityService extends BaseService 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); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index 16a96f8194..5108fb6dbc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java +++ b/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 { * 计算区域化党建单位的群众满意度 * @param formDTO */ - void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO); + void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO); List queryListById(List partyUnitIds); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index e912a301db..63cd2daf50 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -141,10 +141,11 @@ public interface IcUserDemandRecService extends BaseService groupByPartyUnit(String customerId, String partyUnitId); + List groupByServer(String customerId, String serverId,String serviceType); /** * 居民端-需求大厅(未处理、处理中、已完成) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index bc72cc7d67..d470f3571f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/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); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 4057d1ba41..045b9564cc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/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(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 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 wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyActivityEntity::getActId, actId); + baseDao.delete(wrapper); + } + /** * 近30天开始时间和结束时间 (精确到秒) * @Param formDTO diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 4141ceb9b6..43c0cd8bb0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/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 list = icUserDemandRecService.groupByPartyUnit(formDTO.getCustomerId(), formDTO.getPartyUnitId()); + List 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); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 8f99ed7e9b..2233765ddc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/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 groupByPartyUnit(String customerId, String partyUnitId) { - if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(partyUnitId)){ + public List 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 0) { actPreviewResultDTO.setActContent(actContent); } + + if (StringUtils.isNotBlank(actPreviewResultDTO.getServiceMatter())) { + //获取服务事项 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(formDTO.getCustomerId()); + codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); + Map 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; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index c1fcd18a57..a54b43cce2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/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 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 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 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 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 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 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 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 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 actContent) { + AtomicReference content = new AtomicReference<>(""); + actContent.forEach(i -> { + if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(i.getContentType())) { + content.set(content.get().concat("

").concat(i.getContent()).concat("

")); + } else { + content.set(content.get().concat("

").concat("").concat("

")); + } + }); + return content.get(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 4ce15b04c7..796fe5cd93 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/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 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 6b8e7cf980..96eba189bf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -397,7 +397,8 @@ - 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' - - and s.server_id=#{partyUnitId} + and s.SERVICE_TYPE='#{serviceType} + + and s.server_id=#{serverId} group by s.SERVER_ID diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml index f0904b26a4..67f4cb64a7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml +++ b/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 diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java index 97509bfebe..2e92d98dbd 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java +++ b/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"; } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java index 80ded0a697..77fe52d141 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java +++ b/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); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java index 28b4ea9087..500f4bb632 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java +++ b/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)); // ...其他监听器类似 } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java index d6bc028d24..63b4c44e2b 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/mq/listener/PointListener.java +++ b/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 formDTO = JSON.parseArray(msg, BasePointEventMsg.class); + userPointActionLogService.grantServerPoint(formDTO); + } /** * @description diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java index b156816c80..360edcb9cb 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java @@ -119,6 +119,12 @@ public interface UserPointActionLogService extends BaseService grantPointParam); + /** + * 需求完成-志愿者发放积分 + * @param grantPointParam + */ + void grantServerPoint(List grantPointParam); + /** * @Description 通过事件推送进行积分加减 * @param event diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java index 45bbb65790..4ede07c03d 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java +++ b/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 baseDao.selectPageResiPoin(formDTO)); return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); } + + /** + * 需求完成,给志愿者发放积分 + * @param list + */ + @Override + public void grantServerPoint(List 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); + }); + } } \ No newline at end of file