| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -124,39 +124,41 @@ public class ResiDemandController { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        formDTO.setApp(tokenDto.getApp()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            mqMsg.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            mqMsg.setServerId(finishResultDTO.getServerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            mqMsg.setServiceType(finishResultDTO.getServiceType()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            SystemMsgFormDTO form = new SystemMsgFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            form.setContent(mqMsg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 志愿者发放积分
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<BasePointEventMsg> actPointEventMsgList = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            BasePointEventMsg actPointEventMsg = new BasePointEventMsg(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setSourceId(formDTO.getDemandRecId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setUserId(finishResultDTO.getServerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setActionFlag(MqConstant.PLUS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setIsCommon(false); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setRemark(finishResultDTO.getRemark()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsg.setPoint(finishResultDTO.getAwardPoint()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            actPointEventMsgList.add(actPointEventMsg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            sendMsgForm.setContent(actPointEventMsgList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!mqResult.success()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.error(String.format("需求评价完成:demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(finishResultDTO.getEvaluateFlag()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ServerSatisfactionCalFormDTO mqMsg = new ServerSatisfactionCalFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                mqMsg.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                mqMsg.setServerId(finishResultDTO.getServerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                mqMsg.setServiceType(finishResultDTO.getServiceType()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                SystemMsgFormDTO form = new SystemMsgFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                form.setContent(mqMsg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && null != finishResultDTO.getAwardPoint() && finishResultDTO.getAwardPoint() > NumConstant.ZERO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                // 志愿者发放积分
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<BasePointEventMsg> actPointEventMsgList = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                BasePointEventMsg actPointEventMsg = new BasePointEventMsg(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setSourceId(formDTO.getDemandRecId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setUserId(finishResultDTO.getServerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setActionFlag(MqConstant.PLUS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setIsCommon(false); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setRemark(finishResultDTO.getRemark()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsg.setPoint(finishResultDTO.getAwardPoint()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                actPointEventMsgList.add(actPointEventMsg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                sendMsgForm.setContent(actPointEventMsgList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (!mqResult.success()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.error(String.format("需求评价完成:demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new Result(); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -242,4 +244,15 @@ public class ResiDemandController { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ValidatorUtils.validateEntity(formDTO, UserDemandRelFormDTO.AddInternalGroup.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new Result<UserDemandRelResDTO>().ok(icUserDemandRecService.queryUserDemandRel(formDTO)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 服务方填写实际服务时间,并点击确认后。 7天内需求人未作出评价,默认完成情况为已完成,五星好评,为服务方发放积分 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @return | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @PostMapping("autoevaluate") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public Result autoEvaluate(){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        icUserDemandRecService.autoEvaluate(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new Result(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					
  |