@@ -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.req.ProjectListReq; | ||||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | ||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.log.annotation.WebLog; | |||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -29,6 +30,7 @@ public class ProjectReviewController { | |||||
@ApiOperation("提交项目评审申请") | @ApiOperation("提交项目评审申请") | ||||
@PostMapping(value = {"/submit", "resubmit"}) | @PostMapping(value = {"/submit", "resubmit"}) | ||||
@WebLog("提交项目评审申请") | |||||
public void projectReviewApply(@RequestBody ProjectReviewApplyReq req) { | public void projectReviewApply(@RequestBody ProjectReviewApplyReq req) { | ||||
projectReviewManage.projectReviewApply(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.DeclaredProjectListVO; | ||||
import com.hz.pm.api.projectlib.model.vo.MhProjectBaseInfoVO; | import com.hz.pm.api.projectlib.model.vo.MhProjectBaseInfoVO; | ||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.log.annotation.WebLog; | |||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import org.springframework.security.access.prepost.PreAuthorize; | |||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
@@ -32,40 +34,47 @@ public class MhProjectController { | |||||
@ApiOperation("立项备案列表") | @ApiOperation("立项备案列表") | ||||
@GetMapping("/pageDeclaredProject") | @GetMapping("/pageDeclaredProject") | ||||
@WebLog("立项备案列表") | |||||
public PageVo<DeclaredProjectListVO> pageDeclaredProject(DeclaredProjectListReq req) { | public PageVo<DeclaredProjectListVO> pageDeclaredProject(DeclaredProjectListReq req) { | ||||
return declaredRecordManage.pageDeclaredProject(req); | return declaredRecordManage.pageDeclaredProject(req); | ||||
} | } | ||||
@ApiOperation("信产项目基本信息") | @ApiOperation("信产项目基本信息") | ||||
@GetMapping("/baseInfo/{mhProjectId}") | @GetMapping("/baseInfo/{mhProjectId}") | ||||
@WebLog("信产项目基本信息") | |||||
public MhProjectBaseInfoVO projectBaseInfo(@PathVariable Long mhProjectId) { | public MhProjectBaseInfoVO projectBaseInfo(@PathVariable Long mhProjectId) { | ||||
return declaredRecordManage.getProjectBaseInfo(mhProjectId); | return declaredRecordManage.getProjectBaseInfo(mhProjectId); | ||||
} | } | ||||
@ApiOperation("立项备案提交") | @ApiOperation("立项备案提交") | ||||
@PostMapping("/submit") | @PostMapping("/submit") | ||||
@WebLog("立项备案提交") | |||||
public void submit(@Valid @RequestBody DefaultDeclaredDTO req) { | public void submit(@Valid @RequestBody DefaultDeclaredDTO req) { | ||||
declaredRecordManage.startDeclaredRecord(req); | declaredRecordManage.startDeclaredRecord(req); | ||||
} | } | ||||
@ApiOperation("立项备案重新提交") | @ApiOperation("立项备案重新提交") | ||||
@PostMapping("/resubmit") | @PostMapping("/resubmit") | ||||
@WebLog("立项备案重新提交") | |||||
public void resubmit(@Valid @RequestBody DefaultDeclaredDTO req) { | public void resubmit(@Valid @RequestBody DefaultDeclaredDTO req) { | ||||
declaredRecordManage.restartDeclaredRecord(req); | declaredRecordManage.restartDeclaredRecord(req); | ||||
} | } | ||||
@ApiOperation("初始化信产项目至项目库") | @ApiOperation("初始化信产项目至项目库") | ||||
@GetMapping("/initProjectLib") | @GetMapping("/initProjectLib") | ||||
@PreAuthorize("hasAuthority('SUPER_ADMIN')") | |||||
public void initMhProjectToProjectLib() { | public void initMhProjectToProjectLib() { | ||||
declaredRecordManage.initMhProjectToProject(); | declaredRecordManage.initMhProjectToProject(); | ||||
} | } | ||||
@GetMapping("/importReplaceSystemInfos") | @GetMapping("/importReplaceSystemInfos") | ||||
@PreAuthorize("hasAuthority('SUPER_ADMIN')") | |||||
public void importReplaceSystemInfos(MultipartFile file) { | public void importReplaceSystemInfos(MultipartFile file) { | ||||
declaredRecordManage.importReplaceSystemInfos(file); | declaredRecordManage.importReplaceSystemInfos(file); | ||||
} | } | ||||
@GetMapping("/importProjectFinanceInfos") | @GetMapping("/importProjectFinanceInfos") | ||||
@PreAuthorize("hasAuthority('SUPER_ADMIN')") | |||||
public void importProjectFinanceInfos(MultipartFile file) { | public void importProjectFinanceInfos(MultipartFile file) { | ||||
declaredRecordManage.importProjectFinanceInfos(file); | declaredRecordManage.importProjectFinanceInfos(file); | ||||
} | } | ||||
@@ -396,7 +396,7 @@ public class DeclaredRecordManage { | |||||
} | } | ||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public void importProjectFinanceInfos(MultipartFile file) { | |||||
public synchronized void importProjectFinanceInfos(MultipartFile file) { | |||||
try (InputStream is = file.getInputStream()) { | try (InputStream is = file.getInputStream()) { | ||||
List<Map<String, Object>> rows = ExcelUtil.getReader(is).readAll(); | List<Map<String, Object>> rows = ExcelUtil.getReader(is).readAll(); | ||||
if (rows.isEmpty()) { | if (rows.isEmpty()) { | ||||
@@ -459,7 +459,7 @@ public class DeclaredRecordManage { | |||||
} | } | ||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public void importReplaceSystemInfos(MultipartFile file) { | |||||
public synchronized void importReplaceSystemInfos(MultipartFile file) { | |||||
try (InputStream is = file.getInputStream()) { | try (InputStream is = file.getInputStream()) { | ||||
List<Map<String, Object>> rows = ExcelUtil.getReader(is) | List<Map<String, Object>> rows = ExcelUtil.getReader(is) | ||||
.readAll(); | .readAll(); | ||||
@@ -60,6 +60,7 @@ import java.time.LocalDate; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.time.temporal.ChronoUnit; | import java.time.temporal.ChronoUnit; | ||||
import java.util.*; | import java.util.*; | ||||
import java.util.function.ToLongBiFunction; | |||||
import java.util.function.ToLongFunction; | import java.util.function.ToLongFunction; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
@@ -227,12 +228,12 @@ public class WorkbenchManage { | |||||
Map<Long, Long> projBizMap = purchaseEventMap.getOrDefault(event.name(), Collections.emptyMap()); | Map<Long, Long> projBizMap = purchaseEventMap.getOrDefault(event.name(), Collections.emptyMap()); | ||||
return projBizMap.values().stream().mapToLong(l -> l).sum(); | 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()); | 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(); | return projBizMap.size(); | ||||
} else { | } else { | ||||
return projectPurchaseCountMap.entrySet().stream().filter(w -> { | return projectPurchaseCountMap.entrySet().stream().filter(w -> { | ||||
@@ -284,7 +285,7 @@ public class WorkbenchManage { | |||||
projectCount = projectPurchaseCountMap.size(); | projectCount = projectPurchaseCountMap.size(); | ||||
if (bidCount > 0) { | if (bidCount > 0) { | ||||
Wrapper<PurchaseStatusChange> pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) | Wrapper<PurchaseStatusChange> pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) | ||||
.select(PurchaseStatusChange::getEvent) | |||||
.select(PurchaseStatusChange::getEvent,PurchaseStatusChange::getProjectId) | |||||
.in(PurchaseStatusChange::getProjectId, allVersionProjectIds) | .in(PurchaseStatusChange::getProjectId, allVersionProjectIds) | ||||
.in(PurchaseStatusChange::getEvent, AdaptStateChangeEvent.ADAPT_INFO_PASSED, | .in(PurchaseStatusChange::getEvent, AdaptStateChangeEvent.ADAPT_INFO_PASSED, | ||||
SelfTestStateChangeEvent.SELF_TEST_PASSED, | SelfTestStateChangeEvent.SELF_TEST_PASSED, | ||||
@@ -302,29 +303,29 @@ public class WorkbenchManage { | |||||
break; | break; | ||||
case PROJECT_ADAPTION: | case PROJECT_ADAPTION: | ||||
bidCount = countPurchase.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED); | bidCount = countPurchase.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED); | ||||
projectCount = countProject.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED); | |||||
projectCount = countProject.applyAsLong(AdaptStateChangeEvent.ADAPT_INFO_PASSED, node); | |||||
break; | break; | ||||
case SYSTEM_SELF_TEST: | case SYSTEM_SELF_TEST: | ||||
bidCount = countPurchase.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED); | bidCount = countPurchase.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED); | ||||
projectCount = countProject.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED); | |||||
projectCount = countProject.applyAsLong(SelfTestStateChangeEvent.SELF_TEST_PASSED, node); | |||||
break; | break; | ||||
case SYSTEM_TEST_VALID: | case SYSTEM_TEST_VALID: | ||||
bidCount = countPurchase.applyAsLong(TestValidStateChangeEvent.TEST_VALID_INFO_PASSED); | 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; | break; | ||||
case FIRST_INSPECTED: | case FIRST_INSPECTED: | ||||
case PILOT_RUNNING: | case PILOT_RUNNING: | ||||
// 初验试运行数量同步 | // 初验试运行数量同步 | ||||
bidCount = countPurchase.applyAsLong(TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES); | 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; | break; | ||||
case XCFHX_REVIEW: | case XCFHX_REVIEW: | ||||
bidCount = countPurchase.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED); | bidCount = countPurchase.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED); | ||||
projectCount = countProject.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED); | |||||
projectCount = countProject.applyAsLong(XcfhxStateChangeEvent.XCFHX_APPLY_PASSED, node); | |||||
break; | break; | ||||
case FINAL_INSPECTED: | case FINAL_INSPECTED: | ||||
bidCount = countPurchase.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED); | bidCount = countPurchase.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED); | ||||
projectCount = countProject.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED); | |||||
projectCount = countProject.applyAsLong(TenderStateChangeEvent.FINALLY_INSPECTED_PASSED, node); | |||||
break; | break; | ||||
default: | default: | ||||
break; | break; | ||||