@@ -393,7 +393,7 @@ public class PerformanceAppraisalPlanManage { | |||
private LocalDateTime getProjectFinishTime(Project newProject) { | |||
//查出历史版本的 所有项目ID | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(newProject); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(newProject.getProjectCode()); | |||
// 根据项目ID查询出项目终验流程的流程状态 | |||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | |||
.in(ProjectInst::getProjectId, allVersionProjectIds) | |||
@@ -1,11 +1,17 @@ | |||
package com.hz.pm.api.performance.service; | |||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.hz.pm.api.performance.model.entity.ProjectCoreBusinessIndicators; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import java.util.Collection; | |||
import java.util.List; | |||
/** | |||
* <p> | |||
* 服务类 | |||
* 服务类 | |||
* </p> | |||
* | |||
* @author CMM | |||
@@ -13,4 +19,10 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||
*/ | |||
public interface IProjectCoreBusinessIndicatorsService extends IService<ProjectCoreBusinessIndicators> { | |||
default List<ProjectCoreBusinessIndicators> listByApplicationIds(Collection<Long> applicationIds) { | |||
Wrapper<ProjectCoreBusinessIndicators> query = Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) | |||
.in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds); | |||
return list(query); | |||
} | |||
} |
@@ -14,7 +14,6 @@ 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.ApiModelProperty; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
@@ -81,7 +80,7 @@ public class ConstructionController { | |||
@ApiOperation(value = "待初验备案的项目列表", notes = "待初验备案的项目列表") | |||
@GetMapping("/pre-ins/project-list") | |||
public PageVo<ProjectLibListItemVO> preProjectList(@ModelAttribute ProjectListReq req) { | |||
return constructionManage.preProjectlist(req); | |||
return constructionManage.preProjectList(req); | |||
} | |||
@GetMapping("/pre-ins/export") | |||
@@ -36,6 +36,7 @@ import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum; | |||
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.TenderListInfoVO; | |||
import com.hz.pm.api.projectlib.service.IProjectInstService; | |||
import com.hz.pm.api.projectlib.service.IProjectAnnualPaymentPlanService; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
@@ -339,18 +340,16 @@ public class ConstructionManage { | |||
* @param req | |||
* @return | |||
*/ | |||
public PageVo<ProjectLibListItemVO> preProjectlist(ProjectListReq req) { | |||
public PageVo<ProjectLibListItemVO> preProjectList(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | |||
//建设中状态 | |||
query.eq(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | |||
query.eq(Project::getStatus, ProjectStatusEnum.TO_BE_FIRST_INSPECTED.getCode()); | |||
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode()); | |||
query.eq(Project::getNewest, Boolean.TRUE); | |||
//只能看自己单位的 | |||
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr()); | |||
//交货时间 排序 | |||
query.isNotNull(Project::getDeliveryTime); | |||
query.orderByAsc(Project::getDeliveryTime); | |||
Page<Project> page = projectService.page(req.page(), query); | |||
long total; | |||
@@ -358,13 +357,13 @@ public class ConstructionManage { | |||
return PageVo.empty(); | |||
} | |||
Set<String> projectCodes = new HashSet<>(); | |||
List<Long> projectIds = new ArrayList<>(); | |||
for (Project project : page.getRecords()) { | |||
projectIds.add(project.getId()); | |||
projectCodes.add(project.getProjectCode()); | |||
} | |||
List<Purchase> purchases = purchaseService.listByProjectIds(projectIds); | |||
Map<Long, List<Purchase>> purchaseMap = CollUtils.group(purchases, Purchase::getProjectId); | |||
Map<Long, Contract> contractMap = contractService.listByProjectIds(projectIds); | |||
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds); | |||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | |||
@@ -393,6 +392,22 @@ public class ConstructionManage { | |||
item.setAnnualPlanAmount(totalAnnualAmount); | |||
item.setTransactionTime(w.getTransactionTime()); | |||
item.setTransactionAmount(w.getTransactionAmount()); | |||
List<Purchase> currPurchases = purchaseMap.get(w.getId()); | |||
if (currPurchases != null) { | |||
List<TenderListInfoVO> tmpPurchases = CollUtils.convert(currPurchases, x -> { | |||
TenderListInfoVO tender = new TenderListInfoVO(); | |||
tender.setBidName(x.getBidName()); | |||
tender.setBidId(x.getId()); | |||
tender.setBidStatus(x.getStatus()); | |||
tender.setBidStatusName(TenderStatusEnum.getDescByStatus(x.getStatus())); | |||
Contract contract = contractMap.get(x.getId()); | |||
if (contract != null) { | |||
tender.setConstructionAmount(contract.getTotalAmount()); | |||
} | |||
return tender; | |||
}); | |||
item.setTenders(tmpPurchases); | |||
} | |||
return item; | |||
}); | |||
return PageVo.of(records, total); | |||
@@ -309,7 +309,7 @@ public class DelayedApplyManage { | |||
* @return | |||
*/ | |||
public List<DelayedApplyVO> delayList(Long projectId) { | |||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectId); | |||
List<Long> allVersionProjectId = projectService.allVersionProjectIds(projectId); | |||
List<ProjectDelayApply> delays = projectDelayApplyService.list(Wrappers.lambdaQuery(ProjectDelayApply.class) | |||
.in(ProjectDelayApply::getProjectId, allVersionProjectId) | |||
.eq(ProjectDelayApply::getSuccess, Boolean.TRUE)); | |||
@@ -17,22 +17,27 @@ import com.hz.pm.api.common.util.ExcelExportStyle; | |||
import com.hz.pm.api.common.util.StrUtils; | |||
import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectExportDTO; | |||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | |||
import com.hz.pm.api.projectdeclared.model.entity.Contract; | |||
import com.hz.pm.api.projectdeclared.model.entity.Purchase; | |||
import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst; | |||
import com.hz.pm.api.projectdeclared.model.req.SubmitFinallyInspectedReq; | |||
import com.hz.pm.api.projectdeclared.model.vo.FinalAcceptanceVO; | |||
import com.hz.pm.api.projectdeclared.service.IContractService; | |||
import com.hz.pm.api.projectdeclared.service.IPurchaseInstService; | |||
import com.hz.pm.api.projectdeclared.service.IPurchaseService; | |||
import com.hz.pm.api.projectlib.helper.ProjectHelper; | |||
import com.hz.pm.api.projectlib.manage.ProjectLibManage; | |||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan; | |||
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum; | |||
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.TenderListInfoVO; | |||
import com.hz.pm.api.projectlib.service.IProjectAnnualPaymentPlanService; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.hz.pm.api.sys.manage.NoticeManage; | |||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | |||
@@ -57,11 +62,9 @@ import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
import java.util.Collections; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Objects; | |||
import java.util.*; | |||
import java.util.concurrent.atomic.AtomicInteger; | |||
import java.util.stream.Collectors; | |||
@@ -86,8 +89,8 @@ public class FinalAcceptanceManage { | |||
private final ProcessModelService processModelService; | |||
private final ProcessInstanceService processInstanceService; | |||
private final DefaultDeclaredProjectManage declaredProjectManage; | |||
private final NoticeManage noticeManage; | |||
private final ProjectLibManage projectLibManage; | |||
private final IContractService contractService; | |||
private final IProjectAnnualPaymentPlanService projectAnnualPaymentPlanService; | |||
private final StateMachineUtil stateMachineUtil; | |||
private final TenderStateMachineUtil tenderStateMachineUtil; | |||
@@ -115,6 +118,14 @@ public class FinalAcceptanceManage { | |||
if ((total = page.getTotal()) == 0) { | |||
return PageVo.empty(); | |||
} | |||
List<Long> projectIds = new ArrayList<>(); | |||
for (Project project : page.getRecords()) { | |||
projectIds.add(project.getId()); | |||
} | |||
List<Purchase> purchases = purchaseService.listByProjectIds(projectIds); | |||
Map<Long, List<Purchase>> purchaseMap = CollUtils.group(purchases, Purchase::getProjectId); | |||
Map<Long, Contract> contractMap = contractService.listByProjectIds(projectIds); | |||
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectAnnualPaymentPlanService.listByProjectIds(projectIds); | |||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | |||
ProjectLibListItemVO item = new ProjectLibListItemVO(); | |||
@@ -135,7 +146,28 @@ public class FinalAcceptanceManage { | |||
item.setApprovalDate(w.getApprovalDate()); | |||
item.setBuildCycle(StringUtils.isNotBlank(w.getBuildCycle()) ? | |||
Integer.valueOf(w.getBuildCycle()) : null); | |||
List<ProjectAnnualPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList()); | |||
BigDecimal totalAnnualAmount = paymentPlans.stream() | |||
.map(ProjectAnnualPaymentPlan::getAnnualPlanAmount) | |||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO); | |||
item.setAnnualPlanAmount(totalAnnualAmount); | |||
item.setPlanAcceptanceTime(w.getPlanAcceptanceTime()); | |||
List<Purchase> currPurchases = purchaseMap.get(w.getId()); | |||
if (currPurchases != null) { | |||
List<TenderListInfoVO> tmpPurchases = CollUtils.convert(currPurchases, x -> { | |||
TenderListInfoVO tender = new TenderListInfoVO(); | |||
tender.setBidName(x.getBidName()); | |||
tender.setBidId(x.getId()); | |||
tender.setBidStatus(x.getStatus()); | |||
tender.setBidStatusName(TenderStatusEnum.getDescByStatus(x.getStatus())); | |||
Contract contract = contractMap.get(x.getId()); | |||
if (contract != null) { | |||
tender.setConstructionAmount(contract.getTotalAmount()); | |||
} | |||
return tender; | |||
}); | |||
item.setTenders(tmpPurchases); | |||
} | |||
return item; | |||
}); | |||
return PageVo.of(records, total); | |||
@@ -67,7 +67,7 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | |||
List<Integer> fieldList = CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatusEnum::getCode); | |||
//查出历史版本的 所有项目ID | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(project.getProjectCode()); | |||
// 项目状态为年度计划中之前的状态 | |||
if (fieldList.contains(status)) { | |||
@@ -43,7 +43,7 @@ public class ArchivedHandle extends AbstractProcessBusinessHandle { | |||
Project project = projectService.getById(projectId); | |||
Integer status = project.getStage(); | |||
//查出历史版本的 所有项目ID | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(project.getProjectCode()); | |||
// 根据项目阶段判断是否已归档 | |||
// 项目阶段不为已归档 | |||
if (!ProjectStatusEnum.ARCHIVED.getCode().equals(status)){ | |||
@@ -58,7 +58,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle | |||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | |||
Project project = projectService.getById(projectId); | |||
//查出历史版本的 所有项目ID | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(project.getProjectCode()); | |||
// 根据项目ID查询出建设方案评审流程的流程状态 | |||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | |||
.in(ProjectInst::getProjectId, allVersionProjectIds) | |||
@@ -58,7 +58,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { | |||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | |||
//查出历史版本的 所有项目ID | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(projectId); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(projectId); | |||
// 根据项目ID查询出部门联审流程的流程状态 | |||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | |||
@@ -62,7 +62,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { | |||
throw new BizException("当前项目不存在!"); | |||
} | |||
//查出历史版本的 所有项目ID | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(projectId); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(projectId); | |||
// 根据项目ID查询项目预审流程的流程状态 | |||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | |||
.in(ProjectInst::getProjectId, allVersionProjectIds) | |||
@@ -44,7 +44,7 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | |||
Project project = projectService.getNewProject(projectId); | |||
//查出历史版本的 所有项目ID | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(project.getProjectCode()); | |||
Integer status = project.getStatus(); | |||
if (Objects.isNull(status)) { | |||
return; | |||
@@ -56,7 +56,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle | |||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | |||
Project project = projectService.getById(projectId); | |||
//查出历史版本的 所有项目ID | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(project.getProjectCode()); | |||
// 根据项目ID查询出项目终验流程的流程状态 | |||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | |||
.in(ProjectInst::getProjectId, allVersionProjectIds) | |||
@@ -60,7 +60,7 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH | |||
List<Integer> fieldList = CollUtils.fieldList(PROJECT_PRELIMINARY_INSPECTION_LIST_STATUS, ProjectStatusEnum::getCode); | |||
Project project = projectService.getNewProject(projectId); | |||
//查出历史版本的 所有项目ID | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(project.getProjectCode()); | |||
Integer status = project.getStatus(); | |||
// 项目状态不在建设中及之后的状态 | |||
if (!fieldList.contains(status)){ | |||
@@ -42,7 +42,7 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle { | |||
//查询项目 | |||
Project project = projectService.getNewProject(projectId); | |||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectId); | |||
List<Long> allVersionProjectId = projectService.allVersionProjectIds(projectId); | |||
// 根据项目ID查询出部门联审流程的流程状态 | |||
if (Objects.isNull(project)) { | |||
@@ -57,7 +57,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | |||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | |||
// 根据项目是否通过立项批复(立项批复时间)来判断招标采购是否开始 | |||
Project project = projectService.getNewProject(projectId); | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(project.getProjectCode()); | |||
Integer status = project.getStatus(); | |||
// 未进行立项批复 | |||
if (Objects.isNull(project.getApprovalDate())) { | |||
@@ -61,7 +61,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { | |||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | |||
processDetailVO.setProcessName(CommonConst.UNIT_INNER_AUDIT); | |||
Project project = projectService.getById(projectId); | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(project.getProjectCode()); | |||
// 根据项目ID查询出单位内部审核流程的流程状态 | |||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | |||
.in(ProjectInst::getProjectId, allVersionProjectIds) | |||
@@ -153,7 +153,8 @@ public class DeclaredRecordManage { | |||
return detail; | |||
} | |||
public String startDeclaredRecord(DefaultDeclaredDTO req) { | |||
@Transactional(rollbackFor = Exception.class) | |||
public void startDeclaredRecord(DefaultDeclaredDTO req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
ProjectDTO projectInfo = req.getProjectInfo(); | |||
@@ -221,8 +222,6 @@ public class DeclaredRecordManage { | |||
//发送给第一个审批人消息 | |||
noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId, | |||
WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||
return instanceId; | |||
} | |||
@Transactional(rollbackFor = Exception.class) | |||
@@ -16,7 +16,6 @@ import com.hz.pm.api.common.compare.CompareUtils; | |||
import com.hz.pm.api.common.enumeration.CommonEnum; | |||
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.model.constant.CommonConst; | |||
import com.hz.pm.api.common.model.entity.ExcelExportWriter; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
@@ -43,11 +42,12 @@ import com.hz.pm.api.portrait.service.ITagService; | |||
import com.hz.pm.api.projectdeclared.manage.ConstructionManage; | |||
import com.hz.pm.api.projectdeclared.model.dto.DelayedApplyDTO; | |||
import com.hz.pm.api.projectdeclared.model.entity.Operation; | |||
import com.hz.pm.api.projectdeclared.model.entity.PaymentPlan; | |||
import com.hz.pm.api.projectdeclared.model.entity.PreInsAcceptancePerson; | |||
import com.hz.pm.api.projectdeclared.model.entity.Purchase; | |||
import com.hz.pm.api.projectdeclared.model.vo.*; | |||
import com.hz.pm.api.projectdeclared.service.*; | |||
import com.hz.pm.api.projectdeclared.service.IOperationService; | |||
import com.hz.pm.api.projectdeclared.service.IPreInsAcceptancePersonService; | |||
import com.hz.pm.api.projectdeclared.service.IPurchaseService; | |||
import com.hz.pm.api.projectdeclared.utils.GenerateProjectCodeUtil; | |||
import com.hz.pm.api.projectlib.handle.ProcessExecuteChainHandle; | |||
import com.hz.pm.api.projectlib.helper.ProjectHelper; | |||
@@ -79,6 +79,7 @@ import com.hz.pm.api.todocenter.service.ITodoService; | |||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | |||
import com.hz.pm.api.user.security.model.UserInfoDetails; | |||
import com.hz.pm.api.user.util.LoginUserUtil; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.function.VUtils; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
@@ -94,10 +95,10 @@ import org.flowable.task.api.Task; | |||
import org.flowable.task.api.TaskInfo; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.math.BigDecimal; | |||
import java.math.RoundingMode; | |||
import java.time.LocalDateTime; | |||
import java.util.*; | |||
import java.util.stream.Collectors; | |||
@@ -126,13 +127,11 @@ public class ProjectLibManage { | |||
private final StateMachineUtil stateMachineUtil; | |||
private final INdProjectDelayApplyService projectDelayApplyService; | |||
private final INdProjectApplyBorrowService projectApplyBorrowService; | |||
private final IContractService contractService; | |||
private final IPurchaseService purchaseService; | |||
private final IPreInsAcceptancePersonService acceptancePersonService; | |||
private final IPaymentPlanService paymentPlanService; | |||
private final ITodoService todoService; | |||
private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; | |||
private final IProjectAnnualPaymentPlanService projectPaymentPlanService; | |||
private final IProjectAnnualPaymentPlanService projectAnnualPaymentPlanService; | |||
private final IOperationService operationService; | |||
private final IProjectTagService projectTagService; | |||
private final ITagService tagService; | |||
@@ -159,7 +158,7 @@ public class ProjectLibManage { | |||
projectCodes.add(project.getProjectCode()); | |||
} | |||
Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap = listRenewDeclarations(projectCodes); | |||
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds); | |||
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectAnnualPaymentPlanService.listByProjectIds(projectIds); | |||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | |||
ProjectLibListItemVO item = new ProjectLibListItemVO(); | |||
@@ -215,7 +214,7 @@ public class ProjectLibManage { | |||
projectCodes.add(project.getProjectCode()); | |||
} | |||
Map<String, List<TagVO>> projectTagMap = getProjectTags(projectCodes); | |||
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds); | |||
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectAnnualPaymentPlanService.listByProjectIds(projectIds); | |||
Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap = listRenewDeclarations(projectCodes); | |||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | |||
@@ -634,11 +633,8 @@ public class ProjectLibManage { | |||
public ProjectDetailVO detailProjectCode(String projectCode) { | |||
// 查询最新的项目申报信息 | |||
Project projectInfo = projectService.getProjectByCode(projectCode); | |||
if (Objects.isNull(projectInfo)) { | |||
return null; | |||
} | |||
return getProjectDetailLogic(projectInfo); | |||
Project project = projectService.getProjectByCode(projectCode); | |||
return project == null ? null : getProjectDetailLogic(project); | |||
} | |||
/** | |||
@@ -649,47 +645,37 @@ public class ProjectLibManage { | |||
*/ | |||
public ProjectDetailVO getProjectDetailThisVersion(Long projectId) { | |||
// 查询最新的项目申报信息 | |||
Project projectInfo = projectService.getById(projectId); | |||
if (Objects.isNull(projectInfo)) { | |||
return null; | |||
} | |||
return getProjectDetailLogic(projectInfo); | |||
Project project = projectService.getById(projectId); | |||
return project == null ? null : getProjectDetailLogic(project); | |||
} | |||
private ProjectDetailVO getProjectDetailLogic(Project projectInfo) { | |||
private ProjectDetailVO getProjectDetailLogic(Project project) { | |||
ProjectDetailVO vo = new ProjectDetailVO(); | |||
BeanUtils.copyProperties(projectInfo, vo); | |||
vo.buildDynamicForm(projectInfo.getDynamicForm()); | |||
BeanUtils.copyProperties(project, vo); | |||
vo.buildDynamicForm(project.getDynamicForm()); | |||
String projectCode = project.getProjectCode(); | |||
// 查询应用 | |||
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) | |||
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) | |||
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); | |||
List<ProjectApplication> applications = applicationService.list(projectCode, project.getVersion(), project.getIsConstruct()); | |||
List<Long> applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); | |||
List<Long> applicationIds = CollUtils.fieldList(applications, ProjectApplication::getId); | |||
//核心业务 | |||
if (CollUtil.isNotEmpty(applicationIds)) { | |||
List<ProjectCoreBusinessIndicators> coreBizs = projectCoreBusinessIndicatorsService.list(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) | |||
.in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); | |||
Map<Long, List<ProjectCoreBusinessIndicators>> coreBizMap = coreBizs.stream().collect(Collectors.groupingBy(ProjectCoreBusinessIndicators::getApplicationId)); | |||
Optional.of(applications).ifPresent(apps -> | |||
vo.setProjectApplications(CollUtils.convert(apps, | |||
app -> ProjectHelper.convertVOWithMap(app, coreBizMap)) | |||
)); | |||
List<ProjectCoreBusinessIndicators> coreBizs = projectCoreBusinessIndicatorsService.listByApplicationIds(applicationIds); | |||
Map<Long, List<ProjectCoreBusinessIndicators>> coreBizMap = CollUtils.group(coreBizs, ProjectCoreBusinessIndicators::getApplicationId); | |||
vo.setProjectApplications(CollUtils.convert(applications, app -> ProjectHelper.convertVOWithMap(app, coreBizMap))); | |||
} | |||
//审批信息 | |||
ProcessDetailReq req = new ProcessDetailReq(); | |||
req.setInstanceId(projectInfo.getInstCode()); | |||
req.setProjectId(projectInfo.getId()); | |||
req.setInstanceId(project.getInstCode()); | |||
req.setProjectId(project.getId()); | |||
vo.setProcess(todoService.getProcessDetail(req)); | |||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); | |||
List<Long> allVersionProjectIds = projectService.allVersionProjectIds(projectCode); | |||
// 查询采购备案 | |||
vo.setPurchaseDetails(new ArrayList<>()); | |||
List<Purchase> purchases = purchaseService.listByProjectIds(allVersionProjectId); | |||
List<Purchase> purchases = purchaseService.listByProjectIds(allVersionProjectIds); | |||
if (!purchases.isEmpty()) { | |||
Map<Long, PurchaseVO> purchaseMap = CollUtils.listToMap(purchases, Purchase::getId, w -> { | |||
PurchaseVO purchase = BeanUtil.copyProperties(w, PurchaseVO.class); | |||
@@ -704,16 +690,16 @@ public class ProjectLibManage { | |||
List<Operation> operations = operationService.list(Wrappers.lambdaQuery(Operation.class) | |||
.in(Operation::getBidId, purchaseMap.keySet())); | |||
List<OperationVO> tmpOperations = BeanUtil.copyToList(operations, OperationVO.class); | |||
Map<Long, OperationVO> operationMap = CollUtils.listToMap(tmpOperations, w -> w.getBidId()); | |||
Map<Long, OperationVO> operationMap = CollUtils.listToMap(tmpOperations, OperationVO::getBidId); | |||
//查询初验信息 | |||
Map<Long, List<PreInsAcceptancePerson>> acceptancePersonsMap = acceptancePersonService.listByBidIds(purchaseMap.keySet()); | |||
Map<Long, List<PreInsAcceptancePerson>> acceptPersonsMap = acceptancePersonService.listByBidIds(purchaseMap.keySet()); | |||
purchaseMap.forEach((k, v) -> { | |||
PurchaseFullInfoVO purchaseFullInfo = new PurchaseFullInfoVO(); | |||
purchaseFullInfo.setPurchase(v); | |||
purchaseFullInfo.setOperation(operationMap.get(k)); | |||
purchaseFullInfo.setConstruction(contractMap.get(k)); | |||
List<PreInsAcceptancePerson> tmpPersons = acceptancePersonsMap.get(k); | |||
List<PreInsAcceptancePerson> tmpPersons = acceptPersonsMap.get(k); | |||
if (tmpPersons != null) { | |||
purchaseFullInfo.setFirstInspectedPersons(convertPersons(tmpPersons)); | |||
} | |||
@@ -722,31 +708,25 @@ public class ProjectLibManage { | |||
} | |||
List<ProjectAnnualPaymentPlan> paymentPlans = projectPaymentPlanService.listByProjectId(projectInfo.getId()); | |||
vo.setAnnualPaymentPlans(BeanUtil.copyToList(paymentPlans, ProjectPaymentPlanDTO.class)); | |||
List<ProjectAnnualPaymentPlan> annualPaymentPlans = projectAnnualPaymentPlanService.listByProjectId(project.getId()); | |||
vo.setAnnualPaymentPlans(BeanUtil.copyToList(annualPaymentPlans, ProjectPaymentPlanDTO.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())); | |||
List<SupplierSafetyQualification> safetyQualifications = supplierSafetyQualificationService.listByProjectCode(projectCode); | |||
if (CollUtil.isNotEmpty(safetyQualifications)) { | |||
safetyVo.setSupplierSafetyQualification(BeanUtil.copyToList(safetyQualifications, SupplierSafetyQualificationVO.class)); | |||
} | |||
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<PersonSafetyInfo> personSafetyInfos = personSafetyInfoService.listByProjectCode(projectCode); | |||
if (CollUtil.isNotEmpty(personSafetyInfos)) { | |||
safetyVo.setPersonSafetyInfo(BeanUtil.copyToList(personSafetyInfos, PersonSafetyInfoVO.class)); | |||
} | |||
//查询终验信息 | |||
vo.setFinalIrsApps(applicationHandler.generateIrsApp(projectInfo.getProjectCode())); | |||
// 查询终验信息 | |||
vo.setFinalIrsApps(applicationHandler.generateIrsApp(projectCode)); | |||
// 处理文件名 | |||
List<Long> fileIdList = new ArrayList<>(); | |||
@@ -759,7 +739,7 @@ public class ProjectLibManage { | |||
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); | |||
} | |||
//专家评审 其它建议 -> 建设方案的会议 | |||
ExpertReview finalReview = expertReviewService.getFinalReview(projectInfo.getProjectCode(), | |||
ExpertReview finalReview = expertReviewService.getFinalReview(projectCode, | |||
ReviewTemplateTypeEnum.CONSTRUCTION_SCHEME_REVIEW.getCode()); | |||
if (Objects.nonNull(finalReview)) { | |||
@@ -846,9 +826,9 @@ public class ProjectLibManage { | |||
/** | |||
* 申报新项目时 保存项目信息和其它相关联的信息 | |||
* | |||
* @param projectDto | |||
* @param instanceId | |||
* @return | |||
* @param projectDto \ | |||
* @param instanceId \ | |||
* @return \ | |||
*/ | |||
public Project saveProjectNewVersion(ProjectDTO projectDto, String instanceId, | |||
Long userId, Boolean isContruct) { | |||
@@ -857,14 +837,15 @@ public class ProjectLibManage { | |||
} | |||
public Project saveProjectNewVersion(ProjectDTO projectDto, String instanceId, | |||
Long userId, Boolean isContruct, | |||
Long userId, Boolean isConstruct, | |||
ProjectStatusEnum stage, | |||
ProjectStatusEnum status) { | |||
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | |||
try { | |||
Project project = new Project(); | |||
Project project; | |||
//为空 代表是新申报的 | |||
if (Objects.isNull(projectDto.getId())) { | |||
project = new Project(); | |||
BeanUtils.copyProperties(projectDto, project); | |||
project.setCreateOn(LocalDateTime.now()); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
@@ -880,7 +861,7 @@ public class ProjectLibManage { | |||
} | |||
} else { | |||
//否则是重新提交的 新生成一个新版本的项目 | |||
project = newProjectWithVersion(projectDto, isContruct); | |||
project = newProjectWithVersion(projectDto, isConstruct); | |||
if (Objects.nonNull(project)) { | |||
project.setInstCode(instanceId); | |||
project.setSponsor(String.valueOf(userId)); | |||
@@ -889,21 +870,21 @@ public class ProjectLibManage { | |||
} | |||
return project; | |||
} catch (Exception e) { | |||
log.error("项目信息入库错误 " + e); | |||
throw new BusinessException("项目信息入库错误 :" + e); | |||
log.error("项目信息入库错误", e); | |||
throw BizException.wrap("项目信息入库错误"); | |||
} | |||
} | |||
private void savePaymentPlans(Project project, List<ProjectPaymentPlanDTO> paymentPlans) { | |||
Integer version = Objects.nonNull(project.getVersion()) ? project.getVersion() : 1; | |||
projectPaymentPlanService.remove(project.getProjectCode(), version); | |||
projectAnnualPaymentPlanService.remove(project.getProjectCode(), version); | |||
List<ProjectAnnualPaymentPlan> plans = paymentPlans.stream().map(w -> { | |||
ProjectAnnualPaymentPlan plan = BeanUtil.copyProperties(w, ProjectAnnualPaymentPlan.class); | |||
plan.setProjectCode(project.getProjectCode()); | |||
plan.setProjectVersion(version); | |||
return plan; | |||
}).collect(Collectors.toList()); | |||
projectPaymentPlanService.saveBatch(plans); | |||
projectAnnualPaymentPlanService.saveBatch(plans); | |||
} | |||
/** | |||
@@ -919,9 +900,10 @@ public class ProjectLibManage { | |||
Long userId, Project oldProject) { | |||
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | |||
try { | |||
Project project = new Project(); | |||
Project project; | |||
//为空 代表是新申报的 | |||
if (Objects.isNull(projectDto.getId())) { | |||
project = new Project(); | |||
BeanUtils.copyProperties(projectDto, project); | |||
// 被撤回重新申报的项目,项目ID要置空 | |||
project.setId(null); | |||
@@ -970,16 +952,16 @@ public class ProjectLibManage { | |||
/** | |||
* 在其它项目阶段 保存项目信息和其它相关联的信息 | |||
* | |||
* @param projectDto | |||
* @return | |||
* @param projectDto \ | |||
* @return \ | |||
*/ | |||
public Project reSaveProjectNewVersion(ProjectDTO projectDto, Boolean isContruct) { | |||
public Project reSaveProjectNewVersion(ProjectDTO projectDto, Boolean isConstruct) { | |||
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | |||
try { | |||
return newProjectWithVersion(projectDto, isContruct); | |||
return newProjectWithVersion(projectDto, isConstruct); | |||
} catch (Exception e) { | |||
log.error("项目信息入库错误 " + e); | |||
throw new BusinessException("项目信息入库错误 :" + e); | |||
log.error("项目信息入库错误 ", e); | |||
throw new BusinessException("项目信息入库错误"); | |||
} | |||
} | |||
@@ -987,14 +969,13 @@ public class ProjectLibManage { | |||
* 重新提交工作流时 舍弃在原有项目修改 | |||
* 新增一个新的项目 新的版本号 | |||
*/ | |||
public Project newProjectWithVersion(ProjectDTO projecDto, Boolean isContruct) { | |||
Project oldProject = projectService.getById(projecDto.getId()); | |||
public Project newProjectWithVersion(ProjectDTO projectDto, Boolean isConstruct) { | |||
Project oldProject = projectService.getById(projectDto.getId()); | |||
Project project = new Project(); | |||
VUtils.isTrue(Objects.isNull(oldProject)) | |||
.throwMessage("项目不存在!"); | |||
VUtils.isTrue(Objects.isNull(oldProject)).throwMessage("项目不存在!"); | |||
BeanUtil.copyProperties(oldProject, project, CopyOptions.create() | |||
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); | |||
BeanUtil.copyProperties(projecDto, project, CopyOptions.create() | |||
BeanUtil.copyProperties(projectDto, project, CopyOptions.create() | |||
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); | |||
project.setVersion(oldProject.getVersion() + 1); | |||
project.setId(null); | |||
@@ -1007,8 +988,8 @@ public class ProjectLibManage { | |||
oldProject.setIsBackReject(Boolean.TRUE); | |||
projectService.updateById(oldProject); | |||
projectService.reverseNewest(project.getProjectCode(), project.getId()); | |||
saveApplication(projecDto, project, isContruct); | |||
savePaymentPlans(project, projecDto.getPaymentPlanList()); | |||
saveApplication(projectDto, project, isConstruct); | |||
savePaymentPlans(project, projectDto.getPaymentPlanList()); | |||
return project; | |||
} | |||
@@ -1044,6 +1025,7 @@ public class ProjectLibManage { | |||
return project; | |||
} | |||
@Transactional(rollbackFor = Exception.class) | |||
public Project saveProjectWithVersion(ProjectDTO projectDto, String instanceId, Integer instType, Boolean isConstruct) { | |||
Project oldProject = projectService.getById(projectDto.getId()); | |||
Project project = new Project(); | |||
@@ -1243,12 +1225,12 @@ public class ProjectLibManage { | |||
List<String> sheetsNames = new ArrayList<>(); | |||
sheetsNames.add(fileName); | |||
// 表体行数据集合 | |||
List<List<String>> exportDatas = ExcelDownUtil.getProjectExportDatas(param.getExportOptionList(), projects); | |||
List<List<String>> exportDataList = ExcelDownUtil.getProjectExportDatas(param.getExportOptionList(), projects); | |||
// sheet列表集合 | |||
List<List<List<String>>> sheets = new ArrayList<>(); | |||
sheets.add(exportDatas); | |||
sheets.add(exportDataList); | |||
excelExportWriter.setHeads(sheets); | |||
excelExportWriter.setDatas(exportDatas); | |||
excelExportWriter.setDatas(exportDataList); | |||
excelExportWriter.setSheets(sheetsNames); | |||
excelExportWriter.setHeadPropertyClass(List.class); | |||
excelExportWriter.setHeadPropertyFlag(Boolean.FALSE); | |||
@@ -1424,21 +1406,8 @@ public class ProjectLibManage { | |||
if (CollUtil.isEmpty(acceptancePersons)) { | |||
return Collections.emptyList(); | |||
} | |||
return acceptancePersons.stream().map(u -> BeanUtil.copyProperties(u, PreInsAcceptancePersonVO.class)).collect(Collectors.toList()); | |||
} | |||
private List<PaymentPlanVO> convertPayments(List<PaymentPlan> payments, BigDecimal totalAmount) { | |||
if (CollUtil.isEmpty(payments)) { | |||
return Collections.emptyList(); | |||
} | |||
return payments.stream().map(p -> { | |||
PaymentPlanVO vo = BeanUtil.copyProperties(p, PaymentPlanVO.class); | |||
vo.setRatio((Objects.isNull(totalAmount) || totalAmount.compareTo(BigDecimal.ZERO) == 0) ? "0%" | |||
: p.getPaymentAmount().multiply(BigDecimal.valueOf(100)) | |||
.divide(totalAmount, BigDecimal.ROUND_CEILING, RoundingMode.CEILING) + "%"); | |||
return vo; | |||
}) | |||
return acceptancePersons.stream() | |||
.map(u -> BeanUtil.copyProperties(u, PreInsAcceptancePersonVO.class)) | |||
.collect(Collectors.toList()); | |||
} | |||
@@ -1603,4 +1572,5 @@ public class ProjectLibManage { | |||
ProjectDetailVO projectDetailVO = this.detailProjectCode(projectCode); | |||
return ProjectConvertUtil.declaredToCollection(projectDetailVO, fileService); | |||
} | |||
} |
@@ -26,6 +26,13 @@ public interface IProjectApplicationService extends IService<ProjectApplication> | |||
.eq(ProjectApplication::getProjectId, projectId)); | |||
} | |||
default List<ProjectApplication> list(String projectCode, Integer version, Boolean isConstruct) { | |||
return list(Wrappers.lambdaQuery(ProjectApplication.class) | |||
.eq(ProjectApplication::getProjectCode, projectCode) | |||
.eq(ProjectApplication::getProjectVersion, version) | |||
.eq(ProjectApplication::getIsConstruct, isConstruct)); | |||
} | |||
default void remove(String projectCode, Integer projectVersion) { | |||
remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||
.eq(ProjectApplication::getProjectCode, projectCode) | |||
@@ -12,6 +12,7 @@ import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||
import java.util.Collection; | |||
import java.util.List; | |||
import java.util.Optional; | |||
/** | |||
* <p> | |||
@@ -23,9 +24,16 @@ import java.util.List; | |||
*/ | |||
public interface IProjectService extends IService<Project> { | |||
public List<Long> getAllVersionProjectId(Project project); | |||
default Optional<String> getProjectCode(Long projectId) { | |||
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) | |||
.select(Project::getProjectCode); | |||
return Optional.ofNullable(getOne(query)) | |||
.flatMap(w -> Optional.of(w.getProjectCode())); | |||
} | |||
List<Long> allVersionProjectIds(String projectCode); | |||
public List<Long> getAllVersionProjectId(Long projectId); | |||
List<Long> allVersionProjectIds(Long projectId); | |||
Project getNewProject(Long projectId); | |||
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service; | |||
import java.util.Collections; | |||
import java.util.List; | |||
import java.util.Objects; | |||
import java.util.Optional; | |||
import java.util.stream.Collectors; | |||
/** | |||
@@ -35,12 +36,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl | |||
private final ProjectMapper projectMapper; | |||
@Override | |||
public List<Long> getAllVersionProjectId(Project project) { | |||
public List<Long> allVersionProjectIds(String projectCode) { | |||
//查出 项目code | |||
String projectCode = project.getProjectCode(); | |||
List<Project> projects = list(Wrappers.lambdaQuery(Project.class) | |||
.eq(Project::getProjectCode, projectCode)); | |||
.select(Project::getId).eq(Project::getProjectCode, projectCode)); | |||
if (CollUtil.isEmpty(projects)) { | |||
return Collections.emptyList(); | |||
@@ -49,12 +48,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl | |||
} | |||
@Override | |||
public List<Long> getAllVersionProjectId(Long projectId) { | |||
Project project = getById(projectId); | |||
if (Objects.isNull(project)) { | |||
return Collections.emptyList(); | |||
} | |||
return getAllVersionProjectId(project); | |||
public List<Long> allVersionProjectIds(Long projectId) { | |||
Optional<String> projectCode = getProjectCode(projectId); | |||
return projectCode.flatMap(code -> Optional.of(allVersionProjectIds(code))) | |||
.orElse(Collections.emptyList()); | |||
} | |||
@Override | |||
@@ -1,8 +1,11 @@ | |||
package com.hz.pm.api.safety.service; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.hz.pm.api.safety.model.entity.PersonSafetyInfo; | |||
import java.util.List; | |||
/** | |||
* @Classname IPersonSafetyInfoService | |||
* @Description | |||
@@ -11,4 +14,9 @@ import com.hz.pm.api.safety.model.entity.PersonSafetyInfo; | |||
*/ | |||
public interface IPersonSafetyInfoService extends IService<PersonSafetyInfo> { | |||
default List<PersonSafetyInfo> listByProjectCode(String projectCode) { | |||
return list(Wrappers.lambdaQuery(PersonSafetyInfo.class) | |||
.eq(PersonSafetyInfo::getProjectCode, projectCode)); | |||
} | |||
} |
@@ -1,14 +1,22 @@ | |||
package com.hz.pm.api.safety.service; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.hz.pm.api.safety.model.entity.SupplierSafetyQualification; | |||
import java.util.List; | |||
/** | |||
* @Classname ISupplierSafetyQulificationService | |||
* @Classname ISupplierSafetyQualificationService | |||
* @Description | |||
* @Date 2023/8/2 10:47 | |||
* @Author PoffyZhang | |||
*/ | |||
public interface ISupplierSafetyQualificationService extends IService<SupplierSafetyQualification> { | |||
default List<SupplierSafetyQualification> listByProjectCode(String projectCode) { | |||
return list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) | |||
.eq(SupplierSafetyQualification::getProjectCode, projectCode)); | |||
} | |||
} |
@@ -824,7 +824,7 @@ public class CockpitStatsStatisticsTask { | |||
if (Objects.isNull(project)) { | |||
return Boolean.FALSE; | |||
} | |||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectId = projectService.allVersionProjectIds(project.getProjectCode()); | |||
ProjectInst pi = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | |||
.in(ProjectInst::getProjectId, allVersionProjectId) | |||
.eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) | |||
@@ -858,7 +858,7 @@ public class CockpitStatsStatisticsTask { | |||
if (Objects.isNull(project)) { | |||
return Boolean.FALSE; | |||
} | |||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(project); | |||
List<Long> allVersionProjectId = projectService.allVersionProjectIds(project.getProjectCode()); | |||
ProjectInst pi = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | |||
.in(ProjectInst::getProjectId, allVersionProjectId) | |||
.eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) | |||
@@ -149,7 +149,7 @@ public class EarlyWarningInstanceNotStartTask { | |||
.filter(p -> { | |||
//判断 当状态在 建设中的时候 是不是要初验了 | |||
if (ProjectStatusEnum.UNDER_CONSTRUCTION.getCode().equals(projectStutas)) { | |||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(p); | |||
List<Long> allVersionProjectId = projectService.allVersionProjectIds(p.getProjectCode()); | |||
//如果合同信息提交过了 才是 待初验状态 | |||
// TODO 初验提醒 | |||
/*if (StringUtils.isNotBlank(p.getPreliminaryInspectionMaterials())) { | |||
@@ -325,7 +325,7 @@ public class EarlyWarningInstanceNotStartTask { | |||
.filter(p -> { | |||
//判断 当状态在 建设中的时候 是不是要初验了 | |||
if (ProjectStatusEnum.UNDER_CONSTRUCTION.getCode().equals(projectStutas)) { | |||
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(p); | |||
List<Long> allVersionProjectId = projectService.allVersionProjectIds(p.getProjectCode()); | |||
//如果合同信息提交过了 才是 待初验状态 | |||
// 初验提醒 | |||
/*if (StringUtils.isNotBlank(p.getPreliminaryInspectionMaterials())) { | |||
@@ -146,7 +146,7 @@ public class TodoServiceImpl implements ITodoService { | |||
return Boolean.FALSE; | |||
} | |||
List<Long> projectIds = projectService.getAllVersionProjectId(project); | |||
List<Long> projectIds = projectService.allVersionProjectIds(project.getProjectCode()); | |||
//2.要判断 项目在当前状态 有没有被驳回和退回过 | |||
//当前项目状态流程的 实例 看看是不是有2个以上 有2个说明 有退回 驳回 | |||
List<ProjectInst> pis = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) | |||
@@ -61,7 +61,7 @@ spring: | |||
# 配置从池返回的连接的默认自动提交行为。默认值为true。 | |||
auto-commit: true | |||
# 开启连接监测泄露 | |||
leak-detection-threshold: 6000 | |||
leak-detection-threshold: 30000 | |||
# 测试连接数据库 | |||
connection-test-query: SELECT 1 | |||
#设置上传 单个文件的大小 | |||