|  | @ -1,6 +1,5 @@ | 
			
		
	
		
		
			
				
					|  |  | package com.epmet.service.impl; |  |  | package com.epmet.service.impl; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |  |  | import com.baomidou.mybatisplus.core.toolkit.IdWorker; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.constant.*; |  |  | import com.epmet.commons.tools.constant.*; | 
			
		
	
	
		
		
			
				
					|  | @ -96,14 +95,18 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
			
		
	
		
		
			
				
					|  |  |     @Autowired |  |  |     @Autowired | 
			
		
	
		
		
			
				
					|  |  |     private ProjectSatisfactionDetailService projectSatisfactionDetailService; |  |  |     private ProjectSatisfactionDetailService projectSatisfactionDetailService; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     public CustomerStaffInfoCacheResult getStaffInfo(String customerId,String staffId){ | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         if (null == staffInfo) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", staffId)); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         return staffInfo; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     @Override |  |  |     @Override | 
			
		
	
		
		
			
				
					|  |  |     public PageData<IcEventListResultDTO> list(IcEventListFormDTO formDTO) { |  |  |     public PageData<IcEventListResultDTO> list(IcEventListFormDTO formDTO) { | 
			
		
	
		
		
			
				
					|  |  |         //获取当前工作人员缓存信息
 |  |  |         //获取当前工作人员缓存信息
 | 
			
		
	
		
		
			
				
					
					|  |  |         CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); |  |  |         CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |         if (null == staffInfo) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getStaffId())); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |         formDTO.setAgencyId(staffInfo.getAgencyId()); |  |  |         formDTO.setAgencyId(staffInfo.getAgencyId()); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |         //分页查询当前组织下网格内事件数据
 |  |  |         //分页查询当前组织下网格内事件数据
 | 
			
		
	
	
		
		
			
				
					|  | @ -149,14 +152,6 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
			
		
	
		
		
			
				
					|  |  |         return new PageData<>(list, pageInfo.getTotal()); |  |  |         return new PageData<>(list, pageInfo.getTotal()); | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     private QueryWrapper<IcEventEntity> getWrapper(Map<String, Object> params) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         String id = (String) params.get(FieldConstant.ID_HUMP); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         QueryWrapper<IcEventEntity> wrapper = new QueryWrapper<>(); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         return wrapper; |  |  |  | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     @Override |  |  |     @Override | 
			
		
	
		
		
			
				
					|  |  |     public IcEventDTO get(String id) { |  |  |     public IcEventDTO get(String id) { | 
			
		
	
	
		
		
			
				
					|  | @ -168,10 +163,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
			
		
	
		
		
			
				
					|  |  |     @Transactional(rollbackFor = Exception.class) |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
		
			
				
					|  |  |     public void save(IcEventAddEditFormDTO formDTO) { |  |  |     public void save(IcEventAddEditFormDTO formDTO) { | 
			
		
	
		
		
			
				
					|  |  |         //获取当前工作人员缓存信息
 |  |  |         //获取当前工作人员缓存信息
 | 
			
		
	
		
		
			
				
					
					|  |  |         CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); |  |  |         CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |         if (null == staffInfo) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |         //获取网格缓存信息
 |  |  |         //获取网格缓存信息
 | 
			
		
	
		
		
			
				
					|  |  |         GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); |  |  |         GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); | 
			
		
	
		
		
			
				
					|  |  |         if (null == gridInfo) { |  |  |         if (null == gridInfo) { | 
			
		
	
	
		
		
			
				
					|  | @ -694,10 +686,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |         //3.新增回复数据
 |  |  |         //3.新增回复数据
 | 
			
		
	
		
		
			
				
					|  |  |         //获取当前工作人员缓存信息
 |  |  |         //获取当前工作人员缓存信息
 | 
			
		
	
		
		
			
				
					
					|  |  |         CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); |  |  |         CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |         if (null == staffInfo) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |         IcEventReplyEntity replyEntity = new IcEventReplyEntity(); |  |  |         IcEventReplyEntity replyEntity = new IcEventReplyEntity(); | 
			
		
	
		
		
			
				
					|  |  |         replyEntity.setCustomerId(formDTO.getCustomerId()); |  |  |         replyEntity.setCustomerId(formDTO.getCustomerId()); | 
			
		
	
		
		
			
				
					|  |  |         replyEntity.setIcEventId(formDTO.getIcEventId()); |  |  |         replyEntity.setIcEventId(formDTO.getIcEventId()); | 
			
		
	
	
		
		
			
				
					|  | @ -834,10 +823,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
			
		
	
		
		
			
				
					|  |  |             messageFormDTO.setUserId(entity.getCreatedBy()); |  |  |             messageFormDTO.setUserId(entity.getCreatedBy()); | 
			
		
	
		
		
			
				
					|  |  |             messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); |  |  |             messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); | 
			
		
	
		
		
			
				
					|  |  |             //获取当前工作人员缓存信息
 |  |  |             //获取当前工作人员缓存信息
 | 
			
		
	
		
		
			
				
					
					|  |  |             CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); |  |  |             CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |             if (null == staffInfo) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                 throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |             messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为项目,请查看。", staffInfo.getAgencyName())); |  |  |             messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为项目,请查看。", staffInfo.getAgencyName())); | 
			
		
	
		
		
			
				
					|  |  |             messageFormDTO.setReadFlag(Constant.UNREAD); |  |  |             messageFormDTO.setReadFlag(Constant.UNREAD); | 
			
		
	
		
		
			
				
					|  |  |             messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); |  |  |             messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); | 
			
		
	
	
		
		
			
				
					|  | @ -919,10 +905,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
			
		
	
		
		
			
				
					|  |  |             messageFormDTO.setGridId(entity.getGridId()); |  |  |             messageFormDTO.setGridId(entity.getGridId()); | 
			
		
	
		
		
			
				
					|  |  |             messageFormDTO.setUserId(entity.getCreatedBy()); |  |  |             messageFormDTO.setUserId(entity.getCreatedBy()); | 
			
		
	
		
		
			
				
					|  |  |             messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); |  |  |             messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); | 
			
		
	
		
		
			
				
					
					|  |  |             CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getDemandUserId()); |  |  |             CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getDemandUserId()); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |             if (null == staffInfo) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                 throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getDemandUserId())); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |             messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为服务,请查看。", staffInfo.getAgencyName())); |  |  |             messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为服务,请查看。", staffInfo.getAgencyName())); | 
			
		
	
		
		
			
				
					|  |  |             messageFormDTO.setReadFlag(Constant.UNREAD); |  |  |             messageFormDTO.setReadFlag(Constant.UNREAD); | 
			
		
	
		
		
			
				
					|  |  |             messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); |  |  |             messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); | 
			
		
	
	
		
		
			
				
					|  | @ -1359,6 +1342,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
			
		
	
		
		
			
				
					|  |  |             attachment.setAttachmentFormat(a.getFormat()); |  |  |             attachment.setAttachmentFormat(a.getFormat()); | 
			
		
	
		
		
			
				
					|  |  |             attachment.setAttachmentType(a.getType()); |  |  |             attachment.setAttachmentType(a.getType()); | 
			
		
	
		
		
			
				
					|  |  |             attachment.setAttachmentUrl(a.getUrl()); |  |  |             attachment.setAttachmentUrl(a.getUrl()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             attachment.setDuration(a.getDuration()); | 
			
		
	
		
		
			
				
					|  |  |             attachment.setStatus(TopicConstant.AUTO_PASSED); |  |  |             attachment.setStatus(TopicConstant.AUTO_PASSED); | 
			
		
	
		
		
			
				
					|  |  |             attachment.setSort(sort++); |  |  |             attachment.setSort(sort++); | 
			
		
	
		
		
			
				
					|  |  |             attachmentEntityList.add(attachment); |  |  |             attachmentEntityList.add(attachment); | 
			
		
	
	
		
		
			
				
					|  | @ -1385,12 +1369,12 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
			
		
	
		
		
			
				
					|  |  |                 //每个事件对应的图片数据
 |  |  |                 //每个事件对应的图片数据
 | 
			
		
	
		
		
			
				
					|  |  |                 if (!CollectionUtils.isEmpty(dto.getAttachmentList())) { |  |  |                 if (!CollectionUtils.isEmpty(dto.getAttachmentList())) { | 
			
		
	
		
		
			
				
					|  |  |                     List<String> imageList = new ArrayList<>(); |  |  |                     List<String> imageList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |                     List<String> voiceList = new ArrayList<>(); |  |  |                     List<IcEventAttachmentDTO> voiceList = new ArrayList<>(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                     for (IcEventAttachmentDTO file : dto.getAttachmentList()) { |  |  |                     for (IcEventAttachmentDTO file : dto.getAttachmentList()) { | 
			
		
	
		
		
			
				
					|  |  |                         if ("image".equals(file.getAttachmentType())) { |  |  |                         if ("image".equals(file.getAttachmentType())) { | 
			
		
	
		
		
			
				
					|  |  |                             imageList.add(file.getAttachmentUrl()); |  |  |                             imageList.add(file.getAttachmentUrl()); | 
			
		
	
		
		
			
				
					|  |  |                         } else if ("voice".equals(file.getAttachmentType())) { |  |  |                         } else if ("voice".equals(file.getAttachmentType())) { | 
			
		
	
		
		
			
				
					
					|  |  |                             voiceList.add(file.getAttachmentUrl()); |  |  |                             voiceList.add(file); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                         } |  |  |                         } | 
			
		
	
		
		
			
				
					|  |  |                     } |  |  |                     } | 
			
		
	
		
		
			
				
					|  |  |                     dto.setImageList(imageList); |  |  |                     dto.setImageList(imageList); | 
			
		
	
	
		
		
			
				
					|  | 
 |