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-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..fb0ac6327a 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,19 @@ 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; } 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..97e013eafc 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,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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; @@ -191,9 +191,10 @@ 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); 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..1cc774248f 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,7 +1,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.constant.NumConstant; @@ -122,9 +122,10 @@ 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); @@ -132,6 +133,7 @@ public class ResiDemandController { } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) { // todo // 志愿者发放积分 + } return new Result(); } 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/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/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/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..8d17d2f3c7 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 @@ -906,15 +906,16 @@ 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); } 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 244dd6f2cc..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,7 +15,10 @@ 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.*; @@ -843,7 +844,7 @@ public class WorkActServiceImpl implements WorkActService { if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { //获取服务事项 SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(customerId); + 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())); @@ -924,7 +925,7 @@ public class WorkActServiceImpl implements WorkActService { if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { //获取服务事项 SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(formDTO.getCustomerId()); + 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())); 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-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 4418c1ebde..660693f986 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 @@ -129,14 +129,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"; /** * 转话题为议题(将自建小组中话题转为议题) */ @@ -149,4 +149,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 83b6c23e7e..4f668a3c5a 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 @@ -193,7 +193,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: @@ -210,6 +210,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; } return topic; }