| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -27,10 +27,15 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.enums.DictTypeEnum; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.EpmetException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.scan.param.TextScanParamDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.scan.param.TextTaskDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.scan.result.SyncScanResult; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ScanContentUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.ReadFlagConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.UserDemandConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.UserMessageTypeConstant; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -56,6 +61,7 @@ import org.apache.commons.collections4.CollectionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.collections4.MapUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Value; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.transaction.annotation.Transactional; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -96,6 +102,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcCommunitySelfOrganizationService communitySelfOrganizationService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private EpmetMessageOpenFeignClient messageOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Value("${openapi.scan.server.url}") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private String scanApiUrl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Value("${openapi.scan.method.textSyncScan}") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private String textSyncScanMethod; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public IcUserDemandRecDTO get(String id) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1028,19 +1038,27 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // todo 只有需求人才可以评价
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //用户输入的完成情况,走内容审核
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        textScan(formDTO.getFinishDesc()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //当前操作用户是工作端用户还是居民端用户
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String userType = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (AppClientConstant.APP_GOV.equals(formDTO.getApp())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            userType = UserDemandConstant.STAFF; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else if (AppClientConstant.APP_RESI.equals(formDTO.getApp())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            userType = UserDemandConstant.RESI; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 1、插入评价得分记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcUserDemandSatisfactionEntity satisfactionEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandSatisfactionEntity.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        satisfactionEntity.setEvaluateTime(new Date()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        satisfactionEntity.setUserType(UserDemandConstant.RESI); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        satisfactionEntity.setUserType(userType); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        satisfactionEntity.setRemark(formDTO.getFinishDesc()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        demandSatisfactionDao.insert(satisfactionEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 2、插入评价操作日志
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandOperateLogEntity.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        evaluateEntity.setActionCode(UserDemandConstant.EVALUATE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        evaluateEntity.setOperateTime(satisfactionEntity.getEvaluateTime()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        evaluateEntity.setUserType(UserDemandConstant.RESI); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        evaluateEntity.setUserType(userType); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        operateLogDao.insert(evaluateEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 3、更新主表已评价标识,是否解决标识。
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1054,7 +1072,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        finishResultDTO.setServerId(serviceEntity.getServerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        finishResultDTO.setServiceType(serviceEntity.getServiceType()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        finishResultDTO.setAwardPoint(entity.getAwardPoint()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //5、我的需求-评价:如果服务方是志愿者,通知它:  您收到来自山东路-张先生的评价,请查看。
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //5、我的需求-评价:如果服务方是志愿者,通知它:  您收到来自XXX(需求人姓名)的评价,请查看。
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        sendVolunnterEvaluated(entity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return finishResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1255,7 +1273,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //需求内容走内容审核
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        textScan(formDTO.getContent()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Date now = new Date(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        DemandRecId resultDto = new DemandRecId(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        resultDto.setDemandRecId(formDTO.getDemandRecId()); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1318,6 +1336,25 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return resultDto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 需求内容,服务评价-完成情况走内容审核 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param content | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private void textScan(String content) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        TextTaskDTO taskDTO = new TextTaskDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        taskDTO.setContent(content); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        textScanParamDTO.getTasks().add(taskDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!textSyncScanResult.success()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!textSyncScanResult.getData().isAllPass()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 我的需求被抢单->您提出的需求将由青岛亿联科技有限公司为您解决,请查看。 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |