|
|
|
@ -28,10 +28,7 @@ import com.epmet.commons.tools.page.PageData; |
|
|
|
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.DateUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
|
import com.epmet.commons.tools.utils.*; |
|
|
|
import com.epmet.constant.ParameterKeyConstant; |
|
|
|
import com.epmet.constant.ProjectConstant; |
|
|
|
import com.epmet.constant.SmsTemplateConstant; |
|
|
|
@ -46,6 +43,9 @@ import com.epmet.feign.*; |
|
|
|
import com.epmet.redis.ProjectRedis; |
|
|
|
import com.epmet.resi.group.constant.TopicConstant; |
|
|
|
import com.epmet.resi.group.dto.topic.ResiTopicDTO; |
|
|
|
import com.epmet.resi.group.dto.topic.form.TopicAttachmentFormDTO; |
|
|
|
import com.epmet.resi.group.dto.topic.result.TopicAttachmentResultDTO; |
|
|
|
import com.epmet.resi.group.dto.topic.result.TopicFileResultDTO; |
|
|
|
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; |
|
|
|
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; |
|
|
|
import com.epmet.service.*; |
|
|
|
@ -63,6 +63,7 @@ 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; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
@ -2124,22 +2125,93 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
applyAssistFormDTO.setCustomerId(projectStaff.getCustomerId()); |
|
|
|
applyAssistFormDTO.setPlatformId(formDTO.getPlatformId()); |
|
|
|
applyAssistFormDTO.setTitle(projectEntity.getTitle()); |
|
|
|
|
|
|
|
UploadFileFormDTO uploadFileFormDTO = new UploadFileFormDTO(); |
|
|
|
uploadFileFormDTO.setCustomerId(projectStaff.getCustomerId()); |
|
|
|
uploadFileFormDTO.setPlatformId(formDTO.getPlatformId()); |
|
|
|
//存放项目和话题的附件
|
|
|
|
PlatformFileDTO platformFileDTO = new PlatformFileDTO(); |
|
|
|
if (CollectionUtils.isNotEmpty(formDTO.getInternalFile())) { |
|
|
|
List<String> imageList = |
|
|
|
formDTO.getInternalFile().stream().filter(fileDTO -> TopicConstant.IMAGE.equals(fileDTO.getType())).map(FileDTO::getUrl).collect(Collectors.toList()); |
|
|
|
//附件上传到第三方平台,获取返回的链接
|
|
|
|
List<FileDTO> imageList = |
|
|
|
formDTO.getInternalFile().stream().filter(fileDTO -> TopicConstant.IMAGE.equals(fileDTO.getType())).collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isNotEmpty(imageList)) { |
|
|
|
applyAssistFormDTO.setImageLink(String.join(StrConstant.COMMA, imageList)); |
|
|
|
List<String> images = new ArrayList<>(); |
|
|
|
for (FileDTO file : imageList) { |
|
|
|
Result<MultipartFile> multipartFileResult = HttpClientManager.getInstance().getFileItem(file.getUrl(), file.getName()); |
|
|
|
if (!multipartFileResult.success()) { |
|
|
|
throw new RenException(multipartFileResult.getCode(), multipartFileResult.getMsg()); |
|
|
|
} |
|
|
|
Result<UploadFileResultDTO> uploadResult = epmetThirdOpenFeignClient.uploadFile(multipartFileResult.getData(), uploadFileFormDTO); |
|
|
|
if (!uploadResult.success()) { |
|
|
|
throw new RenException(uploadResult.getCode(), uploadResult.getMsg()); |
|
|
|
} |
|
|
|
images.add(uploadResult.getData().getUrl()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(images)) { |
|
|
|
String all = String.join(StrConstant.COMMA, images); |
|
|
|
applyAssistFormDTO.setImageLink(all); |
|
|
|
platformFileDTO.setProjectImages(all); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> voiceList = |
|
|
|
formDTO.getInternalFile().stream().filter(fileDTO -> TopicConstant.VOICE.equals(fileDTO.getType())).map(FileDTO::getUrl).collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isNotEmpty(imageList)) { |
|
|
|
applyAssistFormDTO.setVoiceLink(String.join(StrConstant.COMMA, voiceList)); |
|
|
|
List<FileDTO> voiceList = |
|
|
|
formDTO.getInternalFile().stream().filter(fileDTO -> TopicConstant.VOICE.equals(fileDTO.getType())).collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isNotEmpty(voiceList)) { |
|
|
|
List<String> voices = new ArrayList<>(); |
|
|
|
for (FileDTO file : voiceList) { |
|
|
|
Result<MultipartFile> multipartFileResult = HttpClientManager.getInstance().getFileItem(file.getUrl(), file.getName()); |
|
|
|
if (!multipartFileResult.success()) { |
|
|
|
throw new RenException(multipartFileResult.getCode(), multipartFileResult.getMsg()); |
|
|
|
} |
|
|
|
Result<UploadFileResultDTO> uploadResult = epmetThirdOpenFeignClient.uploadFile(multipartFileResult.getData(), uploadFileFormDTO); |
|
|
|
if (!uploadResult.success()) { |
|
|
|
throw new RenException(uploadResult.getCode(), uploadResult.getMsg()); |
|
|
|
} |
|
|
|
voices.add(uploadResult.getData().getUrl()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(voices)) { |
|
|
|
String all = String.join(StrConstant.COMMA, voices); |
|
|
|
applyAssistFormDTO.setVoiceLink(all); |
|
|
|
platformFileDTO.setProjectVoices(all); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> videoList = |
|
|
|
formDTO.getInternalFile().stream().filter(fileDTO -> TopicConstant.VIDEO.equals(fileDTO.getType())).map(FileDTO::getUrl).collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isNotEmpty(imageList)) { |
|
|
|
applyAssistFormDTO.setVideoLink(String.join(StrConstant.COMMA, videoList)); |
|
|
|
List<FileDTO> videoList = |
|
|
|
formDTO.getInternalFile().stream().filter(fileDTO -> TopicConstant.VIDEO.equals(fileDTO.getType())).collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isNotEmpty(videoList)) { |
|
|
|
List<String> videos = new ArrayList<>(); |
|
|
|
for (FileDTO file : videoList) { |
|
|
|
Result<MultipartFile> multipartFileResult = HttpClientManager.getInstance().getFileItem(file.getUrl(), file.getName()); |
|
|
|
if (!multipartFileResult.success()) { |
|
|
|
throw new RenException(multipartFileResult.getCode(), multipartFileResult.getMsg()); |
|
|
|
} |
|
|
|
Result<UploadFileResultDTO> uploadResult = epmetThirdOpenFeignClient.uploadFile(multipartFileResult.getData(), uploadFileFormDTO); |
|
|
|
if (!uploadResult.success()) { |
|
|
|
throw new RenException(uploadResult.getCode(), uploadResult.getMsg()); |
|
|
|
} |
|
|
|
videos.add(uploadResult.getData().getUrl()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(videos)) { |
|
|
|
String all = String.join(StrConstant.COMMA, videos); |
|
|
|
applyAssistFormDTO.setVideoLink(all); |
|
|
|
platformFileDTO.setProjectVideos(all); |
|
|
|
} |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(formDTO.getInternalFile())) { |
|
|
|
List<String> docs = new ArrayList<>(); |
|
|
|
for (FileDTO file : formDTO.getInternalFile()) { |
|
|
|
Result<MultipartFile> multipartFileResult = HttpClientManager.getInstance().getFileItem(file.getUrl(), file.getName()); |
|
|
|
if (!multipartFileResult.success()) { |
|
|
|
throw new RenException(multipartFileResult.getCode(), multipartFileResult.getMsg()); |
|
|
|
} |
|
|
|
Result<UploadFileResultDTO> uploadResult = epmetThirdOpenFeignClient.uploadFile(multipartFileResult.getData(), uploadFileFormDTO); |
|
|
|
if (!uploadResult.success()) { |
|
|
|
throw new RenException(uploadResult.getCode(), uploadResult.getMsg()); |
|
|
|
} |
|
|
|
docs.add(uploadResult.getData().getUrl()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(docs)) { |
|
|
|
String all = String.join(StrConstant.COMMA, docs); |
|
|
|
platformFileDTO.setProjectDocs(all); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//获取工作人员信息
|
|
|
|
@ -2160,6 +2232,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
if (!issueDetail.success()) { |
|
|
|
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()); |
|
|
|
@ -2169,6 +2242,89 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
applyAssistFormDTO.setProvince(topic.getData().getProvince()); |
|
|
|
applyAssistFormDTO.setCity(topic.getData().getCity()); |
|
|
|
applyAssistFormDTO.setArea(topic.getData().getArea()); |
|
|
|
//获取话题附件
|
|
|
|
TopicAttachmentFormDTO topicAttachmentFormDTO = new TopicAttachmentFormDTO(); |
|
|
|
topicAttachmentFormDTO.setTopicId(issueDetail.getData().getTopicInfo().getTopicId()); |
|
|
|
Result<TopicAttachmentResultDTO> topicAttachment = resiGroupOpenFeignClient.topicAttachmentList(topicAttachmentFormDTO); |
|
|
|
if (!topicAttachment.success()) { |
|
|
|
throw new RenException(topicAttachment.getCode(), topicAttachment.getMsg()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(issueDetail.getData().getTopicInfo().getPhotoList())) { |
|
|
|
List<String> files = new ArrayList<>(); |
|
|
|
for (String url : issueDetail.getData().getTopicInfo().getPhotoList()) { |
|
|
|
Result<MultipartFile> multipartFileResult = |
|
|
|
HttpClientManager.getInstance().getFileItem(url, UUID.randomUUID().toString().replace("-", "")); |
|
|
|
if (!multipartFileResult.success()) { |
|
|
|
throw new RenException(multipartFileResult.getCode(), multipartFileResult.getMsg()); |
|
|
|
} |
|
|
|
Result<UploadFileResultDTO> uploadResult = epmetThirdOpenFeignClient.uploadFile(multipartFileResult.getData(), uploadFileFormDTO); |
|
|
|
if (!uploadResult.success()) { |
|
|
|
throw new RenException(uploadResult.getCode(), uploadResult.getMsg()); |
|
|
|
} |
|
|
|
files.add(uploadResult.getData().getUrl()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(files)) { |
|
|
|
String all = String.join(StrConstant.COMMA, files); |
|
|
|
platformFileDTO.setTopicImages(all); |
|
|
|
} |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(topicAttachment.getData().getVoiceList())) { |
|
|
|
List<String> files = new ArrayList<>(); |
|
|
|
for (TopicFileResultDTO item : topicAttachment.getData().getVoiceList()) { |
|
|
|
Result<MultipartFile> multipartFileResult = |
|
|
|
HttpClientManager.getInstance().getFileItem(item.getUrl(), UUID.randomUUID().toString().replace("-", "")); |
|
|
|
if (!multipartFileResult.success()) { |
|
|
|
throw new RenException(multipartFileResult.getCode(), multipartFileResult.getMsg()); |
|
|
|
} |
|
|
|
Result<UploadFileResultDTO> uploadResult = epmetThirdOpenFeignClient.uploadFile(multipartFileResult.getData(), uploadFileFormDTO); |
|
|
|
if (!uploadResult.success()) { |
|
|
|
throw new RenException(uploadResult.getCode(), uploadResult.getMsg()); |
|
|
|
} |
|
|
|
files.add(uploadResult.getData().getUrl()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(files)) { |
|
|
|
String all = String.join(StrConstant.COMMA, files); |
|
|
|
platformFileDTO.setTopicVoices(all); |
|
|
|
} |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(topicAttachment.getData().getVideoList())) { |
|
|
|
List<String> files = new ArrayList<>(); |
|
|
|
for (TopicFileResultDTO item : topicAttachment.getData().getVideoList()) { |
|
|
|
Result<MultipartFile> multipartFileResult = |
|
|
|
HttpClientManager.getInstance().getFileItem(item.getUrl(), UUID.randomUUID().toString().replace("-", "")); |
|
|
|
if (!multipartFileResult.success()) { |
|
|
|
throw new RenException(multipartFileResult.getCode(), multipartFileResult.getMsg()); |
|
|
|
} |
|
|
|
Result<UploadFileResultDTO> uploadResult = epmetThirdOpenFeignClient.uploadFile(multipartFileResult.getData(), uploadFileFormDTO); |
|
|
|
if (!uploadResult.success()) { |
|
|
|
throw new RenException(uploadResult.getCode(), uploadResult.getMsg()); |
|
|
|
} |
|
|
|
files.add(uploadResult.getData().getUrl()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(files)) { |
|
|
|
String all = String.join(StrConstant.COMMA, files); |
|
|
|
platformFileDTO.setTopicVideos(all); |
|
|
|
} |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(topicAttachment.getData().getDocList())) { |
|
|
|
List<String> files = new ArrayList<>(); |
|
|
|
for (TopicFileResultDTO item : topicAttachment.getData().getDocList()) { |
|
|
|
Result<MultipartFile> multipartFileResult = |
|
|
|
HttpClientManager.getInstance().getFileItem(item.getUrl(), UUID.randomUUID().toString().replace("-", "")); |
|
|
|
if (!multipartFileResult.success()) { |
|
|
|
throw new RenException(multipartFileResult.getCode(), multipartFileResult.getMsg()); |
|
|
|
} |
|
|
|
Result<UploadFileResultDTO> uploadResult = epmetThirdOpenFeignClient.uploadFile(multipartFileResult.getData(), uploadFileFormDTO); |
|
|
|
if (!uploadResult.success()) { |
|
|
|
throw new RenException(uploadResult.getCode(), uploadResult.getMsg()); |
|
|
|
} |
|
|
|
files.add(uploadResult.getData().getUrl()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(files)) { |
|
|
|
String all = String.join(StrConstant.COMMA, files); |
|
|
|
platformFileDTO.setTopicDocs(all); |
|
|
|
} |
|
|
|
} |
|
|
|
ProjectDetailDTO projectDetailDTO = ConvertUtils.sourceToTarget(issueDetail.getData(), ProjectDetailDTO.class); |
|
|
|
projectDetailDTO.setTopicContent(issueDetail.getData().getTopicInfo().getTopicContent()); |
|
|
|
projectDetailDTO.setTopicPublisher(issueDetail.getData().getTopicInfo().getTopicPublisher()); |
|
|
|
@ -2189,7 +2345,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
processListV2FormDTO.setProjectId(formDTO.getProjectId()); |
|
|
|
List<ProcessListV2ResultDTO> processList = projectTraceService.processListV2(processListV2FormDTO); |
|
|
|
|
|
|
|
applyAssistFormDTO.setDetail(getDetail(projectDetailDTO, projectDetailResultDTO, processList)); |
|
|
|
applyAssistFormDTO.setDetail(getDetail(projectDetailDTO, projectDetailResultDTO, processList, platformFileDTO)); |
|
|
|
applyAssistFormDTO.setDetailAddress(projectDetailDTO.getBelongsGridName()); |
|
|
|
applyAssistFormDTO.setSource("党建引领"); |
|
|
|
applyAssistFormDTO.setNotifyUrl("/gov/project/project/platformcallback"); |
|
|
|
@ -2285,7 +2441,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
//TODO 保存附件
|
|
|
|
} |
|
|
|
|
|
|
|
private String getDetail(ProjectDetailDTO sourceDTO, ProjectDetailResultDTO projectDetail, List<ProcessListV2ResultDTO> processList) { |
|
|
|
private String getDetail(ProjectDetailDTO sourceDTO, ProjectDetailResultDTO projectDetail, List<ProcessListV2ResultDTO> processList, PlatformFileDTO platformFileDTO) { |
|
|
|
String detail = ""; |
|
|
|
detail = detail.concat("项目来源\n"); |
|
|
|
if (null == sourceDTO.getTopicContent()) { |
|
|
|
@ -2296,16 +2452,27 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
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" + |
|
|
|
"针对话题\n" + (null == sourceDTO.getTopicContent()?"":sourceDTO.getTopicContent()) + "\n"; |
|
|
|
if (StringUtils.isNotEmpty(platformFileDTO.getTopicImages())) { |
|
|
|
source = source + "话题图片:" + platformFileDTO.getTopicImages() + "\n"; |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(platformFileDTO.getTopicVoices())) { |
|
|
|
source = source + "话题语音:" + platformFileDTO.getTopicVoices() + "\n"; |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(platformFileDTO.getTopicVideos())) { |
|
|
|
source = source + "话题视频:" + platformFileDTO.getTopicVideos() + "\n"; |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(platformFileDTO.getTopicDocs())) { |
|
|
|
source = source + "话题文档:" + platformFileDTO.getTopicDocs() + "\n"; |
|
|
|
} |
|
|
|
source = source + "建议采用如下处理方式\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" + |
|
|
|
detail = detail + "项目标题:" +projectDetail.getProjectTitle() + "\n" + |
|
|
|
"项目方案::\n" + projectDetail.getPublicReply() + "\n" + |
|
|
|
"内部备注:\n" + projectDetail.getInternalRemark() + "\n" + |
|
|
|
"当前处理部门:\n"; |
|
|
|
@ -2317,12 +2484,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
for (ProcessListV2ResultDTO item : processList) { |
|
|
|
String process = "【" + item.getProcessName() + "】\n" + |
|
|
|
DateUtils.formatTimestamp(item.getProcessTime(), DateUtils.DATE_TIME_PATTERN) + "\n" + |
|
|
|
"处理部门:" + item.getProcessName() + "\n" + |
|
|
|
"处理部门:" + item.getDepartmentName() + "\n" + |
|
|
|
"说明:" + item.getPublicReply() + "\n"; |
|
|
|
//TODO 上传图片
|
|
|
|
detail = detail + process; |
|
|
|
} |
|
|
|
|
|
|
|
System.out.println(detail); |
|
|
|
return detail; |
|
|
|
|
|
|
|
|