|
|
@@ -37,6 +37,7 @@ import com.hz.pm.api.projectlib.model.vo.TenderListInfoVO; |
|
|
|
import com.hz.pm.api.projectlib.service.IProjectAnnualPaymentPlanService; |
|
|
|
import com.hz.pm.api.projectlib.service.IProjectInstService; |
|
|
|
import com.hz.pm.api.projectlib.service.IProjectService; |
|
|
|
import com.hz.pm.api.todocenter.manage.HandlerManage; |
|
|
|
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; |
|
|
@@ -86,6 +87,7 @@ public class FinalAcceptanceManage { |
|
|
|
private final StateMachineUtil stateMachineUtil; |
|
|
|
private final TenderStateMachineUtil tenderStateMachineUtil; |
|
|
|
private final IProjectInstService projectInstService; |
|
|
|
private final HandlerManage handlerManage; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@@ -234,8 +236,9 @@ public class FinalAcceptanceManage { |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public String startProcess(SubmitFinallyInspectedReq req) { |
|
|
|
Integer instTypeCode = ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode(); |
|
|
|
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) |
|
|
|
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()) |
|
|
|
.eq(WflowModels::getProcessType, instTypeCode) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if (Objects.isNull(model)) { |
|
|
|
throw new BusinessException("找不到验收申报流程配置"); |
|
|
@@ -268,17 +271,26 @@ public class FinalAcceptanceManage { |
|
|
|
purchaseInst.setBidId(req.getBidId()); |
|
|
|
purchaseInst.setInstCode(instanceId); |
|
|
|
purchaseInst.setProjectId(req.getProjectId()); |
|
|
|
purchaseInst.setInstType(ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()); |
|
|
|
purchaseInst.setInstType(instTypeCode); |
|
|
|
purchaseInstService.save(purchaseInst); |
|
|
|
boolean allFinalInspected = purchases.stream().noneMatch(w -> StrUtils.isBlank(w.getFinalInspectionMaterials())); |
|
|
|
ProjectInst projectInst = new ProjectInst(); |
|
|
|
projectInst.setInstType(ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()); |
|
|
|
projectInst.setInstType(instTypeCode); |
|
|
|
projectInst.setInstCode(instanceId); |
|
|
|
projectInst.setProjectId(req.getProjectId()); |
|
|
|
projectInstService.save(projectInst); |
|
|
|
if (allFinalInspected) { |
|
|
|
stateMachineUtil.pass(project); |
|
|
|
projectService.updateById(project); |
|
|
|
|
|
|
|
if (ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.eq(project.getStatus())) { |
|
|
|
// 判断是否所有标段已经进行过终验申报 无论是否通过 |
|
|
|
LambdaQueryWrapper<PurchaseInst> purchaseInstQuery = Wrappers.lambdaQuery(PurchaseInst.class) |
|
|
|
.select(PurchaseInst::getBidId) |
|
|
|
.eq(PurchaseInst::getInstType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()) |
|
|
|
.in(PurchaseInst::getBidId, purchaseMap.keySet()); |
|
|
|
List<PurchaseInst> currPurchaseInstList = purchaseInstService.list(purchaseInstQuery); |
|
|
|
Set<Long> finalInspectedBidIds = CollUtils.fieldSet(currPurchaseInstList, PurchaseInst::getBidId); |
|
|
|
if (finalInspectedBidIds.size() == purchases.size()) { |
|
|
|
stateMachineUtil.pass(project); |
|
|
|
projectService.updateById(project); |
|
|
|
} |
|
|
|
} |
|
|
|
//发送给第一个审批人消息 |
|
|
|
return instanceId; |
|
|
|