|  | @ -45,9 +45,14 @@ import com.epmet.entity.*; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.feign.*; |  |  | import com.epmet.feign.*; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.redis.ProjectRedis; |  |  | import com.epmet.redis.ProjectRedis; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.resi.group.constant.TopicConstant; |  |  | import com.epmet.resi.group.constant.TopicConstant; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.resi.group.dto.topic.ResiTopicDTO; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; |  |  | import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.*; |  |  | import com.epmet.service.*; | 
			
		
	
		
		
			
				
					|  |  | import com.github.pagehelper.PageHelper; |  |  | import com.github.pagehelper.PageHelper; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.google.common.base.Joiner; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.google.gson.Gson; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.google.gson.GsonBuilder; | 
			
		
	
		
		
			
				
					|  |  | import org.apache.commons.collections4.CollectionUtils; |  |  | import org.apache.commons.collections4.CollectionUtils; | 
			
		
	
		
		
			
				
					|  |  | import lombok.extern.slf4j.Slf4j; |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
		
			
				
					|  |  | import org.apache.commons.collections4.ListUtils; |  |  | import org.apache.commons.collections4.ListUtils; | 
			
		
	
	
		
		
			
				
					|  | @ -115,6 +120,10 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
			
		
	
		
		
			
				
					|  |  | 	private EpmetThirdOpenFeignClient epmetThirdOpenFeignClient; |  |  | 	private EpmetThirdOpenFeignClient epmetThirdOpenFeignClient; | 
			
		
	
		
		
			
				
					|  |  | 	@Autowired |  |  | 	@Autowired | 
			
		
	
		
		
			
				
					|  |  | 	private GovOrgOpenFeignClient govOrgOpenFeignClient; |  |  | 	private GovOrgOpenFeignClient govOrgOpenFeignClient; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	@Autowired | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	private ProjectTraceService projectTraceService; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	@Autowired | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	private ResiGroupOpenFeignClient resiGroupOpenFeignClient; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 	private final static String ONE_DAY = "<1"; |  |  | 	private final static String ONE_DAY = "<1"; | 
			
		
	
	
		
		
			
				
					|  | @ -325,6 +334,9 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
			
		
	
		
		
			
				
					|  |  | 						resultDTO.setProcessable(true); |  |  | 						resultDTO.setProcessable(true); | 
			
		
	
		
		
			
				
					|  |  | 						resultDTO.setIsSend(false); |  |  | 						resultDTO.setIsSend(false); | 
			
		
	
		
		
			
				
					|  |  | 					} |  |  | 					} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				} else { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					resultDTO.setProcessable(true); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					resultDTO.setIsSend(false); | 
			
		
	
		
		
			
				
					|  |  | 				} |  |  | 				} | 
			
		
	
		
		
			
				
					|  |  | 			} else { |  |  | 			} else { | 
			
		
	
		
		
			
				
					|  |  | 				resultDTO.setProcessable(false); |  |  | 				resultDTO.setProcessable(false); | 
			
		
	
	
		
		
			
				
					|  | @ -2061,6 +2073,8 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
			
		
	
		
		
			
				
					|  |  | 		ProjectApplyAssistFormDTO applyAssistFormDTO = new ProjectApplyAssistFormDTO(); |  |  | 		ProjectApplyAssistFormDTO applyAssistFormDTO = new ProjectApplyAssistFormDTO(); | 
			
		
	
		
		
			
				
					|  |  | 		applyAssistFormDTO.setCustomerId(projectStaff.getCustomerId()); |  |  | 		applyAssistFormDTO.setCustomerId(projectStaff.getCustomerId()); | 
			
		
	
		
		
			
				
					|  |  | 		applyAssistFormDTO.setPlatformId(formDTO.getPlatformId()); |  |  | 		applyAssistFormDTO.setPlatformId(formDTO.getPlatformId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		applyAssistFormDTO.setTitle(projectEntity.getTitle()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 		if (CollectionUtils.isNotEmpty(formDTO.getInternalFile())) { |  |  | 		if (CollectionUtils.isNotEmpty(formDTO.getInternalFile())) { | 
			
		
	
		
		
			
				
					|  |  | 			List<String> imageList = |  |  | 			List<String> imageList = | 
			
		
	
		
		
			
				
					|  |  | 					formDTO.getInternalFile().stream().filter(fileDTO -> TopicConstant.IMAGE.equals(fileDTO.getType())).map(FileDTO::getUrl).collect(Collectors.toList()); |  |  | 					formDTO.getInternalFile().stream().filter(fileDTO -> TopicConstant.IMAGE.equals(fileDTO.getType())).map(FileDTO::getUrl).collect(Collectors.toList()); | 
			
		
	
	
		
		
			
				
					|  | @ -2089,13 +2103,6 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
			
		
	
		
		
			
				
					|  |  | 		List<ProjectRelatedPersonnelDTO> relatedPersonnel =  projectRelatedPersonnelService.getPersonnelListByProjectId(formDTO.getProjectId()); |  |  | 		List<ProjectRelatedPersonnelDTO> relatedPersonnel =  projectRelatedPersonnelService.getPersonnelListByProjectId(formDTO.getProjectId()); | 
			
		
	
		
		
			
				
					|  |  | 		CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); |  |  | 		CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); | 
			
		
	
		
		
			
				
					|  |  | 		customerGridFormDTO.setGridId(relatedPersonnel.get(0).getGridId()); |  |  | 		customerGridFormDTO.setGridId(relatedPersonnel.get(0).getGridId()); | 
			
		
	
		
		
			
				
					|  |  | 		Result<CustomerGridDTO> gridResult =  govOrgOpenFeignClient.getCustomerGridByGridId(customerGridFormDTO); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 		if (!gridResult.success()) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			throw new RenException(gridResult.getCode(), gridResult.getMsg()); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 		} |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 		applyAssistFormDTO.setLatitude(gridResult.getData().getLatitude()); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 		applyAssistFormDTO.setLongitude(gridResult.getData().getLongitude()); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 		//获取议题详情
 |  |  | 		//获取议题详情
 | 
			
		
	
		
		
			
				
					|  |  | 		IssueDetailFormDTO issueDetailFormDTO = new IssueDetailFormDTO(); |  |  | 		IssueDetailFormDTO issueDetailFormDTO = new IssueDetailFormDTO(); | 
			
		
	
		
		
			
				
					|  |  | 		issueDetailFormDTO.setIssueId(projectEntity.getOriginId()); |  |  | 		issueDetailFormDTO.setIssueId(projectEntity.getOriginId()); | 
			
		
	
	
		
		
			
				
					|  | @ -2103,18 +2110,44 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
			
		
	
		
		
			
				
					|  |  | 		if (!issueDetail.success()) { |  |  | 		if (!issueDetail.success()) { | 
			
		
	
		
		
			
				
					|  |  | 			throw new RenException(issueDetail.getCode(), issueDetail.getMsg()); |  |  | 			throw new RenException(issueDetail.getCode(), issueDetail.getMsg()); | 
			
		
	
		
		
			
				
					|  |  | 		} |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Result<ResiTopicDTO> topic =  resiGroupOpenFeignClient.getTopicById(issueDetail.getData().getTopicInfo().getTopicId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		if (!topic.success()) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			throw new RenException(topic.getCode(), topic.getMsg()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		applyAssistFormDTO.setLatitude(topic.getData().getDimension()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		applyAssistFormDTO.setLongitude(topic.getData().getLongitude()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		applyAssistFormDTO.setProvince(topic.getData().getProvince()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		applyAssistFormDTO.setCity(topic.getData().getCity()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		applyAssistFormDTO.setArea(topic.getData().getArea()); | 
			
		
	
		
		
			
				
					|  |  | 		ProjectDetailDTO projectDetailDTO = ConvertUtils.sourceToTarget(issueDetail.getData(), ProjectDetailDTO.class); |  |  | 		ProjectDetailDTO projectDetailDTO = ConvertUtils.sourceToTarget(issueDetail.getData(), ProjectDetailDTO.class); | 
			
		
	
		
		
			
				
					
					|  |  | 		projectDetailDTO = ConvertUtils.sourceToTarget(issueDetail.getData().getTopicInfo(), ProjectDetailDTO.class); |  |  | 		projectDetailDTO.setTopicContent(issueDetail.getData().getTopicInfo().getTopicContent()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  | 		projectDetailDTO.setTopicPublisher(issueDetail.getData().getTopicInfo().getTopicPublisher()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		projectDetailDTO.setTopicPublisherMobile(issueDetail.getData().getTopicInfo().getTopicPublisherMobile()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		projectDetailDTO.setTopicPublishTime(issueDetail.getData().getTopicInfo().getTopicPublishTime()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		projectDetailDTO.setPhotoList(issueDetail.getData().getTopicInfo().getPhotoList()); | 
			
		
	
		
		
			
				
					|  |  | 		projectDetailDTO.setPublicReply(formDTO.getPublicReply()); |  |  | 		projectDetailDTO.setPublicReply(formDTO.getPublicReply()); | 
			
		
	
		
		
			
				
					|  |  | 		projectDetailDTO.setInternalRemark(formDTO.getInternalRemark()); |  |  | 		projectDetailDTO.setInternalRemark(formDTO.getInternalRemark()); | 
			
		
	
		
		
			
				
					
					|  |  | 		applyAssistFormDTO.setDetail(projectDetailDTO.toString()); |  |  | 		//项目详情
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  | 		ProjectDetailFromDTO projectDetailFromDTO = new ProjectDetailFromDTO(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		projectDetailFromDTO.setUserId(formDTO.getUserId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		projectDetailFromDTO.setProjectId(formDTO.getProjectId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		projectDetailFromDTO.setCustomerId(projectStaff.getCustomerId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		ProjectDetailResultDTO projectDetailResultDTO =  getProjectDetail(projectDetailFromDTO); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		//项目进展
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		processListV2FormDTO.setProjectId(formDTO.getProjectId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		List<ProcessListV2ResultDTO> processList =  projectTraceService.processListV2(processListV2FormDTO); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		applyAssistFormDTO.setDetail(getDetail(projectDetailDTO, projectDetailResultDTO, processList)); | 
			
		
	
		
		
			
				
					|  |  | 		applyAssistFormDTO.setDetailAddress(projectDetailDTO.getBelongsGridName()); |  |  | 		applyAssistFormDTO.setDetailAddress(projectDetailDTO.getBelongsGridName()); | 
			
		
	
		
		
			
				
					
					|  |  | 		Result result = epmetThirdOpenFeignClient.applyAssist(applyAssistFormDTO); |  |  | 		applyAssistFormDTO.setSource("党建引领"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  | 		applyAssistFormDTO.setNotifyUrl("/gov/project/project/platformcallback"); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Result<ProjectAssistResult> result = epmetThirdOpenFeignClient.applyAssist(applyAssistFormDTO); | 
			
		
	
		
		
			
				
					|  |  | 		if (!result.success()) { |  |  | 		if (!result.success()) { | 
			
		
	
		
		
			
				
					|  |  | 			throw new RenException(result.getCode(), result.getMsg()); |  |  | 			throw new RenException(result.getCode(), result.getMsg()); | 
			
		
	
		
		
			
				
					|  |  | 		} |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  | 		applyAssistFormDTO.setSource("党建引领"); |  |  | 		ProjectAssistResult assistResult = result.getData(); | 
			
				
				
			
		
	
		
		
			
				
					|  |  | 		ProjectAssistResult assistResult = (ProjectAssistResult)result.getData(); |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  | 		//发送到外部系统 end
 |  |  | 		//发送到外部系统 end
 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 		//结果存入project_sub_process表
 |  |  | 		//结果存入project_sub_process表
 | 
			
		
	
	
		
		
			
				
					|  | @ -2202,4 +2235,54 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
			
		
	
		
		
			
				
					|  |  | 		//TODO 保存附件
 |  |  | 		//TODO 保存附件
 | 
			
		
	
		
		
			
				
					|  |  | 	} |  |  | 	} | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	private String getDetail(ProjectDetailDTO sourceDTO, ProjectDetailResultDTO projectDetail, List<ProcessListV2ResultDTO> processList) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		String detail = ""; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		detail = detail.concat("项目来源\n"); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		if (null == sourceDTO.getTopicContent()) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			sourceDTO.setTopicContent(""); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		if (CollectionUtils.isEmpty(sourceDTO.getPhotoList())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			sourceDTO.setPhotoList(new ArrayList<>()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		String source = "议题标题:" + sourceDTO.getIssueTitle() + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"针对话题\n" +  (null == sourceDTO.getTopicContent()?"":sourceDTO.getTopicContent())  + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"话题图片\n" +  Joiner.on(StrConstant.COMMA).join(sourceDTO.getPhotoList()) + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"建议采用如下处理方式\n" + sourceDTO.getIssueSuggestion() + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"所属网格:" + sourceDTO.getBelongsGridName() + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"话题发表人:" + sourceDTO.getTopicPublisher() + sourceDTO.getTopicPublisherMobile() + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"议题发表人:" + sourceDTO.getIssueInitiator() + sourceDTO.getIssuePublisherMobile() + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"话题发表时间:" + DateUtils.formatTimestamp(sourceDTO.getTopicPublishTime(), DateUtils.DATE_TIME_PATTERN); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		detail = detail.concat(source); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		detail = detail.concat("\n项目详情\n"); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		detail = "项目标题:" +projectDetail.getProjectTitle() + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"项目方案::\n" + projectDetail.getPublicReply() + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"内部备注:\n" + projectDetail.getInternalRemark() + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				"当前处理部门:\n"; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		for (ProjectDetailResultDTO.DepartmentNameListBean item : projectDetail.getDepartmentList()) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			String department = item.getDepartmentName() + "(" + Joiner.on(StrConstant.COMMA).join(item.getStaffList()) + ")\n"; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			detail = detail + department; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		detail = detail.concat("\n处理进展\n"); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		for (ProcessListV2ResultDTO item : processList) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			String process = "【" + item.getProcessName() + "】\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					DateUtils.formatTimestamp(item.getProcessTime(), DateUtils.DATE_TIME_PATTERN) + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					"处理部门:" + item.getProcessName() + "\n" + | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					"说明:" + item.getPublicReply() + "\n"; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			//TODO 上传图片
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			detail = detail + process; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		System.out.println(detail); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		return detail; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	private String toJson(Object object) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		GsonBuilder gsonBuilder = new GsonBuilder(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		gsonBuilder.setPrettyPrinting(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Gson gson = gsonBuilder.create(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		return gson.toJson(object); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } |