@@ -0,0 +1,22 @@ | |||||
package com.ningdatech.pmapi.common.model; | |||||
import lombok.Data; | |||||
/** | |||||
* <p> | |||||
* FreemarkerBatchExportDTO | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2023/8/1 | |||||
**/ | |||||
@Data | |||||
public class FreemarkerBatchExportDTO { | |||||
private String fileName; | |||||
private String template; | |||||
private Object data; | |||||
} |
@@ -210,6 +210,7 @@ public class ProjectDeclareYHAction { | |||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setStatus(ProjectStatusEnum.OPERATION.getCode()); | project.setStatus(ProjectStatusEnum.OPERATION.getCode()); | ||||
} | } | ||||
@OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") | @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") | ||||
public void START_TO_WORK(Message<ProjectStatusChangeEvent> message) { | public void START_TO_WORK(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
@@ -211,12 +211,11 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | ||||
// 待开工 实施,从实施到建设中 | // 待开工 实施,从实施到建设中 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineJYBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineKFQBuilder implements ProjectDeclareState | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
.target(ProjectStatusEnum.UNDER_CONSTRUCTION) | .target(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
.event(ProjectStatusChangeEvent.START_TO_WORK).and() | |||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | |||||
// 建设中初验备案,从建设中到待终验 | // 建设中初验备案,从建设中到待终验 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.UNDER_CONSTRUCTION) | .source(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
@@ -212,7 +212,7 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -222,7 +222,7 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
.target(ProjectStatusEnum.UNDER_CONSTRUCTION) | .target(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
.event(ProjectStatusChangeEvent.START_TO_WORK).and() | |||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | |||||
// 建设中初验备案,从建设中到待终验 | // 建设中初验备案,从建设中到待终验 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.UNDER_CONSTRUCTION) | .source(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
.target(ProjectStatusEnum.UNDER_CONSTRUCTION) | .target(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
.event(ProjectStatusChangeEvent.START_TO_WORK).and() | |||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | |||||
// 建设中初验备案,从建设中到待终验 | // 建设中初验备案,从建设中到待终验 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.UNDER_CONSTRUCTION) | .source(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
.target(ProjectStatusEnum.UNDER_CONSTRUCTION) | .target(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
.event(ProjectStatusChangeEvent.START_TO_WORK).and() | |||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | |||||
// 建设中初验备案,从建设中到待终验 | // 建设中初验备案,从建设中到待终验 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.UNDER_CONSTRUCTION) | .source(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
@@ -212,7 +212,7 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -222,7 +222,7 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
.target(ProjectStatusEnum.UNDER_CONSTRUCTION) | .target(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
.event(ProjectStatusChangeEvent.START_TO_WORK).and() | |||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | |||||
// 建设中初验备案,从建设中到待终验 | // 建设中初验备案,从建设中到待终验 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.UNDER_CONSTRUCTION) | .source(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_APP_REGISTER) | .source(ProjectStatusEnum.TO_BE_APP_REGISTER) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.REGISTER_APP).and() | .event(ProjectStatusChangeEvent.REGISTER_APP).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -231,7 +231,7 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
.target(ProjectStatusEnum.UNDER_CONSTRUCTION) | .target(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
.event(ProjectStatusChangeEvent.START_TO_WORK).and() | |||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | |||||
// 建设中初验备案,从建设中到待终验 | // 建设中初验备案,从建设中到待终验 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.UNDER_CONSTRUCTION) | .source(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
.target(ProjectStatusEnum.UNDER_CONSTRUCTION) | .target(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
.event(ProjectStatusChangeEvent.START_TO_WORK).and() | |||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | |||||
// 建设中初验备案,从建设中到待终验 | // 建设中初验备案,从建设中到待终验 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.UNDER_CONSTRUCTION) | .source(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM | |||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) | ||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | .target(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() | ||||
// 待采购采购备案,从待采购到实施中 | |||||
// 待采购采购备案,从待采购到建设中 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .source(ProjectStatusEnum.TO_BE_PURCHASED) | ||||
.target(ProjectStatusEnum.OPERATION) | .target(ProjectStatusEnum.OPERATION) | ||||
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
.target(ProjectStatusEnum.UNDER_CONSTRUCTION) | .target(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
.event(ProjectStatusChangeEvent.START_TO_WORK).and() | |||||
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() | |||||
// 建设中初验备案,从建设中到待终验 | // 建设中初验备案,从建设中到待终验 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.UNDER_CONSTRUCTION) | .source(ProjectStatusEnum.UNDER_CONSTRUCTION) | ||||
@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.common.util; | |||||
import cn.hutool.core.io.IoUtil; | import cn.hutool.core.io.IoUtil; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.pmapi.common.model.FreemarkerBatchExportDTO; | |||||
import com.ningdatech.pmapi.meeting.entity.dto.ExpertFeeExportDTO; | import com.ningdatech.pmapi.meeting.entity.dto.ExpertFeeExportDTO; | ||||
import com.ningdatech.pmapi.meeting.entity.dto.ExpertInfoDTO; | import com.ningdatech.pmapi.meeting.entity.dto.ExpertInfoDTO; | ||||
import freemarker.template.Configuration; | import freemarker.template.Configuration; | ||||
@@ -19,6 +20,9 @@ import java.net.URLEncoder; | |||||
import java.nio.charset.StandardCharsets; | import java.nio.charset.StandardCharsets; | ||||
import java.nio.file.Files; | import java.nio.file.Files; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.List; | |||||
import java.util.zip.ZipEntry; | |||||
import java.util.zip.ZipOutputStream; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -31,6 +35,16 @@ import java.util.ArrayList; | |||||
@Slf4j | @Slf4j | ||||
public class FreemarkerWordUtil { | public class FreemarkerWordUtil { | ||||
private static void setDownFileName(HttpServletResponse response, String fileName) { | |||||
String fileNameEncoded; | |||||
try { | |||||
fileNameEncoded = URLEncoder.encode(fileName, "UTF-8"); | |||||
} catch (UnsupportedEncodingException e) { | |||||
throw new RuntimeException("文件名编码异常"); | |||||
} | |||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileNameEncoded); | |||||
} | |||||
private static final Configuration CONFIGURATION = new Configuration(Configuration.VERSION_2_3_31); | private static final Configuration CONFIGURATION = new Configuration(Configuration.VERSION_2_3_31); | ||||
static { | static { | ||||
@@ -69,21 +83,46 @@ public class FreemarkerWordUtil { | |||||
public static void export(String fileName, Object data, HttpServletResponse response, String templateName) throws TemplateException, IOException { | public static void export(String fileName, Object data, HttpServletResponse response, String templateName) throws TemplateException, IOException { | ||||
Template template = CONFIGURATION.getTemplate(templateName); | Template template = CONFIGURATION.getTemplate(templateName); | ||||
StringWriter out = new StringWriter(); | |||||
Writer writer = new BufferedWriter(out, 4096); | |||||
template.process(data, writer); | |||||
response.setCharacterEncoding(StandardCharsets.UTF_8.displayName()); | response.setCharacterEncoding(StandardCharsets.UTF_8.displayName()); | ||||
response.setContentType(ContentType.APPLICATION_JSON.getMimeType()); | response.setContentType(ContentType.APPLICATION_JSON.getMimeType()); | ||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + URLEncoder.encode(fileName, "UTF-8")); | |||||
try (InputStream is = new ByteArrayResource(out.toString().getBytes(StandardCharsets.UTF_8)).getInputStream(); | |||||
ServletOutputStream outputStream = response.getOutputStream()) { | |||||
// 缓冲区 | |||||
byte[] buffer = new byte[1024]; | |||||
int bytesToRead; | |||||
// 通过循环将读入的Word文件的内容输出到浏览器中 | |||||
while ((bytesToRead = is.read(buffer)) != -1) { | |||||
outputStream.write(buffer, 0, bytesToRead); | |||||
setDownFileName(response, fileName); | |||||
try (StringWriter out = new StringWriter(); | |||||
Writer writer = new BufferedWriter(out, 4096)) { | |||||
template.process(data, writer); | |||||
try (InputStream is = new ByteArrayResource(out.toString().getBytes(StandardCharsets.UTF_8)).getInputStream(); | |||||
ServletOutputStream outputStream = response.getOutputStream()) { | |||||
// 缓冲区 | |||||
byte[] buffer = new byte[1024]; | |||||
int bytesToRead; | |||||
// 通过循环将读入的Word文件的内容输出到浏览器中 | |||||
while ((bytesToRead = is.read(buffer)) != -1) { | |||||
outputStream.write(buffer, 0, bytesToRead); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
public static void exportBatch(HttpServletResponse response, List<FreemarkerBatchExportDTO> fbeList, String fileName) throws IOException, TemplateException { | |||||
response.setCharacterEncoding(StandardCharsets.UTF_8.displayName()); | |||||
response.setContentType("application/zip"); | |||||
setDownFileName(response, fileName); | |||||
try (ServletOutputStream os = response.getOutputStream(); | |||||
ZipOutputStream zos = new ZipOutputStream(os)) { | |||||
for (FreemarkerBatchExportDTO param : fbeList) { | |||||
Template template = CONFIGURATION.getTemplate(param.getTemplate()); | |||||
StringWriter out = new StringWriter(); | |||||
try (Writer writer = new BufferedWriter(out, 4096)) { | |||||
template.process(param.getData(), writer); | |||||
} | |||||
ZipEntry zipEntry = new ZipEntry(param.getFileName()); | |||||
zos.putNextEntry(zipEntry); | |||||
zos.write(out.toString().getBytes(StandardCharsets.UTF_8)); | |||||
zos.closeEntry(); | |||||
} | } | ||||
} finally { | |||||
response.flushBuffer(); | |||||
} | } | ||||
} | } | ||||
@@ -1,5 +1,6 @@ | |||||
package com.ningdatech.pmapi.expert.manage; | package com.ningdatech.pmapi.expert.manage; | ||||
import cn.hutool.core.util.StrUtil; | |||||
import cn.hutool.json.JSONUtil; | import cn.hutool.json.JSONUtil; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
@@ -8,7 +9,9 @@ import com.ningdatech.basic.util.CollUtils; | |||||
import com.ningdatech.cache.lock.DistributedLock; | import com.ningdatech.cache.lock.DistributedLock; | ||||
import com.ningdatech.file.entity.vo.result.AttachFileVo; | import com.ningdatech.file.entity.vo.result.AttachFileVo; | ||||
import com.ningdatech.file.service.FileService; | import com.ningdatech.file.service.FileService; | ||||
import com.ningdatech.pmapi.expert.constant.ReviewResultEnum; | |||||
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO; | import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO; | ||||
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateSettingsDTO; | |||||
import com.ningdatech.pmapi.expert.model.entity.ExpertReview; | import com.ningdatech.pmapi.expert.model.entity.ExpertReview; | ||||
import com.ningdatech.pmapi.expert.model.entity.ReviewTemplateSettings; | import com.ningdatech.pmapi.expert.model.entity.ReviewTemplateSettings; | ||||
import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq; | import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq; | ||||
@@ -199,4 +202,42 @@ public class ExpertReviewManage { | |||||
return detail; | return detail; | ||||
} | } | ||||
public List<ExpertReview> listFinalExpertReviews(Long meetingId) { | |||||
LambdaQueryWrapper<ExpertReview> query = Wrappers.lambdaQuery(ExpertReview.class) | |||||
.eq(ExpertReview::getIsFinal, Boolean.TRUE) | |||||
.eq(ExpertReview::getMeetingId, meetingId); | |||||
return expertReviewService.list(query); | |||||
} | |||||
public Map<Long, String> buildExpertReviewToStr(Long meetingId) { | |||||
List<ExpertReview> reviews = listFinalExpertReviews(meetingId); | |||||
if (reviews.isEmpty()) { | |||||
return Collections.emptyMap(); | |||||
} | |||||
List<Long> templateIds = CollUtils.fieldList(reviews, ExpertReview::getTemplateId); | |||||
List<ReviewTemplateSettings> ts = templateSettingsService.listByIds(templateIds); | |||||
Map<Long, ReviewTemplateSettings> tsMap = CollUtils.listToMap(ts, ReviewTemplateSettings::getId); | |||||
Map<Long, String> resMap = new HashMap<>(8); | |||||
for (ExpertReview review : reviews) { | |||||
ReviewTemplateSettings settings = tsMap.get(review.getTemplateId()); | |||||
List<ReviewTemplateSettingsDTO> optionTemplates = JSONUtil.toList(settings.getContent(), ReviewTemplateSettingsDTO.class); | |||||
List<ReviewTemplateOptionDTO> options = JSONUtil.toList(review.getContent(), ReviewTemplateOptionDTO.class); | |||||
Map<Integer, ReviewTemplateOptionDTO> optionsMap = CollUtils.listToMap(options, ReviewTemplateOptionDTO::getQuestionSerialNo); | |||||
StringBuilder str = new StringBuilder(); | |||||
optionTemplates.forEach(ot -> { | |||||
ReviewTemplateOptionDTO rto = optionsMap.get(ot.getSerialNo()); | |||||
String optionsContent = ot.getOptions().stream() | |||||
.filter(w -> rto.getOptionSerialNo().contains(w.getSerialNo())) | |||||
.map(ReviewTemplateSettingsDTO.OptionDTO::getOption) | |||||
.collect(Collectors.joining("、")); | |||||
str.append("<w:br/>").append(ot.getTitle()).append(":").append(optionsContent).append(";"); | |||||
}); | |||||
str.append("<w:br/>").append("其他意见或建议").append(":") | |||||
.append(StrUtil.blankToDefault(review.getOtherAdvice(), "--")).append(";"); | |||||
str.append("<w:br/>").append("评审结果").append(":") | |||||
.append(ReviewResultEnum.getByCode(review.getReviewResult()).getValue()).append(";"); | |||||
resMap.put(review.getProjectId(), str.toString()); | |||||
} | |||||
return resMap; | |||||
} | |||||
} | } |
@@ -1,19 +1,17 @@ | |||||
package com.ningdatech.pmapi.irs.controller; | package com.ningdatech.pmapi.irs.controller; | ||||
import com.alibaba.fastjson.JSON; | |||||
import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
import com.ningdatech.log.annotation.WebLog; | import com.ningdatech.log.annotation.WebLog; | ||||
import com.ningdatech.pmapi.irs.manage.AppIrsManage; | import com.ningdatech.pmapi.irs.manage.AppIrsManage; | ||||
import com.ningdatech.pmapi.irs.model.dto.ApiApplyDTO; | import com.ningdatech.pmapi.irs.model.dto.ApiApplyDTO; | ||||
import com.ningdatech.pmapi.irs.model.dto.ApiApplySearchResult; | |||||
import com.ningdatech.pmapi.irs.model.dto.PushProjectAppToIrsDTO; | import com.ningdatech.pmapi.irs.model.dto.PushProjectAppToIrsDTO; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import javax.validation.Valid; | import javax.validation.Valid; | ||||
import java.security.NoSuchAlgorithmException; | import java.security.NoSuchAlgorithmException; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @Classname ApplicationController | * @Classname ApplicationController | ||||
@@ -45,4 +43,10 @@ public class ApplicationController { | |||||
public JSONArray searchApps(ApiApplyDTO apply) throws NoSuchAlgorithmException { | public JSONArray searchApps(ApiApplyDTO apply) throws NoSuchAlgorithmException { | ||||
return appIrsManage.searchApps(apply); | return appIrsManage.searchApps(apply); | ||||
} | } | ||||
@GetMapping("/digitalResourcesIndicators/{appCode}/{pageSize}") | |||||
public JSONObject getDigitalResourcesIndicators(@PathVariable String appCode,@PathVariable Integer pageSize) { | |||||
return appIrsManage.getDigitalResourceIndicatorsByAppCode(appCode, pageSize); | |||||
} | |||||
} | } |
@@ -1,9 +1,6 @@ | |||||
package com.ningdatech.pmapi.irs.controller; | package com.ningdatech.pmapi.irs.controller; | ||||
import com.ningdatech.log.annotation.WebLog; | import com.ningdatech.log.annotation.WebLog; | ||||
import com.ningdatech.pmapi.common.util.CryptUtils; | |||||
import com.ningdatech.pmapi.common.util.HttpUtil; | |||||
import com.ningdatech.pmapi.irs.utils.RefreshTokenUtil; | |||||
import com.ningdatech.pmapi.projectdeclared.manage.IrsManage; | import com.ningdatech.pmapi.projectdeclared.manage.IrsManage; | ||||
import com.ningdatech.pmapi.projectdeclared.model.vo.IrsApplicationVO; | import com.ningdatech.pmapi.projectdeclared.model.vo.IrsApplicationVO; | ||||
import com.ningdatech.pmapi.projectdeclared.model.vo.PiotTasksVO; | import com.ningdatech.pmapi.projectdeclared.model.vo.PiotTasksVO; | ||||
@@ -11,10 +8,11 @@ import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.http.ResponseEntity; | |||||
import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||
import org.springframework.web.bind.annotation.*; | |||||
import org.springframework.web.client.RestTemplate; | |||||
import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RequestParam; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import java.io.UnsupportedEncodingException; | import java.io.UnsupportedEncodingException; | ||||
import java.security.NoSuchAlgorithmException; | import java.security.NoSuchAlgorithmException; | ||||
@@ -9,12 +9,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.basic.function.VUtils; | import com.ningdatech.basic.function.VUtils; | ||||
import com.ningdatech.irs.service.IRefreshTokenService; | import com.ningdatech.irs.service.IRefreshTokenService; | ||||
import com.ningdatech.pmapi.common.enumeration.CommonEnum; | import com.ningdatech.pmapi.common.enumeration.CommonEnum; | ||||
import com.ningdatech.pmapi.common.statemachine.contants.RegionContant; | |||||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | ||||
import com.ningdatech.pmapi.common.util.CryptUtils; | import com.ningdatech.pmapi.common.util.CryptUtils; | ||||
import com.ningdatech.pmapi.common.util.HttpUtil; | import com.ningdatech.pmapi.common.util.HttpUtil; | ||||
import com.ningdatech.pmapi.common.util.RefreshKeyUtil; | import com.ningdatech.pmapi.common.util.RefreshKeyUtil; | ||||
import com.ningdatech.pmapi.irs.model.dto.*; | |||||
import com.ningdatech.pmapi.irs.model.dto.ApiApplyDTO; | |||||
import com.ningdatech.pmapi.irs.model.dto.ApiApplySearchResult; | |||||
import com.ningdatech.pmapi.irs.model.dto.PushProjectAppToIrsDTO; | |||||
import com.ningdatech.pmapi.irs.model.res.ApiResponse; | import com.ningdatech.pmapi.irs.model.res.ApiResponse; | ||||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
@@ -34,7 +35,6 @@ import org.springframework.web.client.RestTemplate; | |||||
import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
import java.security.NoSuchAlgorithmException; | import java.security.NoSuchAlgorithmException; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.Collections; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
@@ -93,8 +93,23 @@ public class AppIrsManage { | |||||
@Value("${irs.push-project-detail.appSecret}") | @Value("${irs.push-project-detail.appSecret}") | ||||
private String pushProjectAppSecret; | private String pushProjectAppSecret; | ||||
//=============数字资源指标获取======================================================================================== | |||||
@Value("${irs.digital-resource-indicators.app-key}") | |||||
private String driAppKey; | |||||
@Value("${irs.digital-resource-indicators.app-secret}") | |||||
private String driAppSecret; | |||||
@Value("${irs.digital-resource-indicators.interface-name}") | |||||
private String driInterfaceName; | |||||
@Value("${irs.digital-resource-indicators.url}") | |||||
private String driUrl; | |||||
/** | /** | ||||
* 推送 项目和应用关系 | * 推送 项目和应用关系 | ||||
* | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
* @throws NoSuchAlgorithmException | * @throws NoSuchAlgorithmException | ||||
@@ -112,14 +127,14 @@ public class AppIrsManage { | |||||
ApiApplyDTO apiApply = new ApiApplyDTO(); | ApiApplyDTO apiApply = new ApiApplyDTO(); | ||||
apiApply.setAppId(appCode); | apiApply.setAppId(appCode); | ||||
JSONObject jsonObject = this.searchApp(apiApply); | JSONObject jsonObject = this.searchApp(apiApply); | ||||
ApiApplySearchResult apiApplySearchResult = JSON.parseObject(JSON.toJSONString(jsonObject),ApiApplySearchResult.class); | |||||
ApiApplySearchResult apiApplySearchResult = JSON.parseObject(JSON.toJSONString(jsonObject), ApiApplySearchResult.class); | |||||
VUtils.isTrue(Objects.isNull(apiApplySearchResult)).throwMessage("应用在IRS不存在!"); | VUtils.isTrue(Objects.isNull(apiApplySearchResult)).throwMessage("应用在IRS不存在!"); | ||||
long timestamp = System.currentTimeMillis(); | long timestamp = System.currentTimeMillis(); | ||||
String areaCode = project.getAreaCode(); | String areaCode = project.getAreaCode(); | ||||
String projectName = project.getProjectName(); | String projectName = project.getProjectName(); | ||||
String requestSecret = RefreshKeyUtil.getRequestSecret(pushAppKey, pushAppScret); | String requestSecret = RefreshKeyUtil.getRequestSecret(pushAppKey, pushAppScret); | ||||
String capCode = CryptUtils.encryptHMAC(timestamp + areaCode,"bcb4fc0f517fc168ee543fcf4d231f3b"); | |||||
String capCode = CryptUtils.encryptHMAC(timestamp + areaCode, "bcb4fc0f517fc168ee543fcf4d231f3b"); | |||||
String capTime = String.valueOf(timestamp); | String capTime = String.valueOf(timestamp); | ||||
String sign = CryptUtils.MD5Encode(pushAppKey + requestSecret + timestamp); | String sign = CryptUtils.MD5Encode(pushAppKey + requestSecret + timestamp); | ||||
String url = pushUrl + "?requestTime=" + timestamp + | String url = pushUrl + "?requestTime=" + timestamp + | ||||
@@ -134,14 +149,14 @@ public class AppIrsManage { | |||||
ApiResponse body = forEntity.getBody(); | ApiResponse body = forEntity.getBody(); | ||||
if(Objects.isNull(body) || Objects.isNull(body.getCode()) | |||||
|| 0 != body.getCode()){ | |||||
if (Objects.isNull(body) || Objects.isNull(body.getCode()) | |||||
|| 0 != body.getCode()) { | |||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
} | } | ||||
//保存关系 | //保存关系 | ||||
app.setAppCode(appCode); | app.setAppCode(appCode); | ||||
if(applicationService.updateById(app)){ | |||||
if (applicationService.updateById(app)) { | |||||
/** | /** | ||||
* 判断下 如果成功的话 那么判断下 这个项目的初次创建的app 是否都已经被注册 | * 判断下 如果成功的话 那么判断下 这个项目的初次创建的app 是否都已经被注册 | ||||
* 如果都已经注册 要调用状态机 进入下一个状态 | * 如果都已经注册 要调用状态机 进入下一个状态 | ||||
@@ -150,8 +165,8 @@ public class AppIrsManage { | |||||
.eq(ProjectApplication::getProjectId, project.getId())); | .eq(ProjectApplication::getProjectId, project.getId())); | ||||
//筛选出 初次新建的app 但是没有appCode的 | //筛选出 初次新建的app 但是没有appCode的 | ||||
apps = apps.stream().filter(a -> { | apps = apps.stream().filter(a -> { | ||||
if(CommonEnum.YES.getCode().equals(a.getIsFirst()) && | |||||
StringUtils.isBlank(app.getAppCode())){ | |||||
if (CommonEnum.YES.getCode().equals(a.getIsFirst()) && | |||||
StringUtils.isBlank(app.getAppCode())) { | |||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
@@ -159,7 +174,7 @@ public class AppIrsManage { | |||||
.collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
//如果筛选出来的 为空的话 就调用状态机 | //如果筛选出来的 为空的话 就调用状态机 | ||||
if(CollUtil.isEmpty(apps)){ | |||||
if (CollUtil.isEmpty(apps)) { | |||||
stateMachineUtils.pass(project); | stateMachineUtils.pass(project); | ||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
projectService.updateById(project); | projectService.updateById(project); | ||||
@@ -171,6 +186,7 @@ public class AppIrsManage { | |||||
/** | /** | ||||
* 查询app | * 查询app | ||||
* | |||||
* @param apply | * @param apply | ||||
* @return | * @return | ||||
* @throws NoSuchAlgorithmException | * @throws NoSuchAlgorithmException | ||||
@@ -184,27 +200,27 @@ public class AppIrsManage { | |||||
"&appKey=" + searchAppKey + "&" + | "&appKey=" + searchAppKey + "&" + | ||||
"pageSize=10&pageNum=1&appCode=" + appCode + | "pageSize=10&pageNum=1&appCode=" + appCode + | ||||
"&areaCode=&deptCode=&name="; | "&areaCode=&deptCode=&name="; | ||||
log.info("url : {}",url); | |||||
log.info("url : {}", url); | |||||
RestTemplate restTemplate = new RestTemplate(); | RestTemplate restTemplate = new RestTemplate(); | ||||
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ||||
log.info("查询应用目录 : {}",JSON.toJSONString(forEntity)); | |||||
log.info("查询应用目录 : {}", JSON.toJSONString(forEntity)); | |||||
if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody())){ | |||||
if (Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody())) { | |||||
JSONObject body = JSON.parseObject(forEntity.getBody()); | JSONObject body = JSON.parseObject(forEntity.getBody()); | ||||
if(Objects.isNull(body)){ | |||||
if (Objects.isNull(body)) { | |||||
return null; | return null; | ||||
} | } | ||||
JSONObject datas = body.getJSONObject("datas"); | JSONObject datas = body.getJSONObject("datas"); | ||||
if(Objects.isNull(datas)){ | |||||
if (Objects.isNull(datas)) { | |||||
return null; | return null; | ||||
} | } | ||||
JSONObject data = datas.getJSONObject("data"); | JSONObject data = datas.getJSONObject("data"); | ||||
if(Objects.isNull(data)){ | |||||
if (Objects.isNull(data)) { | |||||
return null; | return null; | ||||
} | } | ||||
JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult"); | JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult"); | ||||
if(CollUtil.isEmpty(apiApplySearchResult)){ | |||||
if (CollUtil.isEmpty(apiApplySearchResult)) { | |||||
return null; | return null; | ||||
} | } | ||||
return apiApplySearchResult.getJSONObject(0); | return apiApplySearchResult.getJSONObject(0); | ||||
@@ -225,19 +241,19 @@ public class AppIrsManage { | |||||
RestTemplate restTemplate = new RestTemplate(); | RestTemplate restTemplate = new RestTemplate(); | ||||
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ||||
log.info("查询应用目录 : {}",JSON.toJSONString(forEntity)); | |||||
log.info("查询应用目录 : {}", JSON.toJSONString(forEntity)); | |||||
if(Objects.nonNull(forEntity.getBody())){ | |||||
if (Objects.nonNull(forEntity.getBody())) { | |||||
JSONObject body = JSON.parseObject(forEntity.getBody()); | JSONObject body = JSON.parseObject(forEntity.getBody()); | ||||
if(Objects.isNull(body)){ | |||||
if (Objects.isNull(body)) { | |||||
return null; | return null; | ||||
} | } | ||||
JSONObject datas = body.getJSONObject("datas"); | JSONObject datas = body.getJSONObject("datas"); | ||||
if(Objects.isNull(datas)){ | |||||
if (Objects.isNull(datas)) { | |||||
return null; | return null; | ||||
} | } | ||||
JSONObject data = datas.getJSONObject("data"); | JSONObject data = datas.getJSONObject("data"); | ||||
if(Objects.isNull(data)){ | |||||
if (Objects.isNull(data)) { | |||||
return null; | return null; | ||||
} | } | ||||
JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult"); | JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult"); | ||||
@@ -252,14 +268,14 @@ public class AppIrsManage { | |||||
String appKey = "A331101453557202109017383"; | String appKey = "A331101453557202109017383"; | ||||
String method = "POST"; | String method = "POST"; | ||||
String interfaceName = "5crv7i4727abLCv0"; | String interfaceName = "5crv7i4727abLCv0"; | ||||
String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,interfaceName,method); | |||||
log.info("secret :{}",secret); | |||||
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, method); | |||||
log.info("secret :{}", secret); | |||||
String sign = MD5.create().digestHex(appKey + secret + timestamp); | String sign = MD5.create().digestHex(appKey + secret + timestamp); | ||||
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); | HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); | ||||
RestTemplate restTemplate; | RestTemplate restTemplate; | ||||
if(Objects.nonNull(factory)){ | |||||
if (Objects.nonNull(factory)) { | |||||
restTemplate = new RestTemplate(factory); | restTemplate = new RestTemplate(factory); | ||||
}else{ | |||||
} else { | |||||
restTemplate = new RestTemplate(); | restTemplate = new RestTemplate(); | ||||
} | } | ||||
String appId = "A330000100000202105005790"; | String appId = "A330000100000202105005790"; | ||||
@@ -269,7 +285,7 @@ public class AppIrsManage { | |||||
"&sign=" + sign + "&appKey=" + appKey + | "&sign=" + sign + "&appKey=" + appKey + | ||||
"&capCode=" + capCode + "&capTime=" + timestamp + | "&capCode=" + capCode + "&capTime=" + timestamp + | ||||
"&appId=" + appId; | "&appId=" + appId; | ||||
log.info("url :{}",url); | |||||
log.info("url :{}", url); | |||||
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ||||
log.info(forEntity.getBody()); | log.info(forEntity.getBody()); | ||||
return forEntity.getBody(); | return forEntity.getBody(); | ||||
@@ -277,6 +293,7 @@ public class AppIrsManage { | |||||
/** | /** | ||||
* 推送项目详情 | * 推送项目详情 | ||||
* | |||||
* @return | * @return | ||||
*/ | */ | ||||
public String pushProjectDetail(ProjectDTO projectDto) { | public String pushProjectDetail(ProjectDTO projectDto) { | ||||
@@ -285,14 +302,14 @@ public class AppIrsManage { | |||||
String appKey = pushProjectAppKey; | String appKey = pushProjectAppKey; | ||||
String method = HttpMethod.POST.name(); | String method = HttpMethod.POST.name(); | ||||
String interfaceName = pushProjectInterfaceName; | String interfaceName = pushProjectInterfaceName; | ||||
String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,interfaceName,method); | |||||
log.info("secret :{}",secret); | |||||
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, method); | |||||
log.info("secret :{}", secret); | |||||
String sign = MD5.create().digestHex(appKey + secret + timestamp); | String sign = MD5.create().digestHex(appKey + secret + timestamp); | ||||
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); | HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); | ||||
RestTemplate restTemplate; | RestTemplate restTemplate; | ||||
if(Objects.nonNull(factory)){ | |||||
if (Objects.nonNull(factory)) { | |||||
restTemplate = new RestTemplate(factory); | restTemplate = new RestTemplate(factory); | ||||
}else{ | |||||
} else { | |||||
restTemplate = new RestTemplate(); | restTemplate = new RestTemplate(); | ||||
} | } | ||||
String baseProjPrincipal = projectDto.getResponsibleMan();//"蒋国海" | String baseProjPrincipal = projectDto.getResponsibleMan();//"蒋国海" | ||||
@@ -318,13 +335,13 @@ public class AppIrsManage { | |||||
String baseProvManDeprtDing = projectDto.getHigherSuperOrgCode();//"GO_6c383c049d95461f9a0df780140ceb32"; | String baseProvManDeprtDing = projectDto.getHigherSuperOrgCode();//"GO_6c383c049d95461f9a0df780140ceb32"; | ||||
String baseBasisEstablish = projectDto.getBuildBasis();//"中共遂昌县委办公室关于研究开发“天工”智能化管理平台(三期)的函"; | String baseBasisEstablish = projectDto.getBuildBasis();//"中共遂昌县委办公室关于研究开发“天工”智能化管理平台(三期)的函"; | ||||
String capCode = null; | String capCode = null; | ||||
try{ | |||||
try { | |||||
capCode = CryptUtils.encryptHMAC(timestamp + areaCode, "bcb4fc0f517fc168ee543fcf4d231f3b"); | capCode = CryptUtils.encryptHMAC(timestamp + areaCode, "bcb4fc0f517fc168ee543fcf4d231f3b"); | ||||
}catch (Exception e){ | |||||
} catch (Exception e) { | |||||
log.error(e.getMessage()); | log.error(e.getMessage()); | ||||
} | } | ||||
String url = pushProjectUrl+ "?" + | |||||
String url = pushProjectUrl + "?" + | |||||
"requestTime=" + timestamp + "&sign=" + sign + | "requestTime=" + timestamp + "&sign=" + sign + | ||||
"&appKey=" + appKey + "&baseProjPrincipal=" + baseProjPrincipal + "" + | "&appKey=" + appKey + "&baseProjPrincipal=" + baseProjPrincipal + "" + | ||||
"&baseProjSetYear=" + baseProjSetYear + "&baseProjId=" + baseProjId + | "&baseProjSetYear=" + baseProjSetYear + "&baseProjId=" + baseProjId + | ||||
@@ -337,9 +354,36 @@ public class AppIrsManage { | |||||
"&baseProjConsClass=" + baseProjConsClass + "&capCode=" + capCode + "&baseManDeprtDing=" + baseManDeprtDing + | "&baseProjConsClass=" + baseProjConsClass + "&capCode=" + capCode + "&baseManDeprtDing=" + baseManDeprtDing + | ||||
"&baseProvManDeprtDing=" + baseProvManDeprtDing + "&baseBasisEstablish=" + baseBasisEstablish + | "&baseProvManDeprtDing=" + baseProvManDeprtDing + "&baseBasisEstablish=" + baseBasisEstablish + | ||||
"&baseAreaCode=" + areaCode + "&capTime=" + timestamp + "&baseAreaName=" + baseAreaName; | "&baseAreaCode=" + areaCode + "&capTime=" + timestamp + "&baseAreaName=" + baseAreaName; | ||||
log.info("url :{}",url); | |||||
log.info("url :{}", url); | |||||
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ||||
log.info(forEntity.getBody()); | log.info(forEntity.getBody()); | ||||
return forEntity.getBody(); | return forEntity.getBody(); | ||||
} | } | ||||
public JSONObject getDigitalResourceIndicatorsByAppCode(String appCode, Integer pageSize) { | |||||
long timestamp = System.currentTimeMillis(); | |||||
String appSecret = driAppSecret; | |||||
String appKey = driAppKey; | |||||
String method = HttpMethod.POST.name(); | |||||
String interfaceName = driInterfaceName; | |||||
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, method); | |||||
log.info("secret : {}", secret); | |||||
String sign = MD5.create().digestHex(appKey + secret + timestamp); | |||||
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); | |||||
RestTemplate restTemplate; | |||||
if (Objects.nonNull(factory)) { | |||||
restTemplate = new RestTemplate(factory); | |||||
} else { | |||||
restTemplate = new RestTemplate(); | |||||
} | |||||
String url = driUrl + "?" + | |||||
"requestTime=" + timestamp + "&sign=" + sign + | |||||
"&appKey=" + appKey + "&appCode=" + appCode + "&pageIndex=1&pageSize=" + pageSize; | |||||
log.info("url :{}", url); | |||||
ResponseEntity<JSONObject> forEntity = restTemplate.getForEntity(url, JSONObject.class); | |||||
log.info(Objects.requireNonNull(forEntity.getBody()).toJSONString()); | |||||
return forEntity.getBody(); | |||||
} | |||||
} | } |
@@ -0,0 +1,43 @@ | |||||
package com.ningdatech.pmapi.meeting.controller; | |||||
import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq; | |||||
import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq.Basic; | |||||
import com.ningdatech.pmapi.meeting.manage.MeetingExpertJudgeManage; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.AllArgsConstructor; | |||||
import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import javax.validation.Valid; | |||||
/** | |||||
* <p> | |||||
* 前端控制器 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2023-07-31 | |||||
*/ | |||||
@Api(tags = "履职评价管理") | |||||
@AllArgsConstructor | |||||
@RestController | |||||
@RequestMapping("/api/v1/meeting/expert-judge") | |||||
public class MeetingExpertJudgeController { | |||||
private final MeetingExpertJudgeManage expertJudgeManage; | |||||
@ApiOperation("保存履职评价") | |||||
@PostMapping("/submit") | |||||
public void saveExpertJudge(@Validated(Basic.class) @RequestBody MeetingExpertJudgeReq req) { | |||||
expertJudgeManage.saveExpertJudge(req); | |||||
} | |||||
@ApiOperation("查看履职评价") | |||||
@GetMapping("/detail/{meetingExpertId}") | |||||
public MeetingExpertJudgeReq expertJudgeDetail(@PathVariable Long meetingExpertId) { | |||||
return expertJudgeManage.expertJudgeDetail(meetingExpertId); | |||||
} | |||||
} |
@@ -48,7 +48,7 @@ public class MeetingExportController { | |||||
} | } | ||||
@GetMapping("/expertInviteTable/{meetingId}") | @GetMapping("/expertInviteTable/{meetingId}") | ||||
@ApiOperation("专家评审单导出") | |||||
@ApiOperation("专家抽取表导出") | |||||
public void exportExpertInviteTable(@PathVariable Long meetingId, HttpServletResponse response) { | public void exportExpertInviteTable(@PathVariable Long meetingId, HttpServletResponse response) { | ||||
expertExportManage.expertInviteTable(meetingId, response); | expertExportManage.expertInviteTable(meetingId, response); | ||||
} | } | ||||
@@ -0,0 +1,65 @@ | |||||
package com.ningdatech.pmapi.meeting.entity.domain; | |||||
import com.baomidou.mybatisplus.annotation.*; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* <p> | |||||
* 会议专家履职评价表 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2023-07-31 | |||||
*/ | |||||
@Data | |||||
@TableName("meeting_expert_judge") | |||||
@ApiModel(value = "MeetingExpertJudge对象") | |||||
public class MeetingExpertJudge implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@TableId(type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty("会议ID") | |||||
private Long meetingId; | |||||
private Long expertId; | |||||
@ApiModelProperty("会议专家ID") | |||||
private Long meetingExpertId; | |||||
@ApiModelProperty("评分(1~10)") | |||||
private Integer score; | |||||
@ApiModelProperty("是否参加:1 准时、2 迟到、3 缺席") | |||||
private Integer attended; | |||||
@ApiModelProperty("参与程度:1 积极、2 消极") | |||||
private Integer performance; | |||||
@ApiModelProperty("是否提出建议:true 是、false 否") | |||||
private Boolean advised; | |||||
@ApiModelProperty("是否早退:true 早退、false 未早退") | |||||
private Boolean leaveEarly; | |||||
@ApiModelProperty("是否违规:true 是、false 否") | |||||
private Boolean brokeRule; | |||||
@ApiModelProperty("违规内容") | |||||
private String brokeRuleContent; | |||||
@TableField(fill = FieldFill.INSERT) | |||||
private Long createBy; | |||||
@TableField(fill = FieldFill.INSERT) | |||||
private LocalDateTime createOn; | |||||
} |
@@ -2,6 +2,8 @@ package com.ningdatech.pmapi.meeting.entity.dto; | |||||
import lombok.Data; | import lombok.Data; | ||||
import java.io.Serializable; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* ExpertReviewTableDTO | * ExpertReviewTableDTO | ||||
@@ -11,7 +13,9 @@ import lombok.Data; | |||||
* @since 2023/7/24 | * @since 2023/7/24 | ||||
**/ | **/ | ||||
@Data | @Data | ||||
public class ExpertReviewTableDTO { | |||||
public class ExpertReviewTableDTO implements Serializable { | |||||
private static final long serialVersionUID = 3383159744182234397L; | |||||
private String projectName; | private String projectName; | ||||
@@ -21,4 +25,6 @@ public class ExpertReviewTableDTO { | |||||
private String holdOrg; | private String holdOrg; | ||||
private String reviewResult; | |||||
} | } |
@@ -15,6 +15,10 @@ public class MeetingAndAttendStatusDTO { | |||||
private Long meetingId; | private Long meetingId; | ||||
private Long meetingExpertId; | |||||
private Long expertId; | |||||
private Integer status; | private Integer status; | ||||
private Boolean attended; | private Boolean attended; | ||||
@@ -0,0 +1,49 @@ | |||||
package com.ningdatech.pmapi.meeting.entity.enumeration; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
/** | |||||
* <p> | |||||
* ExpertJudgeEnum | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2023/8/3 | |||||
**/ | |||||
public class ExpertJudgeEnum { | |||||
private ExpertJudgeEnum() { | |||||
} | |||||
@Getter | |||||
@AllArgsConstructor | |||||
public enum AttendStatus { | |||||
ON_TIME(1, "准时"), | |||||
BE_LATE(2, "迟到"), | |||||
ABSENT(3, "缺席"); | |||||
private final Integer code; | |||||
private final String value; | |||||
public boolean eq(Integer code) { | |||||
return this.code.equals(code); | |||||
} | |||||
} | |||||
@Getter | |||||
@AllArgsConstructor | |||||
public enum Performance { | |||||
POSITIVE(1, "积极"), | |||||
NEGATIVE(2, "消极"); | |||||
private final Integer code; | |||||
private final String value; | |||||
public boolean eq(Integer code) { | |||||
return this.code.equals(code); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,77 @@ | |||||
package com.ningdatech.pmapi.meeting.entity.req; | |||||
import com.alibaba.fastjson.annotation.JSONField; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.time.LocalDateTime; | |||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertJudgeEnum; | |||||
import org.hibernate.validator.constraints.Range; | |||||
/** | |||||
* <p> | |||||
* MeetingExpertJudgeReq | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2023/7/31 | |||||
**/ | |||||
@Data | |||||
public class MeetingExpertJudgeReq { | |||||
private Long id; | |||||
@NotNull(message = "会议ID不能为空", groups = Basic.class) | |||||
private Long meetingId; | |||||
@NotNull(message = "会议专家ID不能为空", groups = Basic.class) | |||||
private Long meetingExpertId; | |||||
@ApiModelProperty("评分(1~10)") | |||||
@NotNull(message = "评分不能为空", groups = Basic.class) | |||||
@Range(min = 1, max = 10, message = "评分范围为:1~10") | |||||
private Integer score; | |||||
/** | |||||
* @see ExpertJudgeEnum.AttendStatus | |||||
*/ | |||||
@ApiModelProperty("是否参加:1 准时、2 迟到、3 缺席") | |||||
@NotNull(message = "是否参加不能为空", groups = Basic.class) | |||||
private Integer attended; | |||||
/** | |||||
* @see ExpertJudgeEnum.Performance | |||||
*/ | |||||
@ApiModelProperty("参与程度:1 积极、2 消极") | |||||
@NotNull(message = "参与度不能为空", groups = Attend.class) | |||||
private Integer performance; | |||||
@ApiModelProperty("是否提出建议:true 是、false 否") | |||||
@NotNull(message = "是否提出建议不能为空", groups = Attend.class) | |||||
private Boolean advised; | |||||
@ApiModelProperty("是否早退:true 早退、false 未早退") | |||||
@NotNull(message = "是否早退不能为空", groups = Attend.class) | |||||
private Boolean leaveEarly; | |||||
@ApiModelProperty("是否违规:true 是、false 否") | |||||
@NotNull(message = "是否违规不能为空", groups = Attend.class) | |||||
private Boolean brokeRule; | |||||
@ApiModelProperty("违规内容") | |||||
private String brokeRuleContent; | |||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
private LocalDateTime createOn; | |||||
//================================================================================================================== | |||||
public interface Attend { | |||||
} | |||||
public interface Basic { | |||||
} | |||||
} |
@@ -29,6 +29,9 @@ public class MeetingByManagerVO { | |||||
@ApiModelProperty("会议ID") | @ApiModelProperty("会议ID") | ||||
private Long meetingId; | private Long meetingId; | ||||
@ApiModelProperty("会议专家ID") | |||||
private Long meetingExpertId; | |||||
@ApiModelProperty("会议开始时间") | @ApiModelProperty("会议开始时间") | ||||
@JSONField(format = "yyyy-MM-dd HH:mm") | @JSONField(format = "yyyy-MM-dd HH:mm") | ||||
private LocalDateTime startTime; | private LocalDateTime startTime; | ||||
@@ -70,4 +73,7 @@ public class MeetingByManagerVO { | |||||
@ApiModelProperty("联系方式") | @ApiModelProperty("联系方式") | ||||
private String contact; | private String contact; | ||||
@ApiModelProperty("是否评价") | |||||
private Boolean hasJudge; | |||||
} | } |
@@ -3,16 +3,20 @@ package com.ningdatech.pmapi.meeting.manage; | |||||
import cn.hutool.core.lang.Assert; | import cn.hutool.core.lang.Assert; | ||||
import cn.hutool.core.lang.UUID; | import cn.hutool.core.lang.UUID; | ||||
import cn.hutool.core.util.StrUtil; | import cn.hutool.core.util.StrUtil; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import com.ningdatech.pmapi.common.model.FreemarkerBatchExportDTO; | |||||
import com.ningdatech.pmapi.common.util.FreemarkerWordUtil; | import com.ningdatech.pmapi.common.util.FreemarkerWordUtil; | ||||
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; | import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; | ||||
import com.ningdatech.pmapi.expert.manage.ExpertReviewManage; | |||||
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | ||||
import com.ningdatech.pmapi.meeting.entity.domain.Meeting; | import com.ningdatech.pmapi.meeting.entity.domain.Meeting; | ||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | ||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingInnerProject; | import com.ningdatech.pmapi.meeting.entity.domain.MeetingInnerProject; | ||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingOuterProject; | import com.ningdatech.pmapi.meeting.entity.domain.MeetingOuterProject; | ||||
import com.ningdatech.pmapi.meeting.entity.dto.*; | import com.ningdatech.pmapi.meeting.entity.dto.*; | ||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||||
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; | import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; | ||||
import com.ningdatech.pmapi.meeting.service.IMeetingInnerProjectService; | import com.ningdatech.pmapi.meeting.service.IMeetingInnerProjectService; | ||||
import com.ningdatech.pmapi.meeting.service.IMeetingOuterProjectService; | import com.ningdatech.pmapi.meeting.service.IMeetingOuterProjectService; | ||||
@@ -29,11 +33,13 @@ import javax.servlet.http.HttpServletResponse; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Collections; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | import java.util.Map; | ||||
import java.util.concurrent.atomic.AtomicInteger; | import java.util.concurrent.atomic.AtomicInteger; | ||||
import java.util.function.Function; | import java.util.function.Function; | ||||
import java.util.function.Supplier; | import java.util.function.Supplier; | ||||
import java.util.stream.Collectors; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -54,6 +60,7 @@ public class ExpertExportManage { | |||||
private final IMeetingOuterProjectService meetingOuterProjectService; | private final IMeetingOuterProjectService meetingOuterProjectService; | ||||
private final IExpertUserFullInfoService expertUserInfoService; | private final IExpertUserFullInfoService expertUserInfoService; | ||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private final ExpertReviewManage expertReviewManage; | |||||
//================================================================================================================== | //================================================================================================================== | ||||
@@ -78,6 +85,16 @@ public class ExpertExportManage { | |||||
static Supplier<String> wordName = () -> UUID.randomUUID().toString(true) + ".doc"; | static Supplier<String> wordName = () -> UUID.randomUUID().toString(true) + ".doc"; | ||||
private List<MeetingExpert> listExpertsByAgreeOrLeave(Long meetingId) { | |||||
Page<MeetingExpert> page = Page.of(1, 20); | |||||
meetingExpertService.pageExpertByStatusAndMeetingId(page, meetingId, null, null); | |||||
if (page.getTotal() == 0) { | |||||
return Collections.emptyList(); | |||||
} | |||||
page.getRecords().removeIf(w -> !(ExpertAttendStatusEnum.AGREED.eq(w.getStatus()) || ExpertAttendStatusEnum.ON_LEAVE.eq(w.getStatus()))); | |||||
return page.getRecords(); | |||||
} | |||||
//================================================================================================================== | //================================================================================================================== | ||||
public void exportFeeForExpert(Long meetingId, HttpServletResponse response) { | public void exportFeeForExpert(Long meetingId, HttpServletResponse response) { | ||||
@@ -130,22 +147,43 @@ public class ExpertExportManage { | |||||
public void expertReviewTable(Long meetingId, HttpServletResponse response) { | public void expertReviewTable(Long meetingId, HttpServletResponse response) { | ||||
try { | try { | ||||
Meeting meeting = meetingService.getById(meetingId); | Meeting meeting = meetingService.getById(meetingId); | ||||
ExpertReviewTableDTO data = new ExpertReviewTableDTO(); | |||||
data.setMeetingTime(DateUtil.localDateTimeFormat(meeting.getStartTime(), "yyyy年M月d日")); | |||||
data.setMeetingAddress(meeting.getMeetingAddress()); | |||||
data.setHoldOrg(meeting.getHoldOrg()); | |||||
List<String> projectNames = new ArrayList<>(); | |||||
String startTime = DateUtil.localDateTimeFormat(meeting.getStartTime(), "yyyy年M月d日"); | |||||
List<FreemarkerBatchExportDTO> fbeList; | |||||
if (meeting.getIsInnerProject()) { | if (meeting.getIsInnerProject()) { | ||||
List<MeetingInnerProject> inners = meetingInnerProjectService.listByMeetingId(meetingId); | List<MeetingInnerProject> inners = meetingInnerProjectService.listByMeetingId(meetingId); | ||||
Map<Long, String> reviewResultMap = expertReviewManage.buildExpertReviewToStr(meetingId); | |||||
List<Long> projectIds = CollUtils.fieldList(inners, MeetingInnerProject::getProjectId); | List<Long> projectIds = CollUtils.fieldList(inners, MeetingInnerProject::getProjectId); | ||||
List<Project> projects = projectService.listByIds(projectIds); | List<Project> projects = projectService.listByIds(projectIds); | ||||
projects.forEach(w -> projectNames.add(w.getProjectName())); | |||||
fbeList = projects.stream().map(w -> { | |||||
FreemarkerBatchExportDTO fbe = new FreemarkerBatchExportDTO(); | |||||
ExpertReviewTableDTO currData = new ExpertReviewTableDTO(); | |||||
currData.setHoldOrg(meeting.getHoldOrg()); | |||||
currData.setMeetingTime(startTime); | |||||
currData.setMeetingAddress(meeting.getMeetingAddress()); | |||||
currData.setProjectName(w.getProjectName()); | |||||
currData.setReviewResult(reviewResultMap.get(w.getId())); | |||||
fbe.setData(currData); | |||||
fbe.setTemplate(EXPERT_REVIEW); | |||||
fbe.setFileName(w.getProjectName() + ".doc"); | |||||
return fbe; | |||||
}).collect(Collectors.toList()); | |||||
} else { | } else { | ||||
List<MeetingOuterProject> inners = meetingOuterProjectService.listByMeetingId(meetingId); | List<MeetingOuterProject> inners = meetingOuterProjectService.listByMeetingId(meetingId); | ||||
inners.forEach(w -> projectNames.add(w.getProjectName())); | |||||
fbeList = inners.stream().map(w -> { | |||||
FreemarkerBatchExportDTO fbe = new FreemarkerBatchExportDTO(); | |||||
ExpertReviewTableDTO currData = new ExpertReviewTableDTO(); | |||||
currData.setHoldOrg(meeting.getHoldOrg()); | |||||
currData.setMeetingTime(startTime); | |||||
currData.setMeetingAddress(meeting.getMeetingAddress()); | |||||
currData.setProjectName(w.getProjectName()); | |||||
fbe.setData(currData); | |||||
fbe.setTemplate(EXPERT_REVIEW); | |||||
fbe.setFileName(w.getProjectName() + ".doc"); | |||||
return fbe; | |||||
}).collect(Collectors.toList()); | |||||
} | } | ||||
data.setProjectName(StrUtil.join("、", projectNames)); | |||||
FreemarkerWordUtil.export(wordName.get(), data, response, EXPERT_REVIEW); | |||||
String exportFileName = meeting.getName() + "专家评审表.zip"; | |||||
FreemarkerWordUtil.exportBatch(response, fbeList, exportFileName); | |||||
} catch (TemplateException | IOException e) { | } catch (TemplateException | IOException e) { | ||||
log.error("专家评审单导出异常:{}", meetingId, e); | log.error("专家评审单导出异常:{}", meetingId, e); | ||||
throw BizException.wrap("专家评审单导出失败"); | throw BizException.wrap("专家评审单导出失败"); | ||||
@@ -171,13 +209,17 @@ public class ExpertExportManage { | |||||
data.setProjectName(StrUtil.join("、", projectNames)); | data.setProjectName(StrUtil.join("、", projectNames)); | ||||
data.setExperts(new ArrayList<>()); | data.setExperts(new ArrayList<>()); | ||||
// 设置专家信息 | // 设置专家信息 | ||||
List<MeetingExpert> experts = meetingExpertService.listAgreedExperts(meetingId); | |||||
List<MeetingExpert> experts = listExpertsByAgreeOrLeave(meetingId); | |||||
List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); | List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); | ||||
List<ExpertUserFullInfo> expertInfos = expertUserInfoService.listByUserId(expertIds); | List<ExpertUserFullInfo> expertInfos = expertUserInfoService.listByUserId(expertIds); | ||||
Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertInfos, ExpertUserFullInfo::getUserId); | Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertInfos, ExpertUserFullInfo::getUserId); | ||||
experts.forEach(w -> { | experts.forEach(w -> { | ||||
ExpertInfoDTO expert = new ExpertInfoDTO(); | ExpertInfoDTO expert = new ExpertInfoDTO(); | ||||
expert.setName(w.getExpertName()); | |||||
if (ExpertAttendStatusEnum.ON_LEAVE.eq(w.getStatus())) { | |||||
expert.setBank(w.getExpertName() + "(请假)"); | |||||
} else { | |||||
expert.setName(w.getExpertName()); | |||||
} | |||||
ExpertUserFullInfo expertUser = expertMap.get(w.getExpertId()); | ExpertUserFullInfo expertUser = expertMap.get(w.getExpertId()); | ||||
if (expertUser != null) { | if (expertUser != null) { | ||||
expert.setCompany(expertUser.getCompany()); | expert.setCompany(expertUser.getCompany()); | ||||
@@ -217,7 +259,7 @@ public class ExpertExportManage { | |||||
} | } | ||||
data.setExperts(new ArrayList<>()); | data.setExperts(new ArrayList<>()); | ||||
// 设置专家信息 | // 设置专家信息 | ||||
List<MeetingExpert> experts = meetingExpertService.listAgreedExperts(meetingId); | |||||
List<MeetingExpert> experts = listExpertsByAgreeOrLeave(meetingId); | |||||
List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); | List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); | ||||
List<ExpertUserFullInfo> expertInfos = expertUserInfoService.listByUserId(expertIds); | List<ExpertUserFullInfo> expertInfos = expertUserInfoService.listByUserId(expertIds); | ||||
Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertInfos, ExpertUserFullInfo::getUserId); | Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertInfos, ExpertUserFullInfo::getUserId); | ||||
@@ -225,7 +267,11 @@ public class ExpertExportManage { | |||||
experts.forEach(w -> { | experts.forEach(w -> { | ||||
ExpertInfoDTO expert = new ExpertInfoDTO(); | ExpertInfoDTO expert = new ExpertInfoDTO(); | ||||
expert.setNo(integer.incrementAndGet()); | expert.setNo(integer.incrementAndGet()); | ||||
expert.setName(w.getExpertName()); | |||||
if (ExpertAttendStatusEnum.ON_LEAVE.eq(w.getStatus())) { | |||||
expert.setBank(w.getExpertName() + "(请假)"); | |||||
} else { | |||||
expert.setName(w.getExpertName()); | |||||
} | |||||
expert.setMobile(w.getMobile()); | expert.setMobile(w.getMobile()); | ||||
ExpertUserFullInfo expertUser = expertMap.get(w.getExpertId()); | ExpertUserFullInfo expertUser = expertMap.get(w.getExpertId()); | ||||
if (expertUser != null) { | if (expertUser != null) { | ||||
@@ -0,0 +1,94 @@ | |||||
package com.ningdatech.pmapi.meeting.manage; | |||||
import cn.hutool.core.bean.BeanUtil; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.util.CollUtils; | |||||
import com.ningdatech.basic.util.ValidUtil; | |||||
import com.ningdatech.cache.lock.DistributedLock; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.Meeting; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpertJudge; | |||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertJudgeEnum; | |||||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; | |||||
import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq; | |||||
import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq.Attend; | |||||
import com.ningdatech.pmapi.meeting.service.IMeetingExpertJudgeService; | |||||
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; | |||||
import com.ningdatech.pmapi.meeting.service.IMeetingService; | |||||
import lombok.AllArgsConstructor; | |||||
import org.springframework.stereotype.Component; | |||||
import java.util.Map; | |||||
/** | |||||
* <p> | |||||
* MeetingExpertJudgeManage | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2023/7/31 | |||||
**/ | |||||
@Component | |||||
@AllArgsConstructor | |||||
public class MeetingExpertJudgeManage { | |||||
private final IMeetingExpertJudgeService expertJudgeService; | |||||
private final IMeetingExpertService meetingExpertService; | |||||
private final IMeetingService meetingService; | |||||
private final DistributedLock distributedLock; | |||||
private MeetingExpertJudge getMeetingExpertJudge(Long meetingExpertId) { | |||||
LambdaQueryWrapper<MeetingExpertJudge> query = Wrappers.lambdaQuery(MeetingExpertJudge.class) | |||||
.eq(MeetingExpertJudge::getMeetingExpertId, meetingExpertId); | |||||
return expertJudgeService.getOne(query); | |||||
} | |||||
public void saveExpertJudge(MeetingExpertJudgeReq req) { | |||||
String key = "lock_expert_judge:" + req.getMeetingExpertId(); | |||||
if (!distributedLock.lock(key, 3)) { | |||||
throw BizException.wrap("履职评价失败,请重试"); | |||||
} | |||||
try { | |||||
if (!ExpertJudgeEnum.AttendStatus.ABSENT.eq(req.getAttended())) { | |||||
Map<String, String> validMap = ValidUtil.valid(req, Attend.class); | |||||
if (!validMap.isEmpty()) { | |||||
String errMsg = CollUtils.joinByComma(validMap.values()); | |||||
throw BizException.wrap(errMsg); | |||||
} | |||||
} | |||||
// 会议状态校验 | |||||
Meeting meeting = meetingService.getById(req.getMeetingId()); | |||||
if (meeting == null || MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) { | |||||
throw BizException.wrap("会议不存在或已取消"); | |||||
} | |||||
// 专家抽取状态校验 | |||||
MeetingExpert expert = meetingExpertService.getById(req.getMeetingExpertId()); | |||||
if (expert == null || (ExpertAttendStatusEnum.AGREED.eq(expert.getStatus()) | |||||
&& ExpertAttendStatusEnum.ON_LEAVE.eq(expert.getStatus()))) { | |||||
throw BizException.wrap("未被抽中专家无法进行履职评价"); | |||||
} | |||||
// 智能履职评价一次 | |||||
MeetingExpertJudge judge = getMeetingExpertJudge(req.getMeetingExpertId()); | |||||
if (judge != null) { | |||||
throw BizException.wrap("履职评价已提交"); | |||||
} | |||||
MeetingExpertJudge entity = BeanUtil.copyProperties(req, MeetingExpertJudge.class); | |||||
entity.setExpertId(expert.getExpertId()); | |||||
expertJudgeService.save(entity); | |||||
} finally { | |||||
distributedLock.releaseLock(key); | |||||
} | |||||
} | |||||
public MeetingExpertJudgeReq expertJudgeDetail(Long meetingExpertId) { | |||||
MeetingExpertJudge judge = getMeetingExpertJudge(meetingExpertId); | |||||
if (judge == null) { | |||||
throw BizException.wrap("履职评价未提交"); | |||||
} | |||||
return BeanUtil.copyProperties(judge, MeetingExpertJudgeReq.class); | |||||
} | |||||
} |
@@ -97,6 +97,7 @@ public class MeetingManage { | |||||
private final ExpertInviteHelper expertInviteHelper; | private final ExpertInviteHelper expertInviteHelper; | ||||
private final MeetingCallOrMsgHelper meetingCallOrMsgHelper; | private final MeetingCallOrMsgHelper meetingCallOrMsgHelper; | ||||
private final MeetingDataScopeHelper meetingDataScopeHelper; | private final MeetingDataScopeHelper meetingDataScopeHelper; | ||||
private final IMeetingExpertJudgeService expertJudgeService; | |||||
private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; | private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; | ||||
private static final String MEETING_CREATE_KEY = "MEETING_CREATE:"; | private static final String MEETING_CREATE_KEY = "MEETING_CREATE:"; | ||||
@@ -324,7 +325,11 @@ public class MeetingManage { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
Map<Long, MeetingAndAttendStatusDTO> mapByMeetingId = new HashMap<>(16); | Map<Long, MeetingAndAttendStatusDTO> mapByMeetingId = new HashMap<>(16); | ||||
meetings.forEach(w -> mapByMeetingId.put(w.getMeetingId(), w)); | |||||
List<Long> meetingExpertIds = new ArrayList<>(); | |||||
meetings.forEach(w -> { | |||||
mapByMeetingId.put(w.getMeetingId(), w); | |||||
meetingExpertIds.add(w.getMeetingExpertId()); | |||||
}); | |||||
LambdaQueryWrapper<Meeting> query = new LambdaQueryWrapper<Meeting>() | LambdaQueryWrapper<Meeting> query = new LambdaQueryWrapper<Meeting>() | ||||
.orderByDesc(Meeting::getCreateOn) | .orderByDesc(Meeting::getCreateOn) | ||||
.in(Meeting::getId, mapByMeetingId.keySet()) | .in(Meeting::getId, mapByMeetingId.keySet()) | ||||
@@ -337,11 +342,14 @@ public class MeetingManage { | |||||
if (page.getTotal() == 0) { | if (page.getTotal() == 0) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<Long> existsMeIds = expertJudgeService.listExistsMeetingExpertIds(meetingExpertIds); | |||||
PageVo<MeetingByManagerVO> result = new PageVo<>(new ArrayList<>(), page.getTotal()); | PageVo<MeetingByManagerVO> result = new PageVo<>(new ArrayList<>(), page.getTotal()); | ||||
page.getRecords().forEach(meeting -> { | page.getRecords().forEach(meeting -> { | ||||
MeetingByManagerVO item = meetingManageHelper.buildByMeeting(meeting); | MeetingByManagerVO item = meetingManageHelper.buildByMeeting(meeting); | ||||
MeetingAndAttendStatusDTO info = mapByMeetingId.get(meeting.getId()); | MeetingAndAttendStatusDTO info = mapByMeetingId.get(meeting.getId()); | ||||
item.setMeetingExpertId(info.getMeetingExpertId()); | |||||
item.setExpertStatus(info.getStatus()); | item.setExpertStatus(info.getStatus()); | ||||
item.setHasJudge(existsMeIds.contains(info.getMeetingExpertId())); | |||||
result.getRecords().add(item); | result.getRecords().add(item); | ||||
}); | }); | ||||
return result; | return result; | ||||
@@ -0,0 +1,16 @@ | |||||
package com.ningdatech.pmapi.meeting.mapper; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpertJudge; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-07-31 | |||||
*/ | |||||
public interface MeetingExpertJudgeMapper extends BaseMapper<MeetingExpertJudge> { | |||||
} |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.ningdatech.pmapi.meeting.mapper.MeetingExpertJudgeMapper"> | |||||
</mapper> |
@@ -4,7 +4,7 @@ | |||||
<select id="selectByExpertIdAndStatus" | <select id="selectByExpertIdAndStatus" | ||||
resultType="com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO"> | resultType="com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO"> | ||||
SELECT em.meeting_id meetingId, em.status | |||||
SELECT em.meeting_id meetingId, em.status, em.ID meetingExpertId | |||||
FROM (SELECT ROW_NUMBER() OVER ( PARTITION BY meeting_id ORDER BY update_on DESC ) rowNumber, ID, expert_id, | FROM (SELECT ROW_NUMBER() OVER ( PARTITION BY meeting_id ORDER BY update_on DESC ) rowNumber, ID, expert_id, | ||||
status, meeting_id | status, meeting_id | ||||
FROM meeting_expert | FROM meeting_expert | ||||
@@ -0,0 +1,34 @@ | |||||
package com.ningdatech.pmapi.meeting.service; | |||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.basic.util.CollUtils; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpertJudge; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
import java.util.Collection; | |||||
import java.util.Collections; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-07-31 | |||||
*/ | |||||
public interface IMeetingExpertJudgeService extends IService<MeetingExpertJudge> { | |||||
default List<Long> listExistsMeetingExpertIds(Collection<Long> meetingExpertIds) { | |||||
if (CollUtil.isEmpty(meetingExpertIds)) { | |||||
return Collections.emptyList(); | |||||
} | |||||
LambdaQueryWrapper<MeetingExpertJudge> query = Wrappers.lambdaQuery(MeetingExpertJudge.class) | |||||
.select(MeetingExpertJudge::getMeetingExpertId) | |||||
.in(MeetingExpertJudge::getMeetingExpertId, meetingExpertIds); | |||||
return CollUtils.fieldList(list(query), MeetingExpertJudge::getMeetingExpertId); | |||||
} | |||||
} |
@@ -0,0 +1,20 @@ | |||||
package com.ningdatech.pmapi.meeting.service.impl; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpertJudge; | |||||
import com.ningdatech.pmapi.meeting.mapper.MeetingExpertJudgeMapper; | |||||
import com.ningdatech.pmapi.meeting.service.IMeetingExpertJudgeService; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-07-31 | |||||
*/ | |||||
@Service | |||||
public class MeetingExpertJudgeServiceImpl extends ServiceImpl<MeetingExpertJudgeMapper, MeetingExpertJudge> implements IMeetingExpertJudgeService { | |||||
} |
@@ -4,7 +4,6 @@ import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.log.annotation.WebLog; | import com.ningdatech.log.annotation.WebLog; | ||||
import com.ningdatech.pmapi.common.util.ExcelDownUtil; | import com.ningdatech.pmapi.common.util.ExcelDownUtil; | ||||
import com.ningdatech.pmapi.projectdeclared.manage.DelayedApplyManage; | import com.ningdatech.pmapi.projectdeclared.manage.DelayedApplyManage; | ||||
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; | |||||
import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; | import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; | ||||
import com.ningdatech.pmapi.projectdeclared.model.vo.DelayedApplyVO; | import com.ningdatech.pmapi.projectdeclared.model.vo.DelayedApplyVO; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | ||||
@@ -16,6 +15,7 @@ import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @Classname DelayedProjectController | * @Classname DelayedProjectController | ||||
@@ -39,6 +39,12 @@ public class DelayedApplyController { | |||||
return delayedApplyManage.projectLibList(req); | return delayedApplyManage.projectLibList(req); | ||||
} | } | ||||
@ApiOperation(value = "查看某个项目的延期列表", notes = "查看某个项目的延期列表") | |||||
@GetMapping("/delay-list/{projectId}") | |||||
public List<DelayedApplyVO> delayList(@PathVariable Long projectId) { | |||||
return delayedApplyManage.delayList(projectId); | |||||
} | |||||
@ApiOperation(value = "延期的内容详情", notes = "延期的内容详情") | @ApiOperation(value = "延期的内容详情", notes = "延期的内容详情") | ||||
@GetMapping("/detail/{projectId}") | @GetMapping("/detail/{projectId}") | ||||
public DelayedApplyVO detailByProjectId(@PathVariable Long projectId) { | public DelayedApplyVO detailByProjectId(@PathVariable Long projectId) { | ||||
@@ -175,7 +175,13 @@ public class ConstructionPlanManage { | |||||
log.info("建设方案项目申报成功 【{}】", instanceId); | log.info("建设方案项目申报成功 【{}】", instanceId); | ||||
// 保存建设项目相关 | // 保存建设项目相关 | ||||
Project buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode,oldProject); | |||||
Project buildProject = new Project(); | |||||
if(dto.getRestart()){ | |||||
//如果是重新提交 不用生成新版本 前面已经生成过了 | |||||
buildProject = contructionPlanModifyProject(oldProject, instanceId); | |||||
}else{ | |||||
buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode,oldProject); | |||||
} | |||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirtUser(buildProject,model.getFormName(),instanceId, | noticeManage.sendFirtUser(buildProject,model.getFormName(),instanceId, | ||||
@@ -184,6 +190,24 @@ public class ConstructionPlanManage { | |||||
return instanceId; | return instanceId; | ||||
} | } | ||||
private Project contructionPlanModifyProject(Project project, String instanceId) { | |||||
stateMachineUtils.pass(project); | |||||
project.setUpdateOn(LocalDateTime.now()); | |||||
project.setInstCode(instanceId); | |||||
projectService.updateById(project); | |||||
//保存项目和实例的关系 | |||||
ProjectInst projectInst = new ProjectInst(); | |||||
projectInst.setProjectId(project.getId()); | |||||
projectInst.setInstCode(instanceId); | |||||
projectInst.setCreatOn(LocalDateTime.now()); | |||||
projectInst.setUpdateOn(LocalDateTime.now()); | |||||
projectInst.setInstType(ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode()); | |||||
projectInstService.save(projectInst); | |||||
return project; | |||||
} | |||||
/** | /** | ||||
* 驳回 重新提交建设方案 | * 驳回 重新提交建设方案 | ||||
* | * | ||||
@@ -303,4 +303,22 @@ public class DelayedApplyManage { | |||||
} | } | ||||
return BeanUtil.copyProperties(delayApply,DelayedApplyVO.class); | return BeanUtil.copyProperties(delayApply,DelayedApplyVO.class); | ||||
} | } | ||||
/** | |||||
* 查看某个项目的 延期列表 | |||||
* @param projectId | |||||
* @return | |||||
*/ | |||||
public List<DelayedApplyVO> delayList(Long projectId) { | |||||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectId); | |||||
List<ProjectDelayApply> delays = projectDelayApplyService.list(Wrappers.lambdaQuery(ProjectDelayApply.class) | |||||
.in(ProjectDelayApply::getProjectId, allVersionProjectId)); | |||||
if(CollUtil.isEmpty(delays)){ | |||||
return Collections.emptyList(); | |||||
} | |||||
return delays.stream().map(d -> BeanUtil.copyProperties(d,DelayedApplyVO.class)) | |||||
.collect(Collectors.toList()); | |||||
} | |||||
} | } |
@@ -238,7 +238,8 @@ public class FinalAcceptanceManage { | |||||
//保存终验项目 | //保存终验项目 | ||||
//生成新版本 并且进入下一状态 | //生成新版本 并且进入下一状态 | ||||
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()); | |||||
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, | |||||
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE); | |||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | ||||
@@ -298,7 +299,8 @@ public class FinalAcceptanceManage { | |||||
//保存终验项目 | //保存终验项目 | ||||
//生成新版本 并且进入下一状态 | //生成新版本 并且进入下一状态 | ||||
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()); | |||||
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, | |||||
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE); | |||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | ||||
@@ -81,6 +81,8 @@ public class OperationManage { | |||||
entity.setProjectCode(project.getProjectCode()); | entity.setProjectCode(project.getProjectCode()); | ||||
entity.setUpdateOn(LocalDateTime.now()); | entity.setUpdateOn(LocalDateTime.now()); | ||||
entity.setUpdateBy(user.getUsername()); | entity.setUpdateBy(user.getUsername()); | ||||
//强制放入 计划终验时间 | |||||
entity.setFinalInspectionDate(project.getPlanAcceptanceTime()); | |||||
if(operationService.saveOrUpdate(entity)){ | if(operationService.saveOrUpdate(entity)){ | ||||
stateMachineUtils.pass(project); | stateMachineUtils.pass(project); | ||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
@@ -102,9 +102,6 @@ public class ReviewByDeptJointManage { | |||||
//保存项目信息 | //保存项目信息 | ||||
projectInfo = projectLibManage.saveProjectWithVersion(projectInfo,instanceId,ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode()); | projectInfo = projectLibManage.saveProjectWithVersion(projectInfo,instanceId,ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode()); | ||||
// if(!modifyProject(projectInfo, instanceId)){ | |||||
// return Boolean.FALSE; | |||||
// } | |||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | ||||
@@ -12,6 +12,7 @@ import com.ningdatech.pmapi.common.constant.BizConst; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | ||||
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; | |||||
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | ||||
import com.wflow.workflow.bean.process.ProgressNode; | import com.wflow.workflow.bean.process.ProgressNode; | ||||
import com.wflow.workflow.bean.vo.ProcessDetailVO; | import com.wflow.workflow.bean.vo.ProcessDetailVO; | ||||
@@ -64,6 +65,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle | |||||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ||||
.in(ProjectInst::getProjectId, allVersionProjectIds) | .in(ProjectInst::getProjectId, allVersionProjectIds) | ||||
.eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) | .eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) | ||||
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) | |||||
.orderByDesc(ProjectInst::getCreatOn) | .orderByDesc(ProjectInst::getCreatOn) | ||||
.last(BizConst.LIMIT_1)); | .last(BizConst.LIMIT_1)); | ||||
ProcessProgressVo instanceDetail = null; | ProcessProgressVo instanceDetail = null; | ||||
@@ -10,6 +10,7 @@ import com.ningdatech.basic.util.NdDateUtils; | |||||
import com.ningdatech.pmapi.common.constant.BizConst; | import com.ningdatech.pmapi.common.constant.BizConst; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | ||||
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; | |||||
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | ||||
import com.wflow.workflow.bean.process.ProgressNode; | import com.wflow.workflow.bean.process.ProgressNode; | ||||
import com.wflow.workflow.bean.vo.ProcessDetailVO; | import com.wflow.workflow.bean.vo.ProcessDetailVO; | ||||
@@ -66,6 +67,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { | |||||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ||||
.in(ProjectInst::getProjectId, allVersionProjectIds) | .in(ProjectInst::getProjectId, allVersionProjectIds) | ||||
.eq(ProjectInst::getInstType, InstTypeEnum.DEPT_UNITED_REVIEW.getCode()) | .eq(ProjectInst::getInstType, InstTypeEnum.DEPT_UNITED_REVIEW.getCode()) | ||||
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) | |||||
.orderByDesc(ProjectInst::getCreatOn) | .orderByDesc(ProjectInst::getCreatOn) | ||||
.last(BizConst.LIMIT_1)); | .last(BizConst.LIMIT_1)); | ||||
if (Objects.isNull(projectInst)){ | if (Objects.isNull(projectInst)){ | ||||
@@ -12,6 +12,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | |||||
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | ||||
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; | |||||
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | ||||
import com.wflow.workflow.bean.process.ProgressNode; | import com.wflow.workflow.bean.process.ProgressNode; | ||||
import com.wflow.workflow.bean.vo.ProcessDetailVO; | import com.wflow.workflow.bean.vo.ProcessDetailVO; | ||||
@@ -60,10 +61,13 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { | |||||
if (Objects.isNull(project)){ | if (Objects.isNull(project)){ | ||||
throw new BizException("当前项目不存在!"); | throw new BizException("当前项目不存在!"); | ||||
} | } | ||||
//查出历史版本的 所有项目ID | |||||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(projectId); | |||||
// 根据项目ID查询项目预审流程的流程状态 | // 根据项目ID查询项目预审流程的流程状态 | ||||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ||||
.eq(ProjectInst::getProjectId, projectId) | |||||
.in(ProjectInst::getProjectId, allVersionProjectIds) | |||||
.eq(ProjectInst::getInstType, InstTypeEnum.PRELIMINARY_PREVIEW.getCode()) | .eq(ProjectInst::getInstType, InstTypeEnum.PRELIMINARY_PREVIEW.getCode()) | ||||
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) | |||||
.orderByDesc(ProjectInst::getCreatOn) | .orderByDesc(ProjectInst::getCreatOn) | ||||
.last("limit 1")); | .last("limit 1")); | ||||
ProcessProgressVo instanceDetail = null; | ProcessProgressVo instanceDetail = null; | ||||
@@ -13,6 +13,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; | |||||
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | ||||
import com.wflow.workflow.bean.process.ProgressNode; | import com.wflow.workflow.bean.process.ProgressNode; | ||||
import com.wflow.workflow.bean.vo.ProcessDetailVO; | import com.wflow.workflow.bean.vo.ProcessDetailVO; | ||||
@@ -60,6 +61,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle | |||||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ||||
.in(ProjectInst::getProjectId, allVersionProjectIds) | .in(ProjectInst::getProjectId, allVersionProjectIds) | ||||
.eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) | .eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) | ||||
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) | |||||
.orderByDesc(ProjectInst::getCreatOn) | .orderByDesc(ProjectInst::getCreatOn) | ||||
.last(BizConst.LIMIT_1)); | .last(BizConst.LIMIT_1)); | ||||
@@ -20,6 +20,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | |||||
import com.ningdatech.pmapi.common.constant.CommonConst; | import com.ningdatech.pmapi.common.constant.CommonConst; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | ||||
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; | |||||
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | ||||
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | ||||
import com.wflow.workflow.bean.process.ProgressNode; | import com.wflow.workflow.bean.process.ProgressNode; | ||||
@@ -67,6 +68,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { | |||||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ||||
.in(ProjectInst::getProjectId, allVersionProjectIds) | .in(ProjectInst::getProjectId, allVersionProjectIds) | ||||
.eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode()) | .eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode()) | ||||
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) | |||||
.orderByDesc(ProjectInst::getCreatOn) | .orderByDesc(ProjectInst::getCreatOn) | ||||
.last(BizConst.LIMIT_1)); | .last(BizConst.LIMIT_1)); | ||||
ProcessProgressVo instanceDetail = null; | ProcessProgressVo instanceDetail = null; | ||||
@@ -164,12 +164,18 @@ public class AnnualPlanLibManage { | |||||
//计划出 计划验收时间 | //计划出 计划验收时间 | ||||
LocalDateTime planAcceptanceTime = getPlanAcceptanceTime(req); | LocalDateTime planAcceptanceTime = getPlanAcceptanceTime(req); | ||||
LambdaUpdateWrapper<Project> update = | LambdaUpdateWrapper<Project> update = | ||||
Wrappers.lambdaUpdate(Project.class).set(Project::getApprovalAmount, req.getApprovedAmount()) | |||||
.set(Project::getApprovedFile, req.getApprovedFileId()).set(Project::getBuildCycle, req.getBuildCycle()) | |||||
Wrappers.lambdaUpdate(Project.class) | |||||
.set(Project::getApprovalAmount, req.getApprovedAmount()) | |||||
.set(Project::getApprovedFile, req.getApprovedFileId()) | |||||
.set(Project::getBuildCycle, req.getBuildCycle()) | |||||
.set(Project::getOriginBuildCycle,req.getBuildCycle()) | |||||
.set(Project::getApprovedConstructionPlanFile, req.getBuildPlanFileId()) | .set(Project::getApprovedConstructionPlanFile, req.getBuildPlanFileId()) | ||||
.set(Project::getApprovalDate, req.getApprovedDate()).set(Project::getStatus, project.getStatus()) | |||||
.set(Project::getApprovalDate, req.getApprovedDate()) | |||||
.set(Project::getStatus, project.getStatus()) | |||||
.set(Project::getStage, project.getStage()) | .set(Project::getStage, project.getStage()) | ||||
.set(Objects.nonNull(planAcceptanceTime),Project::getPlanAcceptanceTime,planAcceptanceTime) | .set(Objects.nonNull(planAcceptanceTime),Project::getPlanAcceptanceTime,planAcceptanceTime) | ||||
//记录原始的 计划验收时间 | |||||
.set(Objects.nonNull(planAcceptanceTime),Project::getOriginPlanAcceptanceTime,planAcceptanceTime) | |||||
.eq(Project::getId, req.getProjectId()); | .eq(Project::getId, req.getProjectId()); | ||||
projectService.update(update); | projectService.update(update); | ||||
} | } | ||||
@@ -139,6 +139,9 @@ public class ProjectLibManage { | |||||
ProjectLibListItemVO item = new ProjectLibListItemVO(); | ProjectLibListItemVO item = new ProjectLibListItemVO(); | ||||
item.setId(w.getId()); | item.setId(w.getId()); | ||||
item.setProjectName(w.getProjectName()); | item.setProjectName(w.getProjectName()); | ||||
item.setProjectCode(w.getProjectCode()); | |||||
item.setArea(w.getArea()); | |||||
item.setAreaCode(w.getAreaCode()); | |||||
item.setCreateOn(w.getCreateOn()); | item.setCreateOn(w.getCreateOn()); | ||||
item.setDeclaredAmount(w.getDeclareAmount()); | item.setDeclaredAmount(w.getDeclareAmount()); | ||||
item.setStage(w.getStage()); | item.setStage(w.getStage()); | ||||
@@ -188,6 +191,9 @@ public class ProjectLibManage { | |||||
ProjectLibListItemVO item = new ProjectLibListItemVO(); | ProjectLibListItemVO item = new ProjectLibListItemVO(); | ||||
item.setId(w.getId()); | item.setId(w.getId()); | ||||
item.setProjectName(w.getProjectName()); | item.setProjectName(w.getProjectName()); | ||||
item.setProjectCode(w.getProjectCode()); | |||||
item.setArea(w.getArea()); | |||||
item.setAreaCode(w.getAreaCode()); | |||||
item.setCreateOn(w.getCreateOn()); | item.setCreateOn(w.getCreateOn()); | ||||
item.setDeclaredAmount(w.getDeclareAmount()); | item.setDeclaredAmount(w.getDeclareAmount()); | ||||
item.setStage(w.getStage()); | item.setStage(w.getStage()); | ||||
@@ -234,6 +240,238 @@ public class ProjectLibManage { | |||||
} | } | ||||
/** | /** | ||||
* @param projectId 项目详情 | |||||
* @return com.ningdatech.pmapi.projectlib.model.entity.vo.ProjectDetailVO | |||||
* @author ZPF | |||||
* @since 2023/02/11 11:15 | |||||
*/ | |||||
public ProjectDetailVO getProjectDetail(Long projectId) { | |||||
// 查询最新的项目申报信息 | |||||
Project projectInfo = projectService.getNewProject(projectId); | |||||
if (Objects.isNull(projectInfo)) { | |||||
return null; | |||||
} | |||||
ProjectDetailVO vo = new ProjectDetailVO(); | |||||
BeanUtils.copyProperties(projectInfo, vo); | |||||
vo.buildDynamicForm(projectInfo.getDynamicForm()); | |||||
// 查询应用 | |||||
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) | |||||
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) | |||||
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); | |||||
Optional.ofNullable(applications).ifPresent(apps -> | |||||
vo.setProjectApplications(CollUtils.convert(apps, | |||||
ProjectHelper::convertVO) | |||||
)); | |||||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); | |||||
//查询采购备案 | |||||
List<Purchase> purchases = purchaseService.listByProjectId(projectId); | |||||
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); | |||||
//查询合同备案 | |||||
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) | |||||
.in(Contract::getProjectId, allVersionProjectId) | |||||
.last(BizConst.LIMIT_1)); | |||||
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class); | |||||
vo.setContract(contractVO); | |||||
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) | |||||
.in(PaymentPlan::getProjectId, allVersionProjectId) | |||||
.orderByAsc(PaymentPlan::getPaymentTime)); | |||||
if (Objects.nonNull(contractVO)) { | |||||
contractVO.setPayments(convertPayments(payments, | |||||
contractVO.getTotalAmount())); | |||||
} | |||||
//查询实施信息 | |||||
Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class) | |||||
.in(Operation::getProjectId, allVersionProjectId) | |||||
.orderByAsc(Operation::getCreateOn) | |||||
.last(BizConst.LIMIT_1)); | |||||
vo.setOperation(BeanUtil.copyProperties(operation, OperationVO.class)); | |||||
SafetyMonitorVO safetyVo = new SafetyMonitorVO(); | |||||
//查询风险监测 | |||||
List<SupplierSafetyQualification> ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) | |||||
.eq(SupplierSafetyQualification::getProjectCode, projectInfo.getProjectCode())); | |||||
if(CollUtil.isNotEmpty(ssq)){ | |||||
safetyVo.setSupplierSafetyQualification(ssq.stream() | |||||
.map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) | |||||
.collect(Collectors.toList())); | |||||
} | |||||
vo.setSafetyInfo(safetyVo); | |||||
List<PersonSafetyInfo> psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) | |||||
.eq(PersonSafetyInfo::getProjectCode, projectInfo.getProjectCode())); | |||||
if(CollUtil.isNotEmpty(psi)){ | |||||
safetyVo.setPersonSafetyInfo(psi.stream() | |||||
.map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) | |||||
.collect(Collectors.toList())); | |||||
} | |||||
//查询初验信息 | |||||
List<PreInsAcceptancePerson> acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) | |||||
.in(PreInsAcceptancePerson::getProjectId, allVersionProjectId) | |||||
.orderByAsc(PreInsAcceptancePerson::getCreateOn)); | |||||
vo.setAcceptancePersons(convertPersons(acceptancePersons)); | |||||
//查询终验信息 | |||||
//查询年度投资金额 要是已验收的项目 | |||||
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { | |||||
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | |||||
annualAmounts.add(AnnualAmountVO.builder() | |||||
.projectId(projectInfo.getId()) | |||||
.projectYear(projectInfo.getProjectYear()) | |||||
.annualAmount(projectInfo.getAnnualPlanAmount()) | |||||
.build()); | |||||
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | |||||
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) | |||||
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); | |||||
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> | |||||
declarations.forEach(declaration -> { | |||||
annualAmounts.add(AnnualAmountVO.builder() | |||||
.projectId(projectInfo.getId()) | |||||
.projectYear(declaration.getProjectYear()) | |||||
.annualAmount(declaration.getAnnualPaymentAmount()) | |||||
.build()); | |||||
}) | |||||
); | |||||
vo.setAnnualAccumulateAmountList(annualAmounts); | |||||
} | |||||
// 处理文件名 | |||||
List<Long> fileIdList = new ArrayList<>(); | |||||
BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w))); | |||||
BizUtils.notBlank(vo.getApprovedConstructionPlanFile(), w -> fileIdList.add(Long.parseLong(w))); | |||||
if (!fileIdList.isEmpty()) { | |||||
List<File> files = fileService.listByIds(fileIdList); | |||||
Map<String, String> fileMap = CollUtils.listToMap(files, w -> w.getId().toString(), File::getOriginalFileName); | |||||
vo.setApprovedFileName(fileMap.get(vo.getApprovedFile())); | |||||
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); | |||||
} | |||||
return vo; | |||||
} | |||||
/** | |||||
* @param projectId 项目详情 不查询最新版本 | |||||
* @return com.ningdatech.pmapi.projectlib.model.entity.vo.ProjectDetailVO | |||||
* @author ZPF | |||||
* @since 2023/02/11 11:15 | |||||
*/ | |||||
public ProjectDetailVO getProjectDetailThisVersion(Long projectId) { | |||||
// 查询最新的项目申报信息 | |||||
Project projectInfo = projectService.getById(projectId); | |||||
if (Objects.isNull(projectInfo)) { | |||||
return null; | |||||
} | |||||
ProjectDetailVO vo = new ProjectDetailVO(); | |||||
BeanUtils.copyProperties(projectInfo, vo); | |||||
vo.buildDynamicForm(projectInfo.getDynamicForm()); | |||||
// 查询应用 | |||||
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) | |||||
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) | |||||
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); | |||||
Optional.ofNullable(applications).ifPresent(apps -> | |||||
vo.setProjectApplications(CollUtils.convert(apps, | |||||
ProjectHelper::convertVO) | |||||
)); | |||||
//审批信息 | |||||
ProcessDetailReq req = new ProcessDetailReq(); | |||||
req.setInstanceId(projectInfo.getInstCode()); | |||||
req.setProjectId(projectId); | |||||
vo.setProcess(todoService.getProcessDetail(req)); | |||||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); | |||||
//查询采购备案 | |||||
List<Purchase> purchases = purchaseService.listByProjectId(projectId); | |||||
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); | |||||
//查询合同备案 | |||||
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) | |||||
.in(Contract::getProjectId, allVersionProjectId) | |||||
.last(BizConst.LIMIT_1)); | |||||
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class); | |||||
vo.setContract(contractVO); | |||||
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) | |||||
.in(PaymentPlan::getProjectId, allVersionProjectId) | |||||
.orderByAsc(PaymentPlan::getPaymentTime)); | |||||
if (Objects.nonNull(contractVO)) { | |||||
contractVO.setPayments(convertPayments(payments, | |||||
contractVO.getTotalAmount())); | |||||
} | |||||
//查询实施信息 | |||||
Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class) | |||||
.in(Operation::getProjectId, allVersionProjectId) | |||||
.orderByAsc(Operation::getCreateOn) | |||||
.last(BizConst.LIMIT_1)); | |||||
vo.setOperation(BeanUtil.copyProperties(operation, OperationVO.class)); | |||||
SafetyMonitorVO safetyVo = new SafetyMonitorVO(); | |||||
//查询风险监测 | |||||
List<SupplierSafetyQualification> ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) | |||||
.eq(SupplierSafetyQualification::getProjectCode, projectInfo.getProjectCode())); | |||||
if(CollUtil.isNotEmpty(ssq)){ | |||||
safetyVo.setSupplierSafetyQualification(ssq.stream() | |||||
.map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) | |||||
.collect(Collectors.toList())); | |||||
} | |||||
vo.setSafetyInfo(safetyVo); | |||||
List<PersonSafetyInfo> psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) | |||||
.eq(PersonSafetyInfo::getProjectCode, projectInfo.getProjectCode())); | |||||
if(CollUtil.isNotEmpty(psi)){ | |||||
safetyVo.setPersonSafetyInfo(psi.stream() | |||||
.map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) | |||||
.collect(Collectors.toList())); | |||||
} | |||||
//查询初验信息 | |||||
List<PreInsAcceptancePerson> acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) | |||||
.in(PreInsAcceptancePerson::getProjectId, allVersionProjectId) | |||||
.orderByAsc(PreInsAcceptancePerson::getCreateOn)); | |||||
vo.setAcceptancePersons(convertPersons(acceptancePersons)); | |||||
//查询终验信息 | |||||
//查询年度投资金额 要是已验收的项目 | |||||
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { | |||||
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | |||||
annualAmounts.add(AnnualAmountVO.builder() | |||||
.projectId(projectInfo.getId()) | |||||
.projectYear(projectInfo.getProjectYear()) | |||||
.annualAmount(projectInfo.getAnnualPlanAmount()) | |||||
.build()); | |||||
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | |||||
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) | |||||
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); | |||||
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> | |||||
declarations.forEach(declaration -> { | |||||
annualAmounts.add(AnnualAmountVO.builder() | |||||
.projectId(projectInfo.getId()) | |||||
.projectYear(declaration.getProjectYear()) | |||||
.annualAmount(declaration.getAnnualPaymentAmount()) | |||||
.build()); | |||||
}) | |||||
); | |||||
vo.setAnnualAccumulateAmountList(annualAmounts); | |||||
} | |||||
// 处理文件名 | |||||
List<Long> fileIdList = new ArrayList<>(); | |||||
BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w))); | |||||
BizUtils.notBlank(vo.getApprovedConstructionPlanFile(), w -> fileIdList.add(Long.parseLong(w))); | |||||
if (!fileIdList.isEmpty()) { | |||||
List<File> files = fileService.listByIds(fileIdList); | |||||
Map<String, String> fileMap = CollUtils.listToMap(files, w -> w.getId().toString(), File::getOriginalFileName); | |||||
vo.setApprovedFileName(fileMap.get(vo.getApprovedFile())); | |||||
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); | |||||
} | |||||
return vo; | |||||
} | |||||
/** | |||||
* 申报新项目时 保存项目信息和其它相关联的信息 | * 申报新项目时 保存项目信息和其它相关联的信息 | ||||
* | * | ||||
* @param projectDto | * @param projectDto | ||||
@@ -310,7 +548,9 @@ public class ProjectLibManage { | |||||
project.setSponsor(employeeCode); | project.setSponsor(employeeCode); | ||||
String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); | String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); | ||||
project.setProjectCode(projectCode); | project.setProjectCode(projectCode); | ||||
projectService.save(project); | |||||
if(projectService.save(project)){ | |||||
saveApplication(projectDto,project,null); | |||||
} | |||||
} else { | } else { | ||||
//否则是重新提交的 新生成一个新版本的项目 | //否则是重新提交的 新生成一个新版本的项目 | ||||
project = newProjectWithVersion(projectDto); | project = newProjectWithVersion(projectDto); | ||||
@@ -320,30 +560,6 @@ public class ProjectLibManage { | |||||
projectService.updateById(project); | projectService.updateById(project); | ||||
} | } | ||||
} | } | ||||
//保存项目应用 | |||||
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | |||||
? Boolean.TRUE : Boolean.FALSE; | |||||
//采取批量删除 批量添加的方式 | |||||
Integer version = Objects.nonNull(project.getVersion()) ? project.getVersion() : 1; | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion, version)); | |||||
if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | |||||
Project finalProject = project; | |||||
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | |||||
ProjectApplication projectApplication = new ProjectApplication(); | |||||
BeanUtils.copyProperties(application, projectApplication); | |||||
projectApplication.setId(null); | |||||
projectApplication.setProjectId(finalProject.getId()); | |||||
projectApplication.setProjectCode(finalProject.getProjectCode()); | |||||
projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); | |||||
projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); | |||||
projectApplication.setProjectVersion(version); | |||||
return projectApplication; | |||||
}).collect(Collectors.toList()); | |||||
projectApplicationService.saveOrUpdateBatch(applications); | |||||
} | |||||
return project; | return project; | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
log.error("项目信息入库错误 " + e); | log.error("项目信息入库错误 " + e); | ||||
@@ -381,6 +597,7 @@ public class ProjectLibManage { | |||||
project.setVersion(oldProject.getVersion() + 1); | project.setVersion(oldProject.getVersion() + 1); | ||||
// 标记为建设方案申报 | // 标记为建设方案申报 | ||||
project.setIsConstruct(Boolean.TRUE); | project.setIsConstruct(Boolean.TRUE); | ||||
project.setIsBackReject(Boolean.FALSE); | |||||
// 保存初步方案项目ID | // 保存初步方案项目ID | ||||
if (Boolean.TRUE.equals(oldProject.getIsConstruct())) { | if (Boolean.TRUE.equals(oldProject.getIsConstruct())) { | ||||
// 重新提交 | // 重新提交 | ||||
@@ -388,13 +605,16 @@ public class ProjectLibManage { | |||||
} else { | } else { | ||||
project.setPrePlanProjectId(oldProject.getId()); | project.setPrePlanProjectId(oldProject.getId()); | ||||
} | } | ||||
projectService.save(project); | |||||
if(projectService.save(project)){ | |||||
saveApplication(projectDto,project,null); | |||||
// 将旧的项目版本置为不是最新 | |||||
projectService.update(Wrappers.lambdaUpdate(Project.class) | |||||
.set(Project::getNewest, Boolean.FALSE) | |||||
.ne(Project::getId, project.getId()) | |||||
.eq(Project::getProjectCode, project.getProjectCode())); | |||||
} | |||||
// 将旧的项目版本置为不是最新 | |||||
projectService.update(Wrappers.lambdaUpdate(Project.class) | |||||
.set(Project::getNewest, Boolean.FALSE) | |||||
.ne(Project::getId, project.getId()) | |||||
.eq(Project::getProjectCode, project.getProjectCode())); | |||||
} else { | } else { | ||||
//否则是被驳回,重新提交的 新生成一个新版本的项目 | //否则是被驳回,重新提交的 新生成一个新版本的项目 | ||||
project = newProjectWithVersion(projectDto); | project = newProjectWithVersion(projectDto); | ||||
@@ -404,49 +624,6 @@ public class ProjectLibManage { | |||||
projectService.updateById(project); | projectService.updateById(project); | ||||
} | } | ||||
} | } | ||||
//保存项目应用 | |||||
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | |||||
? Boolean.TRUE : Boolean.FALSE; | |||||
//采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息及关联的核心业务 | |||||
List<ProjectApplication> applications = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion, project.getVersion()) | |||||
.eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); | |||||
if (CollUtil.isNotEmpty(applications)) { | |||||
projectApplicationService.removeBatchByIds(applications); | |||||
List<Long> applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); | |||||
projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) | |||||
.in(ProjectCoreBusinessIndicators::getApplicationId,applicationIds)); | |||||
} | |||||
if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | |||||
Project finalProject = project; | |||||
List<ProjectApplicationDTO> applicationList = projectDto.getApplicationList(); | |||||
for (ProjectApplicationDTO application : applicationList) { | |||||
ProjectApplication projectApplication = new ProjectApplication(); | |||||
BeanUtils.copyProperties(application, projectApplication); | |||||
projectApplication.setId(null); | |||||
projectApplication.setProjectId(finalProject.getId()); | |||||
projectApplication.setProjectCode(finalProject.getProjectCode()); | |||||
projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); | |||||
projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); | |||||
projectApplication.setIsConstruct(Boolean.TRUE); | |||||
projectApplication.setProjectVersion(finalProject.getVersion()); | |||||
boolean result = projectApplicationService.save(projectApplication); | |||||
// 保存应用关联的核心业务 | |||||
List<ProjectCoreBusinessDTO> coreBusinessList = application.getCoreBusinessList(); | |||||
Boolean hasCoreBusiness = CollUtil.isNotEmpty(coreBusinessList) ? Boolean.TRUE : Boolean.FALSE; | |||||
if (Boolean.TRUE.equals(result) && Boolean.TRUE.equals(hasCoreBusiness)){ | |||||
for (ProjectCoreBusinessDTO coreBusiness : coreBusinessList) { | |||||
ProjectCoreBusinessIndicators projectCoreBusinessIndicators = new ProjectCoreBusinessIndicators(); | |||||
BeanUtils.copyProperties(coreBusiness, projectCoreBusinessIndicators); | |||||
projectCoreBusinessIndicators.setApplicationId(application.getId()); | |||||
projectCoreBusinessIndicatorsService.save(projectCoreBusinessIndicators); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
return project; | return project; | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
log.error("项目信息入库错误 " + e); | log.error("项目信息入库错误 " + e); | ||||
@@ -464,29 +641,7 @@ public class ProjectLibManage { | |||||
public Project reSaveProjectNewVersion(ProjectDTO projectDto) { | public Project reSaveProjectNewVersion(ProjectDTO projectDto) { | ||||
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | ||||
try { | try { | ||||
Project project = newProjectWithVersion(projectDto); | |||||
//保存项目应用 | |||||
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | |||||
? Boolean.TRUE : Boolean.FALSE; | |||||
//采取批量删除 批量添加的方式 | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion, project.getVersion())); | |||||
if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | |||||
Project finalProject = project; | |||||
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | |||||
ProjectApplication projectApplication = new ProjectApplication(); | |||||
BeanUtils.copyProperties(application, projectApplication); | |||||
projectApplication.setId(null); | |||||
projectApplication.setProjectId(finalProject.getId()); | |||||
projectApplication.setProjectCode(finalProject.getProjectCode()); | |||||
projectApplication.setProjectVersion(finalProject.getVersion()); | |||||
return projectApplication; | |||||
}).collect(Collectors.toList()); | |||||
projectApplicationService.saveOrUpdateBatch(applications); | |||||
} | |||||
return project; | |||||
return newProjectWithVersion(projectDto); | |||||
} catch (Exception e) { | } catch (Exception e) { | ||||
log.error("项目信息入库错误 " + e); | log.error("项目信息入库错误 " + e); | ||||
throw new BusinessException("项目信息入库错误 :" + e); | throw new BusinessException("项目信息入库错误 :" + e); | ||||
@@ -510,14 +665,20 @@ public class ProjectLibManage { | |||||
project.setId(null); | project.setId(null); | ||||
project.setCreateOn(LocalDateTime.now()); | project.setCreateOn(LocalDateTime.now()); | ||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
project.setIsBackReject(Boolean.FALSE); | |||||
stateMachineUtils.pass(project); | stateMachineUtils.pass(project); | ||||
projectService.save(project); | projectService.save(project); | ||||
oldProject.setIsBackReject(Boolean.TRUE); | |||||
projectService.updateById(oldProject); | |||||
projectService.update(Wrappers.lambdaUpdate(Project.class) | projectService.update(Wrappers.lambdaUpdate(Project.class) | ||||
.set(Project::getNewest, Boolean.FALSE) | .set(Project::getNewest, Boolean.FALSE) | ||||
.ne(Project::getId, project.getId()) | .ne(Project::getId, project.getId()) | ||||
.eq(Project::getProjectCode, project.getProjectCode())); | .eq(Project::getProjectCode, project.getProjectCode())); | ||||
saveApplication(projecDto,project,null); | |||||
return project; | return project; | ||||
} | } | ||||
@@ -534,6 +695,8 @@ public class ProjectLibManage { | |||||
project.setId(null); | project.setId(null); | ||||
project.setCreateOn(LocalDateTime.now()); | project.setCreateOn(LocalDateTime.now()); | ||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
//都是在驳回 重新提交时用的 | |||||
project.setIsBackReject(Boolean.FALSE); | |||||
if (Objects.nonNull(stageCode)) { | if (Objects.nonNull(stageCode)) { | ||||
project.setStage(stageCode); | project.setStage(stageCode); | ||||
} | } | ||||
@@ -541,47 +704,23 @@ public class ProjectLibManage { | |||||
project.setStatus(statusCode); | project.setStatus(statusCode); | ||||
} | } | ||||
oldProject.setIsBackReject(Boolean.TRUE); | |||||
projectService.updateById(oldProject); | |||||
if (projectService.save(project)) { | if (projectService.save(project)) { | ||||
projectService.update(Wrappers.lambdaUpdate(Project.class) | projectService.update(Wrappers.lambdaUpdate(Project.class) | ||||
.set(Project::getNewest, Boolean.FALSE) | .set(Project::getNewest, Boolean.FALSE) | ||||
.ne(Project::getId, project.getId()) | .ne(Project::getId, project.getId()) | ||||
.eq(Project::getProjectCode, project.getProjectCode())); | .eq(Project::getProjectCode, project.getProjectCode())); | ||||
//删除当前版本的app 一般情况是没有 保险起见 | |||||
List<ProjectApplication> applications = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion, project.getVersion())); | |||||
if (CollUtil.isNotEmpty(applications)) { | |||||
projectApplicationService.removeBatchByIds(applications); | |||||
List<Long> applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); | |||||
projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) | |||||
.in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); | |||||
} | |||||
//app | //app | ||||
List<ProjectApplicationDTO> applicationList = projecDto.getApplicationList(); | |||||
if (CollUtil.isNotEmpty(applicationList)) { | |||||
List<ProjectApplication> apps = applicationList.stream() | |||||
.map(a -> { | |||||
ProjectApplication app = BeanUtil.copyProperties(a, ProjectApplication.class); | |||||
app.setId(null); | |||||
app.setProjectId(project.getId()); | |||||
app.setProjectCode(project.getProjectCode()); | |||||
app.setBuildOrgName(project.getBuildOrgName()); | |||||
app.setBuildOrgCode(project.getBuildOrgCode()); | |||||
app.setIsConstruct(isConstruct); | |||||
app.setProjectVersion(project.getVersion()); | |||||
return app; | |||||
}) | |||||
.collect(Collectors.toList()); | |||||
projectApplicationService.saveBatch(apps); | |||||
} | |||||
saveApplication(projecDto,project,isConstruct); | |||||
} | } | ||||
return project; | return project; | ||||
} | } | ||||
public Project saveProjectWithVersion(ProjectDTO projecDto, String instanceId, Integer instType) { | |||||
public Project saveProjectWithVersion(ProjectDTO projecDto, String instanceId, Integer instType,Boolean isConstruct) { | |||||
Project oldProject = projectService.getById(projecDto.getId()); | Project oldProject = projectService.getById(projecDto.getId()); | ||||
Project project = new Project(); | Project project = new Project(); | ||||
VUtils.isTrue(Objects.isNull(oldProject)) | VUtils.isTrue(Objects.isNull(oldProject)) | ||||
@@ -612,27 +751,7 @@ public class ProjectLibManage { | |||||
.eq(Project::getProjectCode, project.getProjectCode())); | .eq(Project::getProjectCode, project.getProjectCode())); | ||||
//app | //app | ||||
//采取批量删除 批量添加的方式 | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion, project.getVersion())); | |||||
List<ProjectApplicationDTO> applicationList = projecDto.getApplicationList(); | |||||
if (CollUtil.isNotEmpty(applicationList)) { | |||||
List<ProjectApplication> apps = applicationList.stream() | |||||
.map(a -> { | |||||
ProjectApplication app = BeanUtil.copyProperties(a, ProjectApplication.class); | |||||
app.setId(null); | |||||
app.setProjectId(project.getId()); | |||||
app.setProjectCode(project.getProjectCode()); | |||||
app.setBuildOrgName(project.getBuildOrgName()); | |||||
app.setBuildOrgCode(project.getBuildOrgCode()); | |||||
app.setProjectVersion(project.getVersion()); | |||||
return app; | |||||
}) | |||||
.collect(Collectors.toList()); | |||||
projectApplicationService.saveBatch(apps); | |||||
} | |||||
saveApplication(projecDto,project,isConstruct); | |||||
} | } | ||||
return project; | return project; | ||||
@@ -665,23 +784,13 @@ public class ProjectLibManage { | |||||
.ne(Project::getId, project.getId()) | .ne(Project::getId, project.getId()) | ||||
.eq(Project::getProjectCode, project.getProjectCode())); | .eq(Project::getProjectCode, project.getProjectCode())); | ||||
List<ProjectApplication> apps = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectId, oldProject.getId())); | |||||
if(CollUtil.isNotEmpty(apps)){ | |||||
apps = apps.stream().map(app -> { | |||||
app.setProjectVersion(project.getVersion()); | |||||
app.setProjectId(project.getId()); | |||||
app.setId(null); | |||||
return app; | |||||
}).collect(Collectors.toList()); | |||||
projectApplicationService.saveBatch(apps); | |||||
} | |||||
saveApplication(project,oldProject,null); | |||||
} | } | ||||
return project; | return project; | ||||
} | } | ||||
public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType) { | |||||
public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType,Boolean isBackReject) { | |||||
Project project = new Project(); | Project project = new Project(); | ||||
VUtils.isTrue(Objects.isNull(oldProject)) | VUtils.isTrue(Objects.isNull(oldProject)) | ||||
.throwMessage("项目不存在!"); | .throwMessage("项目不存在!"); | ||||
@@ -693,9 +802,13 @@ public class ProjectLibManage { | |||||
project.setCreateOn(LocalDateTime.now()); | project.setCreateOn(LocalDateTime.now()); | ||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
// 标识保存的项目信息是否为建设方案申报项目 | // 标识保存的项目信息是否为建设方案申报项目 | ||||
project.setIsConstruct(Boolean.TRUE); | |||||
project.setIsConstruct(Boolean.FALSE); | |||||
project.setIsBackReject(isBackReject); | |||||
stateMachineUtils.pass(project); | stateMachineUtils.pass(project); | ||||
oldProject.setIsBackReject(Boolean.TRUE); | |||||
projectService.updateById(oldProject); | |||||
if (projectService.save(project)) { | if (projectService.save(project)) { | ||||
//保存项目和实例的关系 | //保存项目和实例的关系 | ||||
ProjectInst projectInst = new ProjectInst(); | ProjectInst projectInst = new ProjectInst(); | ||||
@@ -710,6 +823,9 @@ public class ProjectLibManage { | |||||
.set(Project::getNewest, Boolean.FALSE) | .set(Project::getNewest, Boolean.FALSE) | ||||
.ne(Project::getId, project.getId()) | .ne(Project::getId, project.getId()) | ||||
.eq(Project::getProjectCode, project.getProjectCode())); | .eq(Project::getProjectCode, project.getProjectCode())); | ||||
//APP | |||||
saveApplication(project,oldProject,null); | |||||
} | } | ||||
return project; | return project; | ||||
@@ -727,9 +843,12 @@ public class ProjectLibManage { | |||||
project.setCreateOn(LocalDateTime.now()); | project.setCreateOn(LocalDateTime.now()); | ||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
// 标识保存的项目信息是否为建设方案申报项目 | // 标识保存的项目信息是否为建设方案申报项目 | ||||
project.setIsConstruct(Boolean.TRUE); | |||||
project.setIsConstruct(Boolean.FALSE); | |||||
stateMachineUtils.pass(project); | stateMachineUtils.pass(project); | ||||
oldProject.setIsBackReject(Boolean.TRUE); | |||||
projectService.updateById(oldProject); | |||||
if (projectService.save(project)) { | if (projectService.save(project)) { | ||||
//保存项目和实例的关系 | //保存项目和实例的关系 | ||||
ProjectInst projectInst = new ProjectInst(); | ProjectInst projectInst = new ProjectInst(); | ||||
@@ -744,241 +863,11 @@ public class ProjectLibManage { | |||||
.set(Project::getNewest, Boolean.FALSE) | .set(Project::getNewest, Boolean.FALSE) | ||||
.ne(Project::getId, project.getId()) | .ne(Project::getId, project.getId()) | ||||
.eq(Project::getProjectCode, project.getProjectCode())); | .eq(Project::getProjectCode, project.getProjectCode())); | ||||
} | |||||
return project; | |||||
} | |||||
/** | |||||
* @param projectId 项目详情 | |||||
* @return com.ningdatech.pmapi.projectlib.model.entity.vo.ProjectDetailVO | |||||
* @author ZPF | |||||
* @since 2023/02/11 11:15 | |||||
*/ | |||||
public ProjectDetailVO getProjectDetail(Long projectId) { | |||||
// 查询最新的项目申报信息 | |||||
Project projectInfo = projectService.getNewProject(projectId); | |||||
if (Objects.isNull(projectInfo)) { | |||||
return null; | |||||
} | |||||
ProjectDetailVO vo = new ProjectDetailVO(); | |||||
BeanUtils.copyProperties(projectInfo, vo); | |||||
vo.buildDynamicForm(projectInfo.getDynamicForm()); | |||||
// 查询应用 | |||||
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) | |||||
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) | |||||
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); | |||||
Optional.ofNullable(applications).ifPresent(apps -> | |||||
vo.setProjectApplications(CollUtils.convert(apps, | |||||
ProjectHelper::convertVO) | |||||
)); | |||||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); | |||||
//查询采购备案 | |||||
List<Purchase> purchases = purchaseService.listByProjectId(projectId); | |||||
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); | |||||
//查询合同备案 | |||||
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) | |||||
.in(Contract::getProjectId, allVersionProjectId) | |||||
.last(BizConst.LIMIT_1)); | |||||
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class); | |||||
vo.setContract(contractVO); | |||||
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) | |||||
.in(PaymentPlan::getProjectId, allVersionProjectId) | |||||
.orderByAsc(PaymentPlan::getPaymentTime)); | |||||
if (Objects.nonNull(contractVO)) { | |||||
contractVO.setPayments(convertPayments(payments, | |||||
contractVO.getTotalAmount())); | |||||
} | |||||
//查询实施信息 | |||||
Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class) | |||||
.in(Operation::getProjectId, allVersionProjectId) | |||||
.orderByAsc(Operation::getCreateOn) | |||||
.last(BizConst.LIMIT_1)); | |||||
vo.setOperation(BeanUtil.copyProperties(operation, OperationVO.class)); | |||||
SafetyMonitorVO safetyVo = new SafetyMonitorVO(); | |||||
//查询风险监测 | |||||
List<SupplierSafetyQualification> ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) | |||||
.eq(SupplierSafetyQualification::getProjectCode, projectInfo.getProjectCode())); | |||||
if(CollUtil.isNotEmpty(ssq)){ | |||||
safetyVo.setSupplierSafetyQualification(ssq.stream() | |||||
.map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) | |||||
.collect(Collectors.toList())); | |||||
} | |||||
vo.setSafetyInfo(safetyVo); | |||||
List<PersonSafetyInfo> psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) | |||||
.eq(PersonSafetyInfo::getProjectCode, projectInfo.getProjectCode())); | |||||
if(CollUtil.isNotEmpty(psi)){ | |||||
safetyVo.setPersonSafetyInfo(psi.stream() | |||||
.map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) | |||||
.collect(Collectors.toList())); | |||||
} | |||||
//查询初验信息 | |||||
List<PreInsAcceptancePerson> acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) | |||||
.in(PreInsAcceptancePerson::getProjectId, allVersionProjectId) | |||||
.orderByAsc(PreInsAcceptancePerson::getCreateOn)); | |||||
vo.setAcceptancePersons(convertPersons(acceptancePersons)); | |||||
//查询终验信息 | |||||
//查询年度投资金额 要是已验收的项目 | |||||
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { | |||||
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | |||||
annualAmounts.add(AnnualAmountVO.builder() | |||||
.projectId(projectInfo.getId()) | |||||
.projectYear(projectInfo.getProjectYear()) | |||||
.annualAmount(projectInfo.getAnnualPlanAmount()) | |||||
.build()); | |||||
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | |||||
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) | |||||
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); | |||||
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> | |||||
declarations.forEach(declaration -> { | |||||
annualAmounts.add(AnnualAmountVO.builder() | |||||
.projectId(projectInfo.getId()) | |||||
.projectYear(declaration.getProjectYear()) | |||||
.annualAmount(declaration.getAnnualPaymentAmount()) | |||||
.build()); | |||||
}) | |||||
); | |||||
vo.setAnnualAccumulateAmountList(annualAmounts); | |||||
} | |||||
// 处理文件名 | |||||
List<Long> fileIdList = new ArrayList<>(); | |||||
BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w))); | |||||
BizUtils.notBlank(vo.getApprovedConstructionPlanFile(), w -> fileIdList.add(Long.parseLong(w))); | |||||
if (!fileIdList.isEmpty()) { | |||||
List<File> files = fileService.listByIds(fileIdList); | |||||
Map<String, String> fileMap = CollUtils.listToMap(files, w -> w.getId().toString(), File::getOriginalFileName); | |||||
vo.setApprovedFileName(fileMap.get(vo.getApprovedFile())); | |||||
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); | |||||
} | |||||
return vo; | |||||
} | |||||
/** | |||||
* @param projectId 项目详情 不查询最新版本 | |||||
* @return com.ningdatech.pmapi.projectlib.model.entity.vo.ProjectDetailVO | |||||
* @author ZPF | |||||
* @since 2023/02/11 11:15 | |||||
*/ | |||||
public ProjectDetailVO getProjectDetailThisVersion(Long projectId) { | |||||
// 查询最新的项目申报信息 | |||||
Project projectInfo = projectService.getById(projectId); | |||||
if (Objects.isNull(projectInfo)) { | |||||
return null; | |||||
} | |||||
ProjectDetailVO vo = new ProjectDetailVO(); | |||||
BeanUtils.copyProperties(projectInfo, vo); | |||||
vo.buildDynamicForm(projectInfo.getDynamicForm()); | |||||
// 查询应用 | |||||
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) | |||||
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) | |||||
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); | |||||
Optional.ofNullable(applications).ifPresent(apps -> | |||||
vo.setProjectApplications(CollUtils.convert(apps, | |||||
ProjectHelper::convertVO) | |||||
)); | |||||
//审批信息 | |||||
ProcessDetailReq req = new ProcessDetailReq(); | |||||
req.setInstanceId(projectInfo.getInstCode()); | |||||
req.setProjectId(projectId); | |||||
vo.setProcess(todoService.getProcessDetail(req)); | |||||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); | |||||
//查询采购备案 | |||||
List<Purchase> purchases = purchaseService.listByProjectId(projectId); | |||||
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); | |||||
//查询合同备案 | |||||
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) | |||||
.in(Contract::getProjectId, allVersionProjectId) | |||||
.last(BizConst.LIMIT_1)); | |||||
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class); | |||||
vo.setContract(contractVO); | |||||
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) | |||||
.in(PaymentPlan::getProjectId, allVersionProjectId) | |||||
.orderByAsc(PaymentPlan::getPaymentTime)); | |||||
if (Objects.nonNull(contractVO)) { | |||||
contractVO.setPayments(convertPayments(payments, | |||||
contractVO.getTotalAmount())); | |||||
saveApplication(project,oldProject,Boolean.TRUE); | |||||
} | } | ||||
//查询实施信息 | |||||
Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class) | |||||
.in(Operation::getProjectId, allVersionProjectId) | |||||
.orderByAsc(Operation::getCreateOn) | |||||
.last(BizConst.LIMIT_1)); | |||||
vo.setOperation(BeanUtil.copyProperties(operation, OperationVO.class)); | |||||
SafetyMonitorVO safetyVo = new SafetyMonitorVO(); | |||||
//查询风险监测 | |||||
List<SupplierSafetyQualification> ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) | |||||
.eq(SupplierSafetyQualification::getProjectCode, projectInfo.getProjectCode())); | |||||
if(CollUtil.isNotEmpty(ssq)){ | |||||
safetyVo.setSupplierSafetyQualification(ssq.stream() | |||||
.map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) | |||||
.collect(Collectors.toList())); | |||||
} | |||||
vo.setSafetyInfo(safetyVo); | |||||
List<PersonSafetyInfo> psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) | |||||
.eq(PersonSafetyInfo::getProjectCode, projectInfo.getProjectCode())); | |||||
if(CollUtil.isNotEmpty(psi)){ | |||||
safetyVo.setPersonSafetyInfo(psi.stream() | |||||
.map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) | |||||
.collect(Collectors.toList())); | |||||
} | |||||
//查询初验信息 | |||||
List<PreInsAcceptancePerson> acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) | |||||
.in(PreInsAcceptancePerson::getProjectId, allVersionProjectId) | |||||
.orderByAsc(PreInsAcceptancePerson::getCreateOn)); | |||||
vo.setAcceptancePersons(convertPersons(acceptancePersons)); | |||||
//查询终验信息 | |||||
//查询年度投资金额 要是已验收的项目 | |||||
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { | |||||
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | |||||
annualAmounts.add(AnnualAmountVO.builder() | |||||
.projectId(projectInfo.getId()) | |||||
.projectYear(projectInfo.getProjectYear()) | |||||
.annualAmount(projectInfo.getAnnualPlanAmount()) | |||||
.build()); | |||||
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | |||||
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) | |||||
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); | |||||
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> | |||||
declarations.forEach(declaration -> { | |||||
annualAmounts.add(AnnualAmountVO.builder() | |||||
.projectId(projectInfo.getId()) | |||||
.projectYear(declaration.getProjectYear()) | |||||
.annualAmount(declaration.getAnnualPaymentAmount()) | |||||
.build()); | |||||
}) | |||||
); | |||||
vo.setAnnualAccumulateAmountList(annualAmounts); | |||||
} | |||||
// 处理文件名 | |||||
List<Long> fileIdList = new ArrayList<>(); | |||||
BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w))); | |||||
BizUtils.notBlank(vo.getApprovedConstructionPlanFile(), w -> fileIdList.add(Long.parseLong(w))); | |||||
if (!fileIdList.isEmpty()) { | |||||
List<File> files = fileService.listByIds(fileIdList); | |||||
Map<String, String> fileMap = CollUtils.listToMap(files, w -> w.getId().toString(), File::getOriginalFileName); | |||||
vo.setApprovedFileName(fileMap.get(vo.getApprovedFile())); | |||||
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); | |||||
} | |||||
return vo; | |||||
return project; | |||||
} | } | ||||
/** | /** | ||||
@@ -1246,8 +1135,11 @@ public class ProjectLibManage { | |||||
return res; | return res; | ||||
} | } | ||||
//只查 当前版本 和历史被驳回|退回的版本 | |||||
List<Project> historyProjects = projectService.list(Wrappers.lambdaQuery(Project.class) | List<Project> historyProjects = projectService.list(Wrappers.lambdaQuery(Project.class) | ||||
.eq(Project::getProjectCode, project.getProjectCode()) | .eq(Project::getProjectCode, project.getProjectCode()) | ||||
.and(q1->q1.eq(Project::getNewest, Boolean.TRUE) | |||||
.or(q2->q2.eq(Project::getIsBackReject,Boolean.TRUE))) | |||||
.orderByDesc(Project::getCreateOn)); | .orderByDesc(Project::getCreateOn)); | ||||
if (CollUtil.isEmpty(historyProjects)) { | if (CollUtil.isEmpty(historyProjects)) { | ||||
@@ -1308,4 +1200,72 @@ public class ProjectLibManage { | |||||
res.put(ProjectConstant.ProjectLib.PROCESS_KEY, todoService.getProcessDetail(req)); | res.put(ProjectConstant.ProjectLib.PROCESS_KEY, todoService.getProcessDetail(req)); | ||||
return res; | return res; | ||||
} | } | ||||
private void saveApplication(Project project,Project oldProject,Boolean isConstruct) { | |||||
List<ProjectApplication> apps = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, oldProject.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion, oldProject.getVersion())); | |||||
if(CollUtil.isNotEmpty(apps)){ | |||||
apps = apps.stream().map(app -> { | |||||
app.setProjectVersion(project.getVersion()); | |||||
app.setProjectId(project.getId()); | |||||
app.setId(null); | |||||
if(Objects.nonNull(isConstruct)){ | |||||
app.setIsConstruct(isConstruct); | |||||
} | |||||
return app; | |||||
}).collect(Collectors.toList()); | |||||
projectApplicationService.saveBatch(apps); | |||||
} | |||||
} | |||||
private void saveApplication(ProjectDTO projectDto,Project project,Boolean isConstruct) { | |||||
//保存项目应用 | |||||
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | |||||
? Boolean.TRUE : Boolean.FALSE; | |||||
//采取批量删除 批量添加的方式 | |||||
Integer version = Objects.nonNull(project.getVersion()) ? project.getVersion() : 1; | |||||
//删除当前版本的app 一般情况是没有 保险起见 | |||||
List<ProjectApplication> applications = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion, version)); | |||||
if (CollUtil.isNotEmpty(applications)) { | |||||
projectApplicationService.removeBatchByIds(applications); | |||||
List<Long> applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); | |||||
projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) | |||||
.in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); | |||||
} | |||||
if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | |||||
Project finalProject = project; | |||||
projectDto.getApplicationList().forEach(application -> { | |||||
ProjectApplication projectApplication = new ProjectApplication(); | |||||
BeanUtils.copyProperties(application, projectApplication); | |||||
projectApplication.setId(null); | |||||
projectApplication.setProjectId(finalProject.getId()); | |||||
projectApplication.setProjectCode(finalProject.getProjectCode()); | |||||
projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); | |||||
projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); | |||||
projectApplication.setProjectVersion(version); | |||||
projectApplication.setIsConstruct(isConstruct); | |||||
if(StringUtils.isNotBlank(application.getRelatedExistsApplication())){ | |||||
projectApplication.setApplicationName(null); | |||||
} | |||||
boolean result = projectApplicationService.save(projectApplication); | |||||
// 保存应用关联的核心业务 | |||||
List<ProjectCoreBusinessDTO> coreBusinessList = application.getCoreBusinessList(); | |||||
Boolean hasCoreBusiness = CollUtil.isNotEmpty(coreBusinessList) ? Boolean.TRUE : Boolean.FALSE; | |||||
if (Boolean.TRUE.equals(result) && Boolean.TRUE.equals(hasCoreBusiness)){ | |||||
for (ProjectCoreBusinessDTO coreBusiness : coreBusinessList) { | |||||
ProjectCoreBusinessIndicators projectCoreBusinessIndicators = new ProjectCoreBusinessIndicators(); | |||||
BeanUtils.copyProperties(coreBusiness, projectCoreBusinessIndicators); | |||||
projectCoreBusinessIndicators.setApplicationId(application.getId()); | |||||
projectCoreBusinessIndicatorsService.save(projectCoreBusinessIndicators); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
} | } |
@@ -317,4 +317,7 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("项目类型 01首次建设;02迭代升级;03结转建设;04新运维;05续运维") | @ApiModelProperty("项目类型 01首次建设;02迭代升级;03结转建设;04新运维;05续运维") | ||||
private String baseProjType; | private String baseProjType; | ||||
@ApiModelProperty("是否退回|驳回的项目版本") | |||||
private Boolean isBackReject = Boolean.FALSE; | |||||
} | } |
@@ -325,6 +325,10 @@ public class Project implements Serializable { | |||||
@Compare("建设周期(月)") | @Compare("建设周期(月)") | ||||
private String buildCycle; | private String buildCycle; | ||||
@ApiModelProperty("原始建设周期(月)") | |||||
@Compare("建设周期(月)") | |||||
private Integer originBuildCycle; | |||||
@ApiModelProperty("建设方案文件") | @ApiModelProperty("建设方案文件") | ||||
@Compare("建设方案文件") | @Compare("建设方案文件") | ||||
private String constructionPlanFile; | private String constructionPlanFile; | ||||
@@ -453,10 +457,17 @@ public class Project implements Serializable { | |||||
@Compare("合同总金额") | @Compare("合同总金额") | ||||
private BigDecimal contractAmount; | private BigDecimal contractAmount; | ||||
@ApiModelProperty("计划验收时间") | |||||
@ApiModelProperty("计划验收时间(有可能是延期后的)") | |||||
@Compare("计划验收时间") | @Compare("计划验收时间") | ||||
private LocalDateTime planAcceptanceTime; | private LocalDateTime planAcceptanceTime; | ||||
@ApiModelProperty("原本计划验收时间") | |||||
@Compare("原本计划验收时间") | |||||
private LocalDateTime originPlanAcceptanceTime; | |||||
@ApiModelProperty("延期月份数") | |||||
private Integer applyDelayMonths; | |||||
@ApiModelProperty("申请延期佐证材料") | @ApiModelProperty("申请延期佐证材料") | ||||
private String applyDelayFile; | private String applyDelayFile; | ||||
@@ -483,4 +494,8 @@ public class Project implements Serializable { | |||||
@ApiModelProperty("区县预审本级主管单位盖章审核日期") | @ApiModelProperty("区县预审本级主管单位盖章审核日期") | ||||
private String countrySealAuditDate; | private String countrySealAuditDate; | ||||
@ApiModelProperty("是否退回|驳回的项目版本") | |||||
private Boolean isBackReject; | |||||
} | } |
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; | |||||
import com.alibaba.fastjson.annotation.JSONField; | import com.alibaba.fastjson.annotation.JSONField; | ||||
import com.fasterxml.jackson.annotation.JsonFormat; | import com.fasterxml.jackson.annotation.JsonFormat; | ||||
import com.ningdatech.basic.util.NdDateUtils; | import com.ningdatech.basic.util.NdDateUtils; | ||||
import com.ningdatech.pmapi.common.compare.Compare; | |||||
import com.ningdatech.pmapi.common.util.BizUtils; | import com.ningdatech.pmapi.common.util.BizUtils; | ||||
import com.ningdatech.pmapi.portrait.model.vo.TagVO; | import com.ningdatech.pmapi.portrait.model.vo.TagVO; | ||||
import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; | import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; | ||||
@@ -405,6 +406,20 @@ public class ProjectDetailVO { | |||||
@ApiModelProperty("标签") | @ApiModelProperty("标签") | ||||
private List<TagVO> tags; | private List<TagVO> tags; | ||||
@ApiModelProperty("是否退回|驳回的项目版本") | |||||
private Boolean isBackReject; | |||||
@ApiModelProperty("原本计划验收时间") | |||||
@Compare("原本计划验收时间") | |||||
private LocalDateTime originPlanAcceptanceTime; | |||||
@ApiModelProperty("延期月份数") | |||||
private Integer applyDelayMonths; | |||||
@ApiModelProperty("原始建设周期(月)") | |||||
@Compare("建设周期(月)") | |||||
private Integer originBuildCycle; | |||||
public String getVersionStr() { | public String getVersionStr() { | ||||
if (Objects.nonNull(this.newest) && this.newest) { | if (Objects.nonNull(this.newest) && this.newest) { | ||||
this.versionStr = "当前版本"; | this.versionStr = "当前版本"; | ||||
@@ -41,6 +41,15 @@ public class ProjectLibListItemVO { | |||||
@ApiModelProperty("项目ID") | @ApiModelProperty("项目ID") | ||||
private Long id; | private Long id; | ||||
@ApiModelProperty("项目编号") | |||||
private String projectCode; | |||||
@ApiModelProperty("区域") | |||||
private String area; | |||||
@ApiModelProperty("区域Code") | |||||
private String areaCode; | |||||
@ApiModelProperty("项目名称") | @ApiModelProperty("项目名称") | ||||
private String projectName; | private String projectName; | ||||
@@ -129,9 +138,6 @@ public class ProjectLibListItemVO { | |||||
@ApiModelProperty("能否被预审申报") | @ApiModelProperty("能否被预审申报") | ||||
private Boolean canPreDeclared = Boolean.FALSE; | private Boolean canPreDeclared = Boolean.FALSE; | ||||
@ApiModelProperty("21位项目编号") | |||||
private String projectCode; | |||||
@ApiModelProperty("是否有上级条线主管部门 0没有 1有") | @ApiModelProperty("是否有上级条线主管部门 0没有 1有") | ||||
private Integer isHigherSuperOrg; | private Integer isHigherSuperOrg; | ||||
@@ -31,6 +31,7 @@ public class ProjectStatusFlowUtil { | |||||
* value: lambda表达式,最终会获取发起实例的函数 | * value: lambda表达式,最终会获取发起实例的函数 | ||||
*/ | */ | ||||
public ProjectStatusFlowUtil(){ | public ProjectStatusFlowUtil(){ | ||||
intervalTimeMap.put(0,60); | |||||
intervalTimeMap.put(1,60 * 2); | intervalTimeMap.put(1,60 * 2); | ||||
intervalTimeMap.put(2,60 * 6); | intervalTimeMap.put(2,60 * 6); | ||||
intervalTimeMap.put(3,60 * 15); | intervalTimeMap.put(3,60 * 15); | ||||
@@ -259,6 +259,9 @@ public class HandlerManage { | |||||
declaredProject.setInstCode(instanceId); | declaredProject.setInstCode(instanceId); | ||||
declaredProject.setApplyDelayFile(delayApply.getDelayApplyFile()); | declaredProject.setApplyDelayFile(delayApply.getDelayApplyFile()); | ||||
declaredProject.setApplyDelayReason(delayApply.getDelayApplyReason()); | declaredProject.setApplyDelayReason(delayApply.getDelayApplyReason()); | ||||
//增加总延期的月份 | |||||
declaredProject.setApplyDelayMonths(Objects.nonNull(declaredProject.getApplyDelayMonths()) ? | |||||
declaredProject.getApplyDelayMonths() + delayApply.getDelayTime() : delayApply.getDelayTime()); | |||||
projectService.updateById(declaredProject); | projectService.updateById(declaredProject); | ||||
} | } | ||||
@@ -1097,12 +1097,15 @@ public class TodoCenterManage { | |||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
projectService.save(project); | projectService.save(project); | ||||
oldProject.setIsBackReject(Boolean.TRUE); | |||||
projectService.updateById(oldProject); | |||||
ProjectInst oldInst = projectInstService.getOne(Wrappers.lambdaUpdate(ProjectInst.class) | ProjectInst oldInst = projectInstService.getOne(Wrappers.lambdaUpdate(ProjectInst.class) | ||||
.eq(ProjectInst::getProjectId, oldProject.getId()) | .eq(ProjectInst::getProjectId, oldProject.getId()) | ||||
.eq(ProjectInst::getInstCode, oldProject.getInstCode())); | .eq(ProjectInst::getInstCode, oldProject.getInstCode())); | ||||
String instCode = oldProject.getInstCode(); | String instCode = oldProject.getInstCode(); | ||||
oldInst.setInstCode("EMPTY"); | |||||
oldInst.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE); | |||||
projectInstService.updateById(oldInst); | projectInstService.updateById(oldInst); | ||||
ProjectInst newPi = new ProjectInst(); | ProjectInst newPi = new ProjectInst(); | ||||
@@ -206,6 +206,11 @@ provincial: | |||||
#天印服务器接口信息 | #天印服务器接口信息 | ||||
irs: | irs: | ||||
is-search-app: false | is-search-app: false | ||||
digital-resource-indicators: | |||||
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm | |||||
interface-name: 99E2bic31KdXzaa7 | |||||
app-key: A331101453557202109017383 | |||||
app-secret: 496f0f2a19994f76b4fd9dae087366c7 | |||||
seal-platform: | seal-platform: | ||||
project-id: 330001110 | project-id: 330001110 | ||||
project-secret: 70e512d40c8f440484db4acab181570a | project-secret: 70e512d40c8f440484db4acab181570a | ||||
@@ -209,6 +209,11 @@ provincial: | |||||
#天印服务器接口信息 | #天印服务器接口信息 | ||||
irs: | irs: | ||||
is-search-app: true | is-search-app: true | ||||
digital-resource-indicators: | |||||
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm | |||||
interfaceName: 99E2bic31KdXzaa7 | |||||
app-key: A331101453557202109017383 | |||||
app-secret: 496f0f2a19994f76b4fd9dae087366c7 | |||||
seal-platform: | seal-platform: | ||||
project-id: 330001110 | project-id: 330001110 | ||||
project-secret: 70e512d40c8f440484db4acab181570a | project-secret: 70e512d40c8f440484db4acab181570a | ||||
@@ -209,6 +209,11 @@ provincial: | |||||
#天印服务器接口信息 | #天印服务器接口信息 | ||||
irs: | irs: | ||||
is-search-app: true | is-search-app: true | ||||
digital-resource-indicators: | |||||
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm | |||||
interfaceName: 99E2bic31KdXzaa7 | |||||
app-key: A331101453557202109017383 | |||||
app-secret: 496f0f2a19994f76b4fd9dae087366c7 | |||||
seal-platform: | seal-platform: | ||||
project-id: 330001110 | project-id: 330001110 | ||||
project-secret: 70e512d40c8f440484db4acab181570a | project-secret: 70e512d40c8f440484db4acab181570a | ||||
@@ -553,21 +553,36 @@ | |||||
<w:sz w:val="30"/> | <w:sz w:val="30"/> | ||||
<w:sz-cs w:val="30"/> | <w:sz-cs w:val="30"/> | ||||
</w:rPr> | </w:rPr> | ||||
<w:t>${meetingTime},${holdOrg}组织专家在${meetingAddress}对${projectName}进行评审。专家组认真听取了项目业主方、建设方的情况汇报,审阅了项目材料,实地查看了设备及平台演示,专家组织质询、讨论后提出以下意见: | |||||
<w:t>${meetingTime},${holdOrg}组织专家在${meetingAddress}对${projectName} | |||||
进行评审。专家组认真听取了项目业主方、建设方的情况汇报,审阅了项目材料,实地查看了设备及平台演示,专家组织质询、讨论后提出以下意见: | |||||
</w:t> | </w:t> | ||||
</w:r> | </w:r> | ||||
</w:p> | </w:p> | ||||
<w:p> | <w:p> | ||||
<w:pPr> | <w:pPr> | ||||
<w:pStyle w:val="a2"/> | <w:pStyle w:val="a2"/> | ||||
<w:spacing w:line="244" w:line-rule="auto"/> | |||||
<w:spacing w:line="257" w:line-rule="auto"/> | |||||
</w:pPr> | </w:pPr> | ||||
</w:p> | </w:p> | ||||
<w:p> | <w:p> | ||||
<w:pPr> | <w:pPr> | ||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="244" w:line-rule="auto"/> | |||||
<w:ind w:first-line="500" w:first-line-chars="0"/> | |||||
<w:rPr> | |||||
<w:rFonts w:ascii="微软雅黑" w:h-ansi="微软雅黑" w:fareast="微软雅黑" w:cs="微软雅黑" | |||||
w:hint="fareast"/> | |||||
<w:sz w:val="30"/> | |||||
<w:sz-cs w:val="30"/> | |||||
</w:rPr> | |||||
</w:pPr> | </w:pPr> | ||||
<w:r> | |||||
<w:rPr> | |||||
<w:rFonts w:ascii="微软雅黑" w:h-ansi="微软雅黑" w:fareast="微软雅黑" w:cs="微软雅黑" | |||||
w:hint="fareast"/> | |||||
<w:sz w:val="30"/> | |||||
<w:sz-cs w:val="30"/> | |||||
</w:rPr> | |||||
<w:t>${(reviewResult)!}</w:t> | |||||
</w:r> | |||||
</w:p> | </w:p> | ||||
<w:p> | <w:p> | ||||
<w:pPr> | <w:pPr> | ||||
@@ -644,73 +659,13 @@ | |||||
<w:p> | <w:p> | ||||
<w:pPr> | <w:pPr> | ||||
<w:pStyle w:val="a2"/> | <w:pStyle w:val="a2"/> | ||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
</w:pPr> | |||||
</w:p> | |||||
<w:p> | |||||
<w:pPr> | |||||
<w:pStyle w:val="a2"/> | |||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
<w:spacing w:line="244" w:line-rule="auto"/> | |||||
</w:pPr> | </w:pPr> | ||||
</w:p> | </w:p> | ||||
<w:p> | <w:p> | ||||
<w:pPr> | <w:pPr> | ||||
<w:pStyle w:val="a2"/> | <w:pStyle w:val="a2"/> | ||||
<w:spacing w:line="245" w:line-rule="auto"/> | |||||
<w:spacing w:line="244" w:line-rule="auto"/> | |||||
</w:pPr> | </w:pPr> | ||||
</w:p> | </w:p> | ||||
<w:p> | <w:p> | ||||
@@ -4,12 +4,14 @@ import cn.hutool.core.collection.CollUtil; | |||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.pmapi.AppTests; | import com.ningdatech.pmapi.AppTests; | ||||
import com.ningdatech.pmapi.common.constant.BizConst; | |||||
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | ||||
import com.wflow.workflow.bean.dto.TodoCenterListReqDTO; | import com.wflow.workflow.bean.dto.TodoCenterListReqDTO; | ||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.flowable.engine.HistoryService; | import org.flowable.engine.HistoryService; | ||||
import org.flowable.engine.RuntimeService; | import org.flowable.engine.RuntimeService; | ||||
import org.flowable.engine.history.HistoricActivityInstance; | import org.flowable.engine.history.HistoricActivityInstance; | ||||
@@ -29,6 +31,7 @@ import java.util.stream.Collectors; | |||||
* @Date 2023/2/16 14:44 | * @Date 2023/2/16 14:44 | ||||
* @Author PoffyZhang | * @Author PoffyZhang | ||||
*/ | */ | ||||
@Slf4j | |||||
public class InstanceTest extends AppTests { | public class InstanceTest extends AppTests { | ||||
@Autowired | @Autowired | ||||
@@ -145,4 +148,43 @@ public class InstanceTest extends AppTests { | |||||
} | } | ||||
} | } | ||||
@Test | |||||
public void test4(){ | |||||
String nodeId = "node_64d1bc4694fc85e4dd1f1b36"; | |||||
List<HistoricActivityInstance> hais = historyService.createHistoricActivityInstanceQuery() | |||||
.activityId(nodeId) | |||||
.unfinished() | |||||
.orderByHistoricActivityInstanceStartTime() | |||||
.asc() | |||||
.list(); | |||||
log.info("hais :{}",JSON.toJSONString(hais)); | |||||
if (CollUtil.isEmpty(hais)) { | |||||
log.info("没有查到 历史实例"); | |||||
return; | |||||
} | |||||
String instanceId = hais.get(0).getProcessInstanceId(); | |||||
log.info("instanceId :{}",instanceId); | |||||
//查询当前未完成的此实例 | |||||
HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery() | |||||
.processInstanceId(instanceId) | |||||
.unfinished() | |||||
.singleResult(); | |||||
log.info("instance :{}",JSON.toJSONString(instance)); | |||||
if (Objects.isNull(instance)) { | |||||
log.info("没有查到实例 或者 实例已经结束"); | |||||
return; | |||||
} | |||||
//2.查到 此流程实例的 项目 | |||||
ProjectInst pi = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | |||||
.eq(ProjectInst::getInstCode, instanceId) | |||||
.last(BizConst.LIMIT_1)); | |||||
log.info("pi :{}",JSON.toJSONString(pi)); | |||||
} | |||||
} | } |
@@ -7,6 +7,7 @@ import com.ningdatech.pmapi.AppTests; | |||||
import com.ningdatech.pmapi.common.util.CryptUtils; | import com.ningdatech.pmapi.common.util.CryptUtils; | ||||
import com.ningdatech.pmapi.common.util.HmacAuthUtil; | import com.ningdatech.pmapi.common.util.HmacAuthUtil; | ||||
import com.ningdatech.pmapi.common.util.RefreshKeyUtil; | import com.ningdatech.pmapi.common.util.RefreshKeyUtil; | ||||
import com.ningdatech.pmapi.irs.manage.AppIrsManage; | |||||
import com.ningdatech.zwdd.ZwddIntegrationProperties; | import com.ningdatech.zwdd.ZwddIntegrationProperties; | ||||
import com.ningdatech.zwdd.client.ZwddAuthClient; | import com.ningdatech.zwdd.client.ZwddAuthClient; | ||||
import com.ningdatech.zwdd.client.ZwddClient; | import com.ningdatech.zwdd.client.ZwddClient; | ||||
@@ -20,12 +21,14 @@ import org.springframework.http.HttpMethod; | |||||
import org.springframework.http.ResponseEntity; | import org.springframework.http.ResponseEntity; | ||||
import org.springframework.util.MultiValueMap; | import org.springframework.util.MultiValueMap; | ||||
import org.springframework.web.client.RestTemplate; | import org.springframework.web.client.RestTemplate; | ||||
import java.io.File; | import java.io.File; | ||||
import java.io.FileOutputStream; | import java.io.FileOutputStream; | ||||
import java.io.InputStream; | import java.io.InputStream; | ||||
import java.io.OutputStream; | import java.io.OutputStream; | ||||
import java.security.NoSuchAlgorithmException; | import java.security.NoSuchAlgorithmException; | ||||
import java.util.*; | |||||
import java.util.Map; | |||||
import java.util.Objects; | |||||
/** | /** | ||||
* @Classname IrsTest | * @Classname IrsTest | ||||
@@ -40,12 +43,14 @@ public class IrsTest extends AppTests { | |||||
@Autowired | @Autowired | ||||
private ZwddClient zwddClient; | private ZwddClient zwddClient; | ||||
@Autowired | |||||
private AppIrsManage appIrsManage; | |||||
@Test | @Test | ||||
public void test1(){ | |||||
public void test1() { | |||||
String method = "GET"; | String method = "GET"; | ||||
String url = "https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020230427000001/irs-res-bill/report/pdfUrl" + | String url = "https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020230427000001/irs-res-bill/report/pdfUrl" + | ||||
"?appCode=A331123467587202307014177"; | |||||
"?appCode=A331101453557202109017383"; | |||||
String appScret = "BCDSGS_4ab4235d26a9a357170a39f3a13fd68c"; | String appScret = "BCDSGS_4ab4235d26a9a357170a39f3a13fd68c"; | ||||
String appKey = "BCDSGA_d874c8e46b541eb4e8aac6510fd3351b"; | String appKey = "BCDSGA_d874c8e46b541eb4e8aac6510fd3351b"; | ||||
@@ -53,14 +58,14 @@ public class IrsTest extends AppTests { | |||||
//请求头 | //请求头 | ||||
HttpHeaders headers = new HttpHeaders(); | HttpHeaders headers = new HttpHeaders(); | ||||
for(Map.Entry<String, String> entry : header.entrySet()){ | |||||
for (Map.Entry<String, String> entry : header.entrySet()) { | |||||
headers.add(entry.getKey(), entry.getValue()); | headers.add(entry.getKey(), entry.getValue()); | ||||
} | } | ||||
//封装请求头 | //封装请求头 | ||||
HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers); | HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers); | ||||
RestTemplate restTemplate = new RestTemplate(); | RestTemplate restTemplate = new RestTemplate(); | ||||
ResponseEntity<String> forEntity = restTemplate.exchange(url, HttpMethod.GET,formEntity, String.class); | |||||
ResponseEntity<String> forEntity = restTemplate.exchange(url, HttpMethod.GET, formEntity, String.class); | |||||
System.out.println(JSON.toJSONString(forEntity)); | System.out.println(JSON.toJSONString(forEntity)); | ||||
} | } | ||||
@@ -100,7 +105,7 @@ public class IrsTest extends AppTests { | |||||
String sign = CryptUtils.MD5Encode(appKey + requestSecret + timestamp); | String sign = CryptUtils.MD5Encode(appKey + requestSecret + timestamp); | ||||
String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/94wbaL1I1Pbz0648.htm?requestTime=" + timestamp + | String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/94wbaL1I1Pbz0648.htm?requestTime=" + timestamp + | ||||
"&sign=" + sign + "&appKey=" + appKey + "&capCode=" + capCode + "&capTime=" + capTime + | "&sign=" + sign + "&appKey=" + appKey + "&capCode=" + capCode + "&capTime=" + capTime + | ||||
"&baseProjSys=" + baseProjSys + "&areaCode=331123&baseProjName=" + baseProjName + "&baseProjId=" + baseProjId + | |||||
"&baseProjSys=" + baseProjSys + "&areaCode=331123&baseProjName=" + baseProjName + "&baseProjId=" + baseProjId + | |||||
"&isEffective=1&baseProjSysCode=" + baseProjSysCode; | "&isEffective=1&baseProjSysCode=" + baseProjSysCode; | ||||
RestTemplate restTemplate = new RestTemplate(); | RestTemplate restTemplate = new RestTemplate(); | ||||
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | ||||
@@ -116,7 +121,7 @@ public class IrsTest extends AppTests { | |||||
} | } | ||||
@Test | @Test | ||||
public void test4(){ | |||||
public void test4() { | |||||
CloseableHttpResponse response = null; | CloseableHttpResponse response = null; | ||||
try { | try { | ||||
String api = "/media/download"; | String api = "/media/download"; | ||||
@@ -147,7 +152,7 @@ public class IrsTest extends AppTests { | |||||
fos.close(); | fos.close(); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
System.out.println(e); | System.out.println(e); | ||||
}finally { | |||||
} finally { | |||||
if (response != null) { | if (response != null) { | ||||
try { | try { | ||||
//特别提醒:需要调用response的close方法关闭网络连接!!! | //特别提醒:需要调用response的close方法关闭网络连接!!! | ||||
@@ -160,7 +165,7 @@ public class IrsTest extends AppTests { | |||||
} | } | ||||
@Test | @Test | ||||
public void test5(){ | |||||
public void test5() { | |||||
CloseableHttpResponse response = null; | CloseableHttpResponse response = null; | ||||
try { | try { | ||||
String api = "/media/download"; | String api = "/media/download"; | ||||
@@ -191,7 +196,7 @@ public class IrsTest extends AppTests { | |||||
fos.close(); | fos.close(); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
System.out.println(e); | System.out.println(e); | ||||
}finally { | |||||
} finally { | |||||
if (response != null) { | if (response != null) { | ||||
try { | try { | ||||
//特别提醒:需要调用response的close方法关闭网络连接!!! | //特别提醒:需要调用response的close方法关闭网络连接!!! | ||||
@@ -206,6 +211,7 @@ public class IrsTest extends AppTests { | |||||
private static ExecutableClient zwddExecutableClient; | private static ExecutableClient zwddExecutableClient; | ||||
@Autowired | @Autowired | ||||
private ZwddIntegrationProperties zwddProperties; | private ZwddIntegrationProperties zwddProperties; | ||||
public ExecutableClient getZwddExecutableClient() { | public ExecutableClient getZwddExecutableClient() { | ||||
if (Objects.isNull(zwddExecutableClient)) { | if (Objects.isNull(zwddExecutableClient)) { | ||||
synchronized (ZwddAuthClientProvider.class) { | synchronized (ZwddAuthClientProvider.class) { | ||||
@@ -224,4 +230,5 @@ public class IrsTest extends AppTests { | |||||
} | } | ||||
return zwddExecutableClient; | return zwddExecutableClient; | ||||
} | } | ||||
} | } |
@@ -0,0 +1,26 @@ | |||||
package com.ningdatech.pmapi.password; | |||||
import org.junit.Test; | |||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | |||||
import org.springframework.security.crypto.password.PasswordEncoder; | |||||
/** | |||||
* @Classname PasswordTest | |||||
* @Description | |||||
* @Date 2023/8/2 17:39 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
public class PasswordTest { | |||||
@Test | |||||
public void password(){ | |||||
String mingwen = "ELgaCeHteZA8VJK8"; | |||||
String miwen = "$2a$10$MT82RbInrIkRVL/GRS01Vew8AO6ICngOpbAGbdkWgSnYFhog5n8.q"; | |||||
String encode = new BCryptPasswordEncoder().encode(mingwen); | |||||
boolean matches = new BCryptPasswordEncoder().matches(mingwen, encode); | |||||
System.out.println(encode); | |||||
System.out.println(matches); | |||||
} | |||||
} |
@@ -206,6 +206,11 @@ provincial: | |||||
#天印服务器接口信息 | #天印服务器接口信息 | ||||
irs: | irs: | ||||
is-search-app: false | is-search-app: false | ||||
digital-resource-indicators: | |||||
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm | |||||
interfaceName: 99E2bic31KdXzaa7 | |||||
app-key: A331101453557202109017383 | |||||
app-secret: 496f0f2a19994f76b4fd9dae087366c7 | |||||
seal-platform: | seal-platform: | ||||
project-id: 330001110 | project-id: 330001110 | ||||
project-secret: 70e512d40c8f440484db4acab181570a | project-secret: 70e512d40c8f440484db4acab181570a | ||||
@@ -145,7 +145,7 @@ flowable: | |||||
async-executor-activate: true | async-executor-activate: true | ||||
#关闭一些不需要的功能服务 | #关闭一些不需要的功能服务 | ||||
rest-api-enabled: false | rest-api-enabled: false | ||||
# database-schema-update: false | |||||
# database-schema-update: false | |||||
idm: | idm: | ||||
enabled: false | enabled: false | ||||
common: | common: | ||||
@@ -209,6 +209,11 @@ provincial: | |||||
#天印服务器接口信息 | #天印服务器接口信息 | ||||
irs: | irs: | ||||
is-search-app: true | is-search-app: true | ||||
digital-resource-indicators: | |||||
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm | |||||
interfaceName: 99E2bic31KdXzaa7 | |||||
app-key: A331101453557202109017383 | |||||
app-secret: 496f0f2a19994f76b4fd9dae087366c7 | |||||
seal-platform: | seal-platform: | ||||
project-id: 330001110 | project-id: 330001110 | ||||
project-secret: 70e512d40c8f440484db4acab181570a | project-secret: 70e512d40c8f440484db4acab181570a | ||||