@@ -6,6 +6,7 @@ import com.hz.pm.api.projectdeclared.model.req.ProjectReviewApplyReq; | |||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.log.annotation.WebLog; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.RequiredArgsConstructor; | |||
@@ -29,6 +30,7 @@ public class ProjectReviewController { | |||
@ApiOperation("提交项目评审申请") | |||
@PostMapping(value = {"/submit", "resubmit"}) | |||
@WebLog("提交项目评审申请") | |||
public void projectReviewApply(@RequestBody ProjectReviewApplyReq req) { | |||
projectReviewManage.projectReviewApply(req); | |||
} | |||
@@ -1,39 +0,0 @@ | |||
package com.hz.pm.api.projectdeclared.model.req; | |||
import com.ningdatech.basic.model.PagePo; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.time.LocalDateTime; | |||
/** | |||
* @Classname PrequalificationDeclaredReq | |||
* @Description | |||
* @Date 2023/2/14 11:42 | |||
* @Author PoffyZhang | |||
*/ | |||
@Data | |||
public class ConstrctionPlanListReq extends PagePo { | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
@ApiModelProperty("申报单位") | |||
private String buildOrg; | |||
@ApiModelProperty("项目类型") | |||
private Integer projectType; | |||
@ApiModelProperty("预算年度") | |||
private Integer projectYear; | |||
@ApiModelProperty("创建时间") | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") | |||
private LocalDateTime createOnMin; | |||
@ApiModelProperty("创建时间") | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") | |||
private LocalDateTime createOnMax; | |||
} |
@@ -6,9 +6,11 @@ import com.hz.pm.api.projectlib.model.req.DeclaredProjectListReq; | |||
import com.hz.pm.api.projectlib.model.vo.DeclaredProjectListVO; | |||
import com.hz.pm.api.projectlib.model.vo.MhProjectBaseInfoVO; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.log.annotation.WebLog; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.security.access.prepost.PreAuthorize; | |||
import org.springframework.web.bind.annotation.*; | |||
import org.springframework.web.multipart.MultipartFile; | |||
@@ -32,40 +34,47 @@ public class MhProjectController { | |||
@ApiOperation("立项备案列表") | |||
@GetMapping("/pageDeclaredProject") | |||
@WebLog("立项备案列表") | |||
public PageVo<DeclaredProjectListVO> pageDeclaredProject(DeclaredProjectListReq req) { | |||
return declaredRecordManage.pageDeclaredProject(req); | |||
} | |||
@ApiOperation("信产项目基本信息") | |||
@GetMapping("/baseInfo/{mhProjectId}") | |||
@WebLog("信产项目基本信息") | |||
public MhProjectBaseInfoVO projectBaseInfo(@PathVariable Long mhProjectId) { | |||
return declaredRecordManage.getProjectBaseInfo(mhProjectId); | |||
} | |||
@ApiOperation("立项备案提交") | |||
@PostMapping("/submit") | |||
@WebLog("立项备案提交") | |||
public void submit(@Valid @RequestBody DefaultDeclaredDTO req) { | |||
declaredRecordManage.startDeclaredRecord(req); | |||
} | |||
@ApiOperation("立项备案重新提交") | |||
@PostMapping("/resubmit") | |||
@WebLog("立项备案重新提交") | |||
public void resubmit(@Valid @RequestBody DefaultDeclaredDTO req) { | |||
declaredRecordManage.restartDeclaredRecord(req); | |||
} | |||
@ApiOperation("初始化信产项目至项目库") | |||
@GetMapping("/initProjectLib") | |||
@PreAuthorize("hasAuthority('SUPER_ADMIN')") | |||
public void initMhProjectToProjectLib() { | |||
declaredRecordManage.initMhProjectToProject(); | |||
} | |||
@GetMapping("/importReplaceSystemInfos") | |||
@PreAuthorize("hasAuthority('SUPER_ADMIN')") | |||
public void importReplaceSystemInfos(MultipartFile file) { | |||
declaredRecordManage.importReplaceSystemInfos(file); | |||
} | |||
@GetMapping("/importProjectFinanceInfos") | |||
@PreAuthorize("hasAuthority('SUPER_ADMIN')") | |||
public void importProjectFinanceInfos(MultipartFile file) { | |||
declaredRecordManage.importProjectFinanceInfos(file); | |||
} | |||
@@ -396,7 +396,7 @@ public class DeclaredRecordManage { | |||
} | |||
@Transactional(rollbackFor = Exception.class) | |||
public void importProjectFinanceInfos(MultipartFile file) { | |||
public synchronized void importProjectFinanceInfos(MultipartFile file) { | |||
try (InputStream is = file.getInputStream()) { | |||
List<Map<String, Object>> rows = ExcelUtil.getReader(is).readAll(); | |||
if (rows.isEmpty()) { | |||
@@ -459,7 +459,7 @@ public class DeclaredRecordManage { | |||
} | |||
@Transactional(rollbackFor = Exception.class) | |||
public void importReplaceSystemInfos(MultipartFile file) { | |||
public synchronized void importReplaceSystemInfos(MultipartFile file) { | |||
try (InputStream is = file.getInputStream()) { | |||
List<Map<String, Object>> rows = ExcelUtil.getReader(is) | |||
.readAll(); | |||
@@ -60,6 +60,7 @@ import java.time.LocalDate; | |||
import java.time.LocalDateTime; | |||
import java.time.temporal.ChronoUnit; | |||
import java.util.*; | |||
import java.util.function.ToLongBiFunction; | |||
import java.util.function.ToLongFunction; | |||
import java.util.stream.Collectors; | |||
@@ -227,12 +228,12 @@ public class WorkbenchManage { | |||
Map<Long, Long> projBizMap = purchaseEventMap.getOrDefault(event.name(), Collections.emptyMap()); | |||
return projBizMap.values().stream().mapToLong(l -> l).sum(); | |||
}; | |||
ToLongFunction<AbstractStateChangeEvent> countProject = event -> { | |||
ToLongBiFunction<AbstractStateChangeEvent, ProcessNode> countProject = (event, node) -> { | |||
Map<Long, Long> projBizMap = purchaseEventMap.getOrDefault(event.name(), Collections.emptyMap()); | |||
if (event.name().equals(ProcessNode.PROJECT_ADAPTION.name()) | |||
|| event.name().equals(ProcessNode.SYSTEM_SELF_TEST.name()) | |||
|| event.name().equals(ProcessNode.SYSTEM_TEST_VALID.name()) | |||
|| event.name().equals(ProcessNode.XCFHX_REVIEW.name())) { | |||
if (node.equals(ProcessNode.PROJECT_ADAPTION) | |||
|| node.equals(ProcessNode.SYSTEM_SELF_TEST) | |||
|| node.equals(ProcessNode.SYSTEM_TEST_VALID) | |||
|| node.equals(ProcessNode.XCFHX_REVIEW)) { | |||
return projBizMap.size(); | |||
} else { | |||
return projectPurchaseCountMap.entrySet().stream().filter(w -> { | |||
@@ -284,7 +285,7 @@ public class WorkbenchManage { | |||
projectCount = projectPurchaseCountMap.size(); | |||
if (bidCount > 0) { | |||
Wrapper<PurchaseStatusChange> pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) | |||
.select(PurchaseStatusChange::getEvent) | |||
.select(PurchaseStatusChange::getEvent,PurchaseStatusChange::getProjectId) | |||
.in(PurchaseStatusChange::getProjectId, allVersionProjectIds) | |||
.in(PurchaseStatusChange::getEvent, AdaptStateChangeEvent.ADAPT_INFO_PASSED, | |||
SelfTestStateChangeEvent.SELF_TEST_PASSED, | |||
@@ -302,29 +303,29 @@ public class WorkbenchManage { | |||
break; | |||
case PROJECT_ADAPTION: | |||
bidCount = countPurchase.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED); | |||
projectCount = countProject.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED); | |||
projectCount = countProject.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED, node); | |||
break; | |||
case SYSTEM_SELF_TEST: | |||
bidCount = countPurchase.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED); | |||
projectCount = countProject.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED); | |||
projectCount = countProject.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED, node); | |||
break; | |||
case SYSTEM_TEST_VALID: | |||
bidCount = countPurchase.applyAsLong(TestValidStateChangeEvent.TEST_VALID_INFO_PASSED); | |||
projectCount = countProject.applyAsLong(TestValidStateChangeEvent.TEST_VALID_INFO_PASSED); | |||
projectCount = countProject.applyAsLong(TestValidStateChangeEvent.TEST_VALID_INFO_PASSED, node); | |||
break; | |||
case FIRST_INSPECTED: | |||
case PILOT_RUNNING: | |||
// 初验试运行数量同步 | |||
bidCount = countPurchase.applyAsLong(TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES); | |||
projectCount = countProject.applyAsLong(TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES); | |||
projectCount = countProject.applyAsLong(TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES, node); | |||
break; | |||
case XCFHX_REVIEW: | |||
bidCount = countPurchase.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED); | |||
projectCount = countProject.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED); | |||
projectCount = countProject.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED, node); | |||
break; | |||
case FINAL_INSPECTED: | |||
bidCount = countPurchase.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED); | |||
projectCount = countProject.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED); | |||
projectCount = countProject.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED, node); | |||
break; | |||
default: | |||
break; | |||