From 475539be71cc66b303cd5eceb15ad67238804482 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 09:52:18 +0800 Subject: [PATCH 001/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E6=94=BE=E5=85=A5=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 23 +++++++++++----------- .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 4 ++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 177679e..44d3c7a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -35,18 +35,9 @@ import com.ningdatech.pmapi.performance.model.dto.ProjectCoreBusinessDTO; import com.ningdatech.pmapi.performance.model.entity.ProjectCoreBusinessIndicators; import com.ningdatech.pmapi.performance.service.IProjectCoreBusinessIndicatorsService; import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; -import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; -import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; -import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; -import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; -import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PaymentPlanVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; -import com.ningdatech.pmapi.projectdeclared.service.IContractService; -import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; -import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; -import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService; +import com.ningdatech.pmapi.projectdeclared.model.entity.*; +import com.ningdatech.pmapi.projectdeclared.model.vo.*; +import com.ningdatech.pmapi.projectdeclared.service.*; import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; import com.ningdatech.pmapi.projectlib.constant.ProjectConstant; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; @@ -114,6 +105,8 @@ public class ProjectLibManage { private final ITodoService todoService; private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; + private final IOperationService operationService; + public PageVo projectLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); query.eq(Project::getNewest, Boolean.TRUE); @@ -746,6 +739,12 @@ public class ProjectLibManage { 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)); //查询初验信息 List acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 21ded6a..522efdb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -7,6 +7,7 @@ import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; @@ -374,6 +375,9 @@ public class ProjectDetailVO { @ApiModelProperty("初审人员") private List acceptancePersons; + @ApiModelProperty("实施信息") + private OperationVO operation; + @ApiModelProperty("版本号str") private String versionStr; From cf6b01258c214887f776a4000324d9404ace7479 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 10:37:08 +0800 Subject: [PATCH 002/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9C=BA=E4=BF=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/statemachine/action/ProjectDeclareAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareJNAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareJYAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareKFBAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareLDAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareLQAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareQTAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareQYAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareSBJAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareSCAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareSYAction.java | 1 - .../pmapi/common/statemachine/action/ProjectDeclareYHAction.java | 1 - .../common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java | 1 + .../common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java | 1 + .../statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java | 1 + .../common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java | 1 + .../common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java | 1 + .../common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java | 1 + .../common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java | 1 + .../statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java | 1 + .../common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java | 1 + .../common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java | 1 + .../common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java | 1 + 23 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java index d82d21b..1cf9af9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java @@ -214,7 +214,6 @@ public class ProjectDeclareAction { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.OPERATION.getCode()); } - @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") public void START_TO_WORK(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java index 6d16ba6..868d2f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java @@ -211,7 +211,6 @@ public class ProjectDeclareJNAction { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.OPERATION.getCode()); } - @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") public void START_TO_WORK(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java index 106bcd5..e5b4081 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java @@ -204,7 +204,6 @@ public class ProjectDeclareJYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java index a58b1e0..a72963f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java @@ -204,7 +204,6 @@ public class ProjectDeclareKFBAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java index 3dea7b8..7ac6a59 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java @@ -204,7 +204,6 @@ public class ProjectDeclareLDAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java index acde109..4c6e792 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java @@ -204,7 +204,6 @@ public class ProjectDeclareLQAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java index d5269cc..6d127ac 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java @@ -204,7 +204,6 @@ public class ProjectDeclareQTAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java index afaee56..9906c7d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java @@ -204,7 +204,6 @@ public class ProjectDeclareQYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java index 56044ea..b83c62a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java @@ -204,7 +204,6 @@ public class ProjectDeclareSBJAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java index 436cf3a..c5e6db5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java @@ -212,7 +212,6 @@ public class ProjectDeclareSCAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java index 7f8d38c..e515925 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java @@ -204,7 +204,6 @@ public class ProjectDeclareSYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java index 1498589..9fe7b1b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java @@ -210,7 +210,6 @@ public class ProjectDeclareYHAction { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.OPERATION.getCode()); } - @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") public void START_TO_WORK(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java index d77704f..6699f8a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java @@ -216,6 +216,7 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java index 8ddc583..0e1e70b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java @@ -216,6 +216,7 @@ public class ProjectDeclareStateMachineJYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java index 37becf2..a9c54d0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java @@ -216,6 +216,7 @@ public class ProjectDeclareStateMachineKFQBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java index 4c5187e..575ff1a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java @@ -216,6 +216,7 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java index db9f3a5..737d7f5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java @@ -217,6 +217,7 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java index e1b3c00..43dae81 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java @@ -216,6 +216,7 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java index 690d7ff..617c7d7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java @@ -216,6 +216,7 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java index 9178ee3..c321412 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java @@ -217,6 +217,7 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java index e2bd06f..eddf681 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java @@ -226,6 +226,7 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java index ca854dd..048aac5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java @@ -216,6 +216,7 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java index ac57d56..e7bbd74 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java @@ -216,6 +216,7 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) From a3070118334ad7845c1f05a5b4921cf1fb3f5acf Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 003/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/controller/EarlyWarningController.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java new file mode 100644 index 0000000..d446d01 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.sys.controller; + +import com.ningdatech.log.annotation.WebLog; +import com.wflow.bean.dto.WflowEarlyWarningDTO; +import com.wflow.bean.vo.WflowEarlyWarningVO; +import com.wflow.service.IEarlyWarningService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @Classname EarlyWarningController + * @Description + * @Date 2023/8/01 14:28 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/sys/early-warning") +@Api(value = "EarlyWarning", tags = "系统管理-预警规则") +@RequiredArgsConstructor +public class EarlyWarningController { + + private final IEarlyWarningService earlyWarningService; + + @ApiOperation(value = "预警规则获取", notes = "预警规则获取") + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); + } + + @ApiOperation(value = "预警规则保存", notes = "预警规则保存") + @PostMapping("/save") + @WebLog("预警规则保存") + public String save(@Validated @RequestBody WflowEarlyWarningDTO dto) { + return earlyWarningService.saveByDto(dto); + } +} From 10e43a8c61601de59b078b146bcca409e891a38a Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:34:26 +0800 Subject: [PATCH 004/137] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/controller/ProjectApplicationController.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java index 7ea6617..a5b7123 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java @@ -6,14 +6,10 @@ import com.ningdatech.pmapi.projectlib.manage.ApplicationManage; import com.ningdatech.pmapi.projectlib.model.dto.ApplicationAppCodeSaveDTO; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; -import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; -import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; -import com.ningdatech.pmapi.user.util.LoginUserUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; - import javax.validation.Valid; /** From 11269df2e062d3873713418efac71cdf82a08aaa Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 005/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 1cd390f3e2a47ea2dec892664e674818f24fca0a Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:39:20 +0800 Subject: [PATCH 006/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E5=8C=BA=E5=9F=9FCODE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 056bdff31cc972325fbad1b1334d9802762baccd Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:01:40 +0800 Subject: [PATCH 007/137] =?UTF-8?q?debug=20=E9=A2=84=E5=AE=A1=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java | 2 +- .../java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index fe7bea6..a03920e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -154,7 +154,7 @@ public class DeclaredProjectManage { Project project = new Project(); BeanUtils.copyProperties(projectInfo,project); Map orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,project); - String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); + String instanceId = processService.startProcessLs(model, params,orgModelMap); log.info("申报项目成功 【{}】", instanceId); //如果是重新提交的话 判断下 项目是否存在 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 177679e..1fb877f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -903,7 +903,8 @@ public class ProjectLibManage { // 查询应用 List applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) .eq(ProjectApplication::getProjectCode, vo.getProjectCode()) - .eq(ProjectApplication::getIsConstruct, Boolean.FALSE)); + .eq(ProjectApplication::getIsConstruct, Boolean.FALSE) + .eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); Optional.ofNullable(applications).ifPresent(apps -> vo.setProjectApplications(CollUtils.convert(apps, From 5a2013c8069e795478d1c75ebb9a395a5e62e713 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 008/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 16dbddf02a39400bce9273ca296a69ae0dde8480 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Tue, 1 Aug 2023 19:19:31 +0800 Subject: [PATCH 009/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92-=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/constant/CommonConst.java | 2 + .../PerformanceAppraisalPlanController.java | 25 ++- .../convert/PerformanceAppraisalConveter.java | 36 ++- .../performance/enumration/EvalObjectEnum.java | 42 ++++ .../performance/manage/OrgSelfAppraisalManage.java | 16 +- .../manage/PerformanceAppraisalPlanManage.java | 241 +++++++++++++++++---- .../model/dto/PerformanceAppraisalCreateDTO.java | 40 ++-- .../model/dto/PerformanceAppraisalEditDTO.java | 33 +-- .../model/entity/PerformanceAppraisal.java | 26 +-- .../entity/PerformanceAppraisalApplication.java | 2 +- .../model/entity/PerformanceAppraisalProject.java | 6 + .../model/req/PerformanceAppraisalListReq.java | 6 + .../vo/PerformanceAppraisalApplicationVO.java | 4 +- .../model/vo/PerformanceAppraisalVO.java | 24 +- 14 files changed, 371 insertions(+), 132 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/EvalObjectEnum.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java index 287cb64..dbcf670 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java @@ -58,6 +58,8 @@ public interface CommonConst { Integer VERSION_JUDGE = -1; String COPY = "副本"; + String PROJECT_REPEAT = " 项目已在其他评价计划中,请勿重复添加!"; + String APP_REPEAT = " 应用已在其他评价计划中,请勿重复添加!"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java index c501e1c..ac636e0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java @@ -7,6 +7,7 @@ import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalCreateDTO; import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalEditDTO; import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalProjectGroupSaveDTO; import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq; +import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalApplicationVO; import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectGroupVO; import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO; import io.swagger.annotations.Api; @@ -32,13 +33,13 @@ public class PerformanceAppraisalPlanController { private final PerformanceAppraisalPlanManage performanceAppraisalPlanManage; @GetMapping("/list") - @ApiOperation("绩效评价列表") + @ApiOperation("评价计划列表") public PageVo list(PerformanceAppraisalListReq req) { return performanceAppraisalPlanManage.list(req); } @GetMapping("/detail/{id}") - @ApiOperation("绩效评价列表") + @ApiOperation("评价计划详情") public PerformanceAppraisalVO detail(@PathVariable Long id) { return performanceAppraisalPlanManage.detail(id); } @@ -50,6 +51,20 @@ public class PerformanceAppraisalPlanController { return performanceAppraisalPlanManage.create(createDTO); } + @PostMapping("/addProject") + @ApiOperation("评价计划-添加待评价项目") + @WebLog("评价计划-添加待评价项目") + public String addProject(@Valid @RequestBody PerformanceAppraisalCreateDTO createDTO) { + return performanceAppraisalPlanManage.addProject(createDTO); + } + + @PostMapping("/addApplication") + @ApiOperation("评价计划-添加待评价应用") + @WebLog("评价计划-添加待评价应用") + public String addApplication(@Valid @RequestBody PerformanceAppraisalCreateDTO createDTO) { + return performanceAppraisalPlanManage.addApplication(createDTO); + } + @PostMapping("/edit") @ApiOperation("编辑绩效评价") @WebLog("编辑绩效评价") @@ -64,6 +79,12 @@ public class PerformanceAppraisalPlanController { return performanceAppraisalPlanManage.delete(id); } + @GetMapping("/application-list") + @ApiOperation("待添加应用列表") + public PageVo applicationList(PerformanceAppraisalListReq req) { + return performanceAppraisalPlanManage.applicationList(req); + } + @GetMapping("/group/list/{appraisalId}") @ApiOperation("绩效评价分组列表") public List groupList(@PathVariable Long appraisalId, diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java index e31be2e..d3095a6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java @@ -1,6 +1,14 @@ package com.ningdatech.pmapi.performance.convert; -import cn.hutool.core.collection.CollUtil; +import java.time.LocalDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; + import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication; import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject; import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalApplicationVO; @@ -8,10 +16,8 @@ import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; -import org.apache.commons.lang3.StringUtils; -import java.util.*; -import java.util.stream.Collectors; +import cn.hutool.core.collection.CollUtil; /** * @Classname PerformanceAppraisalConverer @@ -27,6 +33,7 @@ public class PerformanceAppraisalConveter { return projects.stream().map(p -> { PerformanceAppraisalProjectVO vo = new PerformanceAppraisalProjectVO(); vo.setIsReAppraisal(p.getIsReAppraisal()); + vo.setCanSelfAppraisal(checkCanSelfAppraisal(p)); vo.setId(p.getProjectId()); if(map.containsKey(p.getProjectCode())){ Project project = map.get(p.getProjectCode()); @@ -45,17 +52,18 @@ public class PerformanceAppraisalConveter { } public static List convertApplications( - List applications, Map map) { + List applications, Map map) { if(CollUtil.isNotEmpty(applications) && CollUtil.isNotEmpty(map)){ return applications.stream().map(a -> { PerformanceAppraisalApplicationVO vo = new PerformanceAppraisalApplicationVO(); - vo.setId(a.getApplicationId()); + vo.setAppId(a.getApplicationId()); if(map.containsKey(a.getApplicationId())){ ProjectApplication application = map.get(a.getApplicationId()); vo.setApplicationName(StringUtils.isNotBlank(application.getApplicationName())? application.getApplicationName() : application.getAccountAppName()); vo.setApplicationType(application.getApplicationType()); vo.setBizDomain(application.getBizDomain()); + vo.setBuildOrgName(application.getBuildOrgName()); vo.setPublishSide(application.getPublishSide()); } return vo; @@ -70,4 +78,20 @@ public class PerformanceAppraisalConveter { } return StringUtils.EMPTY; } + + /** + * 是否可以自评 + * @param appraisalProject + * @return + */ + public static Boolean checkCanSelfAppraisal(PerformanceAppraisalProject appraisalProject) { + if (Objects.nonNull(appraisalProject.getSelfAppraisalStart()) + && Objects.nonNull(appraisalProject.getSelfAppraisalEnd())) { + if (LocalDateTime.now().compareTo(appraisalProject.getSelfAppraisalStart()) > 0 && + LocalDateTime.now().compareTo(appraisalProject.getSelfAppraisalEnd()) < 0) { + return Boolean.TRUE; + } + } + return Boolean.FALSE; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/EvalObjectEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/EvalObjectEnum.java new file mode 100644 index 0000000..8cbd684 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/EvalObjectEnum.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.performance.enumration; + +import java.util.Objects; + +import org.apache.commons.lang3.StringUtils; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * EvalObjectEnum + * @return + * @author CMM + * @since 2023/07/26 16:44 + */ +@Getter +@AllArgsConstructor +@NoArgsConstructor +public enum EvalObjectEnum { + /** + * 评价对象 + */ + PROJECT("1", "项目"), + APP("2", "应用"), + PROJECT_APP("1,2", "项目、应用"); + + private String code; + private String desc; + + public static String getDesc(String code) { + if (Objects.isNull(code)) { + return StringUtils.EMPTY; + } + for (EvalObjectEnum t : EvalObjectEnum.values()) { + if (code.equals(t.getCode())) { + return t.desc; + } + } + return StringUtils.EMPTY; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java index 35b1c59..bcb8322 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java @@ -79,8 +79,8 @@ public class OrgSelfAppraisalManage { Page page = req.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) - .in(PerformanceAppraisal::getId,paIds) - .orderByDesc(PerformanceAppraisal::getUpdateOn); + .in(PerformanceAppraisal::getId,paIds) + .orderByDesc(PerformanceAppraisal::getUpdateOn); performanceAppraisalService.page(page,wrapper); if(0L == page.getTotal()){ return PageVo.empty(); @@ -101,6 +101,7 @@ public class OrgSelfAppraisalManage { List paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) .eq(PerformanceAppraisalProject::getAppraisalId, plan.getId())); + Map papsMap = paps.stream().collect(Collectors.toMap(PerformanceAppraisalProject::getProjectId, p -> p)); if(CollUtil.isEmpty(paps)){ return PageVo.empty(); @@ -122,7 +123,8 @@ public class OrgSelfAppraisalManage { List res = page.getRecords().stream() .map(p -> { PerformanceAppraisalProjectVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalProjectVO.class); - vo.setCanSelfAppraisal(checkCanSelfAppraisal(plan)); + PerformanceAppraisalProject appraisalProject = papsMap.get(p.getId()); + vo.setCanSelfAppraisal(checkCanSelfAppraisal(appraisalProject)); return vo; }) .collect(Collectors.toList()); @@ -142,12 +144,12 @@ public class OrgSelfAppraisalManage { /** * 是否可以自评 - * @param plan + * @param appraisalProject * @return */ - private Boolean checkCanSelfAppraisal(PerformanceAppraisal plan) { - if(LocalDateTime.now().compareTo(plan.getSelfAppraisalStart()) > 0 && - LocalDateTime.now().compareTo(plan.getSelfAppraisalEnd()) < 0){ + private Boolean checkCanSelfAppraisal(PerformanceAppraisalProject appraisalProject) { + if(LocalDateTime.now().compareTo(appraisalProject.getSelfAppraisalStart()) > 0 && + LocalDateTime.now().compareTo(appraisalProject.getSelfAppraisalEnd()) < 0){ return Boolean.TRUE; } return Boolean.FALSE; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index a47a31f..804603c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -1,21 +1,31 @@ package com.ningdatech.pmapi.performance.manage; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; + +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.basic.util.StrPool; +import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.common.util.CodeUtil; import com.ningdatech.pmapi.performance.convert.PerformanceAppraisalConveter; +import com.ningdatech.pmapi.performance.enumration.EvalObjectEnum; import com.ningdatech.pmapi.performance.model.dto.AppraisalProjectDTO; import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalCreateDTO; import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalEditDTO; @@ -25,6 +35,7 @@ import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplica import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject; import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectGroup; import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq; +import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalApplicationVO; import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectGroupVO; import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO; import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO; @@ -32,20 +43,27 @@ import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalApplication import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectGroupService; import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectService; import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalService; +import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; +import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; import com.ningdatech.pmapi.user.util.LoginUserUtil; +import com.wflow.workflow.bean.process.ProgressNode; +import com.wflow.workflow.bean.vo.ProcessProgressVo; +import com.wflow.workflow.service.ProcessInstanceService; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.CollectionUtil; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; /** * @Classname PerformanceAppraisalManage @@ -59,18 +77,15 @@ import java.util.stream.Collectors; public class PerformanceAppraisalPlanManage { private final IPerformanceAppraisalService performanceAppraisalService; - private final IPerformanceAppraisalProjectService performanceAppraisalProjectService; - private final IPerformanceAppraisalApplicationService performanceAppraisalApplicationService; - private final IProjectService projectService; - private final IProjectApplicationService applicationService; - private final IPerformanceAppraisalProjectGroupService groupService; - private final UserInfoHelper userInfoHelper; + private final IProjectInstService projectInstService; + private final ProcessInstanceService processInstanceService; + private final BuildUserUtils buildUserUtils; /** * 绩效列表 @@ -78,12 +93,15 @@ public class PerformanceAppraisalPlanManage { * @return */ public PageVo list(PerformanceAppraisalListReq req) { + UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); + String regionCode = userDetail.getRegionCode(); Page page = req.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) - .like(StringUtils.isNotBlank(req.getPlanName()),PerformanceAppraisal::getName,req.getPlanName()) - .ge(Objects.nonNull(req.getStart()),PerformanceAppraisal::getCreateOn,req.getStart()) - .le(Objects.nonNull(req.getEnd()),PerformanceAppraisal::getCreateOn,req.getEnd()) - .orderByDesc(PerformanceAppraisal::getUpdateOn); + .like(StringUtils.isNotBlank(req.getPlanName()),PerformanceAppraisal::getName,req.getPlanName()) + .ge(Objects.nonNull(req.getStart()),PerformanceAppraisal::getCreateOn,req.getStart()) + .le(Objects.nonNull(req.getEnd()),PerformanceAppraisal::getCreateOn,req.getEnd()) + .eq(PerformanceAppraisal::getRegionCode,regionCode) + .orderByDesc(PerformanceAppraisal::getUpdateOn); performanceAppraisalService.page(page,wrapper); if(0L == page.getTotal()){ return PageVo.empty(); @@ -188,6 +206,15 @@ public class PerformanceAppraisalPlanManage { if(finalPaasGroupMap.containsKey(vo.getId())){ vo.setApplications(PerformanceAppraisalConveter.convertApplications(finalPaasGroupMap.get(vo.getId()),finalApplicationMap)); } + + // 评价计划关联的分组信息 + List groupList = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) + .eq(PerformanceAppraisalProjectGroup::getAppraisalId, id)); + // 对计划内待评价项目进行了分组 + if (CollUtil.isNotEmpty(groupList)){ + + } + return vo; } @@ -199,25 +226,25 @@ public class PerformanceAppraisalPlanManage { @Transactional public String create(PerformanceAppraisalCreateDTO createDTO) { UserInfoDetails user = LoginUserUtil.loginUserDetail(); - + // 计划名称重复校验 deduplicationName(createDTO); - PerformanceAppraisal pa = BeanUtil.copyProperties(createDTO,PerformanceAppraisal.class); pa.setCreateOn(LocalDateTime.now()); pa.setCreateBy(user.getUsername()); pa.setUpdateOn(LocalDateTime.now()); pa.setUpdateBy(user.getUsername()); + pa.setRegionCode(user.getRegionCode()); performanceAppraisalService.save(pa); if(CollUtil.isNotEmpty(createDTO.getProjects()) && StringUtils.isNotBlank(createDTO.getTarget()) - && createDTO.getTarget().contains("1")){ + && createDTO.getTarget().contains(EvalObjectEnum.PROJECT.getCode())){ saveProjects(createDTO,pa.getId(),user); } if(CollUtil.isNotEmpty(createDTO.getApplicationIds()) && StringUtils.isNotBlank(createDTO.getTarget()) - && createDTO.getTarget().contains("2")){ + && createDTO.getTarget().contains(EvalObjectEnum.APP.getCode())){ saveApplications(createDTO,pa.getId(),user); } @@ -278,11 +305,16 @@ public class PerformanceAppraisalPlanManage { return; } + Integer startSelfDays = createDTO.getStartSelfDays(); + Integer completeSelfDays = createDTO.getCompleteSelfDays(); List projects = createDTO.getProjects(); for(AppraisalProjectDTO appraisalProject : projects){ Project newProject = projectService.getNewProject(appraisalProject.getId()); VUtils.isTrue(Objects.isNull(newProject)).throwMessage("项目不存在 " + appraisalProject.getId()); + // 获取项目终验完成的时间 + LocalDateTime finishTime = getProjectFinishTime(newProject); + PerformanceAppraisalProject pap = new PerformanceAppraisalProject(); pap.setAppraisalId(id); pap.setProjectId(appraisalProject.getId()); @@ -292,10 +324,44 @@ public class PerformanceAppraisalPlanManage { pap.setCreateOn(LocalDateTime.now()); pap.setUpdateBy(user.getUsername()); pap.setUpdateOn(LocalDateTime.now()); + LocalDateTime selfAppraisalStart = finishTime.plusDays(startSelfDays); + pap.setSelfAppraisalStart(selfAppraisalStart); + long days = startSelfDays + completeSelfDays; + LocalDateTime selfAppraisalEnd = finishTime.plusDays(days); + pap.setSelfAppraisalEnd(selfAppraisalEnd); performanceAppraisalProjectService.save(pap); } } + private LocalDateTime getProjectFinishTime(Project newProject) { + //查出历史版本的 所有项目ID + List allVersionProjectIds = projectService.getAllVersionProjectId(newProject); + // 根据项目ID查询出项目终验流程的流程状态 + ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) + .in(ProjectInst::getProjectId, allVersionProjectIds) + .eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) + .orderByDesc(ProjectInst::getCreatOn) + .last(BizConst.LIMIT_1)); + + if (Objects.isNull(projectInst)){ + throw new BizException("未获取到项目终验审批流程信息!"); + } + + LocalDateTime finishTime; + String instCode = projectInst.getInstCode(); + ProcessProgressVo instanceDetail = processInstanceService.getProgressInstanceDetail(null, instCode); + // 装配节点审核人员信息 + List progressInfo = instanceDetail.getProgressInfo(); + if (CollUtil.isNotEmpty(progressInfo)) { + buildUserUtils.buildUserByProcessInfo(progressInfo); + ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1); + finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime()); + }else { + finishTime = NdDateUtils.date2LocalDateTime(instanceDetail.getStartTime()); + } + return finishTime; + } + @Transactional public void saveApplications(PerformanceAppraisalCreateDTO createDTO,Long id,UserInfoDetails user) { if(CollUtil.isEmpty(createDTO.getApplicationIds())){ @@ -303,10 +369,7 @@ public class PerformanceAppraisalPlanManage { } List applicationIds = createDTO.getApplicationIds(); - for(Long applicationId : applicationIds){ - ProjectApplication projectApplication = applicationService.getById(applicationId); - VUtils.isTrue(Objects.isNull(projectApplication)).throwMessage("应用不存在 " + applicationId); PerformanceAppraisalApplication paa = new PerformanceAppraisalApplication(); paa.setAppraisalId(id); paa.setApplicationId(applicationId); @@ -327,10 +390,14 @@ public class PerformanceAppraisalPlanManage { //删除先 performanceAppraisalProjectService.remove(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) .eq(PerformanceAppraisalProject::getAppraisalId,editDTO.getId())); + Integer startSelfDays = editDTO.getStartSelfDays(); + Integer completeSelfDays = editDTO.getCompleteSelfDays(); List projects = editDTO.getProjects(); for(AppraisalProjectDTO appraisalProject : projects){ Project newProject = projectService.getNewProject(appraisalProject.getId()); VUtils.isTrue(Objects.isNull(newProject)).throwMessage("项目不存在 " + appraisalProject.getId()); + // 获取项目终验完成的时间 + LocalDateTime finishTime = getProjectFinishTime(newProject); PerformanceAppraisalProject pap = new PerformanceAppraisalProject(); pap.setAppraisalId(editDTO.getId()); pap.setProjectId(appraisalProject.getId()); @@ -340,6 +407,11 @@ public class PerformanceAppraisalPlanManage { pap.setCreateOn(LocalDateTime.now()); pap.setUpdateBy(user.getUsername()); pap.setUpdateOn(LocalDateTime.now()); + LocalDateTime selfAppraisalStart = finishTime.plusDays(startSelfDays); + pap.setSelfAppraisalStart(selfAppraisalStart); + long days = startSelfDays + completeSelfDays; + LocalDateTime selfAppraisalEnd = finishTime.plusDays(days); + pap.setSelfAppraisalEnd(selfAppraisalEnd); performanceAppraisalProjectService.save(pap); } } @@ -379,12 +451,17 @@ public class PerformanceAppraisalPlanManage { PerformanceAppraisal pa = performanceAppraisalService.getById(id); VUtils.isTrue(Objects.isNull(pa)).throwMessage("绩效评价不存在 删除失败!"); - //如果到了自评就不能删除了 - if(pa.getSelfAppraisalStart().compareTo(LocalDateTime.now()) < 0){ - throw new BizException("自评已经开始 不能够删除绩效评价"); - } - if(performanceAppraisalService.removeById(id)){ + // 删除评价计划关联的项目 + //绩效关联的项目 + List paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) + .eq(PerformanceAppraisalProject::getAppraisalId, id)); + performanceAppraisalProjectService.removeBatchByIds(paps); + // 删除评价计划关联的应用 + //绩效关联的应用 + List paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class) + .eq(PerformanceAppraisalApplication::getAppraisalId, id)); + performanceAppraisalApplicationService.removeBatchByIds(paas); return "删除成功"; } return "删除失败"; @@ -393,8 +470,8 @@ public class PerformanceAppraisalPlanManage { public List groupList(Long appraisalId,String name) { List groups = groupService.list( Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) - .eq(PerformanceAppraisalProjectGroup::getAppraisalId, appraisalId) - .like(StringUtils.isNotBlank(name),PerformanceAppraisalProjectGroup::getName,name)); + .eq(PerformanceAppraisalProjectGroup::getAppraisalId, appraisalId) + .like(StringUtils.isNotBlank(name),PerformanceAppraisalProjectGroup::getName,name)); if(CollUtil.isEmpty(groups)){ return Collections.emptyList(); } @@ -538,11 +615,6 @@ public class PerformanceAppraisalPlanManage { PerformanceAppraisal pa = performanceAppraisalService.getById(appraisalId); VUtils.isTrue(Objects.isNull(pa)).throwMessage("评价不存在"); - //如果到了自评就不能删除了 - if(pa.getSelfAppraisalStart().compareTo(LocalDateTime.now()) < 0){ - throw new BizException("自评已经开始 不能够删除绩效评价"); - } - if(groupService.removeById(id)){ return "删除成功"; } @@ -573,7 +645,102 @@ public class PerformanceAppraisalPlanManage { return Collections.emptyList(); } return Arrays.stream(users.split(StrPool.COMMA)).map( - employeeCode -> userMap.get(employeeCode) + employeeCode -> userMap.get(employeeCode) ).collect(Collectors.toList()); } + + public PageVo applicationList(PerformanceAppraisalListReq req) { + Page page = req.page(); + // 获取登录用户所在区域已验收项目 + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + String regionCode = user.getRegionCode(); + List projects = projectService.list(Wrappers.lambdaQuery(Project.class) + .eq(Project::getAreaCode,regionCode) + .eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()) + .eq(Project::getNewest, Boolean.TRUE)); + // 获取已验收项目关联的应用信息 + List projectVersions = projects.stream().map(Project::getVersion).collect(Collectors.toList()); + List projectCodes = projects.stream().map(Project::getProjectCode).collect(Collectors.toList()); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ProjectApplication.class) + .like(StringUtils.isNotBlank(req.getApplicationName()),ProjectApplication::getApplicationName,req.getApplicationName()) + .like(StringUtils.isNotBlank(req.getBuildOrgName()),ProjectApplication::getBuildOrgName,req.getBuildOrgName()) + .in(ProjectApplication::getProjectCode,projectCodes) + .in(ProjectApplication::getProjectVersion,projectVersions) + .orderByDesc(ProjectApplication::getCreateOn); + applicationService.page(page,wrapper); + if(0L == page.getTotal()){ + return PageVo.empty(); + } + List res = page.getRecords().stream().map(r -> { + PerformanceAppraisalApplicationVO vo = new PerformanceAppraisalApplicationVO(); + vo.setAppId(r.getId()); + vo.setApplicationName(Objects.nonNull(r.getApplicationName()) ? r.getApplicationName() : r.getRelatedExistsApplication()); + vo.setBuildOrgName(r.getBuildOrgName()); + vo.setApplicationType(r.getApplicationType()); + vo.setBizDomain(r.getBizDomain()); + vo.setPublishSide(r.getPublishSide()); + return vo; + }).collect(Collectors.toList()); + return PageVo.of(res,page.getTotal()); + } + + public String addProject(PerformanceAppraisalCreateDTO addDTO) { + List projects = addDTO.getProjects(); + if (CollUtil.isEmpty(projects)){ + throw new BizException("请选择至少一个评价项目!"); + } + List projectIdList = projects.stream().map(AppraisalProjectDTO::getId).collect(Collectors.toList()); + // 获取已经创建的评价计划中添加的评价项目ID + List projectIds = performanceAppraisalProjectService.list().stream() + .map(PerformanceAppraisalProject::getProjectId).collect(Collectors.toList()); + // 如果有交集,说明选择的项目中,有已经在其他评价计划中的项目 + if (Boolean.TRUE.equals(haveIntersection(projectIdList, projectIds))){ + // 得到交集 + List intersection = Lists.newArrayList(projectIdList); + intersection.retainAll(projectIds); + // 获取重复添加的项目名称 + String names = intersection.stream().map(i -> { + Project project = projectService.getById(i); + if (Objects.nonNull(project)) { + return project.getProjectName(); + } + return StrPool.EMPTY; + }).collect(Collectors.joining(StrPool.COMMA)); + throw new BizException(names + CommonConst.PROJECT_REPEAT); + } + return "添加成功"; + } + + + public String addApplication(PerformanceAppraisalCreateDTO addDTO) { + List applicationIdList = addDTO.getApplicationIds(); + if (CollUtil.isEmpty(applicationIdList)){ + throw new BizException("请选择至少一个评应用!"); + } + // 获取已经创建的评价计划中添加的评价应用ID + List applicationIds = performanceAppraisalApplicationService.list().stream() + .map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList()); + // 如果有交集,说明选择的应用中,有已经在其他评价计划中的应用 + if (Boolean.TRUE.equals(haveIntersection(applicationIdList, applicationIds))){ + // 得到交集 + List intersection = Lists.newArrayList(applicationIdList); + intersection.retainAll(applicationIds); + // 获取重复添加的应用名称 + String names = intersection.stream().map(i -> { + ProjectApplication application = applicationService.getById(i); + if (Objects.nonNull(application)) { + return Objects.nonNull(application.getApplicationName()) ? application.getApplicationName() + : application.getRelatedExistsApplication(); + } + return StrPool.EMPTY; + }).collect(Collectors.joining(StrPool.COMMA)); + throw new BizException(names + CommonConst.APP_REPEAT); + } + return "添加成功"; + } + + private Boolean haveIntersection(List idList, List ids) { + return !CollectionUtil.intersection(idList, ids).isEmpty(); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalCreateDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalCreateDTO.java index dd3e2b4..d5e744f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalCreateDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalCreateDTO.java @@ -6,9 +6,11 @@ import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.hibernate.validator.constraints.Range; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; import java.io.Serializable; import java.time.LocalDateTime; import java.util.List; @@ -27,37 +29,21 @@ public class PerformanceAppraisalCreateDTO implements Serializable { @ApiModelProperty("计划名称") @NotBlank(message = "请输入计划名称") + @Size(max = 50) private String name; - @ApiModelProperty("自评开始时间") - @NotNull(message = "自评时间错误") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime selfAppraisalStart; + @ApiModelProperty("终验后 xx 天开始自评") + @NotNull(message = "开始自评时间不能为空") + @Range(min = 0, max = 100, message = "数值范围不正确,数值应为1~100") + private Integer startSelfDays; - @ApiModelProperty("自评结束时间") - @NotNull(message = "自评时间错误") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime selfAppraisalEnd; + @ApiModelProperty("xx 天需完成自评") + @NotNull(message = "完成自评时间不能为空") + @Range(min = 0, max = 100, message = "数值范围不正确,数值应为1~100") + private Integer completeSelfDays; - @ApiModelProperty("复评开始时间") - @NotNull(message = "复评时间错误") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime reAppraisalStart; - - @ApiModelProperty("复评结束时间") - @NotNull(message = "复评时间错误") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime reAppraisalEnd; - - @ApiModelProperty("核查开始时间") - @NotNull(message = "核查时间错误") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime verificationStart; - - @ApiModelProperty("核查结束时间") - @NotNull(message = "核查时间错误") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime verificationEnd; + @ApiModelProperty("备注") + private String remark; @ApiModelProperty("评价目标 1项目 2应用 可多选 1,2") @NotBlank(message = "评价目标不能为空") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalEditDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalEditDTO.java index 1654133..139cbf0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalEditDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalEditDTO.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.annotation.JSONField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.hibernate.validator.constraints.Range; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -28,32 +29,20 @@ public class PerformanceAppraisalEditDTO implements Serializable { private Long id; @ApiModelProperty("计划名称") - @JSONField(format = "yyyy-MM-dd") private String name; - @ApiModelProperty("自评开始时间") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime selfAppraisalStart; + @ApiModelProperty("终验后 xx 天开始自评") + @NotNull(message = "开始自评时间不能为空") + @Range(min = 0, max = 100, message = "数值范围不正确,数值应为1~100") + private Integer startSelfDays; - @ApiModelProperty("自评结束时间") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime selfAppraisalEnd; + @ApiModelProperty("xx 天需完成自评") + @NotNull(message = "完成自评时间不能为空") + @Range(min = 0, max = 100, message = "数值范围不正确,数值应为1~100") + private Integer completeSelfDays; - @ApiModelProperty("复评开始时间") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime reAppraisalStart; - - @ApiModelProperty("复评结束时间") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime reAppraisalEnd; - - @ApiModelProperty("核查开始时间") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime verificationStart; - - @ApiModelProperty("核查结束时间") - @JSONField(format = "yyyy-MM-dd") - private LocalDateTime verificationEnd; + @ApiModelProperty("备注") + private String remark; @ApiModelProperty("评价目标 1项目 2应用 可多选 1,2") private String target; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisal.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisal.java index a52c803..9a72064 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisal.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisal.java @@ -35,24 +35,18 @@ public class PerformanceAppraisal implements Serializable { @ApiModelProperty("计划名称") private String name; - @ApiModelProperty("自评开始时间") - private LocalDateTime selfAppraisalStart; - - @ApiModelProperty("自评结束时间") - private LocalDateTime selfAppraisalEnd; - - @ApiModelProperty("复评开始时间") - private LocalDateTime reAppraisalStart; + @ApiModelProperty("评价目标 1项目 2应用 可多选 1,2") + private String target; - @ApiModelProperty("复评结束时间") - private LocalDateTime reAppraisalEnd; + @ApiModelProperty("终验后 xx 天开始自评") + private Integer startSelfDays; - @ApiModelProperty("核查开始时间") - private LocalDateTime verificationStart; + @ApiModelProperty("xx 天需完成自评") + private Integer completeSelfDays; - @ApiModelProperty("核查结束时间") - private LocalDateTime verificationEnd; + @ApiModelProperty("区域编码") + private String regionCode; - @ApiModelProperty("评价目标 1项目 2应用 可多选 1,2") - private String target; + @ApiModelProperty("备注") + private String remark; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalApplication.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalApplication.java index fe82b6c..1084386 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalApplication.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalApplication.java @@ -35,6 +35,6 @@ public class PerformanceAppraisalApplication implements Serializable { @ApiModelProperty("计划id") private Long appraisalId; - @ApiModelProperty("应用id") + @ApiModelProperty("应用ID") private Long applicationId; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java index 6de11c4..cebda6d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java @@ -43,4 +43,10 @@ public class PerformanceAppraisalProject implements Serializable { @ApiModelProperty("是否核查") private Boolean isReAppraisal; + + @ApiModelProperty("自评开始时间") + private LocalDateTime selfAppraisalStart; + + @ApiModelProperty("自评结束时间") + private LocalDateTime selfAppraisalEnd; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java index cbe4d42..1577aa1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java @@ -39,4 +39,10 @@ public class PerformanceAppraisalListReq extends PagePo { @ApiModelProperty("指标级别 1一级指标 2二级指标 3三级指标") private Integer indexLevel; + + @ApiModelProperty("应用名称") + private String applicationName; + + @ApiModelProperty("申报单位") + private String buildOrgName; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalApplicationVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalApplicationVO.java index a84bf01..c4bba5f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalApplicationVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalApplicationVO.java @@ -18,8 +18,8 @@ public class PerformanceAppraisalApplicationVO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("项目ID") - private Long id; + @ApiModelProperty("应用ID") + private Long appId; @ApiModelProperty("应用名称") private String applicationName; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java index f1e1aaa..50ed03f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java @@ -37,18 +37,6 @@ public class PerformanceAppraisalVO implements Serializable { @ApiModelProperty("自评结束时间") private LocalDateTime selfAppraisalEnd; - @ApiModelProperty("复评开始时间") - private LocalDateTime reAppraisalStart; - - @ApiModelProperty("复评结束时间") - private LocalDateTime reAppraisalEnd; - - @ApiModelProperty("核查开始时间") - private LocalDateTime verificationStart; - - @ApiModelProperty("核查结束时间") - private LocalDateTime verificationEnd; - @ApiModelProperty("评价目标 1项目 2应用 可多选 1,2") private String target; @@ -57,4 +45,16 @@ public class PerformanceAppraisalVO implements Serializable { @ApiModelProperty("评价应用列表") private List applications; + + @ApiModelProperty("项目分组信息") + private List groups; + + @ApiModelProperty("终验后 xx 天开始自评") + private Integer startSelfDays; + + @ApiModelProperty("xx 天需完成自评") + private Integer completeSelfDays; + + @ApiModelProperty("备注") + private String remark; } From 292b9c4eaddbf89125dd440dff152716cb1189ca Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 09:52:18 +0800 Subject: [PATCH 010/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E6=94=BE=E5=85=A5=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 23 +++++++++++----------- .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 4 ++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 810d0ab..6c9e029 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -35,18 +35,9 @@ import com.ningdatech.pmapi.performance.model.dto.ProjectCoreBusinessDTO; import com.ningdatech.pmapi.performance.model.entity.ProjectCoreBusinessIndicators; import com.ningdatech.pmapi.performance.service.IProjectCoreBusinessIndicatorsService; import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; -import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; -import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; -import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; -import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; -import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PaymentPlanVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; -import com.ningdatech.pmapi.projectdeclared.service.IContractService; -import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; -import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; -import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService; +import com.ningdatech.pmapi.projectdeclared.model.entity.*; +import com.ningdatech.pmapi.projectdeclared.model.vo.*; +import com.ningdatech.pmapi.projectdeclared.service.*; import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; import com.ningdatech.pmapi.projectlib.constant.ProjectConstant; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; @@ -114,6 +105,8 @@ public class ProjectLibManage { private final ITodoService todoService; private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; + private final IOperationService operationService; + public PageVo projectLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); query.eq(Project::getNewest, Boolean.TRUE); @@ -607,6 +600,12 @@ public class ProjectLibManage { 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)); //查询初验信息 List acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 21ded6a..522efdb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -7,6 +7,7 @@ import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; @@ -374,6 +375,9 @@ public class ProjectDetailVO { @ApiModelProperty("初审人员") private List acceptancePersons; + @ApiModelProperty("实施信息") + private OperationVO operation; + @ApiModelProperty("版本号str") private String versionStr; From 60d57d9aa117c6143bff003ba4bef402f0cd60a9 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 10:37:08 +0800 Subject: [PATCH 011/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9C=BA=E4=BF=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/statemachine/action/ProjectDeclareAction.java | 7 ++++++- .../common/statemachine/action/ProjectDeclareJNAction.java | 7 ++++++- .../common/statemachine/action/ProjectDeclareJYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareKFBAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareLDAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareLQAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareQTAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareQYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSBJAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSCAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareYHAction.java | 7 ++++++- .../builder/ProjectDeclareStateMachineJNBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineJYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineKFQBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineLDBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineLQBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineQTBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineQYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSBJBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSCBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineYHBuilder.java | 10 ++++++++-- 23 files changed, 169 insertions(+), 43 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java index 044d908..1cf9af9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java @@ -209,9 +209,14 @@ public class ProjectDeclareAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java index ffa8ae0..868d2f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java @@ -206,9 +206,14 @@ public class ProjectDeclareJNAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java index eb1ab5d..e5b4081 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareJYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java index bff3743..a72963f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareKFBAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java index 8fbcf3a..7ac6a59 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareLDAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java index f87fa91..4c6e792 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareLQAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java index 9c4a19a..6d127ac 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareQTAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java index 4117798..9906c7d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareQYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java index 466fb16..b83c62a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareSBJAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java index d1351c6..c5e6db5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java @@ -212,10 +212,15 @@ public class ProjectDeclareSCAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java index 0f54f1f..e515925 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareSYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java index 4d78f52..9fe7b1b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java @@ -205,9 +205,14 @@ public class ProjectDeclareYHAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java index 0ef1da6..6699f8a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java index 342220b..0e1e70b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineJYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java index f25cacb..a9c54d0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineKFQBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java index 1b5f4fa..575ff1a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java index e6dfb16..737d7f5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java @@ -212,11 +212,17 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java index 2656ba4..43dae81 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java index e65d761..617c7d7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java index 40d38b4..c321412 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java @@ -212,11 +212,17 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java index f432e34..eddf681 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java @@ -221,11 +221,17 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APP_REGISTER) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.REGISTER_APP).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java index 9a7b257..048aac5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java index cb7b103..e7bbd74 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) From f7544931bea77f23521fa67b1c283ae9a40d2dee Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 012/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/controller/EarlyWarningController.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java new file mode 100644 index 0000000..d446d01 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.sys.controller; + +import com.ningdatech.log.annotation.WebLog; +import com.wflow.bean.dto.WflowEarlyWarningDTO; +import com.wflow.bean.vo.WflowEarlyWarningVO; +import com.wflow.service.IEarlyWarningService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @Classname EarlyWarningController + * @Description + * @Date 2023/8/01 14:28 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/sys/early-warning") +@Api(value = "EarlyWarning", tags = "系统管理-预警规则") +@RequiredArgsConstructor +public class EarlyWarningController { + + private final IEarlyWarningService earlyWarningService; + + @ApiOperation(value = "预警规则获取", notes = "预警规则获取") + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); + } + + @ApiOperation(value = "预警规则保存", notes = "预警规则保存") + @PostMapping("/save") + @WebLog("预警规则保存") + public String save(@Validated @RequestBody WflowEarlyWarningDTO dto) { + return earlyWarningService.saveByDto(dto); + } +} From 0bb967fa285fe234c94b9c2864e63eb161843fb6 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:34:26 +0800 Subject: [PATCH 013/137] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/controller/ProjectApplicationController.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java index 7ea6617..a5b7123 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java @@ -6,14 +6,10 @@ import com.ningdatech.pmapi.projectlib.manage.ApplicationManage; import com.ningdatech.pmapi.projectlib.model.dto.ApplicationAppCodeSaveDTO; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; -import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; -import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; -import com.ningdatech.pmapi.user.util.LoginUserUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; - import javax.validation.Valid; /** From 04d4f23e23152f498fa8283361eb60aacb620a79 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Mon, 31 Jul 2023 16:32:09 +0800 Subject: [PATCH 014/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/performance/manage/PerformanceAppraisalPlanManage.java | 2 ++ .../model/entity/PerformanceIndicatorProjectTemplate.java | 6 ++++++ .../pmapi/performance/model/vo/ProjectIndexTemplateVO.java | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index 804603c..eff697b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -229,6 +229,8 @@ public class PerformanceAppraisalPlanManage { // 计划名称重复校验 deduplicationName(createDTO); PerformanceAppraisal pa = BeanUtil.copyProperties(createDTO,PerformanceAppraisal.class); + + pa.setCreateOn(LocalDateTime.now()); pa.setCreateBy(user.getUsername()); pa.setUpdateOn(LocalDateTime.now()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java index 1631390..55b92d9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java @@ -53,4 +53,10 @@ public class PerformanceIndicatorProjectTemplate implements Serializable { @ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上") private Integer amountRange; + + @ApiModelProperty("项目标签ID") + private Long projectTagId; + + @ApiModelProperty("项目标签名称") + private String projectTagName; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java index 32ec504..a344072 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java @@ -55,4 +55,10 @@ public class ProjectIndexTemplateVO implements Serializable { @ApiModelProperty("附加绩效指标详情") private List additionalIndexDetails; + + @ApiModelProperty("项目标签ID") + private Long projectTagId; + + @ApiModelProperty("项目标签名称") + private String projectTagName; } From 37abecc6de86ada1d45afb4d81b8305893ab7fa9 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Tue, 1 Aug 2023 11:55:42 +0800 Subject: [PATCH 015/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java | 1 + .../pmapi/performance/enumration/PerformanceTemplateTypeEnum.java | 1 - .../pmapi/projectdeclared/controller/ConstructionPlanController.java | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java index 53c5f02..a58f952 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java @@ -22,6 +22,7 @@ public class ApiApplySearchResult implements Serializable { private String type; private String status; private String sysStateTime; + private String systemAreas; private String deptName; private String deptCode; private String fiveAreas; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java index 879c2e5..82e03fb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java @@ -22,7 +22,6 @@ public enum PerformanceTemplateTypeEnum { /** * 模板类型 */ - //STAGE(0, "阶段"), FIRST_INDEX(1, "第一指标"), SECOND_INDEX(2, "第二指标"), THIRD_INDEX(3, "第三指标"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java index 25cbdd1..5779ac6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java @@ -46,8 +46,6 @@ public class ConstructionPlanController { return "建设方案申报 【" + instanceId + "】 成功"; } - - @GetMapping("/export") @ApiOperation("可申报建设方案项目列表导出") @WebLog("可申报建设方案项目列表导出") From d5cd5f9a9bbe7e4ce9a583af3b5f72566a0ef9b2 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 016/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 691bd5a6182215ceffc9748a94a3368cbb11ec2e Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:01:40 +0800 Subject: [PATCH 017/137] =?UTF-8?q?debug=20=E9=A2=84=E5=AE=A1=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index fe7bea6..a03920e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -154,7 +154,7 @@ public class DeclaredProjectManage { Project project = new Project(); BeanUtils.copyProperties(projectInfo,project); Map orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,project); - String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); + String instanceId = processService.startProcessLs(model, params,orgModelMap); log.info("申报项目成功 【{}】", instanceId); //如果是重新提交的话 判断下 项目是否存在 From 207713e520266d7de3fa635a9c7be1364925c964 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 018/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 053f9633e2924caa89d427e308fa4a38357924b2 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 019/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -31,7 +29,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 4f72c5ee07ed107395dc9acd8b4de99339415d30 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 020/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From de7d019a431d61780cc34e24763b5c6fc23af0b0 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Wed, 2 Aug 2023 08:51:32 +0800 Subject: [PATCH 021/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92-=E8=AF=84=E4=BB=B7=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/PerformanceAppraisalPlanManage.java | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index 804603c..8362ce8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -4,6 +4,7 @@ import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; +import org.checkerframework.checker.nullness.qual.Nullable; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -212,9 +213,36 @@ public class PerformanceAppraisalPlanManage { .eq(PerformanceAppraisalProjectGroup::getAppraisalId, id)); // 对计划内待评价项目进行了分组 if (CollUtil.isNotEmpty(groupList)){ - + // 获取分组信息 + List groups = groupList.stream().map(g -> { + PerformanceAppraisalProjectGroupVO groupVo = new PerformanceAppraisalProjectGroupVO(); + groupVo.setAppraisalId(id); + groupVo.setName(g.getName()); + String reAppraisalUsersStr = g.getReAppraisalUsers(); + List reAppraisalUsers = Arrays.stream(reAppraisalUsersStr.split(StrPool.COMMA)).map(r -> { + UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); + List reUsers = Arrays.asList(r.split(StrPool.PIPE)); + if (CollUtil.isNotEmpty(reUsers)) { + userFullInfoDTO.setUsername(reUsers.get(0)); + } + return userFullInfoDTO; + }).collect(Collectors.toList()); + groupVo.setReAppraisalUsers(reAppraisalUsers); + String verificationUsersStr = g.getVerificationUsers(); + List verificationUsers = Arrays.stream(verificationUsersStr.split(StrPool.COMMA)).map(r -> { + UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); + List reUsers = Arrays.asList(r.split(StrPool.PIPE)); + if (CollUtil.isNotEmpty(reUsers)) { + userFullInfoDTO.setUsername(reUsers.get(0)); + } + return userFullInfoDTO; + }).collect(Collectors.toList()); + groupVo.setVerificationUsers(verificationUsers); + groupVo.setCreateOn(g.getCreateOn()); + return groupVo; + }).collect(Collectors.toList()); + vo.setGroups(groups); } - return vo; } From f0a7b68c2f04911112bba0a861fdfa328f85c8ea Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 09:52:18 +0800 Subject: [PATCH 022/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E6=94=BE=E5=85=A5=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 23 +++++++++++----------- .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 4 ++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 810d0ab..6c9e029 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -35,18 +35,9 @@ import com.ningdatech.pmapi.performance.model.dto.ProjectCoreBusinessDTO; import com.ningdatech.pmapi.performance.model.entity.ProjectCoreBusinessIndicators; import com.ningdatech.pmapi.performance.service.IProjectCoreBusinessIndicatorsService; import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; -import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; -import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; -import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; -import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; -import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PaymentPlanVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; -import com.ningdatech.pmapi.projectdeclared.service.IContractService; -import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; -import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; -import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService; +import com.ningdatech.pmapi.projectdeclared.model.entity.*; +import com.ningdatech.pmapi.projectdeclared.model.vo.*; +import com.ningdatech.pmapi.projectdeclared.service.*; import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; import com.ningdatech.pmapi.projectlib.constant.ProjectConstant; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; @@ -114,6 +105,8 @@ public class ProjectLibManage { private final ITodoService todoService; private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; + private final IOperationService operationService; + public PageVo projectLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); query.eq(Project::getNewest, Boolean.TRUE); @@ -607,6 +600,12 @@ public class ProjectLibManage { 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)); //查询初验信息 List acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 21ded6a..522efdb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -7,6 +7,7 @@ import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; @@ -374,6 +375,9 @@ public class ProjectDetailVO { @ApiModelProperty("初审人员") private List acceptancePersons; + @ApiModelProperty("实施信息") + private OperationVO operation; + @ApiModelProperty("版本号str") private String versionStr; From 8dba59f51c60fe24c1a71eefc6bea6946fdfe3b3 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 10:37:08 +0800 Subject: [PATCH 023/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9C=BA=E4=BF=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/statemachine/action/ProjectDeclareAction.java | 7 ++++++- .../common/statemachine/action/ProjectDeclareJNAction.java | 7 ++++++- .../common/statemachine/action/ProjectDeclareJYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareKFBAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareLDAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareLQAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareQTAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareQYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSBJAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSCAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareYHAction.java | 7 ++++++- .../builder/ProjectDeclareStateMachineJNBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineJYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineKFQBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineLDBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineLQBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineQTBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineQYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSBJBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSCBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineYHBuilder.java | 10 ++++++++-- 23 files changed, 169 insertions(+), 43 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java index 044d908..1cf9af9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java @@ -209,9 +209,14 @@ public class ProjectDeclareAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java index ffa8ae0..868d2f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java @@ -206,9 +206,14 @@ public class ProjectDeclareJNAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java index eb1ab5d..e5b4081 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareJYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java index bff3743..a72963f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareKFBAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java index 8fbcf3a..7ac6a59 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareLDAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java index f87fa91..4c6e792 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareLQAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java index 9c4a19a..6d127ac 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareQTAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java index 4117798..9906c7d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareQYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java index 466fb16..b83c62a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareSBJAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java index d1351c6..c5e6db5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java @@ -212,10 +212,15 @@ public class ProjectDeclareSCAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java index 0f54f1f..e515925 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareSYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java index 4d78f52..9fe7b1b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java @@ -205,9 +205,14 @@ public class ProjectDeclareYHAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java index 0ef1da6..6699f8a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java index 342220b..0e1e70b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineJYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java index f25cacb..a9c54d0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineKFQBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java index 1b5f4fa..575ff1a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java index e6dfb16..737d7f5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java @@ -212,11 +212,17 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java index 2656ba4..43dae81 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java index e65d761..617c7d7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java index 40d38b4..c321412 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java @@ -212,11 +212,17 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java index f432e34..eddf681 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java @@ -221,11 +221,17 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APP_REGISTER) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.REGISTER_APP).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java index 9a7b257..048aac5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java index cb7b103..e7bbd74 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) From ef9340308c65890b575e396927c185a7ac84e93b Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 024/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/controller/EarlyWarningController.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java new file mode 100644 index 0000000..d446d01 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.sys.controller; + +import com.ningdatech.log.annotation.WebLog; +import com.wflow.bean.dto.WflowEarlyWarningDTO; +import com.wflow.bean.vo.WflowEarlyWarningVO; +import com.wflow.service.IEarlyWarningService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @Classname EarlyWarningController + * @Description + * @Date 2023/8/01 14:28 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/sys/early-warning") +@Api(value = "EarlyWarning", tags = "系统管理-预警规则") +@RequiredArgsConstructor +public class EarlyWarningController { + + private final IEarlyWarningService earlyWarningService; + + @ApiOperation(value = "预警规则获取", notes = "预警规则获取") + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); + } + + @ApiOperation(value = "预警规则保存", notes = "预警规则保存") + @PostMapping("/save") + @WebLog("预警规则保存") + public String save(@Validated @RequestBody WflowEarlyWarningDTO dto) { + return earlyWarningService.saveByDto(dto); + } +} From 923b601260756cd6750eca381ed571767afd4a3b Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:34:26 +0800 Subject: [PATCH 025/137] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/controller/ProjectApplicationController.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java index 7ea6617..a5b7123 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java @@ -6,14 +6,10 @@ import com.ningdatech.pmapi.projectlib.manage.ApplicationManage; import com.ningdatech.pmapi.projectlib.model.dto.ApplicationAppCodeSaveDTO; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; -import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; -import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; -import com.ningdatech.pmapi.user.util.LoginUserUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; - import javax.validation.Valid; /** From 87f3cc7bfb810a81e071143b1cdda28a6060bf6a Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Mon, 31 Jul 2023 16:32:09 +0800 Subject: [PATCH 026/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/performance/manage/PerformanceAppraisalPlanManage.java | 2 ++ .../model/entity/PerformanceIndicatorProjectTemplate.java | 6 ++++++ .../pmapi/performance/model/vo/ProjectIndexTemplateVO.java | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index 8362ce8..a97ebea 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -257,6 +257,8 @@ public class PerformanceAppraisalPlanManage { // 计划名称重复校验 deduplicationName(createDTO); PerformanceAppraisal pa = BeanUtil.copyProperties(createDTO,PerformanceAppraisal.class); + + pa.setCreateOn(LocalDateTime.now()); pa.setCreateBy(user.getUsername()); pa.setUpdateOn(LocalDateTime.now()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java index 1631390..55b92d9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java @@ -53,4 +53,10 @@ public class PerformanceIndicatorProjectTemplate implements Serializable { @ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上") private Integer amountRange; + + @ApiModelProperty("项目标签ID") + private Long projectTagId; + + @ApiModelProperty("项目标签名称") + private String projectTagName; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java index 32ec504..a344072 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java @@ -55,4 +55,10 @@ public class ProjectIndexTemplateVO implements Serializable { @ApiModelProperty("附加绩效指标详情") private List additionalIndexDetails; + + @ApiModelProperty("项目标签ID") + private Long projectTagId; + + @ApiModelProperty("项目标签名称") + private String projectTagName; } From a49ece46b03e491fe2fdbd65211b75cd865d35ec Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Tue, 1 Aug 2023 11:55:42 +0800 Subject: [PATCH 027/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java | 1 + .../pmapi/performance/enumration/PerformanceTemplateTypeEnum.java | 1 - .../pmapi/projectdeclared/controller/ConstructionPlanController.java | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java index 53c5f02..a58f952 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java @@ -22,6 +22,7 @@ public class ApiApplySearchResult implements Serializable { private String type; private String status; private String sysStateTime; + private String systemAreas; private String deptName; private String deptCode; private String fiveAreas; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java index 879c2e5..82e03fb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java @@ -22,7 +22,6 @@ public enum PerformanceTemplateTypeEnum { /** * 模板类型 */ - //STAGE(0, "阶段"), FIRST_INDEX(1, "第一指标"), SECOND_INDEX(2, "第二指标"), THIRD_INDEX(3, "第三指标"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java index 25cbdd1..5779ac6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java @@ -46,8 +46,6 @@ public class ConstructionPlanController { return "建设方案申报 【" + instanceId + "】 成功"; } - - @GetMapping("/export") @ApiOperation("可申报建设方案项目列表导出") @WebLog("可申报建设方案项目列表导出") From dcbb49ed0ed56f9a1865b2081212f0dbd01d45aa Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 028/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 5301af5b5ce48a2ed14c83750f451ecf6bfb367f Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:01:40 +0800 Subject: [PATCH 029/137] =?UTF-8?q?debug=20=E9=A2=84=E5=AE=A1=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index fe7bea6..a03920e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -154,7 +154,7 @@ public class DeclaredProjectManage { Project project = new Project(); BeanUtils.copyProperties(projectInfo,project); Map orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,project); - String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); + String instanceId = processService.startProcessLs(model, params,orgModelMap); log.info("申报项目成功 【{}】", instanceId); //如果是重新提交的话 判断下 项目是否存在 From dc1fcfd637cb9dbb5668cd9816f96efca4203483 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 030/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 7e76cbf70ab130008c369d9306c1ade2f5374c78 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 031/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -31,7 +29,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 8656d50ebb1af635a717600cd5a2ed62a30dd232 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 032/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From a92b3f681d6691bb1dff9e89c73a0eff57e72ab9 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 033/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 36bae085043f3e00115bcf4b86f13eb32a68a57f Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 034/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 511d82ce5d2cda4253f19397d77213d7e79728ce Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 035/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 23fcf7fc4532eea5e5f4eea0f0ff04c54bbdc1e1 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 09:46:16 +0800 Subject: [PATCH 036/137] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/handler/GlobalResponseHandler.java | 3 +- .../controller/AnnualPlanController.java | 1 - .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 19 ++++++ .../safety/controller/SafetyRiskController.java | 54 ++++++++++++++++ .../pmapi/safety/manage/SafetyRiskManage.java | 34 ++++++++++ .../pmapi/safety/model/vo/ProjectMonitorVO.java | 75 ++++++++++++++++++++++ 6 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index ad76321..7f7bb57 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java @@ -30,7 +30,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.ningdatech.pmapi.ding.controller", "com.ningdatech.pmapi.filemanage.controller", "com.ningdatech.pmapi.performance.controller", - "com.ningdatech.pmapi.irs.controller" + "com.ningdatech.pmapi.irs.controller", + "com.ningdatech.pmapi.safety.controller" }) public class GlobalResponseHandler implements ResponseBodyAdvice { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 8850698..5202441 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -37,7 +37,6 @@ public class AnnualPlanController { @GetMapping("/list") @ApiOperation("年度计划库列表") - @WebLog("年度计划库列表") public PageVo annualPlanLibList(ProjectListReq req) { return annualPlanLibManage.annulPlanLibList(req); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 21ded6a..c010c8f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -9,6 +9,7 @@ import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; import io.swagger.annotations.ApiModel; @@ -418,4 +419,22 @@ public class ProjectDetailVO { this.dynamicForm = JSON.parseObject(dynamicFormStr, Map.class); } } + + @ApiModelProperty("项目阶段中文") + private String stageName; + public String getStageName(){ + if(Objects.nonNull(this.stage)){ + return ProjectStatusEnum.getDesc(this.stage); + } + return StringUtils.EMPTY; + } + + @ApiModelProperty("项目状态中文") + private String statusName; + public String getStatusName(){ + if(Objects.nonNull(this.status)){ + return ProjectStatusEnum.getDesc(this.status); + } + return StringUtils.EMPTY; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java new file mode 100644 index 0000000..3badb64 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -0,0 +1,54 @@ +package com.ningdatech.pmapi.safety.controller; + +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; +import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Classname SafetyRiskController + * @Description + * @Date 2023/8/2 9:15 + * @Author PoffyZhang + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "安全风险监测") +@RequestMapping("/api/v1/safety-risk") +public class SafetyRiskController { + + private final SafetyRiskManage safetyRiskManage; + + @GetMapping("/person-monitor/list") + @ApiOperation("安全人员监控列表") + public PageVo personMonitorList(ProjectListReq req) { + return safetyRiskManage.personMonitorList(req); + } + + @GetMapping("/person-monitor/detail/{projectCode}") + @ApiOperation("安全人员监控详情") + public ProjectMonitorVO personMonitorDetail(@PathVariable String projectCode) { + return safetyRiskManage.personMonitorDetail(projectCode); + } + + + @GetMapping("/operation-monitor/list") + @ApiOperation("安全运行监控列表") + public PageVo operationnMonitorList(ProjectListReq req) { + return safetyRiskManage.operationnMonitorList(req); + } + + @GetMapping("/operation-monitor/search/{projectCode}") + @ApiOperation("安全运行监控-查询监测(对接外部平台)") + public JSONObject operationnMonitorList(@PathVariable String projectCode) { + return safetyRiskManage.operationnMonitorSearch(projectCode); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java new file mode 100644 index 0000000..eb57d94 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -0,0 +1,34 @@ +package com.ningdatech.pmapi.safety.manage; + +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import org.springframework.stereotype.Component; + +/** + * @Classname SafetyRiskManage + * @Description + * @Date 2023/8/2 9:17 + * @Author PoffyZhang + */ +@Component +public class SafetyRiskManage { + + + public PageVo personMonitorList(ProjectListReq req) { + return null; + } + + public ProjectMonitorVO personMonitorDetail(String projectCode) { + return null; + } + + public PageVo operationnMonitorList(ProjectListReq req) { + return null; + } + + public JSONObject operationnMonitorSearch(String projectCode) { + return null; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java new file mode 100644 index 0000000..11d5972 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java @@ -0,0 +1,75 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; +import java.util.Optional; + +/** + * @Classname ProjectMonitorVO + * @Description + * @Date 2023/8/2 9:19 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "ProjectMonitorVO", description = "项目监控VO") +public class ProjectMonitorVO { + + @ApiModelProperty("项目ID") + private Long id; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位code") + private String buildOrgCode; + + @ApiModelProperty("申报单位名") + private String buildOrgName; + + @ApiModelProperty("项目年度") + private Integer projectYear; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("项目类型名") + private String projectTypeName; + + public String getProjectTypeName() { + if (Objects.nonNull(this.projectType)) { + Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) + .ifPresent(desc -> this.projectTypeName = desc); + } + return this.projectTypeName; + } + + @ApiModelProperty("项目阶段") + private Integer stage; + + @ApiModelProperty("项目状态") + private Integer status; + + @ApiModelProperty("项目阶段中文") + private String stageName; + public String getStageName(){ + if(Objects.nonNull(this.stage)){ + return ProjectStatusEnum.getDesc(this.stage); + } + return StringUtils.EMPTY; + } + + @ApiModelProperty("项目状态中文") + private String statusName; + public String getStatusName(){ + if(Objects.nonNull(this.status)){ + return ProjectStatusEnum.getDesc(this.status); + } + return StringUtils.EMPTY; + } +} From 62024bd91bfbb0b129f8754a056a54e07446cc92 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 11:49:37 +0800 Subject: [PATCH 037/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safety/controller/SafetyRiskController.java | 35 ++-- .../pmapi/safety/manage/SafetyRiskManage.java | 178 ++++++++++++++++++++- .../safety/mapper/PersonSafetyInfoMapper.java | 15 ++ .../mapper/SupplierSafetyQualificationMapper.java | 15 ++ .../safety/model/dto/PersonSafetyInfoDTO.java | 45 ++++++ .../model/dto/SupplierSafetyQualificationDTO.java | 39 +++++ .../safety/model/entity/PersonSafetyInfo.java | 48 ++++++ .../model/entity/SupplierSafetyQualification.java | 45 ++++++ .../pmapi/safety/model/vo/PersonSafetyInfoVO.java | 43 +++++ .../pmapi/safety/model/vo/SafetyMonitorVO.java | 23 +++ .../model/vo/SupplierSafetyQualificationVO.java | 43 +++++ .../safety/service/IPersonSafetyInfoService.java | 14 ++ .../ISupplierSafetyQualificationService.java | 14 ++ .../service/impl/PersonSafetyInfoServiceImpl.java | 20 +++ .../SupplierSafetyQualificationServiceImpl.java | 20 +++ .../user/security/auth/model/UserInfoDetails.java | 12 ++ 16 files changed, 592 insertions(+), 17 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java index 3badb64..a71523b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -2,16 +2,20 @@ package com.ningdatech.pmapi.safety.controller; import com.alibaba.fastjson.JSONObject; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; +import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; +import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; /** * @Classname SafetyRiskController @@ -33,17 +37,24 @@ public class SafetyRiskController { return safetyRiskManage.personMonitorList(req); } - @GetMapping("/person-monitor/detail/{projectCode}") - @ApiOperation("安全人员监控详情") - public ProjectMonitorVO personMonitorDetail(@PathVariable String projectCode) { - return safetyRiskManage.personMonitorDetail(projectCode); + @PostMapping("/person-monitor/save") + @ApiOperation("安全人员监控信息保存") + @WebLog("安全人员监控信息保存") + public String personMonitorSave(@Valid @RequestBody List dtos) { + return safetyRiskManage.personMonitorSave(dtos); } + @GetMapping("/supplier-safety-qualification/save") + @ApiOperation("供应商安全资质保存") + @WebLog("供应商安全资质保存") + public String supplierSafetyQualificationSave(@Valid @RequestBody List dtos) { + return safetyRiskManage.supplierSafetyQualificationSave(dtos); + } - @GetMapping("/operation-monitor/list") - @ApiOperation("安全运行监控列表") - public PageVo operationnMonitorList(ProjectListReq req) { - return safetyRiskManage.operationnMonitorList(req); + @GetMapping("/detail/{projectCode}") + @ApiOperation("安全人员管控详情") + public SafetyMonitorVO personMonitorDetail(@PathVariable String projectCode) { + return safetyRiskManage.personMonitorDetail(projectCode); } @GetMapping("/operation-monitor/search/{projectCode}") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java index eb57d94..e9c8f5a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -1,11 +1,41 @@ package com.ningdatech.pmapi.safety.manage; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; +import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; +import com.ningdatech.pmapi.safety.model.vo.PersonSafetyInfoVO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SupplierSafetyQualificationVO; +import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; +import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; +import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + /** * @Classname SafetyRiskManage * @Description @@ -13,22 +43,160 @@ import org.springframework.stereotype.Component; * @Author PoffyZhang */ @Component +@Slf4j +@AllArgsConstructor public class SafetyRiskManage { + private final IProjectService projectService; + + private final ISupplierSafetyQualificationService supplierSafetyQualificationService; + + private final IPersonSafetyInfoService personSafetyInfoService; + /** + * 列表 + * @param req + * @return + */ public PageVo personMonitorList(ProjectListReq req) { - return null; + LambdaQueryWrapper query = Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .ge(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) + .ne(Project::getStatus, ProjectStatusEnum.OPERATION.getCode()) + .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()) + .like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()); + checkAuth(query,LoginUserUtil.loginUserDetail()); + Page page = projectService.page(req.page(), query); + long total; + if ((total = page.getTotal()) == 0) { + return PageVo.empty(); + } + List records = CollUtils.convert(page.getRecords(), + p -> BeanUtil.copyProperties(p,ProjectMonitorVO.class)); + return PageVo.of(records, total); } - public ProjectMonitorVO personMonitorDetail(String projectCode) { - return null; + /** + * 权限控制 + * @param query + * @param user + */ + private void checkAuth(LambdaQueryWrapper query, UserInfoDetails user) { + //如果是超管 + if(user.getSuperAdmin()){ + log.info(user.getUsername() + " 是超管,可以看所有项目"); + }else if(user.getRegionAdmin()){ + //如果是区域管理员 + log.info(user.getUsername() + " 是区管,可以看本区域" + user.getRegionCode() + "项目"); + query.eq(Project::getAreaCode,user.getRegionCode()); + }else if(user.getIsOrgAdmin()){ + //单位管理员 + log.info(user.getUsername() + " 是单位管理员,可以看单位 " + user.getEmpPosUnitName() + " 项目"); + query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); + }else{ + //其它角色全都看不见 + query.eq(Project::getId,0L); + } } - public PageVo operationnMonitorList(ProjectListReq req) { - return null; + public SafetyMonitorVO personMonitorDetail(String projectCode) { + SafetyMonitorVO vo = new SafetyMonitorVO(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + if(Objects.isNull(project)){ + return null; + } + + List ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) + .eq(SupplierSafetyQualification::getProjectCode, projectCode)); + if(CollUtil.isNotEmpty(ssq)){ + vo.setSupplierSafetyQualification(ssq.stream() + .map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) + .collect(Collectors.toList())); + } + + List psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) + .eq(PersonSafetyInfo::getProjectCode, projectCode)); + if(CollUtil.isNotEmpty(psi)){ + vo.setPersonSafetyInfo(psi.stream() + .map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) + .collect(Collectors.toList())); + } + + return vo; } public JSONObject operationnMonitorSearch(String projectCode) { return null; } + + /** + * 保存 供应商安全资质 + * @param dtos + * @return + */ + public String supplierSafetyQualificationSave(List dtos) { + if(CollUtil.isEmpty(dtos)){ + return "数据为空"; + } + + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + Integer sucessNum = 0; + for(SupplierSafetyQualificationDTO dto : dtos){ + String projectCode = dto.getProjectCode(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); + + SupplierSafetyQualification entity = BeanUtil.copyProperties(dto, SupplierSafetyQualification.class); + entity.setCreateBy(user.getUsername()); + entity.setCreateOn(LocalDateTime.now()); + entity.setProjectId(project.getId()); + entity.setUpdateBy(user.getUsername()); + entity.setUpdateOn(LocalDateTime.now()); + if(supplierSafetyQualificationService.save(entity)){ + sucessNum ++; + } + } + + return "保存成功" + sucessNum + "条"; + } + + public String personMonitorSave(List dtos) { + if(CollUtil.isEmpty(dtos)){ + return "数据为空"; + } + + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + Integer sucessNum = 0; + for(PersonSafetyInfoDTO dto : dtos){ + String projectCode = dto.getProjectCode(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); + + PersonSafetyInfo entity = BeanUtil.copyProperties(dto, PersonSafetyInfo.class); + entity.setCreateBy(user.getUsername()); + entity.setCreateOn(LocalDateTime.now()); + entity.setProjectId(project.getId()); + entity.setUpdateBy(user.getUsername()); + entity.setUpdateOn(LocalDateTime.now()); + if(personSafetyInfoService.save(entity)){ + sucessNum ++; + } + } + + return "保存成功" + sucessNum + "条"; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java new file mode 100644 index 0000000..3316418 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.safety.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface PersonSafetyInfoMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java new file mode 100644 index 0000000..39e897b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.safety.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface SupplierSafetyQualificationMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java new file mode 100644 index 0000000..afcca6a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.safety.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 安全人员信息 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") +public class PersonSafetyInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + @NotBlank(message = "项目编号不能为空") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员姓名") + private String username; + + @ApiModelProperty("调查报告") + private String investigationReport; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java new file mode 100644 index 0000000..9da9fbe --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java @@ -0,0 +1,39 @@ +package com.ningdatech.pmapi.safety.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + *

+ * 供应商安全资质 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") +public class SupplierSafetyQualificationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + @NotBlank(message = "项目编号不能为空") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("安全资质") + private String safetyQualification; + + @ApiModelProperty("安全协议") + private String safetyProtocol; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java new file mode 100644 index 0000000..0b7139e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java @@ -0,0 +1,48 @@ +package com.ningdatech.pmapi.safety.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 安全人员信息 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_person_safety_info") +@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") +public class PersonSafetyInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员姓名") + private String username; + + @ApiModelProperty("调查报告") + private String investigationReport; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java new file mode 100644 index 0000000..c2632b6 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.safety.model.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 供应商安全资质 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_supplier_safety_qualification") +@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") +public class SupplierSafetyQualification implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("安全资质") + private String safetyQualification; + + @ApiModelProperty("安全协议") + private String safetyProtocol; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java new file mode 100644 index 0000000..07c7019 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java @@ -0,0 +1,43 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 安全人员信息 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") +public class PersonSafetyInfoVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员姓名") + private String username; + + @ApiModelProperty("调查报告") + private String investigationReport; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java new file mode 100644 index 0000000..8ec87f2 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java @@ -0,0 +1,23 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.util.List; + +/** + * @Classname SafetyMonitorVO + * @Description + * @Date 2023/8/2 9:19 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "SafetyMonitorVO", description = "监控VO") +public class SafetyMonitorVO { + + @ApiModelProperty("人员安全信息") + private List personSafetyInfo; + + @ApiModelProperty("供应商安全资质") + private List supplierSafetyQualification; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java new file mode 100644 index 0000000..ab4943b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java @@ -0,0 +1,43 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 供应商安全资质 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") +public class SupplierSafetyQualificationVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("安全资质") + private String safetyQualification; + + @ApiModelProperty("安全协议") + private String safetyProtocol; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java new file mode 100644 index 0000000..885cf5d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.safety.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; + +/** + * @Classname IPersonSafetyInfoService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface IPersonSafetyInfoService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java new file mode 100644 index 0000000..d68cca7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.safety.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; + +/** + * @Classname ISupplierSafetyQulificationService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface ISupplierSafetyQualificationService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java new file mode 100644 index 0000000..c0bca50 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.safety.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.safety.mapper.PersonSafetyInfoMapper; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; +import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class PersonSafetyInfoServiceImpl extends ServiceImpl implements IPersonSafetyInfoService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java new file mode 100644 index 0000000..dc3af89 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.safety.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.safety.mapper.SupplierSafetyQualificationMapper; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; +import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class SupplierSafetyQualificationServiceImpl extends ServiceImpl implements ISupplierSafetyQualificationService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java index c477497..75fec5c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java @@ -157,6 +157,18 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { return Boolean.FALSE; } + public Boolean getRegionAdmin() { + if (CollUtil.isNotEmpty(this.userRoleList)) { + for (Role role : this.userRoleList) { + RoleEnum roleEnum = RoleEnum.mathByName(role.getCode()); + if (Objects.nonNull(roleEnum) && roleEnum.eq(RoleEnum.REGION_MANAGER.name())) { + return Boolean.TRUE; + } + } + } + return Boolean.FALSE; + } + public Boolean getIsMunicipalOrg() { //如果是丽水市本级的code 就是 if (RegionConst.RC_LS.equals(this.regionCode)) { From fadef577d9370829bc37f5ac20bab86be6bf5544 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 11:57:09 +0800 Subject: [PATCH 038/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java index 11d5972..12419e3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java @@ -26,6 +26,9 @@ public class ProjectMonitorVO { @ApiModelProperty("项目名称") private String projectName; + @ApiModelProperty("项目编号") + private String projectCode; + @ApiModelProperty("申报单位code") private String buildOrgCode; From 161ac32989160281cf1123e253e2159da5aec078 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 12:01:34 +0800 Subject: [PATCH 039/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java | 3 --- .../pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java | 3 --- 2 files changed, 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java index afcca6a..8527086 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java @@ -22,9 +22,6 @@ public class PersonSafetyInfoDTO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("主键") - private Long id; - @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java index 9da9fbe..512d9c7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java @@ -21,9 +21,6 @@ public class SupplierSafetyQualificationDTO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("主键") - private Long id; - @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; From 688725d9a163c5e1238ad06e818ccd5bb6c70f94 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 12:07:41 +0800 Subject: [PATCH 040/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/safety/controller/SafetyRiskController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java index a71523b..aa4708c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -44,7 +44,7 @@ public class SafetyRiskController { return safetyRiskManage.personMonitorSave(dtos); } - @GetMapping("/supplier-safety-qualification/save") + @PostMapping("/supplier-safety-qualification/save") @ApiOperation("供应商安全资质保存") @WebLog("供应商安全资质保存") public String supplierSafetyQualificationSave(@Valid @RequestBody List dtos) { From 360aca6672740ce707355ba18be6b605fc90d710 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Wed, 2 Aug 2023 15:21:20 +0800 Subject: [PATCH 041/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92-=E5=88=86=E7=BB=84=E5=BE=85=E8=AF=84?= =?UTF-8?q?=E4=BB=B7=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/constant/CommonConst.java | 1 + .../PerformanceAppraisalPlanController.java | 16 ++- .../manage/PerformanceAppraisalPlanManage.java | 122 ++++++++++++++------- .../entity/PerformanceAppraisalProjectGroup.java | 4 +- .../model/req/PerformanceAppraisalListReq.java | 3 + 5 files changed, 102 insertions(+), 44 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java index dbcf670..03dbaf8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java @@ -60,6 +60,7 @@ public interface CommonConst { String COPY = "副本"; String PROJECT_REPEAT = " 项目已在其他评价计划中,请勿重复添加!"; String APP_REPEAT = " 应用已在其他评价计划中,请勿重复添加!"; + String REAPPRAISAL_REPEAT = " 已在其他当前评价计划其他分组中,请勿重复添加!"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java index ac636e0..fc9bff3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java @@ -3,12 +3,14 @@ package com.ningdatech.pmapi.performance.controller; import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.performance.manage.PerformanceAppraisalPlanManage; +import com.ningdatech.pmapi.performance.model.dto.AddAppraisalObjectDTO; import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalCreateDTO; import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalEditDTO; import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalProjectGroupSaveDTO; import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq; import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalApplicationVO; import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectGroupVO; +import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO; import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -54,15 +56,15 @@ public class PerformanceAppraisalPlanController { @PostMapping("/addProject") @ApiOperation("评价计划-添加待评价项目") @WebLog("评价计划-添加待评价项目") - public String addProject(@Valid @RequestBody PerformanceAppraisalCreateDTO createDTO) { - return performanceAppraisalPlanManage.addProject(createDTO); + public String addProject(@Valid @RequestBody AddAppraisalObjectDTO addDTO) { + return performanceAppraisalPlanManage.addProject(addDTO); } @PostMapping("/addApplication") @ApiOperation("评价计划-添加待评价应用") @WebLog("评价计划-添加待评价应用") - public String addApplication(@Valid @RequestBody PerformanceAppraisalCreateDTO createDTO) { - return performanceAppraisalPlanManage.addApplication(createDTO); + public String addApplication(@Valid @RequestBody AddAppraisalObjectDTO addDTO) { + return performanceAppraisalPlanManage.addApplication(addDTO); } @PostMapping("/edit") @@ -85,6 +87,12 @@ public class PerformanceAppraisalPlanController { return performanceAppraisalPlanManage.applicationList(req); } + @GetMapping("/project-list") + @ApiOperation("项目分组-评价计划内待评价项目列表") + public PageVo projectList(PerformanceAppraisalListReq req) { + return performanceAppraisalPlanManage.projectList(req); + } + @GetMapping("/group/list/{appraisalId}") @ApiOperation("绩效评价分组列表") public List groupList(@PathVariable Long appraisalId, diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index 8362ce8..c9bffc5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -4,7 +4,6 @@ import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; -import org.checkerframework.checker.nullness.qual.Nullable; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -27,10 +26,7 @@ import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.common.util.CodeUtil; import com.ningdatech.pmapi.performance.convert.PerformanceAppraisalConveter; import com.ningdatech.pmapi.performance.enumration.EvalObjectEnum; -import com.ningdatech.pmapi.performance.model.dto.AppraisalProjectDTO; -import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalCreateDTO; -import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalEditDTO; -import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalProjectGroupSaveDTO; +import com.ningdatech.pmapi.performance.model.dto.*; import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal; import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication; import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject; @@ -46,6 +42,7 @@ import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectServ import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalService; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; @@ -219,24 +216,12 @@ public class PerformanceAppraisalPlanManage { groupVo.setAppraisalId(id); groupVo.setName(g.getName()); String reAppraisalUsersStr = g.getReAppraisalUsers(); - List reAppraisalUsers = Arrays.stream(reAppraisalUsersStr.split(StrPool.COMMA)).map(r -> { - UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); - List reUsers = Arrays.asList(r.split(StrPool.PIPE)); - if (CollUtil.isNotEmpty(reUsers)) { - userFullInfoDTO.setUsername(reUsers.get(0)); - } - return userFullInfoDTO; - }).collect(Collectors.toList()); + List reAppraisalUsers = Arrays.stream(reAppraisalUsersStr.split(StrPool.COMMA)) + .map(userInfoHelper::getUserFullInfoByEmployeeCode).collect(Collectors.toList()); groupVo.setReAppraisalUsers(reAppraisalUsers); String verificationUsersStr = g.getVerificationUsers(); - List verificationUsers = Arrays.stream(verificationUsersStr.split(StrPool.COMMA)).map(r -> { - UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); - List reUsers = Arrays.asList(r.split(StrPool.PIPE)); - if (CollUtil.isNotEmpty(reUsers)) { - userFullInfoDTO.setUsername(reUsers.get(0)); - } - return userFullInfoDTO; - }).collect(Collectors.toList()); + List verificationUsers = Arrays.stream(verificationUsersStr.split(StrPool.COMMA)) + .map(userInfoHelper::getUserFullInfoByEmployeeCode).collect(Collectors.toList()); groupVo.setVerificationUsers(verificationUsers); groupVo.setCreateOn(g.getCreateOn()); return groupVo; @@ -499,7 +484,8 @@ public class PerformanceAppraisalPlanManage { List groups = groupService.list( Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) .eq(PerformanceAppraisalProjectGroup::getAppraisalId, appraisalId) - .like(StringUtils.isNotBlank(name),PerformanceAppraisalProjectGroup::getName,name)); + .like(StringUtils.isNotBlank(name),PerformanceAppraisalProjectGroup::getName,name) + .orderByDesc(PerformanceAppraisalProjectGroup::getCreateOn)); if(CollUtil.isEmpty(groups)){ return Collections.emptyList(); } @@ -511,7 +497,7 @@ public class PerformanceAppraisalPlanManage { groups.stream().forEach(g -> { allEmployeeCodes.addAll(CodeUtil.convertStrToList(g.getReAppraisalUsers())); allEmployeeCodes.addAll(CodeUtil.convertStrToList(g.getVerificationUsers())); - projectCodes.addAll(CodeUtil.convertStrToList(g.getProjectIds())); + projectCodes.addAll(CodeUtil.convertStrToList(g.getProjectCodes())); }); if(CollUtil.isNotEmpty(allEmployeeCodes)){ @@ -541,7 +527,7 @@ public class PerformanceAppraisalPlanManage { vo.setUpdateBy(g.getUpdateBy()); vo.setUpdateOn(g.getUpdateOn()); vo.setId(g.getId()); - vo.setProjects(checkProject(g.getProjectIds(), finalProjectMap)); + vo.setProjects(checkProject(g.getProjectCodes(), finalProjectMap)); vo.setReAppraisalUsers(checkUser(g.getReAppraisalUsers(), finalUserMap)); vo.setVerificationUsers(checkUser(g.getVerificationUsers(), finalUserMap)); return vo; @@ -562,8 +548,8 @@ public class PerformanceAppraisalPlanManage { Map projectMap = Maps.newHashMap(); List projects = projectService.list(Wrappers.lambdaQuery(Project.class) - .in(StringUtils.isNotBlank(group.getProjectIds()),Project::getProjectCode, - Arrays.stream(group.getProjectIds().split(StrPool.COMMA)).collect(Collectors.toList())) + .in(StringUtils.isNotBlank(group.getProjectCodes()),Project::getProjectCode, + Arrays.stream(group.getProjectCodes().split(StrPool.COMMA)).collect(Collectors.toList())) .eq(Project::getNewest,Boolean.TRUE)); if(CollUtil.isNotEmpty(projects)){ projectMap = projects.stream().collect(Collectors.toMap(Project::getProjectCode,p -> p)); @@ -588,7 +574,7 @@ public class PerformanceAppraisalPlanManage { vo.setUpdateBy(group.getUpdateBy()); vo.setUpdateOn(group.getUpdateOn()); vo.setId(group.getId()); - vo.setProjects(checkProject(group.getProjectIds(), projectMap)); + vo.setProjects(checkProject(group.getProjectCodes(), projectMap)); vo.setReAppraisalUsers(checkUser(group.getReAppraisalUsers(), userMap)); vo.setVerificationUsers(checkUser(group.getVerificationUsers(), userMap)); return vo; @@ -614,13 +600,15 @@ public class PerformanceAppraisalPlanManage { group.setId(old.getId()); } if(CollUtil.isNotEmpty(dto.getProjectCodes())){ - group.setProjectIds(dto.getProjectCodes().stream().collect(Collectors.joining(StrPool.COMMA))); + group.setProjectCodes(String.join(StrPool.COMMA, dto.getProjectCodes())); } if(CollUtil.isNotEmpty(dto.getReAppraisalUsers())){ - group.setReAppraisalUsers(dto.getReAppraisalUsers().stream().collect(Collectors.joining(StrPool.COMMA))); + // 判断选择的复评人员是否已经在当前评价计划的其他分组内 + checkReAppraisalUsers(dto.getReAppraisalUsers(),dto.getAppraisalId()); + group.setReAppraisalUsers(String.join(StrPool.COMMA, dto.getReAppraisalUsers())); } if(CollUtil.isNotEmpty(dto.getVerificationUsers())){ - group.setVerificationUsers(dto.getVerificationUsers().stream().collect(Collectors.joining(StrPool.COMMA))); + group.setVerificationUsers(String.join(StrPool.COMMA, dto.getVerificationUsers())); } group.setUpdateOn(LocalDateTime.now()); group.setUpdateBy(user.getUsername()); @@ -628,6 +616,29 @@ public class PerformanceAppraisalPlanManage { return "操作成功"; } + private void checkReAppraisalUsers(List reAppraisalUsers, Long appraisalId) { + // 获取当前评价计划的其他分组的复评人员信息 + List groupList = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) + .eq(PerformanceAppraisalProjectGroup::getAppraisalId, appraisalId)); + List reUserList = groupList.stream() + .map(PerformanceAppraisalProjectGroup::getReAppraisalUsers) + .collect(Collectors.toList()); + // 如果提交的复评人员在该评价计划其他分组中 + if (!CollectionUtil.intersection(reAppraisalUsers,reUserList).isEmpty()){ + ArrayList reUsers = Lists.newArrayList(reAppraisalUsers); + reUsers.retainAll(reUserList); + // 获取重复添加的复评人员名字 + String names = reUsers.stream().map(i -> { + UserFullInfoDTO info = userInfoHelper.getUserFullInfoByEmployeeCode(i); + if (Objects.nonNull(info)){ + return info.getUsername(); + } + return StrPool.EMPTY; + }).collect(Collectors.joining(StrPool.COMMA)); + throw new BizException("复评人员:" + names + CommonConst.REAPPRAISAL_REPEAT); + } + } + /** * 删除分组 * @param id @@ -672,9 +683,7 @@ public class PerformanceAppraisalPlanManage { if(StringUtils.isBlank(users)){ return Collections.emptyList(); } - return Arrays.stream(users.split(StrPool.COMMA)).map( - employeeCode -> userMap.get(employeeCode) - ).collect(Collectors.toList()); + return Arrays.stream(users.split(StrPool.COMMA)).map(userMap::get).collect(Collectors.toList()); } public PageVo applicationList(PerformanceAppraisalListReq req) { @@ -712,12 +721,11 @@ public class PerformanceAppraisalPlanManage { return PageVo.of(res,page.getTotal()); } - public String addProject(PerformanceAppraisalCreateDTO addDTO) { - List projects = addDTO.getProjects(); - if (CollUtil.isEmpty(projects)){ + public String addProject(AddAppraisalObjectDTO addDTO) { + List projectIdList = addDTO.getProjectIds(); + if (CollUtil.isEmpty(projectIdList)){ throw new BizException("请选择至少一个评价项目!"); } - List projectIdList = projects.stream().map(AppraisalProjectDTO::getId).collect(Collectors.toList()); // 获取已经创建的评价计划中添加的评价项目ID List projectIds = performanceAppraisalProjectService.list().stream() .map(PerformanceAppraisalProject::getProjectId).collect(Collectors.toList()); @@ -740,7 +748,7 @@ public class PerformanceAppraisalPlanManage { } - public String addApplication(PerformanceAppraisalCreateDTO addDTO) { + public String addApplication(AddAppraisalObjectDTO addDTO) { List applicationIdList = addDTO.getApplicationIds(); if (CollUtil.isEmpty(applicationIdList)){ throw new BizException("请选择至少一个评应用!"); @@ -771,4 +779,42 @@ public class PerformanceAppraisalPlanManage { return !CollectionUtil.intersection(idList, ids).isEmpty(); } + public PageVo projectList(PerformanceAppraisalListReq req) { + Long appraisalId = req.getAppraisalId(); + VUtils.isTrue(Objects.isNull(appraisalId)).throwMessage("未传入评价计划ID"); + String projectName = req.getProjectName(); + String buildOrgName = req.getBuildOrgName(); + // 获取评价计划内的选择的项目信息 + List appraisalProjectList = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) + .eq(PerformanceAppraisalProject::getAppraisalId, appraisalId)); + List projectCodes = appraisalProjectList.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList()); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(Project.class) + .in(Project::getProjectCode, projectCodes) + .eq(Project::getNewest, Boolean.TRUE); + + // 如果对项目名称进行模糊查询 + if (StringUtils.isNotBlank(projectName) && StringUtils.isBlank(buildOrgName)){ + wrapper.like(Project::getProjectName,projectName); + } + // 如果对申报单位进行模糊查询 + else if (StringUtils.isNotBlank(buildOrgName) && StringUtils.isBlank(projectName)) { + wrapper.like(Project::getBuildOrgName,buildOrgName); + } + // 同时对项目名称和申报单位进行模糊查询 + else if (StringUtils.isNotBlank(projectName) && StringUtils.isNotBlank(buildOrgName)) { + wrapper.like(Project::getProjectName, projectName) + .like(Project::getBuildOrgName, buildOrgName); + } + List projects = projectService.list(wrapper); + if (CollUtil.isEmpty(projects)){ + return PageVo.empty(); + } + List voList = projects.stream().map(p -> { + PerformanceAppraisalProjectVO appraisalProjectVo = new PerformanceAppraisalProjectVO(); + BeanUtil.copyProperties(p, appraisalProjectVo); + appraisalProjectVo.setProjectTypeName(ProjectTypeEnum.getDesc(p.getProjectType())); + return appraisalProjectVo; + }).collect(Collectors.toList()); + return PageVo.of(voList,voList.size()); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectGroup.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectGroup.java index dd6939c..72f4672 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectGroup.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectGroup.java @@ -38,8 +38,8 @@ public class PerformanceAppraisalProjectGroup implements Serializable { @ApiModelProperty("计划id") private Long appraisalId; - @ApiModelProperty("分组内的所有项目id") - private String projectIds; + @ApiModelProperty("分组内的所有项目code") + private String projectCodes; @ApiModelProperty("复评人员") private String reAppraisalUsers; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java index 1577aa1..4923b6d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java @@ -45,4 +45,7 @@ public class PerformanceAppraisalListReq extends PagePo { @ApiModelProperty("申报单位") private String buildOrgName; + + @ApiModelProperty("评价计划ID") + private Long appraisalId; } From 4d2b70e2a3d4a6c66145a67cd0d77eb947be59b3 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Wed, 2 Aug 2023 15:22:03 +0800 Subject: [PATCH 042/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92-=E6=B7=BB=E5=8A=A0=E5=BE=85=E8=AF=84?= =?UTF-8?q?=E4=BB=B7=E9=A1=B9=E7=9B=AE=E3=80=81=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/dto/AddAppraisalObjectDTO.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AddAppraisalObjectDTO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AddAppraisalObjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AddAppraisalObjectDTO.java new file mode 100644 index 0000000..c43f995 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AddAppraisalObjectDTO.java @@ -0,0 +1,33 @@ +package com.ningdatech.pmapi.performance.model.dto; + +import java.io.Serializable; +import java.util.List; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +import org.hibernate.validator.constraints.Range; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 评级计划-添加评价对象 + * @return + * @author CMM + * @since 2023/08/02 11:41 + */ +@Data +@ApiModel(value = "评级计划-添加评价对象", description = "评级计划-添加评价对象") +public class AddAppraisalObjectDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("评价项目 只有ID 和是否复评") + private List projectIds; + + @ApiModelProperty("评价应用ids") + private List applicationIds; +} From 9cf80bc6d115d5aa2e79ac0434eac29a26c3d321 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 09:52:18 +0800 Subject: [PATCH 043/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E6=94=BE=E5=85=A5=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 23 +++++++++++----------- .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 4 ++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 810d0ab..6c9e029 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -35,18 +35,9 @@ import com.ningdatech.pmapi.performance.model.dto.ProjectCoreBusinessDTO; import com.ningdatech.pmapi.performance.model.entity.ProjectCoreBusinessIndicators; import com.ningdatech.pmapi.performance.service.IProjectCoreBusinessIndicatorsService; import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; -import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; -import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; -import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; -import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; -import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PaymentPlanVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; -import com.ningdatech.pmapi.projectdeclared.service.IContractService; -import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; -import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; -import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService; +import com.ningdatech.pmapi.projectdeclared.model.entity.*; +import com.ningdatech.pmapi.projectdeclared.model.vo.*; +import com.ningdatech.pmapi.projectdeclared.service.*; import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; import com.ningdatech.pmapi.projectlib.constant.ProjectConstant; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; @@ -114,6 +105,8 @@ public class ProjectLibManage { private final ITodoService todoService; private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; + private final IOperationService operationService; + public PageVo projectLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); query.eq(Project::getNewest, Boolean.TRUE); @@ -607,6 +600,12 @@ public class ProjectLibManage { 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)); //查询初验信息 List acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 21ded6a..522efdb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -7,6 +7,7 @@ import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; @@ -374,6 +375,9 @@ public class ProjectDetailVO { @ApiModelProperty("初审人员") private List acceptancePersons; + @ApiModelProperty("实施信息") + private OperationVO operation; + @ApiModelProperty("版本号str") private String versionStr; From 505f7e9d3bcf5f05425d0287e1e8511e770e2991 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 10:37:08 +0800 Subject: [PATCH 044/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9C=BA=E4=BF=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/statemachine/action/ProjectDeclareAction.java | 7 ++++++- .../common/statemachine/action/ProjectDeclareJNAction.java | 7 ++++++- .../common/statemachine/action/ProjectDeclareJYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareKFBAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareLDAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareLQAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareQTAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareQYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSBJAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSCAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareYHAction.java | 7 ++++++- .../builder/ProjectDeclareStateMachineJNBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineJYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineKFQBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineLDBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineLQBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineQTBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineQYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSBJBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSCBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineYHBuilder.java | 10 ++++++++-- 23 files changed, 169 insertions(+), 43 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java index 044d908..1cf9af9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java @@ -209,9 +209,14 @@ public class ProjectDeclareAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java index ffa8ae0..868d2f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java @@ -206,9 +206,14 @@ public class ProjectDeclareJNAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java index eb1ab5d..e5b4081 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareJYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java index bff3743..a72963f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareKFBAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java index 8fbcf3a..7ac6a59 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareLDAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java index f87fa91..4c6e792 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareLQAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java index 9c4a19a..6d127ac 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareQTAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java index 4117798..9906c7d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareQYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java index 466fb16..b83c62a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareSBJAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java index d1351c6..c5e6db5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java @@ -212,10 +212,15 @@ public class ProjectDeclareSCAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java index 0f54f1f..e515925 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareSYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java index 4d78f52..9fe7b1b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java @@ -205,9 +205,14 @@ public class ProjectDeclareYHAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java index 0ef1da6..6699f8a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java index 342220b..0e1e70b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineJYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java index f25cacb..a9c54d0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineKFQBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java index 1b5f4fa..575ff1a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java index e6dfb16..737d7f5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java @@ -212,11 +212,17 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java index 2656ba4..43dae81 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java index e65d761..617c7d7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java index 40d38b4..c321412 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java @@ -212,11 +212,17 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java index f432e34..eddf681 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java @@ -221,11 +221,17 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APP_REGISTER) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.REGISTER_APP).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java index 9a7b257..048aac5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java index cb7b103..e7bbd74 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) From 5126557ff565a88af1f357c27b4134b4bcf20351 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 045/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/controller/EarlyWarningController.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java new file mode 100644 index 0000000..d446d01 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.sys.controller; + +import com.ningdatech.log.annotation.WebLog; +import com.wflow.bean.dto.WflowEarlyWarningDTO; +import com.wflow.bean.vo.WflowEarlyWarningVO; +import com.wflow.service.IEarlyWarningService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @Classname EarlyWarningController + * @Description + * @Date 2023/8/01 14:28 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/sys/early-warning") +@Api(value = "EarlyWarning", tags = "系统管理-预警规则") +@RequiredArgsConstructor +public class EarlyWarningController { + + private final IEarlyWarningService earlyWarningService; + + @ApiOperation(value = "预警规则获取", notes = "预警规则获取") + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); + } + + @ApiOperation(value = "预警规则保存", notes = "预警规则保存") + @PostMapping("/save") + @WebLog("预警规则保存") + public String save(@Validated @RequestBody WflowEarlyWarningDTO dto) { + return earlyWarningService.saveByDto(dto); + } +} From 55b9d66413f3f4ff441cc1702587784fad6f58c2 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:34:26 +0800 Subject: [PATCH 046/137] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/controller/ProjectApplicationController.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java index 7ea6617..a5b7123 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java @@ -6,14 +6,10 @@ import com.ningdatech.pmapi.projectlib.manage.ApplicationManage; import com.ningdatech.pmapi.projectlib.model.dto.ApplicationAppCodeSaveDTO; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; -import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; -import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; -import com.ningdatech.pmapi.user.util.LoginUserUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; - import javax.validation.Valid; /** From 080fe692fa7085c5fca99ede0c3e5b6f63f362e4 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Mon, 31 Jul 2023 16:32:09 +0800 Subject: [PATCH 047/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/performance/manage/PerformanceAppraisalPlanManage.java | 2 ++ .../model/entity/PerformanceIndicatorProjectTemplate.java | 6 ++++++ .../pmapi/performance/model/vo/ProjectIndexTemplateVO.java | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index c9bffc5..4cb9ba2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -242,6 +242,8 @@ public class PerformanceAppraisalPlanManage { // 计划名称重复校验 deduplicationName(createDTO); PerformanceAppraisal pa = BeanUtil.copyProperties(createDTO,PerformanceAppraisal.class); + + pa.setCreateOn(LocalDateTime.now()); pa.setCreateBy(user.getUsername()); pa.setUpdateOn(LocalDateTime.now()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java index 1631390..55b92d9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java @@ -53,4 +53,10 @@ public class PerformanceIndicatorProjectTemplate implements Serializable { @ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上") private Integer amountRange; + + @ApiModelProperty("项目标签ID") + private Long projectTagId; + + @ApiModelProperty("项目标签名称") + private String projectTagName; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java index 32ec504..a344072 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java @@ -55,4 +55,10 @@ public class ProjectIndexTemplateVO implements Serializable { @ApiModelProperty("附加绩效指标详情") private List additionalIndexDetails; + + @ApiModelProperty("项目标签ID") + private Long projectTagId; + + @ApiModelProperty("项目标签名称") + private String projectTagName; } From 3f260b1bc24ea3b3673d1982b96f53a3e172528c Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Tue, 1 Aug 2023 11:55:42 +0800 Subject: [PATCH 048/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java | 1 + .../pmapi/performance/enumration/PerformanceTemplateTypeEnum.java | 1 - .../pmapi/projectdeclared/controller/ConstructionPlanController.java | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java index 53c5f02..a58f952 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java @@ -22,6 +22,7 @@ public class ApiApplySearchResult implements Serializable { private String type; private String status; private String sysStateTime; + private String systemAreas; private String deptName; private String deptCode; private String fiveAreas; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java index 879c2e5..82e03fb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java @@ -22,7 +22,6 @@ public enum PerformanceTemplateTypeEnum { /** * 模板类型 */ - //STAGE(0, "阶段"), FIRST_INDEX(1, "第一指标"), SECOND_INDEX(2, "第二指标"), THIRD_INDEX(3, "第三指标"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java index 25cbdd1..5779ac6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java @@ -46,8 +46,6 @@ public class ConstructionPlanController { return "建设方案申报 【" + instanceId + "】 成功"; } - - @GetMapping("/export") @ApiOperation("可申报建设方案项目列表导出") @WebLog("可申报建设方案项目列表导出") From f87e30143df0347f87e410b1413584700819d139 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 049/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 37850c2ef6aa56d5a268eda884f15da7047acc5c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:01:40 +0800 Subject: [PATCH 050/137] =?UTF-8?q?debug=20=E9=A2=84=E5=AE=A1=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index fe7bea6..a03920e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -154,7 +154,7 @@ public class DeclaredProjectManage { Project project = new Project(); BeanUtils.copyProperties(projectInfo,project); Map orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,project); - String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); + String instanceId = processService.startProcessLs(model, params,orgModelMap); log.info("申报项目成功 【{}】", instanceId); //如果是重新提交的话 判断下 项目是否存在 From c0b20efb9305d0b0cce09933041f3f9a54700608 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 051/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From ef74db6af2ba28c59a9f08776e2226e8028b0c67 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 052/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -31,7 +29,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 432bfbf79fedb6b1e7c9fdc3958213dd6116b554 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 053/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 72ebd73cd0038a156bdfbc406a9c8eb8437cf38c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 054/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 9be264211438779f223787402b698abbbb22d519 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 055/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 2f4d402d5d36d99cdfd8e89ff20f594fc8e3a7ea Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 056/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 3176829c5e026af257a446e604b4828707f740d9 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 057/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 0aa4198b702d099549d9e530904f75cbf4171de9 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 058/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 83b69bc511c0f52c1365954b2e6c40595983d321 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 059/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 54178c62db362a9f8b4bc21d93816f6a206a792f Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 060/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -31,7 +29,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 8447ac7d5753ca285e533a6fac11929634db4126 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 061/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From c4c97f75bf54bc001b9593168e9619f2a1f40287 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 062/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From a7e65b75489c63904de758748326dba4ab0a4e9c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 063/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From e1c7cc2d09675a5127127fedfb1460fbe0d5be4c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 064/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 85c247ade9959568e592232429fa74707f095fdd Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 09:53:56 +0800 Subject: [PATCH 065/137] =?UTF-8?q?debug=20=E5=BA=94=E7=94=A8=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 19 ++++++++++++------- .../pmapi/todocenter/manage/TodoCenterManage.java | 16 +--------------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 6c9e029..8d35323 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -255,7 +255,9 @@ public class ProjectLibManage { project.setSponsor(employeeCode); String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); project.setProjectCode(projectCode); - projectService.save(project); + if(projectService.save(project)){ + saveApplication(projectDto,project,null); + } } else { //否则是重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); @@ -309,13 +311,16 @@ public class ProjectLibManage { } else { 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 { //否则是被驳回,重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index aaf4cf4..c8997dc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -1136,9 +1136,6 @@ public class TodoCenterManage { .eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); if (CollUtil.isNotEmpty(applicationList)) { projectApplicationService.removeBatchByIds(applicationList); - List applicationIds = applicationList.stream().map(ProjectApplication::getId).collect(Collectors.toList()); -// projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) -// .in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); } List applications = projectDto.getApplicationList(); @@ -1157,18 +1154,7 @@ public class TodoCenterManage { projectApplication.setIsConstruct(Boolean.TRUE); } projectApplication.setProjectVersion(project.getVersion()); - boolean result = projectApplicationService.save(projectApplication); -// // 保存应用关联的核心业务 -// List 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); -// } -// } + projectApplicationService.save(projectApplication); } } return Boolean.TRUE; From a341199e2187910cfe03901a3e269a2604ad0d28 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 09:46:16 +0800 Subject: [PATCH 066/137] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/handler/GlobalResponseHandler.java | 3 +- .../controller/AnnualPlanController.java | 1 - .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 19 ++++++ .../safety/controller/SafetyRiskController.java | 54 ++++++++++++++++ .../pmapi/safety/manage/SafetyRiskManage.java | 34 ++++++++++ .../pmapi/safety/model/vo/ProjectMonitorVO.java | 75 ++++++++++++++++++++++ 6 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index ad76321..7f7bb57 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java @@ -30,7 +30,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.ningdatech.pmapi.ding.controller", "com.ningdatech.pmapi.filemanage.controller", "com.ningdatech.pmapi.performance.controller", - "com.ningdatech.pmapi.irs.controller" + "com.ningdatech.pmapi.irs.controller", + "com.ningdatech.pmapi.safety.controller" }) public class GlobalResponseHandler implements ResponseBodyAdvice { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 8850698..5202441 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -37,7 +37,6 @@ public class AnnualPlanController { @GetMapping("/list") @ApiOperation("年度计划库列表") - @WebLog("年度计划库列表") public PageVo annualPlanLibList(ProjectListReq req) { return annualPlanLibManage.annulPlanLibList(req); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 522efdb..5815201 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -10,6 +10,7 @@ import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; import io.swagger.annotations.ApiModel; @@ -422,4 +423,22 @@ public class ProjectDetailVO { this.dynamicForm = JSON.parseObject(dynamicFormStr, Map.class); } } + + @ApiModelProperty("项目阶段中文") + private String stageName; + public String getStageName(){ + if(Objects.nonNull(this.stage)){ + return ProjectStatusEnum.getDesc(this.stage); + } + return StringUtils.EMPTY; + } + + @ApiModelProperty("项目状态中文") + private String statusName; + public String getStatusName(){ + if(Objects.nonNull(this.status)){ + return ProjectStatusEnum.getDesc(this.status); + } + return StringUtils.EMPTY; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java new file mode 100644 index 0000000..3badb64 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -0,0 +1,54 @@ +package com.ningdatech.pmapi.safety.controller; + +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; +import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Classname SafetyRiskController + * @Description + * @Date 2023/8/2 9:15 + * @Author PoffyZhang + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "安全风险监测") +@RequestMapping("/api/v1/safety-risk") +public class SafetyRiskController { + + private final SafetyRiskManage safetyRiskManage; + + @GetMapping("/person-monitor/list") + @ApiOperation("安全人员监控列表") + public PageVo personMonitorList(ProjectListReq req) { + return safetyRiskManage.personMonitorList(req); + } + + @GetMapping("/person-monitor/detail/{projectCode}") + @ApiOperation("安全人员监控详情") + public ProjectMonitorVO personMonitorDetail(@PathVariable String projectCode) { + return safetyRiskManage.personMonitorDetail(projectCode); + } + + + @GetMapping("/operation-monitor/list") + @ApiOperation("安全运行监控列表") + public PageVo operationnMonitorList(ProjectListReq req) { + return safetyRiskManage.operationnMonitorList(req); + } + + @GetMapping("/operation-monitor/search/{projectCode}") + @ApiOperation("安全运行监控-查询监测(对接外部平台)") + public JSONObject operationnMonitorList(@PathVariable String projectCode) { + return safetyRiskManage.operationnMonitorSearch(projectCode); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java new file mode 100644 index 0000000..eb57d94 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -0,0 +1,34 @@ +package com.ningdatech.pmapi.safety.manage; + +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import org.springframework.stereotype.Component; + +/** + * @Classname SafetyRiskManage + * @Description + * @Date 2023/8/2 9:17 + * @Author PoffyZhang + */ +@Component +public class SafetyRiskManage { + + + public PageVo personMonitorList(ProjectListReq req) { + return null; + } + + public ProjectMonitorVO personMonitorDetail(String projectCode) { + return null; + } + + public PageVo operationnMonitorList(ProjectListReq req) { + return null; + } + + public JSONObject operationnMonitorSearch(String projectCode) { + return null; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java new file mode 100644 index 0000000..11d5972 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java @@ -0,0 +1,75 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; +import java.util.Optional; + +/** + * @Classname ProjectMonitorVO + * @Description + * @Date 2023/8/2 9:19 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "ProjectMonitorVO", description = "项目监控VO") +public class ProjectMonitorVO { + + @ApiModelProperty("项目ID") + private Long id; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位code") + private String buildOrgCode; + + @ApiModelProperty("申报单位名") + private String buildOrgName; + + @ApiModelProperty("项目年度") + private Integer projectYear; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("项目类型名") + private String projectTypeName; + + public String getProjectTypeName() { + if (Objects.nonNull(this.projectType)) { + Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) + .ifPresent(desc -> this.projectTypeName = desc); + } + return this.projectTypeName; + } + + @ApiModelProperty("项目阶段") + private Integer stage; + + @ApiModelProperty("项目状态") + private Integer status; + + @ApiModelProperty("项目阶段中文") + private String stageName; + public String getStageName(){ + if(Objects.nonNull(this.stage)){ + return ProjectStatusEnum.getDesc(this.stage); + } + return StringUtils.EMPTY; + } + + @ApiModelProperty("项目状态中文") + private String statusName; + public String getStatusName(){ + if(Objects.nonNull(this.status)){ + return ProjectStatusEnum.getDesc(this.status); + } + return StringUtils.EMPTY; + } +} From 3ef4a2ddec748ca75d8ff634bf2f86ce0b9041c3 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 11:49:37 +0800 Subject: [PATCH 067/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safety/controller/SafetyRiskController.java | 35 ++-- .../pmapi/safety/manage/SafetyRiskManage.java | 178 ++++++++++++++++++++- .../safety/mapper/PersonSafetyInfoMapper.java | 15 ++ .../mapper/SupplierSafetyQualificationMapper.java | 15 ++ .../safety/model/dto/PersonSafetyInfoDTO.java | 45 ++++++ .../model/dto/SupplierSafetyQualificationDTO.java | 39 +++++ .../safety/model/entity/PersonSafetyInfo.java | 48 ++++++ .../model/entity/SupplierSafetyQualification.java | 45 ++++++ .../pmapi/safety/model/vo/PersonSafetyInfoVO.java | 43 +++++ .../pmapi/safety/model/vo/SafetyMonitorVO.java | 23 +++ .../model/vo/SupplierSafetyQualificationVO.java | 43 +++++ .../safety/service/IPersonSafetyInfoService.java | 14 ++ .../ISupplierSafetyQualificationService.java | 14 ++ .../service/impl/PersonSafetyInfoServiceImpl.java | 20 +++ .../SupplierSafetyQualificationServiceImpl.java | 20 +++ .../user/security/auth/model/UserInfoDetails.java | 12 ++ 16 files changed, 592 insertions(+), 17 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java index 3badb64..a71523b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -2,16 +2,20 @@ package com.ningdatech.pmapi.safety.controller; import com.alibaba.fastjson.JSONObject; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; +import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; +import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; /** * @Classname SafetyRiskController @@ -33,17 +37,24 @@ public class SafetyRiskController { return safetyRiskManage.personMonitorList(req); } - @GetMapping("/person-monitor/detail/{projectCode}") - @ApiOperation("安全人员监控详情") - public ProjectMonitorVO personMonitorDetail(@PathVariable String projectCode) { - return safetyRiskManage.personMonitorDetail(projectCode); + @PostMapping("/person-monitor/save") + @ApiOperation("安全人员监控信息保存") + @WebLog("安全人员监控信息保存") + public String personMonitorSave(@Valid @RequestBody List dtos) { + return safetyRiskManage.personMonitorSave(dtos); } + @GetMapping("/supplier-safety-qualification/save") + @ApiOperation("供应商安全资质保存") + @WebLog("供应商安全资质保存") + public String supplierSafetyQualificationSave(@Valid @RequestBody List dtos) { + return safetyRiskManage.supplierSafetyQualificationSave(dtos); + } - @GetMapping("/operation-monitor/list") - @ApiOperation("安全运行监控列表") - public PageVo operationnMonitorList(ProjectListReq req) { - return safetyRiskManage.operationnMonitorList(req); + @GetMapping("/detail/{projectCode}") + @ApiOperation("安全人员管控详情") + public SafetyMonitorVO personMonitorDetail(@PathVariable String projectCode) { + return safetyRiskManage.personMonitorDetail(projectCode); } @GetMapping("/operation-monitor/search/{projectCode}") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java index eb57d94..e9c8f5a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -1,11 +1,41 @@ package com.ningdatech.pmapi.safety.manage; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; +import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; +import com.ningdatech.pmapi.safety.model.vo.PersonSafetyInfoVO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SupplierSafetyQualificationVO; +import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; +import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; +import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + /** * @Classname SafetyRiskManage * @Description @@ -13,22 +43,160 @@ import org.springframework.stereotype.Component; * @Author PoffyZhang */ @Component +@Slf4j +@AllArgsConstructor public class SafetyRiskManage { + private final IProjectService projectService; + + private final ISupplierSafetyQualificationService supplierSafetyQualificationService; + + private final IPersonSafetyInfoService personSafetyInfoService; + /** + * 列表 + * @param req + * @return + */ public PageVo personMonitorList(ProjectListReq req) { - return null; + LambdaQueryWrapper query = Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .ge(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) + .ne(Project::getStatus, ProjectStatusEnum.OPERATION.getCode()) + .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()) + .like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()); + checkAuth(query,LoginUserUtil.loginUserDetail()); + Page page = projectService.page(req.page(), query); + long total; + if ((total = page.getTotal()) == 0) { + return PageVo.empty(); + } + List records = CollUtils.convert(page.getRecords(), + p -> BeanUtil.copyProperties(p,ProjectMonitorVO.class)); + return PageVo.of(records, total); } - public ProjectMonitorVO personMonitorDetail(String projectCode) { - return null; + /** + * 权限控制 + * @param query + * @param user + */ + private void checkAuth(LambdaQueryWrapper query, UserInfoDetails user) { + //如果是超管 + if(user.getSuperAdmin()){ + log.info(user.getUsername() + " 是超管,可以看所有项目"); + }else if(user.getRegionAdmin()){ + //如果是区域管理员 + log.info(user.getUsername() + " 是区管,可以看本区域" + user.getRegionCode() + "项目"); + query.eq(Project::getAreaCode,user.getRegionCode()); + }else if(user.getIsOrgAdmin()){ + //单位管理员 + log.info(user.getUsername() + " 是单位管理员,可以看单位 " + user.getEmpPosUnitName() + " 项目"); + query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); + }else{ + //其它角色全都看不见 + query.eq(Project::getId,0L); + } } - public PageVo operationnMonitorList(ProjectListReq req) { - return null; + public SafetyMonitorVO personMonitorDetail(String projectCode) { + SafetyMonitorVO vo = new SafetyMonitorVO(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + if(Objects.isNull(project)){ + return null; + } + + List ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) + .eq(SupplierSafetyQualification::getProjectCode, projectCode)); + if(CollUtil.isNotEmpty(ssq)){ + vo.setSupplierSafetyQualification(ssq.stream() + .map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) + .collect(Collectors.toList())); + } + + List psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) + .eq(PersonSafetyInfo::getProjectCode, projectCode)); + if(CollUtil.isNotEmpty(psi)){ + vo.setPersonSafetyInfo(psi.stream() + .map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) + .collect(Collectors.toList())); + } + + return vo; } public JSONObject operationnMonitorSearch(String projectCode) { return null; } + + /** + * 保存 供应商安全资质 + * @param dtos + * @return + */ + public String supplierSafetyQualificationSave(List dtos) { + if(CollUtil.isEmpty(dtos)){ + return "数据为空"; + } + + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + Integer sucessNum = 0; + for(SupplierSafetyQualificationDTO dto : dtos){ + String projectCode = dto.getProjectCode(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); + + SupplierSafetyQualification entity = BeanUtil.copyProperties(dto, SupplierSafetyQualification.class); + entity.setCreateBy(user.getUsername()); + entity.setCreateOn(LocalDateTime.now()); + entity.setProjectId(project.getId()); + entity.setUpdateBy(user.getUsername()); + entity.setUpdateOn(LocalDateTime.now()); + if(supplierSafetyQualificationService.save(entity)){ + sucessNum ++; + } + } + + return "保存成功" + sucessNum + "条"; + } + + public String personMonitorSave(List dtos) { + if(CollUtil.isEmpty(dtos)){ + return "数据为空"; + } + + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + Integer sucessNum = 0; + for(PersonSafetyInfoDTO dto : dtos){ + String projectCode = dto.getProjectCode(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); + + PersonSafetyInfo entity = BeanUtil.copyProperties(dto, PersonSafetyInfo.class); + entity.setCreateBy(user.getUsername()); + entity.setCreateOn(LocalDateTime.now()); + entity.setProjectId(project.getId()); + entity.setUpdateBy(user.getUsername()); + entity.setUpdateOn(LocalDateTime.now()); + if(personSafetyInfoService.save(entity)){ + sucessNum ++; + } + } + + return "保存成功" + sucessNum + "条"; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java new file mode 100644 index 0000000..3316418 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.safety.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface PersonSafetyInfoMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java new file mode 100644 index 0000000..39e897b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.safety.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface SupplierSafetyQualificationMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java new file mode 100644 index 0000000..afcca6a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.safety.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 安全人员信息 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") +public class PersonSafetyInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + @NotBlank(message = "项目编号不能为空") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员姓名") + private String username; + + @ApiModelProperty("调查报告") + private String investigationReport; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java new file mode 100644 index 0000000..9da9fbe --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java @@ -0,0 +1,39 @@ +package com.ningdatech.pmapi.safety.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + *

+ * 供应商安全资质 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") +public class SupplierSafetyQualificationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + @NotBlank(message = "项目编号不能为空") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("安全资质") + private String safetyQualification; + + @ApiModelProperty("安全协议") + private String safetyProtocol; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java new file mode 100644 index 0000000..0b7139e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java @@ -0,0 +1,48 @@ +package com.ningdatech.pmapi.safety.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 安全人员信息 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_person_safety_info") +@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") +public class PersonSafetyInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员姓名") + private String username; + + @ApiModelProperty("调查报告") + private String investigationReport; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java new file mode 100644 index 0000000..c2632b6 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.safety.model.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 供应商安全资质 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_supplier_safety_qualification") +@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") +public class SupplierSafetyQualification implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("安全资质") + private String safetyQualification; + + @ApiModelProperty("安全协议") + private String safetyProtocol; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java new file mode 100644 index 0000000..07c7019 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java @@ -0,0 +1,43 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 安全人员信息 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") +public class PersonSafetyInfoVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员姓名") + private String username; + + @ApiModelProperty("调查报告") + private String investigationReport; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java new file mode 100644 index 0000000..8ec87f2 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java @@ -0,0 +1,23 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.util.List; + +/** + * @Classname SafetyMonitorVO + * @Description + * @Date 2023/8/2 9:19 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "SafetyMonitorVO", description = "监控VO") +public class SafetyMonitorVO { + + @ApiModelProperty("人员安全信息") + private List personSafetyInfo; + + @ApiModelProperty("供应商安全资质") + private List supplierSafetyQualification; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java new file mode 100644 index 0000000..ab4943b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java @@ -0,0 +1,43 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 供应商安全资质 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") +public class SupplierSafetyQualificationVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("安全资质") + private String safetyQualification; + + @ApiModelProperty("安全协议") + private String safetyProtocol; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java new file mode 100644 index 0000000..885cf5d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.safety.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; + +/** + * @Classname IPersonSafetyInfoService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface IPersonSafetyInfoService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java new file mode 100644 index 0000000..d68cca7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.safety.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; + +/** + * @Classname ISupplierSafetyQulificationService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface ISupplierSafetyQualificationService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java new file mode 100644 index 0000000..c0bca50 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.safety.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.safety.mapper.PersonSafetyInfoMapper; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; +import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class PersonSafetyInfoServiceImpl extends ServiceImpl implements IPersonSafetyInfoService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java new file mode 100644 index 0000000..dc3af89 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.safety.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.safety.mapper.SupplierSafetyQualificationMapper; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; +import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class SupplierSafetyQualificationServiceImpl extends ServiceImpl implements ISupplierSafetyQualificationService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java index c477497..75fec5c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java @@ -157,6 +157,18 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { return Boolean.FALSE; } + public Boolean getRegionAdmin() { + if (CollUtil.isNotEmpty(this.userRoleList)) { + for (Role role : this.userRoleList) { + RoleEnum roleEnum = RoleEnum.mathByName(role.getCode()); + if (Objects.nonNull(roleEnum) && roleEnum.eq(RoleEnum.REGION_MANAGER.name())) { + return Boolean.TRUE; + } + } + } + return Boolean.FALSE; + } + public Boolean getIsMunicipalOrg() { //如果是丽水市本级的code 就是 if (RegionConst.RC_LS.equals(this.regionCode)) { From b92936aee15ffa155d6022efdd3d0a84a366d40e Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 11:57:09 +0800 Subject: [PATCH 068/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java index 11d5972..12419e3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java @@ -26,6 +26,9 @@ public class ProjectMonitorVO { @ApiModelProperty("项目名称") private String projectName; + @ApiModelProperty("项目编号") + private String projectCode; + @ApiModelProperty("申报单位code") private String buildOrgCode; From 8bb1b0ef921e15912ca400627cfb4e69e830bd10 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 12:01:34 +0800 Subject: [PATCH 069/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java | 3 --- .../pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java | 3 --- 2 files changed, 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java index afcca6a..8527086 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java @@ -22,9 +22,6 @@ public class PersonSafetyInfoDTO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("主键") - private Long id; - @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java index 9da9fbe..512d9c7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java @@ -21,9 +21,6 @@ public class SupplierSafetyQualificationDTO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("主键") - private Long id; - @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; From 1a3f32915927d2c4328d8bd771e68c5538a6cb46 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 12:07:41 +0800 Subject: [PATCH 070/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/safety/controller/SafetyRiskController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java index a71523b..aa4708c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -44,7 +44,7 @@ public class SafetyRiskController { return safetyRiskManage.personMonitorSave(dtos); } - @GetMapping("/supplier-safety-qualification/save") + @PostMapping("/supplier-safety-qualification/save") @ApiOperation("供应商安全资质保存") @WebLog("供应商安全资质保存") public String supplierSafetyQualificationSave(@Valid @RequestBody List dtos) { From 73d2cb44a799bb41aca8e526662121e5aaae0b49 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 15:27:04 +0800 Subject: [PATCH 071/137] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/handler/GlobalResponseHandler.java | 3 +- .../pmapi/portrait/controller/TagController.java | 56 +++++++ .../pmapi/portrait/manage/TagManage.java | 174 +++++++++++++++++++++ .../pmapi/portrait/mapper/ProjectTagMapper.java | 15 ++ .../pmapi/portrait/mapper/TagMapper.java | 15 ++ .../pmapi/portrait/model/dto/TagDTO.java | 36 +++++ .../pmapi/portrait/model/dto/TagToProjectDTO.java | 31 ++++ .../pmapi/portrait/model/entity/ProjectTag.java | 40 +++++ .../pmapi/portrait/model/entity/Tag.java | 45 ++++++ .../pmapi/portrait/model/req/TagPageReq.java | 25 +++ .../ningdatech/pmapi/portrait/model/vo/TagVO.java | 40 +++++ .../pmapi/portrait/service/IProjectTagService.java | 14 ++ .../pmapi/portrait/service/ITagService.java | 14 ++ .../service/impl/ProjectTagServiceImpl.java | 21 +++ .../portrait/service/impl/TagServiceImpl.java | 21 +++ .../pmapi/safety/manage/SafetyRiskManage.java | 22 ++- 16 files changed, 568 insertions(+), 4 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/ProjectTagMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/TagMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagToProjectDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/ProjectTag.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/Tag.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/req/TagPageReq.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/vo/TagVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/IProjectTagService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/ITagService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/ProjectTagServiceImpl.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/TagServiceImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index 7f7bb57..2c0646c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java @@ -31,7 +31,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.ningdatech.pmapi.filemanage.controller", "com.ningdatech.pmapi.performance.controller", "com.ningdatech.pmapi.irs.controller", - "com.ningdatech.pmapi.safety.controller" + "com.ningdatech.pmapi.safety.controller", + "com.ningdatech.pmapi.portrait.controller" }) public class GlobalResponseHandler implements ResponseBodyAdvice { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java new file mode 100644 index 0000000..c56bf7a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java @@ -0,0 +1,56 @@ +package com.ningdatech.pmapi.portrait.controller; + +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; +import com.ningdatech.pmapi.portrait.manage.TagManage; +import com.ningdatech.pmapi.portrait.model.dto.TagDTO; +import com.ningdatech.pmapi.portrait.model.dto.TagToProjectDTO; +import com.ningdatech.pmapi.portrait.model.req.TagPageReq; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @Classname TagController + * @Description + * @Date 2023/8/2 14:11 + * @Author PoffyZhang + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "项目画像-标签") +@RequestMapping("/api/v1/portrait/tag") +public class TagController { + private final TagManage tagManage; + + @GetMapping("/list/{areaCode}") + @ApiOperation("按区域查询标签列表") + public PageVo list(@PathVariable String areaCode, TagPageReq req) { + return tagManage.list(areaCode,req); + } + + @PostMapping("/save") + @ApiOperation("保存标签") + @WebLog("保存标签") + public String save(@Valid @RequestBody TagDTO dto) { + return tagManage.save(dto); + } + + @PostMapping("/save-to-project") + @ApiOperation("设置标签到项目") + @WebLog("设置标签到项目") + public String saveToProject(@Valid @RequestBody TagToProjectDTO dto) { + return tagManage.saveToProject(dto); + } + + @PostMapping("/remove-tag-to-project") + @ApiOperation("项目删除标签") + @WebLog("项目删除标签") + public String removeTagToProject(@Valid @RequestBody TagToProjectDTO dto) { + return tagManage.removeTagToProject(dto); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java new file mode 100644 index 0000000..7aea60a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java @@ -0,0 +1,174 @@ +package com.ningdatech.pmapi.portrait.manage; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.function.VUtils; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.portrait.model.dto.TagDTO; +import com.ningdatech.pmapi.portrait.model.dto.TagToProjectDTO; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; +import com.ningdatech.pmapi.portrait.model.entity.Tag; +import com.ningdatech.pmapi.portrait.model.req.TagPageReq; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; +import com.ningdatech.pmapi.portrait.service.IProjectTagService; +import com.ningdatech.pmapi.portrait.service.ITagService; +import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; + +/** + * @Classname TagManage + * @Description + * @Date 2023/8/2 14:10 + * @Author PoffyZhang + */ +@Component +@Slf4j +@AllArgsConstructor +public class TagManage { + + private final ITagService tagService; + + private final IProjectService projectService; + + private final IProjectTagService projectTagService; + + /** + * 标签分页 + * @param areaCode + * @param req + * @return + */ + public PageVo list(String areaCode, TagPageReq req) { + LambdaQueryWrapper query = Wrappers.lambdaQuery(Tag.class) + .eq(Tag::getAreaCode, areaCode) + .like(StringUtils.isNotBlank(req.getName()),Tag::getName,req.getName()) + .orderByDesc(Tag::getUpdateOn); + checkAuth(query,LoginUserUtil.loginUserDetail()); + Page page = tagService.page(req.page(), query); + long total; + if ((total = page.getTotal()) == 0) { + return PageVo.empty(); + } + List records = CollUtils.convert(page.getRecords(), + t -> BeanUtil.copyProperties(t,TagVO.class)); + return PageVo.of(records, total); + } + + /** + * 权限控制 + * @param query + * @param user + */ + private void checkAuth(LambdaQueryWrapper query, UserInfoDetails user) { + //如果是超管 + if(user.getSuperAdmin()){ + log.info(user.getUsername() + " 是超管,可以看所有标签"); + }else if(user.getRegionAdmin()){ + //如果是区域管理员 + log.info(user.getUsername() + " 是区管,可以看本区域" + user.getRegionCode() + "标签"); + query.eq(Tag::getAreaCode,user.getRegionCode()); + }else{ + //其它角色全都看不见 + query.eq(Tag::getId,0L); + } + } + + /** + * 保存标签 + * @param dto + * @return + */ + public String save(TagDTO dto) { + deduplicationName(dto); + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + Tag entity = BeanUtil.copyProperties(dto,Tag.class); + if(Objects.nonNull(dto.getId())){ + Tag old = tagService.getById(dto.getId()); + VUtils.isTrue(Objects.isNull(old)).throwMessage("此id标签不存在!"); + entity.setId(old.getId()); + }else{ + entity.setId(null); + entity.setCreateOn(LocalDateTime.now()); + entity.setCreateBy(user.getUsername()); + } + entity.setUpdateOn(LocalDateTime.now()); + entity.setUpdateBy(user.getUsername()); + tagService.saveOrUpdate(entity); + + return "保存成功"; + } + + /** + * 标签名 去重 + * @param dto + */ + private void deduplicationName(TagDTO dto) { + if(StringUtils.isNotBlank(dto.getName())){ + long count = tagService.count(Wrappers.lambdaQuery(Tag.class) + .eq(Tag::getAreaCode, dto.getAreaCode()) + .eq(Tag::getName, dto.getName()) + .ne(Objects.nonNull(dto.getId()), Tag::getId, dto.getId())); + VUtils.isTrue(count > 0).throwMessage("保存失败!此区域标签名重复!"); + } + } + + public String saveToProject(TagToProjectDTO dto) { + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + String projectCode = dto.getProjectCode(); + Project project = projectService.getProjectByCode(projectCode); + VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!"); + Long tagId = dto.getTagId(); + Tag tag = tagService.getById(tagId); + VUtils.isTrue(Objects.isNull(tag)).throwMessage("标签不存在!"); + + VUtils.isTrue(!tag.getAreaCode().equals(project.getAreaCode())) + .throwMessage("项目和标签不是一个区域的!"); + + ProjectTag projectTag = new ProjectTag(); + projectTag.setProjectCode(projectCode); + projectTag.setTagId(tagId); + projectTag.setCreateOn(LocalDateTime.now()); + projectTag.setCreateBy(user.getUsername()); + projectTagService.save(projectTag); + + return "保存成功"; + } + + public String removeTagToProject(TagToProjectDTO dto) { + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + String projectCode = dto.getProjectCode(); + Project project = projectService.getProjectByCode(projectCode); + VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!"); + Long tagId = dto.getTagId(); + Tag tag = tagService.getById(tagId); + VUtils.isTrue(Objects.isNull(tag)).throwMessage("标签不存在!"); + + VUtils.isTrue(!tag.getAreaCode().equals(project.getAreaCode())) + .throwMessage("项目和标签不是一个区域的!"); + + ProjectTag pt = projectTagService.getOne(Wrappers.lambdaQuery(ProjectTag.class) + .eq(ProjectTag::getProjectCode, projectCode) + .eq(ProjectTag::getTagId, tagId)); + + VUtils.isTrue(Objects.isNull(pt)) + .throwMessage("该项目没有绑定此标签!"); + projectTagService.removeById(pt.getId()); + + return "删除成功"; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/ProjectTagMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/ProjectTagMapper.java new file mode 100644 index 0000000..7ee6898 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/ProjectTagMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.portrait.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface ProjectTagMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/TagMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/TagMapper.java new file mode 100644 index 0000000..78ed337 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/TagMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.portrait.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.portrait.model.entity.Tag; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface TagMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagDTO.java new file mode 100644 index 0000000..4cc5a2e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagDTO.java @@ -0,0 +1,36 @@ +package com.ningdatech.pmapi.portrait.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + *

+ * 标签 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "Tag对象", description = "标签") +public class TagDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("标签名") + private String name; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("区域CODE") + @NotNull(message = "区域CODE必填") + private String areaCode; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagToProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagToProjectDTO.java new file mode 100644 index 0000000..7bdb8d8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagToProjectDTO.java @@ -0,0 +1,31 @@ +package com.ningdatech.pmapi.portrait.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + *

+ * 标签 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "Tag对象", description = "标签") +public class TagToProjectDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @NotNull(message = "标签ID必填") + private Long tagId; + + @ApiModelProperty("当前项目编号") + @NotNull(message = "项目编号必填") + private String projectCode; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/ProjectTag.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/ProjectTag.java new file mode 100644 index 0000000..f399112 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/ProjectTag.java @@ -0,0 +1,40 @@ +package com.ningdatech.pmapi.portrait.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 标签项目关联 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_project_tag") +@ApiModel(value = "ProjectTag对象", description = "标签项目关联") +public class ProjectTag implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("标签ID") + private Long tagId; + + private LocalDateTime createOn; + private String createBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/Tag.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/Tag.java new file mode 100644 index 0000000..df641ae --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/Tag.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.portrait.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 标签 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_tag") +@ApiModel(value = "Tag对象", description = "标签") +public class Tag implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("标签名") + private String name; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("区域CODE") + private String areaCode; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/req/TagPageReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/req/TagPageReq.java new file mode 100644 index 0000000..85dfd3f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/req/TagPageReq.java @@ -0,0 +1,25 @@ +package com.ningdatech.pmapi.portrait.model.req; + +import com.ningdatech.basic.model.PagePo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; + +/** + * @Classname TagPageReq + * @Description + * @Date 2023/8/2 14:16 + * @Author PoffyZhang + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@ApiModel("标签列表查询") +@EqualsAndHashCode(callSuper = true) +public class TagPageReq extends PagePo { + + @ApiModelProperty("标签名") + private String name; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/vo/TagVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/vo/TagVO.java new file mode 100644 index 0000000..3527f98 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/vo/TagVO.java @@ -0,0 +1,40 @@ +package com.ningdatech.pmapi.portrait.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 标签 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "Tag对象", description = "标签") +public class TagVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("标签名") + private String name; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("区域CODE") + private String areaCode; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/IProjectTagService.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/IProjectTagService.java new file mode 100644 index 0000000..a400cc5 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/IProjectTagService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.portrait.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; + +/** + * @Classname ITagService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface IProjectTagService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/ITagService.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/ITagService.java new file mode 100644 index 0000000..b635e07 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/ITagService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.portrait.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.portrait.model.entity.Tag; + +/** + * @Classname ITagService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface ITagService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/ProjectTagServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/ProjectTagServiceImpl.java new file mode 100644 index 0000000..53bd932 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/ProjectTagServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.portrait.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.portrait.mapper.ProjectTagMapper; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; +import com.ningdatech.pmapi.portrait.service.IProjectTagService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class ProjectTagServiceImpl extends ServiceImpl implements IProjectTagService { + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/TagServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/TagServiceImpl.java new file mode 100644 index 0000000..142029a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/TagServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.portrait.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.portrait.mapper.TagMapper; +import com.ningdatech.pmapi.portrait.model.entity.Tag; +import com.ningdatech.pmapi.portrait.service.ITagService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class TagServiceImpl extends ServiceImpl implements ITagService { + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java index e9c8f5a..5e990df 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; @@ -64,7 +65,8 @@ public class SafetyRiskManage { .ge(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) .ne(Project::getStatus, ProjectStatusEnum.OPERATION.getCode()) .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()) - .like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()); + .like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()) + .orderByDesc(Project::getUpdateOn); checkAuth(query,LoginUserUtil.loginUserDetail()); Page page = projectService.page(req.page(), query); long total; @@ -145,9 +147,16 @@ public class SafetyRiskManage { UserInfoDetails user = LoginUserUtil.loginUserDetail(); + String projectCode = dtos.get(0).getProjectCode(); + if(StringUtils.isBlank(projectCode)){ + throw new BizException("参数有误!"); + } + supplierSafetyQualificationService.remove(Wrappers.lambdaQuery(SupplierSafetyQualification.class) + .eq(SupplierSafetyQualification::getProjectCode, projectCode)); + Integer sucessNum = 0; for(SupplierSafetyQualificationDTO dto : dtos){ - String projectCode = dto.getProjectCode(); + projectCode = dto.getProjectCode(); Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) .eq(Project::getNewest, Boolean.TRUE) .eq(Project::getProjectCode, projectCode) @@ -176,9 +185,16 @@ public class SafetyRiskManage { UserInfoDetails user = LoginUserUtil.loginUserDetail(); + String projectCode = dtos.get(0).getProjectCode(); + if(StringUtils.isBlank(projectCode)){ + throw new BizException("参数有误!"); + } + personSafetyInfoService.remove(Wrappers.lambdaQuery(PersonSafetyInfo.class) + .eq(PersonSafetyInfo::getProjectCode, projectCode)); + Integer sucessNum = 0; for(PersonSafetyInfoDTO dto : dtos){ - String projectCode = dto.getProjectCode(); + projectCode = dto.getProjectCode(); Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) .eq(Project::getNewest, Boolean.TRUE) .eq(Project::getProjectCode, projectCode) From ab10af9d23dd2abe6d56a7f592d08c0124c7089a Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 15:43:09 +0800 Subject: [PATCH 072/137] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=A0=87=E7=AD=BE=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 44 ++++++++++++++++++++++ .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 4 ++ .../projectlib/model/vo/ProjectLibListItemVO.java | 5 +++ 3 files changed, 53 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 1fb877f..ad07ef5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; @@ -34,6 +35,11 @@ import com.ningdatech.pmapi.organization.service.IDingOrganizationService; import com.ningdatech.pmapi.performance.model.dto.ProjectCoreBusinessDTO; import com.ningdatech.pmapi.performance.model.entity.ProjectCoreBusinessIndicators; import com.ningdatech.pmapi.performance.service.IProjectCoreBusinessIndicatorsService; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; +import com.ningdatech.pmapi.portrait.model.entity.Tag; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; +import com.ningdatech.pmapi.portrait.service.IProjectTagService; +import com.ningdatech.pmapi.portrait.service.ITagService; import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; @@ -114,6 +120,9 @@ public class ProjectLibManage { private final ITodoService todoService; private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; + private final IProjectTagService projectTagService; + private final ITagService tagService; + public PageVo projectLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); query.eq(Project::getNewest, Boolean.TRUE); @@ -153,6 +162,24 @@ public class ProjectLibManage { return PageVo.empty(); } UserFullInfoDTO finalUser = user; + + Set projectCodes = page.getRecords().stream() + .map(Project::getProjectCode).collect(Collectors.toSet()); + List pts = projectTagService.list(Wrappers.lambdaQuery(ProjectTag.class) + .in(ProjectTag::getProjectCode, projectCodes)); + Map> tagMap = Maps.newHashMap(); + Map tagNameMap = Maps.newHashMap(); + if(CollUtil.isNotEmpty(pts)){ + tagMap = pts.stream().collect(Collectors.groupingBy(ProjectTag::getProjectCode)); + Set tagIds = pts.stream().map(ProjectTag::getTagId).collect(Collectors.toSet()); + List tags = tagService.list(Wrappers.lambdaQuery(Tag.class) + .in(Tag::getId, tagIds)); + if(CollUtil.isNotEmpty(tags)){ + tagNameMap = tags.stream().collect(Collectors.toMap(Tag::getId,Tag::getName)); + } + } + Map> finalTagMap = tagMap; + Map finalTagNameMap = tagNameMap; List records = CollUtils.convert(page.getRecords(), w -> { ProjectLibListItemVO item = new ProjectLibListItemVO(); item.setId(w.getId()); @@ -175,11 +202,28 @@ public class ProjectLibManage { item.setCanPreDeclared(Boolean.TRUE); } item.setPrePlanProjectId(w.getPrePlanProjectId()); + setTag(item,finalTagMap,finalTagNameMap); return item; }); return PageVo.of(records, total); } + private void setTag(ProjectLibListItemVO item, Map> finalTagMap, Map finalTagNameMap) { + if(finalTagMap.containsKey(item.getProjectCode())){ + List tags = Lists.newArrayList(); + List projectTags = finalTagMap.get(item.getProjectCode()); + for(ProjectTag pt :projectTags){ + if(finalTagNameMap.containsKey(pt.getTagId())){ + TagVO vo = new TagVO(); + vo.setId(pt.getTagId()); + vo.setName(finalTagNameMap.get(pt.getTagId())); + tags.add(vo); + } + } + item.setTags(tags); + } + } + public List projectList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); return projectService.list(query); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index c010c8f..916cb07 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.annotation.JSONField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.util.BizUtils; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; @@ -396,6 +397,9 @@ public class ProjectDetailVO { @ApiModelProperty("审批详情") private ProcessProgressDetailVo process; + @ApiModelProperty("标签") + private List tags; + public String getVersionStr() { if (Objects.nonNull(this.newest) && this.newest) { this.versionStr = "当前版本"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 375dc13..408a2b4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -3,6 +3,7 @@ package com.ningdatech.pmapi.projectlib.model.vo; import com.alibaba.fastjson.annotation.JSONField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ningdatech.pmapi.common.enumeration.CommonEnum; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; @@ -16,6 +17,7 @@ import lombok.experimental.Tolerate; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.List; import java.util.Objects; import java.util.Optional; @@ -142,6 +144,9 @@ public class ProjectLibListItemVO { @ApiModelProperty("初步方案项目ID") private Long prePlanProjectId; + @ApiModelProperty("标签") + private List tags; + //预审申报时候 需不需要上传上级条线意见文件 private Boolean needUploadSuperLineFile; public Boolean getNeedUploadSuperLineFile() { From 3488c2edf7e14576e0242d9e43ab8784a0ac6884 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Wed, 2 Aug 2023 16:13:12 +0800 Subject: [PATCH 073/137] =?UTF-8?q?=E8=AF=84=E4=BB=B7=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=88=86=E7=BB=84-=E6=B7=BB=E5=8A=A0=E5=BE=85=E8=AF=84?= =?UTF-8?q?=E4=BB=B7=E9=A1=B9=E7=9B=AE=E3=80=81=E5=BA=94=E7=94=A8=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/PerformanceAppraisalPlanManage.java | 23 ++++++++++++++++++++++ .../model/dto/AddAppraisalObjectDTO.java | 3 +++ .../model/vo/PerformanceAppraisalVO.java | 6 ------ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index c9bffc5..3efe4f6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -668,6 +668,7 @@ public class PerformanceAppraisalPlanManage { PerformanceAppraisalProjectVO vo = new PerformanceAppraisalProjectVO(); if(projectMap.containsKey(projectCode)){ Project project = projectMap.get(projectCode); + vo.setProjectName(project.getProjectName()); vo.setProjectTypeName(BizUtils.getProjectTypeName(project.getProjectType())); vo.setProjectType(project.getProjectType()); vo.setId(project.getId()); @@ -729,6 +730,17 @@ public class PerformanceAppraisalPlanManage { // 获取已经创建的评价计划中添加的评价项目ID List projectIds = performanceAppraisalProjectService.list().stream() .map(PerformanceAppraisalProject::getProjectId).collect(Collectors.toList()); + Long appraisalId = addDTO.getAppraisalId(); + // 如果评价计划不为空,说明是编辑评价计划, + // 评价计划中原来已经勾选的待评价项目,不作为判断重复添加的内容 + if (Objects.nonNull(appraisalId)){ + // 获取当前编辑的评价计划中选择的项目 + List proIds = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) + .eq(PerformanceAppraisalProject::getAppraisalId, appraisalId)).stream() + .map(PerformanceAppraisalProject::getProjectId).collect(Collectors.toList()); + // 去除这些项目 + projectIds.removeAll(proIds); + } // 如果有交集,说明选择的项目中,有已经在其他评价计划中的项目 if (Boolean.TRUE.equals(haveIntersection(projectIdList, projectIds))){ // 得到交集 @@ -756,6 +768,17 @@ public class PerformanceAppraisalPlanManage { // 获取已经创建的评价计划中添加的评价应用ID List applicationIds = performanceAppraisalApplicationService.list().stream() .map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList()); + Long appraisalId = addDTO.getAppraisalId(); + // 如果评价计划不为空,说明是编辑评价计划, + // 评价计划中原来已经勾选的待评价应用,不作为判断重复添加的内容 + if (Objects.nonNull(appraisalId)){ + // 获取当前编辑的评价计划中选择的应用 + List appIds = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class) + .eq(PerformanceAppraisalApplication::getAppraisalId, appraisalId)).stream() + .map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList()); + // 去除这些应用 + applicationIds.removeAll(appIds); + } // 如果有交集,说明选择的应用中,有已经在其他评价计划中的应用 if (Boolean.TRUE.equals(haveIntersection(applicationIdList, applicationIds))){ // 得到交集 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AddAppraisalObjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AddAppraisalObjectDTO.java index c43f995..2e5cac4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AddAppraisalObjectDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AddAppraisalObjectDTO.java @@ -25,6 +25,9 @@ public class AddAppraisalObjectDTO implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty("评价计划ID") + private Long appraisalId; + @ApiModelProperty("评价项目 只有ID 和是否复评") private List projectIds; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java index 50ed03f..f93f321 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java @@ -31,12 +31,6 @@ public class PerformanceAppraisalVO implements Serializable { @ApiModelProperty("计划名称") private String name; - @ApiModelProperty("自评开始时间") - private LocalDateTime selfAppraisalStart; - - @ApiModelProperty("自评结束时间") - private LocalDateTime selfAppraisalEnd; - @ApiModelProperty("评价目标 1项目 2应用 可多选 1,2") private String target; From b4b2afeaf62ab99af04692ee52a105fa18bb81b5 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 09:52:18 +0800 Subject: [PATCH 074/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E6=94=BE=E5=85=A5=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 23 +++++++++++----------- .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 4 ++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 810d0ab..6c9e029 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -35,18 +35,9 @@ import com.ningdatech.pmapi.performance.model.dto.ProjectCoreBusinessDTO; import com.ningdatech.pmapi.performance.model.entity.ProjectCoreBusinessIndicators; import com.ningdatech.pmapi.performance.service.IProjectCoreBusinessIndicatorsService; import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; -import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; -import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; -import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; -import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; -import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PaymentPlanVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; -import com.ningdatech.pmapi.projectdeclared.service.IContractService; -import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; -import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; -import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService; +import com.ningdatech.pmapi.projectdeclared.model.entity.*; +import com.ningdatech.pmapi.projectdeclared.model.vo.*; +import com.ningdatech.pmapi.projectdeclared.service.*; import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; import com.ningdatech.pmapi.projectlib.constant.ProjectConstant; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; @@ -114,6 +105,8 @@ public class ProjectLibManage { private final ITodoService todoService; private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; + private final IOperationService operationService; + public PageVo projectLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); query.eq(Project::getNewest, Boolean.TRUE); @@ -607,6 +600,12 @@ public class ProjectLibManage { 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)); //查询初验信息 List acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 21ded6a..522efdb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -7,6 +7,7 @@ import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; @@ -374,6 +375,9 @@ public class ProjectDetailVO { @ApiModelProperty("初审人员") private List acceptancePersons; + @ApiModelProperty("实施信息") + private OperationVO operation; + @ApiModelProperty("版本号str") private String versionStr; From c6e8ef3107bf77d3ef4d6fe4cf59020998eaf6bb Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 10:37:08 +0800 Subject: [PATCH 075/137] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9C=BA=E4=BF=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/statemachine/action/ProjectDeclareAction.java | 7 ++++++- .../common/statemachine/action/ProjectDeclareJNAction.java | 7 ++++++- .../common/statemachine/action/ProjectDeclareJYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareKFBAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareLDAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareLQAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareQTAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareQYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSBJAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSCAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareSYAction.java | 9 +++++++-- .../common/statemachine/action/ProjectDeclareYHAction.java | 7 ++++++- .../builder/ProjectDeclareStateMachineJNBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineJYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineKFQBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineLDBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineLQBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineQTBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineQYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSBJBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSCBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineSYBuilder.java | 10 ++++++++-- .../builder/ProjectDeclareStateMachineYHBuilder.java | 10 ++++++++-- 23 files changed, 169 insertions(+), 43 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java index 044d908..1cf9af9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java @@ -209,9 +209,14 @@ public class ProjectDeclareAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java index ffa8ae0..868d2f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJNAction.java @@ -206,9 +206,14 @@ public class ProjectDeclareJNAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java index eb1ab5d..e5b4081 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareJYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareJYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java index bff3743..a72963f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareKFBAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareKFBAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java index 8fbcf3a..7ac6a59 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLDAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareLDAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java index f87fa91..4c6e792 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareLQAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareLQAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java index 9c4a19a..6d127ac 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQTAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareQTAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java index 4117798..9906c7d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareQYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareQYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java index 466fb16..b83c62a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSBJAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareSBJAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java index d1351c6..c5e6db5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSCAction.java @@ -212,10 +212,15 @@ public class ProjectDeclareSCAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java index 0f54f1f..e515925 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareSYAction.java @@ -204,10 +204,15 @@ public class ProjectDeclareSYAction { project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } - - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java index 4d78f52..9fe7b1b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareYHAction.java @@ -205,9 +205,14 @@ public class ProjectDeclareYHAction { } - @OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") + @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") public void PURCHASE_PUT_ON_RECORD(Message message) { Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); + project.setStatus(ProjectStatusEnum.OPERATION.getCode()); + } + @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") + public void START_TO_WORK(Message message) { + Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java index 0ef1da6..6699f8a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java index 342220b..0e1e70b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineJYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java index f25cacb..a9c54d0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineKFQBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java index 1b5f4fa..575ff1a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java index e6dfb16..737d7f5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java @@ -212,11 +212,17 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java index 2656ba4..43dae81 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java index e65d761..617c7d7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java index 40d38b4..c321412 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java @@ -212,11 +212,17 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java index f432e34..eddf681 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java @@ -221,11 +221,17 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APP_REGISTER) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.REGISTER_APP).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java index 9a7b257..048aac5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java index cb7b103..e7bbd74 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java @@ -211,11 +211,17 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待采购采购备案,从待采购到建设中 + // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .target(ProjectStatusEnum.OPERATION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() + + // 待开工 实施,从实施到建设中 + .withExternal() + .source(ProjectStatusEnum.OPERATION) + .target(ProjectStatusEnum.UNDER_CONSTRUCTION) + .event(ProjectStatusChangeEvent.START_TO_WORK).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) From 618b4c47de2c8c97d127b77ce57092865927ba6d Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 076/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/controller/EarlyWarningController.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java new file mode 100644 index 0000000..d446d01 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.sys.controller; + +import com.ningdatech.log.annotation.WebLog; +import com.wflow.bean.dto.WflowEarlyWarningDTO; +import com.wflow.bean.vo.WflowEarlyWarningVO; +import com.wflow.service.IEarlyWarningService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @Classname EarlyWarningController + * @Description + * @Date 2023/8/01 14:28 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/sys/early-warning") +@Api(value = "EarlyWarning", tags = "系统管理-预警规则") +@RequiredArgsConstructor +public class EarlyWarningController { + + private final IEarlyWarningService earlyWarningService; + + @ApiOperation(value = "预警规则获取", notes = "预警规则获取") + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); + } + + @ApiOperation(value = "预警规则保存", notes = "预警规则保存") + @PostMapping("/save") + @WebLog("预警规则保存") + public String save(@Validated @RequestBody WflowEarlyWarningDTO dto) { + return earlyWarningService.saveByDto(dto); + } +} From 81518df854464c668d69c1e309c8291f0cd2e9f9 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:34:26 +0800 Subject: [PATCH 077/137] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/controller/ProjectApplicationController.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java index 7ea6617..a5b7123 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java @@ -6,14 +6,10 @@ import com.ningdatech.pmapi.projectlib.manage.ApplicationManage; import com.ningdatech.pmapi.projectlib.model.dto.ApplicationAppCodeSaveDTO; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; -import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; -import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; -import com.ningdatech.pmapi.user.util.LoginUserUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; - import javax.validation.Valid; /** From ba93689cd0cd9d83dc2d524e489d8afffe577f8f Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Mon, 31 Jul 2023 16:32:09 +0800 Subject: [PATCH 078/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/performance/manage/PerformanceAppraisalPlanManage.java | 2 ++ .../model/entity/PerformanceIndicatorProjectTemplate.java | 6 ++++++ .../pmapi/performance/model/vo/ProjectIndexTemplateVO.java | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index 3efe4f6..16b054a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -242,6 +242,8 @@ public class PerformanceAppraisalPlanManage { // 计划名称重复校验 deduplicationName(createDTO); PerformanceAppraisal pa = BeanUtil.copyProperties(createDTO,PerformanceAppraisal.class); + + pa.setCreateOn(LocalDateTime.now()); pa.setCreateBy(user.getUsername()); pa.setUpdateOn(LocalDateTime.now()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java index 1631390..55b92d9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java @@ -53,4 +53,10 @@ public class PerformanceIndicatorProjectTemplate implements Serializable { @ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上") private Integer amountRange; + + @ApiModelProperty("项目标签ID") + private Long projectTagId; + + @ApiModelProperty("项目标签名称") + private String projectTagName; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java index 32ec504..a344072 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java @@ -55,4 +55,10 @@ public class ProjectIndexTemplateVO implements Serializable { @ApiModelProperty("附加绩效指标详情") private List additionalIndexDetails; + + @ApiModelProperty("项目标签ID") + private Long projectTagId; + + @ApiModelProperty("项目标签名称") + private String projectTagName; } From 01979fe6a533f080fbc9fd13cdc88b402ea12426 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Tue, 1 Aug 2023 11:55:42 +0800 Subject: [PATCH 079/137] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java | 1 + .../pmapi/performance/enumration/PerformanceTemplateTypeEnum.java | 1 - .../pmapi/projectdeclared/controller/ConstructionPlanController.java | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java index 53c5f02..a58f952 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java @@ -22,6 +22,7 @@ public class ApiApplySearchResult implements Serializable { private String type; private String status; private String sysStateTime; + private String systemAreas; private String deptName; private String deptCode; private String fiveAreas; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java index 879c2e5..82e03fb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java @@ -22,7 +22,6 @@ public enum PerformanceTemplateTypeEnum { /** * 模板类型 */ - //STAGE(0, "阶段"), FIRST_INDEX(1, "第一指标"), SECOND_INDEX(2, "第二指标"), THIRD_INDEX(3, "第三指标"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java index 25cbdd1..5779ac6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java @@ -46,8 +46,6 @@ public class ConstructionPlanController { return "建设方案申报 【" + instanceId + "】 成功"; } - - @GetMapping("/export") @ApiOperation("可申报建设方案项目列表导出") @WebLog("可申报建设方案项目列表导出") From 727c8b26ca1fa0a8607483a6768b02632368f70b Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 080/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 59cfa164d6f2f6503fe87363a5ae5d401ec912ff Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:01:40 +0800 Subject: [PATCH 081/137] =?UTF-8?q?debug=20=E9=A2=84=E5=AE=A1=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index fe7bea6..a03920e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -154,7 +154,7 @@ public class DeclaredProjectManage { Project project = new Project(); BeanUtils.copyProperties(projectInfo,project); Map orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,project); - String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); + String instanceId = processService.startProcessLs(model, params,orgModelMap); log.info("申报项目成功 【{}】", instanceId); //如果是重新提交的话 判断下 项目是否存在 From 07913b1e97657e1114d099b6817ef3ea786b9806 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 082/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 6f581f8eeafde9ef987427562c06ccf1c9dadfb5 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 083/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -31,7 +29,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From ce8131d73135a0377cbfdf310342267886bbb4de Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 084/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From d659cd0f258ab5d8bcd33012505170d0f7a4ea0d Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 085/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 8296ee2ff250decb5fe9a41c650966b878d13d4c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 086/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From b653d5d3f364b2eebed86fe8cabc8ebbd9cfbf68 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 087/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From e83f4a8d8cf936c5dcb8474c7be5b97036469c57 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 088/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From fef0b4aa89aaca3786734b2019965341daf618a4 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 089/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From e2dc1cdb301623ba6e5be43e2079aceae81c9258 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 090/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From bfb125fe90e7730f31d1862da03c435a554bdf6d Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 091/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -31,7 +29,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From cee32807768702ba5a56b4d73fac0be6059156b1 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 092/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 40e5ef0794dc6151954c9b179a96beb139d487c4 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 093/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 39124d36700bca27379056361566ee2eea508433 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 094/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 2d9217fcf9263b88947870e2ea73e7d1991e4986 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 095/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 7952aa6f4de24fb229311a364bc61a05334140a0 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 09:53:56 +0800 Subject: [PATCH 096/137] =?UTF-8?q?debug=20=E5=BA=94=E7=94=A8=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 19 ++++++++++++------- .../pmapi/todocenter/manage/TodoCenterManage.java | 16 +--------------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 6c9e029..8d35323 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -255,7 +255,9 @@ public class ProjectLibManage { project.setSponsor(employeeCode); String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); project.setProjectCode(projectCode); - projectService.save(project); + if(projectService.save(project)){ + saveApplication(projectDto,project,null); + } } else { //否则是重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); @@ -309,13 +311,16 @@ public class ProjectLibManage { } else { 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 { //否则是被驳回,重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index aaf4cf4..c8997dc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -1136,9 +1136,6 @@ public class TodoCenterManage { .eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); if (CollUtil.isNotEmpty(applicationList)) { projectApplicationService.removeBatchByIds(applicationList); - List applicationIds = applicationList.stream().map(ProjectApplication::getId).collect(Collectors.toList()); -// projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) -// .in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); } List applications = projectDto.getApplicationList(); @@ -1157,18 +1154,7 @@ public class TodoCenterManage { projectApplication.setIsConstruct(Boolean.TRUE); } projectApplication.setProjectVersion(project.getVersion()); - boolean result = projectApplicationService.save(projectApplication); -// // 保存应用关联的核心业务 -// List 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); -// } -// } + projectApplicationService.save(projectApplication); } } return Boolean.TRUE; From bc41a676bb2825ded7270d35138190ca087ad414 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 09:46:16 +0800 Subject: [PATCH 097/137] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/handler/GlobalResponseHandler.java | 3 +- .../controller/AnnualPlanController.java | 1 - .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 19 ++++++ .../safety/controller/SafetyRiskController.java | 54 ++++++++++++++++ .../pmapi/safety/manage/SafetyRiskManage.java | 34 ++++++++++ .../pmapi/safety/model/vo/ProjectMonitorVO.java | 75 ++++++++++++++++++++++ 6 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index ad76321..7f7bb57 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java @@ -30,7 +30,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.ningdatech.pmapi.ding.controller", "com.ningdatech.pmapi.filemanage.controller", "com.ningdatech.pmapi.performance.controller", - "com.ningdatech.pmapi.irs.controller" + "com.ningdatech.pmapi.irs.controller", + "com.ningdatech.pmapi.safety.controller" }) public class GlobalResponseHandler implements ResponseBodyAdvice { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 8850698..5202441 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -37,7 +37,6 @@ public class AnnualPlanController { @GetMapping("/list") @ApiOperation("年度计划库列表") - @WebLog("年度计划库列表") public PageVo annualPlanLibList(ProjectListReq req) { return annualPlanLibManage.annulPlanLibList(req); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 522efdb..5815201 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -10,6 +10,7 @@ import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; import io.swagger.annotations.ApiModel; @@ -422,4 +423,22 @@ public class ProjectDetailVO { this.dynamicForm = JSON.parseObject(dynamicFormStr, Map.class); } } + + @ApiModelProperty("项目阶段中文") + private String stageName; + public String getStageName(){ + if(Objects.nonNull(this.stage)){ + return ProjectStatusEnum.getDesc(this.stage); + } + return StringUtils.EMPTY; + } + + @ApiModelProperty("项目状态中文") + private String statusName; + public String getStatusName(){ + if(Objects.nonNull(this.status)){ + return ProjectStatusEnum.getDesc(this.status); + } + return StringUtils.EMPTY; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java new file mode 100644 index 0000000..3badb64 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -0,0 +1,54 @@ +package com.ningdatech.pmapi.safety.controller; + +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; +import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Classname SafetyRiskController + * @Description + * @Date 2023/8/2 9:15 + * @Author PoffyZhang + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "安全风险监测") +@RequestMapping("/api/v1/safety-risk") +public class SafetyRiskController { + + private final SafetyRiskManage safetyRiskManage; + + @GetMapping("/person-monitor/list") + @ApiOperation("安全人员监控列表") + public PageVo personMonitorList(ProjectListReq req) { + return safetyRiskManage.personMonitorList(req); + } + + @GetMapping("/person-monitor/detail/{projectCode}") + @ApiOperation("安全人员监控详情") + public ProjectMonitorVO personMonitorDetail(@PathVariable String projectCode) { + return safetyRiskManage.personMonitorDetail(projectCode); + } + + + @GetMapping("/operation-monitor/list") + @ApiOperation("安全运行监控列表") + public PageVo operationnMonitorList(ProjectListReq req) { + return safetyRiskManage.operationnMonitorList(req); + } + + @GetMapping("/operation-monitor/search/{projectCode}") + @ApiOperation("安全运行监控-查询监测(对接外部平台)") + public JSONObject operationnMonitorList(@PathVariable String projectCode) { + return safetyRiskManage.operationnMonitorSearch(projectCode); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java new file mode 100644 index 0000000..eb57d94 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -0,0 +1,34 @@ +package com.ningdatech.pmapi.safety.manage; + +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import org.springframework.stereotype.Component; + +/** + * @Classname SafetyRiskManage + * @Description + * @Date 2023/8/2 9:17 + * @Author PoffyZhang + */ +@Component +public class SafetyRiskManage { + + + public PageVo personMonitorList(ProjectListReq req) { + return null; + } + + public ProjectMonitorVO personMonitorDetail(String projectCode) { + return null; + } + + public PageVo operationnMonitorList(ProjectListReq req) { + return null; + } + + public JSONObject operationnMonitorSearch(String projectCode) { + return null; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java new file mode 100644 index 0000000..11d5972 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java @@ -0,0 +1,75 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; +import java.util.Optional; + +/** + * @Classname ProjectMonitorVO + * @Description + * @Date 2023/8/2 9:19 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "ProjectMonitorVO", description = "项目监控VO") +public class ProjectMonitorVO { + + @ApiModelProperty("项目ID") + private Long id; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位code") + private String buildOrgCode; + + @ApiModelProperty("申报单位名") + private String buildOrgName; + + @ApiModelProperty("项目年度") + private Integer projectYear; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("项目类型名") + private String projectTypeName; + + public String getProjectTypeName() { + if (Objects.nonNull(this.projectType)) { + Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) + .ifPresent(desc -> this.projectTypeName = desc); + } + return this.projectTypeName; + } + + @ApiModelProperty("项目阶段") + private Integer stage; + + @ApiModelProperty("项目状态") + private Integer status; + + @ApiModelProperty("项目阶段中文") + private String stageName; + public String getStageName(){ + if(Objects.nonNull(this.stage)){ + return ProjectStatusEnum.getDesc(this.stage); + } + return StringUtils.EMPTY; + } + + @ApiModelProperty("项目状态中文") + private String statusName; + public String getStatusName(){ + if(Objects.nonNull(this.status)){ + return ProjectStatusEnum.getDesc(this.status); + } + return StringUtils.EMPTY; + } +} From 5d3e11c8fb67842a1abed9e0771f102b09357210 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 11:49:37 +0800 Subject: [PATCH 098/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safety/controller/SafetyRiskController.java | 35 ++-- .../pmapi/safety/manage/SafetyRiskManage.java | 178 ++++++++++++++++++++- .../safety/mapper/PersonSafetyInfoMapper.java | 15 ++ .../mapper/SupplierSafetyQualificationMapper.java | 15 ++ .../safety/model/dto/PersonSafetyInfoDTO.java | 45 ++++++ .../model/dto/SupplierSafetyQualificationDTO.java | 39 +++++ .../safety/model/entity/PersonSafetyInfo.java | 48 ++++++ .../model/entity/SupplierSafetyQualification.java | 45 ++++++ .../pmapi/safety/model/vo/PersonSafetyInfoVO.java | 43 +++++ .../pmapi/safety/model/vo/SafetyMonitorVO.java | 23 +++ .../model/vo/SupplierSafetyQualificationVO.java | 43 +++++ .../safety/service/IPersonSafetyInfoService.java | 14 ++ .../ISupplierSafetyQualificationService.java | 14 ++ .../service/impl/PersonSafetyInfoServiceImpl.java | 20 +++ .../SupplierSafetyQualificationServiceImpl.java | 20 +++ .../user/security/auth/model/UserInfoDetails.java | 12 ++ 16 files changed, 592 insertions(+), 17 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java index 3badb64..a71523b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -2,16 +2,20 @@ package com.ningdatech.pmapi.safety.controller; import com.alibaba.fastjson.JSONObject; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; +import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; +import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; /** * @Classname SafetyRiskController @@ -33,17 +37,24 @@ public class SafetyRiskController { return safetyRiskManage.personMonitorList(req); } - @GetMapping("/person-monitor/detail/{projectCode}") - @ApiOperation("安全人员监控详情") - public ProjectMonitorVO personMonitorDetail(@PathVariable String projectCode) { - return safetyRiskManage.personMonitorDetail(projectCode); + @PostMapping("/person-monitor/save") + @ApiOperation("安全人员监控信息保存") + @WebLog("安全人员监控信息保存") + public String personMonitorSave(@Valid @RequestBody List dtos) { + return safetyRiskManage.personMonitorSave(dtos); } + @GetMapping("/supplier-safety-qualification/save") + @ApiOperation("供应商安全资质保存") + @WebLog("供应商安全资质保存") + public String supplierSafetyQualificationSave(@Valid @RequestBody List dtos) { + return safetyRiskManage.supplierSafetyQualificationSave(dtos); + } - @GetMapping("/operation-monitor/list") - @ApiOperation("安全运行监控列表") - public PageVo operationnMonitorList(ProjectListReq req) { - return safetyRiskManage.operationnMonitorList(req); + @GetMapping("/detail/{projectCode}") + @ApiOperation("安全人员管控详情") + public SafetyMonitorVO personMonitorDetail(@PathVariable String projectCode) { + return safetyRiskManage.personMonitorDetail(projectCode); } @GetMapping("/operation-monitor/search/{projectCode}") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java index eb57d94..e9c8f5a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -1,11 +1,41 @@ package com.ningdatech.pmapi.safety.manage; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; +import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; +import com.ningdatech.pmapi.safety.model.vo.PersonSafetyInfoVO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SupplierSafetyQualificationVO; +import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; +import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; +import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + /** * @Classname SafetyRiskManage * @Description @@ -13,22 +43,160 @@ import org.springframework.stereotype.Component; * @Author PoffyZhang */ @Component +@Slf4j +@AllArgsConstructor public class SafetyRiskManage { + private final IProjectService projectService; + + private final ISupplierSafetyQualificationService supplierSafetyQualificationService; + + private final IPersonSafetyInfoService personSafetyInfoService; + /** + * 列表 + * @param req + * @return + */ public PageVo personMonitorList(ProjectListReq req) { - return null; + LambdaQueryWrapper query = Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .ge(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) + .ne(Project::getStatus, ProjectStatusEnum.OPERATION.getCode()) + .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()) + .like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()); + checkAuth(query,LoginUserUtil.loginUserDetail()); + Page page = projectService.page(req.page(), query); + long total; + if ((total = page.getTotal()) == 0) { + return PageVo.empty(); + } + List records = CollUtils.convert(page.getRecords(), + p -> BeanUtil.copyProperties(p,ProjectMonitorVO.class)); + return PageVo.of(records, total); } - public ProjectMonitorVO personMonitorDetail(String projectCode) { - return null; + /** + * 权限控制 + * @param query + * @param user + */ + private void checkAuth(LambdaQueryWrapper query, UserInfoDetails user) { + //如果是超管 + if(user.getSuperAdmin()){ + log.info(user.getUsername() + " 是超管,可以看所有项目"); + }else if(user.getRegionAdmin()){ + //如果是区域管理员 + log.info(user.getUsername() + " 是区管,可以看本区域" + user.getRegionCode() + "项目"); + query.eq(Project::getAreaCode,user.getRegionCode()); + }else if(user.getIsOrgAdmin()){ + //单位管理员 + log.info(user.getUsername() + " 是单位管理员,可以看单位 " + user.getEmpPosUnitName() + " 项目"); + query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); + }else{ + //其它角色全都看不见 + query.eq(Project::getId,0L); + } } - public PageVo operationnMonitorList(ProjectListReq req) { - return null; + public SafetyMonitorVO personMonitorDetail(String projectCode) { + SafetyMonitorVO vo = new SafetyMonitorVO(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + if(Objects.isNull(project)){ + return null; + } + + List ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) + .eq(SupplierSafetyQualification::getProjectCode, projectCode)); + if(CollUtil.isNotEmpty(ssq)){ + vo.setSupplierSafetyQualification(ssq.stream() + .map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) + .collect(Collectors.toList())); + } + + List psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) + .eq(PersonSafetyInfo::getProjectCode, projectCode)); + if(CollUtil.isNotEmpty(psi)){ + vo.setPersonSafetyInfo(psi.stream() + .map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) + .collect(Collectors.toList())); + } + + return vo; } public JSONObject operationnMonitorSearch(String projectCode) { return null; } + + /** + * 保存 供应商安全资质 + * @param dtos + * @return + */ + public String supplierSafetyQualificationSave(List dtos) { + if(CollUtil.isEmpty(dtos)){ + return "数据为空"; + } + + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + Integer sucessNum = 0; + for(SupplierSafetyQualificationDTO dto : dtos){ + String projectCode = dto.getProjectCode(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); + + SupplierSafetyQualification entity = BeanUtil.copyProperties(dto, SupplierSafetyQualification.class); + entity.setCreateBy(user.getUsername()); + entity.setCreateOn(LocalDateTime.now()); + entity.setProjectId(project.getId()); + entity.setUpdateBy(user.getUsername()); + entity.setUpdateOn(LocalDateTime.now()); + if(supplierSafetyQualificationService.save(entity)){ + sucessNum ++; + } + } + + return "保存成功" + sucessNum + "条"; + } + + public String personMonitorSave(List dtos) { + if(CollUtil.isEmpty(dtos)){ + return "数据为空"; + } + + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + Integer sucessNum = 0; + for(PersonSafetyInfoDTO dto : dtos){ + String projectCode = dto.getProjectCode(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); + + PersonSafetyInfo entity = BeanUtil.copyProperties(dto, PersonSafetyInfo.class); + entity.setCreateBy(user.getUsername()); + entity.setCreateOn(LocalDateTime.now()); + entity.setProjectId(project.getId()); + entity.setUpdateBy(user.getUsername()); + entity.setUpdateOn(LocalDateTime.now()); + if(personSafetyInfoService.save(entity)){ + sucessNum ++; + } + } + + return "保存成功" + sucessNum + "条"; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java new file mode 100644 index 0000000..3316418 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/PersonSafetyInfoMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.safety.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface PersonSafetyInfoMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java new file mode 100644 index 0000000..39e897b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/mapper/SupplierSafetyQualificationMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.safety.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface SupplierSafetyQualificationMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java new file mode 100644 index 0000000..afcca6a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.safety.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 安全人员信息 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") +public class PersonSafetyInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + @NotBlank(message = "项目编号不能为空") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员姓名") + private String username; + + @ApiModelProperty("调查报告") + private String investigationReport; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java new file mode 100644 index 0000000..9da9fbe --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java @@ -0,0 +1,39 @@ +package com.ningdatech.pmapi.safety.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + *

+ * 供应商安全资质 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") +public class SupplierSafetyQualificationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + @NotBlank(message = "项目编号不能为空") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("安全资质") + private String safetyQualification; + + @ApiModelProperty("安全协议") + private String safetyProtocol; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java new file mode 100644 index 0000000..0b7139e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/PersonSafetyInfo.java @@ -0,0 +1,48 @@ +package com.ningdatech.pmapi.safety.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 安全人员信息 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_person_safety_info") +@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") +public class PersonSafetyInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员姓名") + private String username; + + @ApiModelProperty("调查报告") + private String investigationReport; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java new file mode 100644 index 0000000..c2632b6 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/entity/SupplierSafetyQualification.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.safety.model.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 供应商安全资质 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_supplier_safety_qualification") +@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") +public class SupplierSafetyQualification implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("安全资质") + private String safetyQualification; + + @ApiModelProperty("安全协议") + private String safetyProtocol; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java new file mode 100644 index 0000000..07c7019 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/PersonSafetyInfoVO.java @@ -0,0 +1,43 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 安全人员信息 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") +public class PersonSafetyInfoVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("人员姓名") + private String username; + + @ApiModelProperty("调查报告") + private String investigationReport; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java new file mode 100644 index 0000000..8ec87f2 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SafetyMonitorVO.java @@ -0,0 +1,23 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.util.List; + +/** + * @Classname SafetyMonitorVO + * @Description + * @Date 2023/8/2 9:19 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "SafetyMonitorVO", description = "监控VO") +public class SafetyMonitorVO { + + @ApiModelProperty("人员安全信息") + private List personSafetyInfo; + + @ApiModelProperty("供应商安全资质") + private List supplierSafetyQualification; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java new file mode 100644 index 0000000..ab4943b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/SupplierSafetyQualificationVO.java @@ -0,0 +1,43 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 供应商安全资质 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") +public class SupplierSafetyQualificationVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("安全资质") + private String safetyQualification; + + @ApiModelProperty("安全协议") + private String safetyProtocol; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java new file mode 100644 index 0000000..885cf5d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/IPersonSafetyInfoService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.safety.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; + +/** + * @Classname IPersonSafetyInfoService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface IPersonSafetyInfoService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java new file mode 100644 index 0000000..d68cca7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/ISupplierSafetyQualificationService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.safety.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; + +/** + * @Classname ISupplierSafetyQulificationService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface ISupplierSafetyQualificationService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java new file mode 100644 index 0000000..c0bca50 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/PersonSafetyInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.safety.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.safety.mapper.PersonSafetyInfoMapper; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; +import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class PersonSafetyInfoServiceImpl extends ServiceImpl implements IPersonSafetyInfoService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java new file mode 100644 index 0000000..dc3af89 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/service/impl/SupplierSafetyQualificationServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.safety.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.safety.mapper.SupplierSafetyQualificationMapper; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; +import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class SupplierSafetyQualificationServiceImpl extends ServiceImpl implements ISupplierSafetyQualificationService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java index c477497..75fec5c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java @@ -157,6 +157,18 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { return Boolean.FALSE; } + public Boolean getRegionAdmin() { + if (CollUtil.isNotEmpty(this.userRoleList)) { + for (Role role : this.userRoleList) { + RoleEnum roleEnum = RoleEnum.mathByName(role.getCode()); + if (Objects.nonNull(roleEnum) && roleEnum.eq(RoleEnum.REGION_MANAGER.name())) { + return Boolean.TRUE; + } + } + } + return Boolean.FALSE; + } + public Boolean getIsMunicipalOrg() { //如果是丽水市本级的code 就是 if (RegionConst.RC_LS.equals(this.regionCode)) { From ce07cc058eb4fc27a8b999a015f715dfe969dab1 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 11:57:09 +0800 Subject: [PATCH 099/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java index 11d5972..12419e3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java @@ -26,6 +26,9 @@ public class ProjectMonitorVO { @ApiModelProperty("项目名称") private String projectName; + @ApiModelProperty("项目编号") + private String projectCode; + @ApiModelProperty("申报单位code") private String buildOrgCode; From 585a2bc06430fa776ede4478a43e0784d3568fa6 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 12:01:34 +0800 Subject: [PATCH 100/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java | 3 --- .../pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java | 3 --- 2 files changed, 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java index afcca6a..8527086 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java @@ -22,9 +22,6 @@ public class PersonSafetyInfoDTO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("主键") - private Long id; - @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java index 9da9fbe..512d9c7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java @@ -21,9 +21,6 @@ public class SupplierSafetyQualificationDTO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("主键") - private Long id; - @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; From 6874924b782395fc01fe92cbe8dc8923499ec037 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 12:07:41 +0800 Subject: [PATCH 101/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/safety/controller/SafetyRiskController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java index a71523b..aa4708c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -44,7 +44,7 @@ public class SafetyRiskController { return safetyRiskManage.personMonitorSave(dtos); } - @GetMapping("/supplier-safety-qualification/save") + @PostMapping("/supplier-safety-qualification/save") @ApiOperation("供应商安全资质保存") @WebLog("供应商安全资质保存") public String supplierSafetyQualificationSave(@Valid @RequestBody List dtos) { From 9bdfba34961cfb3832070f732a223d50e62d94d7 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 102/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From e1908b4989ab4961f0a416c42fa74c7065824e3c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 103/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From aa9fb24c516afdc511fb8af98e8354f55fdea6e5 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 104/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 7a425c209adef6f7654ef77f01333245019d3987 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 105/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -31,7 +29,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From d960a4d5fb25114f1cfced3e53f8a39c7552e9d4 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 106/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 306d576d568fd9cd621a13d28cfdfe6da05296dd Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 107/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 38acf394717c68c20d7892914277a130212dbd9c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 108/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 2ffb2bbff6a431729069cfa7ee41ea063995668c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 109/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 925551b1b5a9ff316f6350d13971de123622e787 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 110/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From ee4ed0ca0f7f12add6558a6654798d63569a32d0 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 111/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 5b58ad8000341ae5f2672f0c8ce28e77663e8adf Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 112/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 07ce9eb8c797a9b963be6df7519bad4104be4ef0 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 113/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -31,7 +29,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 57b6b2dfbc4bea52424b2c80d3922166a5578c21 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 114/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From aea9d513fe5c03ece2075926e3a58087c3a915ca Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH 115/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/sys/controller/EarlyWarningController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..d446d01 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * @Classname EarlyWarningController * @Description @@ -30,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From 5ebcd18d025f2d788880309a93d6e7e0bf03e152 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:38:28 +0800 Subject: [PATCH 116/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index d446d01..21c621e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -28,9 +28,9 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{regionCode}") - public WflowEarlyWarningVO detail(@PathVariable String regionCode) { - return earlyWarningService.detailByRegion(regionCode); + @GetMapping("/detail/{areaCode}") + public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + return earlyWarningService.detailByRegion(areaCode); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") From ded6f3a43ac6039dc2ca3723b99408d2e26c0ce6 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 16:21:16 +0800 Subject: [PATCH 117/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 21c621e..a4dd3d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Classname EarlyWarningController * @Description @@ -29,7 +31,7 @@ public class EarlyWarningController { @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") - public WflowEarlyWarningVO detail(@PathVariable String areaCode) { + public List detail(@PathVariable String areaCode) { return earlyWarningService.detailByRegion(areaCode); } From 97083ea62e9cd1ed9b749eec517fde99fcca6c54 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 09:46:16 +0800 Subject: [PATCH 118/137] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safety/controller/SafetyRiskController.java | 35 ++-- .../pmapi/safety/manage/SafetyRiskManage.java | 178 +-------------------- .../pmapi/safety/model/vo/ProjectMonitorVO.java | 3 - 3 files changed, 17 insertions(+), 199 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java index aa4708c..3badb64 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -2,20 +2,16 @@ package com.ningdatech.pmapi.safety.controller; import com.alibaba.fastjson.JSONObject; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; -import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; -import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; -import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * @Classname SafetyRiskController @@ -37,24 +33,17 @@ public class SafetyRiskController { return safetyRiskManage.personMonitorList(req); } - @PostMapping("/person-monitor/save") - @ApiOperation("安全人员监控信息保存") - @WebLog("安全人员监控信息保存") - public String personMonitorSave(@Valid @RequestBody List dtos) { - return safetyRiskManage.personMonitorSave(dtos); + @GetMapping("/person-monitor/detail/{projectCode}") + @ApiOperation("安全人员监控详情") + public ProjectMonitorVO personMonitorDetail(@PathVariable String projectCode) { + return safetyRiskManage.personMonitorDetail(projectCode); } - @PostMapping("/supplier-safety-qualification/save") - @ApiOperation("供应商安全资质保存") - @WebLog("供应商安全资质保存") - public String supplierSafetyQualificationSave(@Valid @RequestBody List dtos) { - return safetyRiskManage.supplierSafetyQualificationSave(dtos); - } - @GetMapping("/detail/{projectCode}") - @ApiOperation("安全人员管控详情") - public SafetyMonitorVO personMonitorDetail(@PathVariable String projectCode) { - return safetyRiskManage.personMonitorDetail(projectCode); + @GetMapping("/operation-monitor/list") + @ApiOperation("安全运行监控列表") + public PageVo operationnMonitorList(ProjectListReq req) { + return safetyRiskManage.operationnMonitorList(req); } @GetMapping("/operation-monitor/search/{projectCode}") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java index e9c8f5a..eb57d94 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -1,41 +1,11 @@ package com.ningdatech.pmapi.safety.manage; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.common.constant.BizConst; -import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; -import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; -import com.ningdatech.pmapi.projectlib.service.IProjectService; -import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; -import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; -import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; -import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; -import com.ningdatech.pmapi.safety.model.vo.PersonSafetyInfoVO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; -import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; -import com.ningdatech.pmapi.safety.model.vo.SupplierSafetyQualificationVO; -import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; -import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; -import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; -import com.ningdatech.pmapi.user.util.LoginUserUtil; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - /** * @Classname SafetyRiskManage * @Description @@ -43,160 +13,22 @@ import java.util.stream.Collectors; * @Author PoffyZhang */ @Component -@Slf4j -@AllArgsConstructor public class SafetyRiskManage { - private final IProjectService projectService; - - private final ISupplierSafetyQualificationService supplierSafetyQualificationService; - - private final IPersonSafetyInfoService personSafetyInfoService; - /** - * 列表 - * @param req - * @return - */ public PageVo personMonitorList(ProjectListReq req) { - LambdaQueryWrapper query = Wrappers.lambdaQuery(Project.class) - .eq(Project::getNewest, Boolean.TRUE) - .ge(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) - .ne(Project::getStatus, ProjectStatusEnum.OPERATION.getCode()) - .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()) - .like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()); - checkAuth(query,LoginUserUtil.loginUserDetail()); - Page page = projectService.page(req.page(), query); - long total; - if ((total = page.getTotal()) == 0) { - return PageVo.empty(); - } - List records = CollUtils.convert(page.getRecords(), - p -> BeanUtil.copyProperties(p,ProjectMonitorVO.class)); - return PageVo.of(records, total); + return null; } - /** - * 权限控制 - * @param query - * @param user - */ - private void checkAuth(LambdaQueryWrapper query, UserInfoDetails user) { - //如果是超管 - if(user.getSuperAdmin()){ - log.info(user.getUsername() + " 是超管,可以看所有项目"); - }else if(user.getRegionAdmin()){ - //如果是区域管理员 - log.info(user.getUsername() + " 是区管,可以看本区域" + user.getRegionCode() + "项目"); - query.eq(Project::getAreaCode,user.getRegionCode()); - }else if(user.getIsOrgAdmin()){ - //单位管理员 - log.info(user.getUsername() + " 是单位管理员,可以看单位 " + user.getEmpPosUnitName() + " 项目"); - query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); - }else{ - //其它角色全都看不见 - query.eq(Project::getId,0L); - } + public ProjectMonitorVO personMonitorDetail(String projectCode) { + return null; } - public SafetyMonitorVO personMonitorDetail(String projectCode) { - SafetyMonitorVO vo = new SafetyMonitorVO(); - Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) - .eq(Project::getNewest, Boolean.TRUE) - .eq(Project::getProjectCode, projectCode) - .last(BizConst.LIMIT_1)); - - if(Objects.isNull(project)){ - return null; - } - - List ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) - .eq(SupplierSafetyQualification::getProjectCode, projectCode)); - if(CollUtil.isNotEmpty(ssq)){ - vo.setSupplierSafetyQualification(ssq.stream() - .map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) - .collect(Collectors.toList())); - } - - List psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) - .eq(PersonSafetyInfo::getProjectCode, projectCode)); - if(CollUtil.isNotEmpty(psi)){ - vo.setPersonSafetyInfo(psi.stream() - .map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) - .collect(Collectors.toList())); - } - - return vo; + public PageVo operationnMonitorList(ProjectListReq req) { + return null; } public JSONObject operationnMonitorSearch(String projectCode) { return null; } - - /** - * 保存 供应商安全资质 - * @param dtos - * @return - */ - public String supplierSafetyQualificationSave(List dtos) { - if(CollUtil.isEmpty(dtos)){ - return "数据为空"; - } - - UserInfoDetails user = LoginUserUtil.loginUserDetail(); - - Integer sucessNum = 0; - for(SupplierSafetyQualificationDTO dto : dtos){ - String projectCode = dto.getProjectCode(); - Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) - .eq(Project::getNewest, Boolean.TRUE) - .eq(Project::getProjectCode, projectCode) - .last(BizConst.LIMIT_1)); - - VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); - - SupplierSafetyQualification entity = BeanUtil.copyProperties(dto, SupplierSafetyQualification.class); - entity.setCreateBy(user.getUsername()); - entity.setCreateOn(LocalDateTime.now()); - entity.setProjectId(project.getId()); - entity.setUpdateBy(user.getUsername()); - entity.setUpdateOn(LocalDateTime.now()); - if(supplierSafetyQualificationService.save(entity)){ - sucessNum ++; - } - } - - return "保存成功" + sucessNum + "条"; - } - - public String personMonitorSave(List dtos) { - if(CollUtil.isEmpty(dtos)){ - return "数据为空"; - } - - UserInfoDetails user = LoginUserUtil.loginUserDetail(); - - Integer sucessNum = 0; - for(PersonSafetyInfoDTO dto : dtos){ - String projectCode = dto.getProjectCode(); - Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) - .eq(Project::getNewest, Boolean.TRUE) - .eq(Project::getProjectCode, projectCode) - .last(BizConst.LIMIT_1)); - - VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); - - PersonSafetyInfo entity = BeanUtil.copyProperties(dto, PersonSafetyInfo.class); - entity.setCreateBy(user.getUsername()); - entity.setCreateOn(LocalDateTime.now()); - entity.setProjectId(project.getId()); - entity.setUpdateBy(user.getUsername()); - entity.setUpdateOn(LocalDateTime.now()); - if(personSafetyInfoService.save(entity)){ - sucessNum ++; - } - } - - return "保存成功" + sucessNum + "条"; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java index 12419e3..11d5972 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java @@ -26,9 +26,6 @@ public class ProjectMonitorVO { @ApiModelProperty("项目名称") private String projectName; - @ApiModelProperty("项目编号") - private String projectCode; - @ApiModelProperty("申报单位code") private String buildOrgCode; From 95347b1ad474ea7cc8dcb3cd001107d1c0bd34c4 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 11:49:37 +0800 Subject: [PATCH 119/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safety/controller/SafetyRiskController.java | 35 ++-- .../pmapi/safety/manage/SafetyRiskManage.java | 178 ++++++++++++++++++++- .../safety/model/dto/PersonSafetyInfoDTO.java | 3 + .../model/dto/SupplierSafetyQualificationDTO.java | 3 + 4 files changed, 202 insertions(+), 17 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java index 3badb64..a71523b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -2,16 +2,20 @@ package com.ningdatech.pmapi.safety.controller; import com.alibaba.fastjson.JSONObject; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; +import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; +import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; /** * @Classname SafetyRiskController @@ -33,17 +37,24 @@ public class SafetyRiskController { return safetyRiskManage.personMonitorList(req); } - @GetMapping("/person-monitor/detail/{projectCode}") - @ApiOperation("安全人员监控详情") - public ProjectMonitorVO personMonitorDetail(@PathVariable String projectCode) { - return safetyRiskManage.personMonitorDetail(projectCode); + @PostMapping("/person-monitor/save") + @ApiOperation("安全人员监控信息保存") + @WebLog("安全人员监控信息保存") + public String personMonitorSave(@Valid @RequestBody List dtos) { + return safetyRiskManage.personMonitorSave(dtos); } + @GetMapping("/supplier-safety-qualification/save") + @ApiOperation("供应商安全资质保存") + @WebLog("供应商安全资质保存") + public String supplierSafetyQualificationSave(@Valid @RequestBody List dtos) { + return safetyRiskManage.supplierSafetyQualificationSave(dtos); + } - @GetMapping("/operation-monitor/list") - @ApiOperation("安全运行监控列表") - public PageVo operationnMonitorList(ProjectListReq req) { - return safetyRiskManage.operationnMonitorList(req); + @GetMapping("/detail/{projectCode}") + @ApiOperation("安全人员管控详情") + public SafetyMonitorVO personMonitorDetail(@PathVariable String projectCode) { + return safetyRiskManage.personMonitorDetail(projectCode); } @GetMapping("/operation-monitor/search/{projectCode}") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java index eb57d94..e9c8f5a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -1,11 +1,41 @@ package com.ningdatech.pmapi.safety.manage; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; +import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; +import com.ningdatech.pmapi.safety.model.vo.PersonSafetyInfoVO; import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SupplierSafetyQualificationVO; +import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; +import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; +import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + /** * @Classname SafetyRiskManage * @Description @@ -13,22 +43,160 @@ import org.springframework.stereotype.Component; * @Author PoffyZhang */ @Component +@Slf4j +@AllArgsConstructor public class SafetyRiskManage { + private final IProjectService projectService; + + private final ISupplierSafetyQualificationService supplierSafetyQualificationService; + + private final IPersonSafetyInfoService personSafetyInfoService; + /** + * 列表 + * @param req + * @return + */ public PageVo personMonitorList(ProjectListReq req) { - return null; + LambdaQueryWrapper query = Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .ge(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) + .ne(Project::getStatus, ProjectStatusEnum.OPERATION.getCode()) + .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()) + .like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()); + checkAuth(query,LoginUserUtil.loginUserDetail()); + Page page = projectService.page(req.page(), query); + long total; + if ((total = page.getTotal()) == 0) { + return PageVo.empty(); + } + List records = CollUtils.convert(page.getRecords(), + p -> BeanUtil.copyProperties(p,ProjectMonitorVO.class)); + return PageVo.of(records, total); } - public ProjectMonitorVO personMonitorDetail(String projectCode) { - return null; + /** + * 权限控制 + * @param query + * @param user + */ + private void checkAuth(LambdaQueryWrapper query, UserInfoDetails user) { + //如果是超管 + if(user.getSuperAdmin()){ + log.info(user.getUsername() + " 是超管,可以看所有项目"); + }else if(user.getRegionAdmin()){ + //如果是区域管理员 + log.info(user.getUsername() + " 是区管,可以看本区域" + user.getRegionCode() + "项目"); + query.eq(Project::getAreaCode,user.getRegionCode()); + }else if(user.getIsOrgAdmin()){ + //单位管理员 + log.info(user.getUsername() + " 是单位管理员,可以看单位 " + user.getEmpPosUnitName() + " 项目"); + query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); + }else{ + //其它角色全都看不见 + query.eq(Project::getId,0L); + } } - public PageVo operationnMonitorList(ProjectListReq req) { - return null; + public SafetyMonitorVO personMonitorDetail(String projectCode) { + SafetyMonitorVO vo = new SafetyMonitorVO(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + if(Objects.isNull(project)){ + return null; + } + + List ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) + .eq(SupplierSafetyQualification::getProjectCode, projectCode)); + if(CollUtil.isNotEmpty(ssq)){ + vo.setSupplierSafetyQualification(ssq.stream() + .map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) + .collect(Collectors.toList())); + } + + List psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) + .eq(PersonSafetyInfo::getProjectCode, projectCode)); + if(CollUtil.isNotEmpty(psi)){ + vo.setPersonSafetyInfo(psi.stream() + .map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) + .collect(Collectors.toList())); + } + + return vo; } public JSONObject operationnMonitorSearch(String projectCode) { return null; } + + /** + * 保存 供应商安全资质 + * @param dtos + * @return + */ + public String supplierSafetyQualificationSave(List dtos) { + if(CollUtil.isEmpty(dtos)){ + return "数据为空"; + } + + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + Integer sucessNum = 0; + for(SupplierSafetyQualificationDTO dto : dtos){ + String projectCode = dto.getProjectCode(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); + + SupplierSafetyQualification entity = BeanUtil.copyProperties(dto, SupplierSafetyQualification.class); + entity.setCreateBy(user.getUsername()); + entity.setCreateOn(LocalDateTime.now()); + entity.setProjectId(project.getId()); + entity.setUpdateBy(user.getUsername()); + entity.setUpdateOn(LocalDateTime.now()); + if(supplierSafetyQualificationService.save(entity)){ + sucessNum ++; + } + } + + return "保存成功" + sucessNum + "条"; + } + + public String personMonitorSave(List dtos) { + if(CollUtil.isEmpty(dtos)){ + return "数据为空"; + } + + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + Integer sucessNum = 0; + for(PersonSafetyInfoDTO dto : dtos){ + String projectCode = dto.getProjectCode(); + Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getNewest, Boolean.TRUE) + .eq(Project::getProjectCode, projectCode) + .last(BizConst.LIMIT_1)); + + VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); + + PersonSafetyInfo entity = BeanUtil.copyProperties(dto, PersonSafetyInfo.class); + entity.setCreateBy(user.getUsername()); + entity.setCreateOn(LocalDateTime.now()); + entity.setProjectId(project.getId()); + entity.setUpdateBy(user.getUsername()); + entity.setUpdateOn(LocalDateTime.now()); + if(personSafetyInfoService.save(entity)){ + sucessNum ++; + } + } + + return "保存成功" + sucessNum + "条"; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java index 8527086..afcca6a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java @@ -22,6 +22,9 @@ public class PersonSafetyInfoDTO implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty("主键") + private Long id; + @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java index 512d9c7..9da9fbe 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java @@ -21,6 +21,9 @@ public class SupplierSafetyQualificationDTO implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty("主键") + private Long id; + @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; From dd5e56bb005a6d38e801a032b50ab574c61a394a Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 11:57:09 +0800 Subject: [PATCH 120/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java index 11d5972..12419e3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java @@ -26,6 +26,9 @@ public class ProjectMonitorVO { @ApiModelProperty("项目名称") private String projectName; + @ApiModelProperty("项目编号") + private String projectCode; + @ApiModelProperty("申报单位code") private String buildOrgCode; From 570356f7f1e6237f3a66ac3d9874f529cf69ba32 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 12:01:34 +0800 Subject: [PATCH 121/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java | 3 --- .../pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java | 3 --- 2 files changed, 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java index afcca6a..8527086 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/PersonSafetyInfoDTO.java @@ -22,9 +22,6 @@ public class PersonSafetyInfoDTO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("主键") - private Long id; - @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java index 9da9fbe..512d9c7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/dto/SupplierSafetyQualificationDTO.java @@ -21,9 +21,6 @@ public class SupplierSafetyQualificationDTO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("主键") - private Long id; - @ApiModelProperty("项目编号") @NotBlank(message = "项目编号不能为空") private String projectCode; From 2ddc68b09493e3022a7f0cc076220a06aae58e9f Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 12:07:41 +0800 Subject: [PATCH 122/137] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/safety/controller/SafetyRiskController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java index a71523b..aa4708c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -44,7 +44,7 @@ public class SafetyRiskController { return safetyRiskManage.personMonitorSave(dtos); } - @GetMapping("/supplier-safety-qualification/save") + @PostMapping("/supplier-safety-qualification/save") @ApiOperation("供应商安全资质保存") @WebLog("供应商安全资质保存") public String supplierSafetyQualificationSave(@Valid @RequestBody List dtos) { From bc1c55aa6d16fb4647078559cecaf754c1bbde4b Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 15:27:04 +0800 Subject: [PATCH 123/137] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/handler/GlobalResponseHandler.java | 3 +- .../pmapi/portrait/controller/TagController.java | 56 +++++++ .../pmapi/portrait/manage/TagManage.java | 174 +++++++++++++++++++++ .../pmapi/portrait/mapper/ProjectTagMapper.java | 15 ++ .../pmapi/portrait/mapper/TagMapper.java | 15 ++ .../pmapi/portrait/model/dto/TagDTO.java | 36 +++++ .../pmapi/portrait/model/dto/TagToProjectDTO.java | 31 ++++ .../pmapi/portrait/model/entity/ProjectTag.java | 40 +++++ .../pmapi/portrait/model/entity/Tag.java | 45 ++++++ .../pmapi/portrait/model/req/TagPageReq.java | 25 +++ .../ningdatech/pmapi/portrait/model/vo/TagVO.java | 40 +++++ .../pmapi/portrait/service/IProjectTagService.java | 14 ++ .../pmapi/portrait/service/ITagService.java | 14 ++ .../service/impl/ProjectTagServiceImpl.java | 21 +++ .../portrait/service/impl/TagServiceImpl.java | 21 +++ .../pmapi/safety/manage/SafetyRiskManage.java | 22 ++- 16 files changed, 568 insertions(+), 4 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/ProjectTagMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/TagMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagToProjectDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/ProjectTag.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/Tag.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/req/TagPageReq.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/vo/TagVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/IProjectTagService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/ITagService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/ProjectTagServiceImpl.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/TagServiceImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index 7f7bb57..2c0646c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java @@ -31,7 +31,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.ningdatech.pmapi.filemanage.controller", "com.ningdatech.pmapi.performance.controller", "com.ningdatech.pmapi.irs.controller", - "com.ningdatech.pmapi.safety.controller" + "com.ningdatech.pmapi.safety.controller", + "com.ningdatech.pmapi.portrait.controller" }) public class GlobalResponseHandler implements ResponseBodyAdvice { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java new file mode 100644 index 0000000..c56bf7a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java @@ -0,0 +1,56 @@ +package com.ningdatech.pmapi.portrait.controller; + +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; +import com.ningdatech.pmapi.portrait.manage.TagManage; +import com.ningdatech.pmapi.portrait.model.dto.TagDTO; +import com.ningdatech.pmapi.portrait.model.dto.TagToProjectDTO; +import com.ningdatech.pmapi.portrait.model.req.TagPageReq; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @Classname TagController + * @Description + * @Date 2023/8/2 14:11 + * @Author PoffyZhang + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "项目画像-标签") +@RequestMapping("/api/v1/portrait/tag") +public class TagController { + private final TagManage tagManage; + + @GetMapping("/list/{areaCode}") + @ApiOperation("按区域查询标签列表") + public PageVo list(@PathVariable String areaCode, TagPageReq req) { + return tagManage.list(areaCode,req); + } + + @PostMapping("/save") + @ApiOperation("保存标签") + @WebLog("保存标签") + public String save(@Valid @RequestBody TagDTO dto) { + return tagManage.save(dto); + } + + @PostMapping("/save-to-project") + @ApiOperation("设置标签到项目") + @WebLog("设置标签到项目") + public String saveToProject(@Valid @RequestBody TagToProjectDTO dto) { + return tagManage.saveToProject(dto); + } + + @PostMapping("/remove-tag-to-project") + @ApiOperation("项目删除标签") + @WebLog("项目删除标签") + public String removeTagToProject(@Valid @RequestBody TagToProjectDTO dto) { + return tagManage.removeTagToProject(dto); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java new file mode 100644 index 0000000..7aea60a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java @@ -0,0 +1,174 @@ +package com.ningdatech.pmapi.portrait.manage; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.function.VUtils; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.portrait.model.dto.TagDTO; +import com.ningdatech.pmapi.portrait.model.dto.TagToProjectDTO; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; +import com.ningdatech.pmapi.portrait.model.entity.Tag; +import com.ningdatech.pmapi.portrait.model.req.TagPageReq; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; +import com.ningdatech.pmapi.portrait.service.IProjectTagService; +import com.ningdatech.pmapi.portrait.service.ITagService; +import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; + +/** + * @Classname TagManage + * @Description + * @Date 2023/8/2 14:10 + * @Author PoffyZhang + */ +@Component +@Slf4j +@AllArgsConstructor +public class TagManage { + + private final ITagService tagService; + + private final IProjectService projectService; + + private final IProjectTagService projectTagService; + + /** + * 标签分页 + * @param areaCode + * @param req + * @return + */ + public PageVo list(String areaCode, TagPageReq req) { + LambdaQueryWrapper query = Wrappers.lambdaQuery(Tag.class) + .eq(Tag::getAreaCode, areaCode) + .like(StringUtils.isNotBlank(req.getName()),Tag::getName,req.getName()) + .orderByDesc(Tag::getUpdateOn); + checkAuth(query,LoginUserUtil.loginUserDetail()); + Page page = tagService.page(req.page(), query); + long total; + if ((total = page.getTotal()) == 0) { + return PageVo.empty(); + } + List records = CollUtils.convert(page.getRecords(), + t -> BeanUtil.copyProperties(t,TagVO.class)); + return PageVo.of(records, total); + } + + /** + * 权限控制 + * @param query + * @param user + */ + private void checkAuth(LambdaQueryWrapper query, UserInfoDetails user) { + //如果是超管 + if(user.getSuperAdmin()){ + log.info(user.getUsername() + " 是超管,可以看所有标签"); + }else if(user.getRegionAdmin()){ + //如果是区域管理员 + log.info(user.getUsername() + " 是区管,可以看本区域" + user.getRegionCode() + "标签"); + query.eq(Tag::getAreaCode,user.getRegionCode()); + }else{ + //其它角色全都看不见 + query.eq(Tag::getId,0L); + } + } + + /** + * 保存标签 + * @param dto + * @return + */ + public String save(TagDTO dto) { + deduplicationName(dto); + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + Tag entity = BeanUtil.copyProperties(dto,Tag.class); + if(Objects.nonNull(dto.getId())){ + Tag old = tagService.getById(dto.getId()); + VUtils.isTrue(Objects.isNull(old)).throwMessage("此id标签不存在!"); + entity.setId(old.getId()); + }else{ + entity.setId(null); + entity.setCreateOn(LocalDateTime.now()); + entity.setCreateBy(user.getUsername()); + } + entity.setUpdateOn(LocalDateTime.now()); + entity.setUpdateBy(user.getUsername()); + tagService.saveOrUpdate(entity); + + return "保存成功"; + } + + /** + * 标签名 去重 + * @param dto + */ + private void deduplicationName(TagDTO dto) { + if(StringUtils.isNotBlank(dto.getName())){ + long count = tagService.count(Wrappers.lambdaQuery(Tag.class) + .eq(Tag::getAreaCode, dto.getAreaCode()) + .eq(Tag::getName, dto.getName()) + .ne(Objects.nonNull(dto.getId()), Tag::getId, dto.getId())); + VUtils.isTrue(count > 0).throwMessage("保存失败!此区域标签名重复!"); + } + } + + public String saveToProject(TagToProjectDTO dto) { + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + String projectCode = dto.getProjectCode(); + Project project = projectService.getProjectByCode(projectCode); + VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!"); + Long tagId = dto.getTagId(); + Tag tag = tagService.getById(tagId); + VUtils.isTrue(Objects.isNull(tag)).throwMessage("标签不存在!"); + + VUtils.isTrue(!tag.getAreaCode().equals(project.getAreaCode())) + .throwMessage("项目和标签不是一个区域的!"); + + ProjectTag projectTag = new ProjectTag(); + projectTag.setProjectCode(projectCode); + projectTag.setTagId(tagId); + projectTag.setCreateOn(LocalDateTime.now()); + projectTag.setCreateBy(user.getUsername()); + projectTagService.save(projectTag); + + return "保存成功"; + } + + public String removeTagToProject(TagToProjectDTO dto) { + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + + String projectCode = dto.getProjectCode(); + Project project = projectService.getProjectByCode(projectCode); + VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!"); + Long tagId = dto.getTagId(); + Tag tag = tagService.getById(tagId); + VUtils.isTrue(Objects.isNull(tag)).throwMessage("标签不存在!"); + + VUtils.isTrue(!tag.getAreaCode().equals(project.getAreaCode())) + .throwMessage("项目和标签不是一个区域的!"); + + ProjectTag pt = projectTagService.getOne(Wrappers.lambdaQuery(ProjectTag.class) + .eq(ProjectTag::getProjectCode, projectCode) + .eq(ProjectTag::getTagId, tagId)); + + VUtils.isTrue(Objects.isNull(pt)) + .throwMessage("该项目没有绑定此标签!"); + projectTagService.removeById(pt.getId()); + + return "删除成功"; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/ProjectTagMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/ProjectTagMapper.java new file mode 100644 index 0000000..7ee6898 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/ProjectTagMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.portrait.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface ProjectTagMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/TagMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/TagMapper.java new file mode 100644 index 0000000..78ed337 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/mapper/TagMapper.java @@ -0,0 +1,15 @@ +package com.ningdatech.pmapi.portrait.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.portrait.model.entity.Tag; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +public interface TagMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagDTO.java new file mode 100644 index 0000000..4cc5a2e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagDTO.java @@ -0,0 +1,36 @@ +package com.ningdatech.pmapi.portrait.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + *

+ * 标签 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "Tag对象", description = "标签") +public class TagDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("标签名") + private String name; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("区域CODE") + @NotNull(message = "区域CODE必填") + private String areaCode; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagToProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagToProjectDTO.java new file mode 100644 index 0000000..7bdb8d8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/dto/TagToProjectDTO.java @@ -0,0 +1,31 @@ +package com.ningdatech.pmapi.portrait.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + *

+ * 标签 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "Tag对象", description = "标签") +public class TagToProjectDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @NotNull(message = "标签ID必填") + private Long tagId; + + @ApiModelProperty("当前项目编号") + @NotNull(message = "项目编号必填") + private String projectCode; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/ProjectTag.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/ProjectTag.java new file mode 100644 index 0000000..f399112 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/ProjectTag.java @@ -0,0 +1,40 @@ +package com.ningdatech.pmapi.portrait.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 标签项目关联 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_project_tag") +@ApiModel(value = "ProjectTag对象", description = "标签项目关联") +public class ProjectTag implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("标签ID") + private Long tagId; + + private LocalDateTime createOn; + private String createBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/Tag.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/Tag.java new file mode 100644 index 0000000..df641ae --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/entity/Tag.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.portrait.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 标签 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@TableName("nd_tag") +@ApiModel(value = "Tag对象", description = "标签") +public class Tag implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("标签名") + private String name; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("区域CODE") + private String areaCode; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/req/TagPageReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/req/TagPageReq.java new file mode 100644 index 0000000..85dfd3f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/req/TagPageReq.java @@ -0,0 +1,25 @@ +package com.ningdatech.pmapi.portrait.model.req; + +import com.ningdatech.basic.model.PagePo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; + +/** + * @Classname TagPageReq + * @Description + * @Date 2023/8/2 14:16 + * @Author PoffyZhang + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@ApiModel("标签列表查询") +@EqualsAndHashCode(callSuper = true) +public class TagPageReq extends PagePo { + + @ApiModelProperty("标签名") + private String name; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/vo/TagVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/vo/TagVO.java new file mode 100644 index 0000000..3527f98 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/model/vo/TagVO.java @@ -0,0 +1,40 @@ +package com.ningdatech.pmapi.portrait.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 标签 + *

+ * + * @author ZPF + * @since 2023-08-02 + */ +@Data +@ApiModel(value = "Tag对象", description = "标签") +public class TagVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("标签名") + private String name; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("区域CODE") + private String areaCode; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/IProjectTagService.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/IProjectTagService.java new file mode 100644 index 0000000..a400cc5 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/IProjectTagService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.portrait.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; + +/** + * @Classname ITagService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface IProjectTagService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/ITagService.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/ITagService.java new file mode 100644 index 0000000..b635e07 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/ITagService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.portrait.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.portrait.model.entity.Tag; + +/** + * @Classname ITagService + * @Description + * @Date 2023/8/2 10:47 + * @Author PoffyZhang + */ +public interface ITagService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/ProjectTagServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/ProjectTagServiceImpl.java new file mode 100644 index 0000000..53bd932 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/ProjectTagServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.portrait.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.portrait.mapper.ProjectTagMapper; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; +import com.ningdatech.pmapi.portrait.service.IProjectTagService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class ProjectTagServiceImpl extends ServiceImpl implements IProjectTagService { + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/TagServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/TagServiceImpl.java new file mode 100644 index 0000000..142029a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/service/impl/TagServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.portrait.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.portrait.mapper.TagMapper; +import com.ningdatech.pmapi.portrait.model.entity.Tag; +import com.ningdatech.pmapi.portrait.service.ITagService; +import org.springframework.stereotype.Service; + +/** + *

+ *

+ * + * @author ZPF + * @since 2023-08-2 + */ +@Service +public class TagServiceImpl extends ServiceImpl implements ITagService { + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java index e9c8f5a..5e990df 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; @@ -64,7 +65,8 @@ public class SafetyRiskManage { .ge(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) .ne(Project::getStatus, ProjectStatusEnum.OPERATION.getCode()) .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()) - .like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()); + .like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()) + .orderByDesc(Project::getUpdateOn); checkAuth(query,LoginUserUtil.loginUserDetail()); Page page = projectService.page(req.page(), query); long total; @@ -145,9 +147,16 @@ public class SafetyRiskManage { UserInfoDetails user = LoginUserUtil.loginUserDetail(); + String projectCode = dtos.get(0).getProjectCode(); + if(StringUtils.isBlank(projectCode)){ + throw new BizException("参数有误!"); + } + supplierSafetyQualificationService.remove(Wrappers.lambdaQuery(SupplierSafetyQualification.class) + .eq(SupplierSafetyQualification::getProjectCode, projectCode)); + Integer sucessNum = 0; for(SupplierSafetyQualificationDTO dto : dtos){ - String projectCode = dto.getProjectCode(); + projectCode = dto.getProjectCode(); Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) .eq(Project::getNewest, Boolean.TRUE) .eq(Project::getProjectCode, projectCode) @@ -176,9 +185,16 @@ public class SafetyRiskManage { UserInfoDetails user = LoginUserUtil.loginUserDetail(); + String projectCode = dtos.get(0).getProjectCode(); + if(StringUtils.isBlank(projectCode)){ + throw new BizException("参数有误!"); + } + personSafetyInfoService.remove(Wrappers.lambdaQuery(PersonSafetyInfo.class) + .eq(PersonSafetyInfo::getProjectCode, projectCode)); + Integer sucessNum = 0; for(PersonSafetyInfoDTO dto : dtos){ - String projectCode = dto.getProjectCode(); + projectCode = dto.getProjectCode(); Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) .eq(Project::getNewest, Boolean.TRUE) .eq(Project::getProjectCode, projectCode) From ef2fba5a5ee484d0ebe65b27818eedd57d81bfcc Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 15:43:09 +0800 Subject: [PATCH 124/137] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=A0=87=E7=AD=BE=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 311 ++++++++++++++------- .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 4 + .../projectlib/model/vo/ProjectLibListItemVO.java | 5 + 3 files changed, 222 insertions(+), 98 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 8d35323..ad07ef5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; @@ -34,10 +35,24 @@ import com.ningdatech.pmapi.organization.service.IDingOrganizationService; import com.ningdatech.pmapi.performance.model.dto.ProjectCoreBusinessDTO; import com.ningdatech.pmapi.performance.model.entity.ProjectCoreBusinessIndicators; import com.ningdatech.pmapi.performance.service.IProjectCoreBusinessIndicatorsService; +import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; +import com.ningdatech.pmapi.portrait.model.entity.Tag; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; +import com.ningdatech.pmapi.portrait.service.IProjectTagService; +import com.ningdatech.pmapi.portrait.service.ITagService; import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; -import com.ningdatech.pmapi.projectdeclared.model.entity.*; -import com.ningdatech.pmapi.projectdeclared.model.vo.*; -import com.ningdatech.pmapi.projectdeclared.service.*; +import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; +import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; +import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; +import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; +import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.PaymentPlanVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; +import com.ningdatech.pmapi.projectdeclared.service.IContractService; +import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; +import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; +import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService; import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; import com.ningdatech.pmapi.projectlib.constant.ProjectConstant; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; @@ -105,7 +120,8 @@ public class ProjectLibManage { private final ITodoService todoService; private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; - private final IOperationService operationService; + private final IProjectTagService projectTagService; + private final ITagService tagService; public PageVo projectLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); @@ -146,6 +162,24 @@ public class ProjectLibManage { return PageVo.empty(); } UserFullInfoDTO finalUser = user; + + Set projectCodes = page.getRecords().stream() + .map(Project::getProjectCode).collect(Collectors.toSet()); + List pts = projectTagService.list(Wrappers.lambdaQuery(ProjectTag.class) + .in(ProjectTag::getProjectCode, projectCodes)); + Map> tagMap = Maps.newHashMap(); + Map tagNameMap = Maps.newHashMap(); + if(CollUtil.isNotEmpty(pts)){ + tagMap = pts.stream().collect(Collectors.groupingBy(ProjectTag::getProjectCode)); + Set tagIds = pts.stream().map(ProjectTag::getTagId).collect(Collectors.toSet()); + List tags = tagService.list(Wrappers.lambdaQuery(Tag.class) + .in(Tag::getId, tagIds)); + if(CollUtil.isNotEmpty(tags)){ + tagNameMap = tags.stream().collect(Collectors.toMap(Tag::getId,Tag::getName)); + } + } + Map> finalTagMap = tagMap; + Map finalTagNameMap = tagNameMap; List records = CollUtils.convert(page.getRecords(), w -> { ProjectLibListItemVO item = new ProjectLibListItemVO(); item.setId(w.getId()); @@ -168,11 +202,28 @@ public class ProjectLibManage { item.setCanPreDeclared(Boolean.TRUE); } item.setPrePlanProjectId(w.getPrePlanProjectId()); + setTag(item,finalTagMap,finalTagNameMap); return item; }); return PageVo.of(records, total); } + private void setTag(ProjectLibListItemVO item, Map> finalTagMap, Map finalTagNameMap) { + if(finalTagMap.containsKey(item.getProjectCode())){ + List tags = Lists.newArrayList(); + List projectTags = finalTagMap.get(item.getProjectCode()); + for(ProjectTag pt :projectTags){ + if(finalTagNameMap.containsKey(pt.getTagId())){ + TagVO vo = new TagVO(); + vo.setId(pt.getTagId()); + vo.setName(finalTagNameMap.get(pt.getTagId())); + tags.add(vo); + } + } + item.setTags(tags); + } + } + public List projectList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); return projectService.list(query); @@ -255,9 +306,7 @@ public class ProjectLibManage { project.setSponsor(employeeCode); String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); project.setProjectCode(projectCode); - if(projectService.save(project)){ - saveApplication(projectDto,project,null); - } + projectService.save(project); } else { //否则是重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); @@ -267,6 +316,30 @@ public class ProjectLibManage { 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 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; } catch (Exception e) { log.error("项目信息入库错误 " + e); @@ -311,16 +384,13 @@ public class ProjectLibManage { } else { project.setPrePlanProjectId(oldProject.getId()); } - 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.save(project); + // 将旧的项目版本置为不是最新 + projectService.update(Wrappers.lambdaUpdate(Project.class) + .set(Project::getNewest, Boolean.FALSE) + .ne(Project::getId, project.getId()) + .eq(Project::getProjectCode, project.getProjectCode())); } else { //否则是被驳回,重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); @@ -330,6 +400,49 @@ public class ProjectLibManage { projectService.updateById(project); } } + + //保存项目应用 + Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) + ? Boolean.TRUE : Boolean.FALSE; + //采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息及关联的核心业务 + List 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 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 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 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; } catch (Exception e) { log.error("项目信息入库错误 " + e); @@ -347,7 +460,29 @@ public class ProjectLibManage { public Project reSaveProjectNewVersion(ProjectDTO projectDto) { //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 try { - return newProjectWithVersion(projectDto); + 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 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; } catch (Exception e) { log.error("项目信息入库错误 " + e); throw new BusinessException("项目信息入库错误 :" + e); @@ -379,8 +514,6 @@ public class ProjectLibManage { .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); - saveApplication(projecDto,project,null); - return project; } @@ -410,14 +543,41 @@ public class ProjectLibManage { .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); + //删除当前版本的app 一般情况是没有 保险起见 + List 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 applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); + projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) + .in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); + } + //app - saveApplication(projecDto,project,isConstruct); + List applicationList = projecDto.getApplicationList(); + if (CollUtil.isNotEmpty(applicationList)) { + List 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); + } } return project; } - public Project saveProjectWithVersion(ProjectDTO projecDto, String instanceId, Integer instType,Boolean isConstruct) { + public Project saveProjectWithVersion(ProjectDTO projecDto, String instanceId, Integer instType) { Project oldProject = projectService.getById(projecDto.getId()); Project project = new Project(); VUtils.isTrue(Objects.isNull(oldProject)) @@ -448,7 +608,27 @@ public class ProjectLibManage { .eq(Project::getProjectCode, project.getProjectCode())); //app - saveApplication(projecDto,project,isConstruct); + //采取批量删除 批量添加的方式 + projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) + .eq(ProjectApplication::getProjectCode, project.getProjectCode()) + .eq(ProjectApplication::getProjectVersion, project.getVersion())); + + List applicationList = projecDto.getApplicationList(); + if (CollUtil.isNotEmpty(applicationList)) { + List 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); + } } return project; @@ -481,7 +661,17 @@ public class ProjectLibManage { .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); - saveApplication(project,oldProject,null); + List 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); + } } return project; @@ -516,9 +706,6 @@ public class ProjectLibManage { .set(Project::getNewest, Boolean.FALSE) .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); - - //APP - saveApplication(project,oldProject,null); } return project; @@ -553,8 +740,6 @@ public class ProjectLibManage { .set(Project::getNewest, Boolean.FALSE) .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); - - saveApplication(project,oldProject,Boolean.TRUE); } return project; @@ -605,12 +790,6 @@ public class ProjectLibManage { 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)); //查询初验信息 List acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) @@ -1075,68 +1254,4 @@ public class ProjectLibManage { res.put(ProjectConstant.ProjectLib.PROCESS_KEY, todoService.getProcessDetail(req)); return res; } - - private void saveApplication(Project project,Project oldProject,Boolean isConstruct) { - List 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 applications = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectCode, project.getProjectCode()) - .eq(ProjectApplication::getProjectVersion, version)); - if (CollUtil.isNotEmpty(applications)) { - projectApplicationService.removeBatchByIds(applications); - List 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); - - boolean result = projectApplicationService.save(projectApplication); - // 保存应用关联的核心业务 - List 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); - } - } - }); - } - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 5815201..06b5e94 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.annotation.JSONField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.util.BizUtils; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; @@ -400,6 +401,9 @@ public class ProjectDetailVO { @ApiModelProperty("审批详情") private ProcessProgressDetailVo process; + @ApiModelProperty("标签") + private List tags; + public String getVersionStr() { if (Objects.nonNull(this.newest) && this.newest) { this.versionStr = "当前版本"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 375dc13..408a2b4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -3,6 +3,7 @@ package com.ningdatech.pmapi.projectlib.model.vo; import com.alibaba.fastjson.annotation.JSONField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ningdatech.pmapi.common.enumeration.CommonEnum; +import com.ningdatech.pmapi.portrait.model.vo.TagVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; @@ -16,6 +17,7 @@ import lombok.experimental.Tolerate; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.List; import java.util.Objects; import java.util.Optional; @@ -142,6 +144,9 @@ public class ProjectLibListItemVO { @ApiModelProperty("初步方案项目ID") private Long prePlanProjectId; + @ApiModelProperty("标签") + private List tags; + //预审申报时候 需不需要上传上级条线意见文件 private Boolean needUploadSuperLineFile; public Boolean getNeedUploadSuperLineFile() { From d755d5c81128f2663e234ef5359ce44f745f4821 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 17:01:50 +0800 Subject: [PATCH 125/137] =?UTF-8?q?debug=20=E9=87=8D=E5=A4=8Dmap=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 271 ++++++++------------- 1 file changed, 100 insertions(+), 171 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index ad07ef5..f7e8b07 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -41,25 +41,15 @@ import com.ningdatech.pmapi.portrait.model.vo.TagVO; import com.ningdatech.pmapi.portrait.service.IProjectTagService; import com.ningdatech.pmapi.portrait.service.ITagService; import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; -import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; -import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; -import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; -import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; -import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PaymentPlanVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; -import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; -import com.ningdatech.pmapi.projectdeclared.service.IContractService; -import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; -import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; -import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService; +import com.ningdatech.pmapi.projectdeclared.model.entity.*; +import com.ningdatech.pmapi.projectdeclared.model.vo.*; +import com.ningdatech.pmapi.projectdeclared.service.*; import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; import com.ningdatech.pmapi.projectlib.constant.ProjectConstant; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.handle.ProcessExecuteChainHandle; import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; -import com.ningdatech.pmapi.projectlib.model.dto.ProjectApplicationDTO; import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.entity.*; import com.ningdatech.pmapi.projectlib.model.req.ProjectApplicationListReq; @@ -120,6 +110,8 @@ public class ProjectLibManage { private final ITodoService todoService; private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; + private final IOperationService operationService; + private final IProjectTagService projectTagService; private final ITagService tagService; @@ -180,6 +172,7 @@ public class ProjectLibManage { } Map> finalTagMap = tagMap; Map finalTagNameMap = tagNameMap; + List records = CollUtils.convert(page.getRecords(), w -> { ProjectLibListItemVO item = new ProjectLibListItemVO(); item.setId(w.getId()); @@ -306,7 +299,9 @@ public class ProjectLibManage { project.setSponsor(employeeCode); String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); project.setProjectCode(projectCode); - projectService.save(project); + if(projectService.save(project)){ + saveApplication(projectDto,project,null); + } } else { //否则是重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); @@ -316,30 +311,6 @@ public class ProjectLibManage { 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 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; } catch (Exception e) { log.error("项目信息入库错误 " + e); @@ -384,13 +355,16 @@ public class ProjectLibManage { } else { 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 { //否则是被驳回,重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); @@ -400,49 +374,6 @@ public class ProjectLibManage { projectService.updateById(project); } } - - //保存项目应用 - Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) - ? Boolean.TRUE : Boolean.FALSE; - //采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息及关联的核心业务 - List 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 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 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 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; } catch (Exception e) { log.error("项目信息入库错误 " + e); @@ -460,29 +391,7 @@ public class ProjectLibManage { public Project reSaveProjectNewVersion(ProjectDTO projectDto) { //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 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 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) { log.error("项目信息入库错误 " + e); throw new BusinessException("项目信息入库错误 :" + e); @@ -514,6 +423,8 @@ public class ProjectLibManage { .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); + saveApplication(projecDto,project,null); + return project; } @@ -543,41 +454,14 @@ public class ProjectLibManage { .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); - //删除当前版本的app 一般情况是没有 保险起见 - List 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 applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); - projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) - .in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); - } - //app - List applicationList = projecDto.getApplicationList(); - if (CollUtil.isNotEmpty(applicationList)) { - List 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; } - 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 project = new Project(); VUtils.isTrue(Objects.isNull(oldProject)) @@ -608,27 +492,7 @@ public class ProjectLibManage { .eq(Project::getProjectCode, project.getProjectCode())); //app - //采取批量删除 批量添加的方式 - projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectCode, project.getProjectCode()) - .eq(ProjectApplication::getProjectVersion, project.getVersion())); - - List applicationList = projecDto.getApplicationList(); - if (CollUtil.isNotEmpty(applicationList)) { - List 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; @@ -661,17 +525,7 @@ public class ProjectLibManage { .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); - List 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; @@ -706,6 +560,9 @@ public class ProjectLibManage { .set(Project::getNewest, Boolean.FALSE) .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); + + //APP + saveApplication(project,oldProject,null); } return project; @@ -740,6 +597,8 @@ public class ProjectLibManage { .set(Project::getNewest, Boolean.FALSE) .ne(Project::getId, project.getId()) .eq(Project::getProjectCode, project.getProjectCode())); + + saveApplication(project,oldProject,Boolean.TRUE); } return project; @@ -790,6 +649,12 @@ public class ProjectLibManage { 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)); //查询初验信息 List acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) @@ -1254,4 +1119,68 @@ public class ProjectLibManage { res.put(ProjectConstant.ProjectLib.PROCESS_KEY, todoService.getProcessDetail(req)); return res; } + + private void saveApplication(Project project,Project oldProject,Boolean isConstruct) { + List 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 applications = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) + .eq(ProjectApplication::getProjectCode, project.getProjectCode()) + .eq(ProjectApplication::getProjectVersion, version)); + if (CollUtil.isNotEmpty(applications)) { + projectApplicationService.removeBatchByIds(applications); + List 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); + + boolean result = projectApplicationService.save(projectApplication); + // 保存应用关联的核心业务 + List 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); + } + } + }); + } + } } From 08066922f0588612100060a9ff08eca624aafbc6 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 17:02:49 +0800 Subject: [PATCH 126/137] =?UTF-8?q?debug=20=E9=87=8D=E5=A4=8Dmap=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index f7e8b07..4399171 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -1167,6 +1167,9 @@ public class ProjectLibManage { projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); projectApplication.setProjectVersion(version); projectApplication.setIsConstruct(isConstruct); + if(StringUtils.isNotBlank(application.getRelatedExistsApplication())){ + projectApplication.setApplicationName(null); + } boolean result = projectApplicationService.save(projectApplication); // 保存应用关联的核心业务 From 0415b2f4f435170cc4e00e6623db8c1bb6f4946c Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Wed, 2 Aug 2023 17:14:50 +0800 Subject: [PATCH 127/137] =?UTF-8?q?=E8=AF=84=E4=BB=B7=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=88=86=E7=BB=84-=E5=88=86=E7=BB=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E3=80=81=E5=A4=8D=E8=AF=84=E3=80=81=E6=A0=B8=E6=9F=A5=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E9=87=8D=E5=A4=8D=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/constant/CommonConst.java | 4 +- .../manage/PerformanceAppraisalPlanManage.java | 65 +++++++++++++++++----- 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java index 03dbaf8..320cb90 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java @@ -60,7 +60,9 @@ public interface CommonConst { String COPY = "副本"; String PROJECT_REPEAT = " 项目已在其他评价计划中,请勿重复添加!"; String APP_REPEAT = " 应用已在其他评价计划中,请勿重复添加!"; - String REAPPRAISAL_REPEAT = " 已在其他当前评价计划其他分组中,请勿重复添加!"; + Integer REAPPRAISAL_TYPE = 1; + Integer VERIFY_TYPE = 2; + String REPEAT = " 已在其他当前评价计划其他分组中,请勿重复添加!"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index 3efe4f6..2d6f953 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -213,6 +213,7 @@ public class PerformanceAppraisalPlanManage { // 获取分组信息 List groups = groupList.stream().map(g -> { PerformanceAppraisalProjectGroupVO groupVo = new PerformanceAppraisalProjectGroupVO(); + groupVo.setId(g.getId()); groupVo.setAppraisalId(id); groupVo.setName(g.getName()); String reAppraisalUsersStr = g.getReAppraisalUsers(); @@ -589,7 +590,9 @@ public class PerformanceAppraisalPlanManage { UserInfoDetails user = LoginUserUtil.loginUserDetail(); PerformanceAppraisalProjectGroup group = BeanUtil.copyProperties(dto, PerformanceAppraisalProjectGroup.class); - + // 获取当前评价计划内的分组信息 + List groupList = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) + .eq(PerformanceAppraisalProjectGroup::getAppraisalId, dto.getAppraisalId())); if(Objects.isNull(dto.getId())){ group.setId(null); group.setCreateOn(LocalDateTime.now()); @@ -600,14 +603,30 @@ public class PerformanceAppraisalPlanManage { group.setId(old.getId()); } if(CollUtil.isNotEmpty(dto.getProjectCodes())){ + // 判断选择的项目是否已经在当前评价计划的其他分组内 + // 获取当前评价计划的其他分组的项目信息 + List projectCodeList = groupList.stream() + .map(PerformanceAppraisalProjectGroup::getProjectCodes) + .collect(Collectors.toList()); + checkProjectCodes(dto.getProjectCodes(),projectCodeList); group.setProjectCodes(String.join(StrPool.COMMA, dto.getProjectCodes())); } if(CollUtil.isNotEmpty(dto.getReAppraisalUsers())){ // 判断选择的复评人员是否已经在当前评价计划的其他分组内 - checkReAppraisalUsers(dto.getReAppraisalUsers(),dto.getAppraisalId()); + // 获取当前评价计划的其他分组的复评人员信息 + List reUserList = groupList.stream() + .map(PerformanceAppraisalProjectGroup::getReAppraisalUsers) + .collect(Collectors.toList()); + checkReAppraisalAndVerifyUsers(dto.getReAppraisalUsers(),reUserList,CommonConst.REAPPRAISAL_TYPE); group.setReAppraisalUsers(String.join(StrPool.COMMA, dto.getReAppraisalUsers())); } if(CollUtil.isNotEmpty(dto.getVerificationUsers())){ + // 判断选择的核查人员是否已经在当前评价计划的其他分组内 + // 获取当前评价计划的其他分组的核查人员信息 + List verifyList = groupList.stream() + .map(PerformanceAppraisalProjectGroup::getVerificationUsers) + .collect(Collectors.toList()); + checkReAppraisalAndVerifyUsers(dto.getVerificationUsers(),verifyList,CommonConst.VERIFY_TYPE); group.setVerificationUsers(String.join(StrPool.COMMA, dto.getVerificationUsers())); } group.setUpdateOn(LocalDateTime.now()); @@ -616,18 +635,30 @@ public class PerformanceAppraisalPlanManage { return "操作成功"; } - private void checkReAppraisalUsers(List reAppraisalUsers, Long appraisalId) { - // 获取当前评价计划的其他分组的复评人员信息 - List groupList = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) - .eq(PerformanceAppraisalProjectGroup::getAppraisalId, appraisalId)); - List reUserList = groupList.stream() - .map(PerformanceAppraisalProjectGroup::getReAppraisalUsers) - .collect(Collectors.toList()); - // 如果提交的复评人员在该评价计划其他分组中 - if (!CollectionUtil.intersection(reAppraisalUsers,reUserList).isEmpty()){ - ArrayList reUsers = Lists.newArrayList(reAppraisalUsers); - reUsers.retainAll(reUserList); - // 获取重复添加的复评人员名字 + private void checkProjectCodes(List projectCodes, List projectCodeList) { + // 判断选择的项目是否已经在当前评价计划的其他分组内 + // 如果提交的项目在该评价计划其他分组中 + if (!CollectionUtil.intersection(projectCodes,projectCodeList).isEmpty()){ + ArrayList proCodes = Lists.newArrayList(projectCodes); + proCodes.retainAll(projectCodeList); + // 获取重复添加的项目Code + String names = proCodes.stream().map(i -> { + Project project = projectService.getProjectByCode(i); + if (Objects.nonNull(project)){ + return project.getProjectName(); + } + return StrPool.EMPTY; + }).collect(Collectors.joining(StrPool.COMMA)); + throw new BizException("项目:" + names + CommonConst.REPEAT); + } + } + + private void checkReAppraisalAndVerifyUsers(List checkUsers, List compareUsers, Integer type) { + // 如果提交的复评/核查人员在该评价计划其他分组中 + if (!CollectionUtil.intersection(checkUsers,compareUsers).isEmpty()){ + ArrayList reUsers = Lists.newArrayList(checkUsers); + reUsers.retainAll(compareUsers); + // 获取重复添加的复评/核查人员名字 String names = reUsers.stream().map(i -> { UserFullInfoDTO info = userInfoHelper.getUserFullInfoByEmployeeCode(i); if (Objects.nonNull(info)){ @@ -635,7 +666,11 @@ public class PerformanceAppraisalPlanManage { } return StrPool.EMPTY; }).collect(Collectors.joining(StrPool.COMMA)); - throw new BizException("复评人员:" + names + CommonConst.REAPPRAISAL_REPEAT); + if (CommonConst.REAPPRAISAL_TYPE.equals(type)) { + throw new BizException("复评人员:" + names + CommonConst.REPEAT); + }else if (CommonConst.VERIFY_TYPE.equals(type)){ + throw new BizException("核查人员:" + names + CommonConst.REPEAT); + } } } From 128b08ecbf57c28c258011968d6dd6f59e31cb47 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 10:31:14 +0800 Subject: [PATCH 128/137] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/portrait/controller/TagController.java | 12 +++- .../pmapi/portrait/manage/TagManage.java | 67 +++++++++++++++------- .../pmapi/projectlib/manage/ProjectLibManage.java | 30 ++++++++++ .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 4 ++ 4 files changed, 91 insertions(+), 22 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java index c56bf7a..0a46dce 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/controller/TagController.java @@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.List; /** * @Classname TagController @@ -40,11 +41,18 @@ public class TagController { return tagManage.save(dto); } + @PostMapping("/delete/{id}") + @ApiOperation("删除标签") + @WebLog("删除标签") + public String save(@PathVariable Long id) { + return tagManage.delete(id); + } + @PostMapping("/save-to-project") @ApiOperation("设置标签到项目") @WebLog("设置标签到项目") - public String saveToProject(@Valid @RequestBody TagToProjectDTO dto) { - return tagManage.saveToProject(dto); + public String saveToProject(@Valid @RequestBody List dtos) { + return tagManage.saveToProject(dtos); } @PostMapping("/remove-tag-to-project") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java index 7aea60a..dbb16e5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java @@ -1,6 +1,7 @@ package com.ningdatech.pmapi.portrait.manage; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -125,32 +126,39 @@ public class TagManage { } } - public String saveToProject(TagToProjectDTO dto) { - UserInfoDetails user = LoginUserUtil.loginUserDetail(); - - String projectCode = dto.getProjectCode(); - Project project = projectService.getProjectByCode(projectCode); - VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!"); - Long tagId = dto.getTagId(); - Tag tag = tagService.getById(tagId); - VUtils.isTrue(Objects.isNull(tag)).throwMessage("标签不存在!"); + public String saveToProject(List dtos) { + if(CollUtil.isEmpty(dtos)){ + return "参入的标签为空"; + } - VUtils.isTrue(!tag.getAreaCode().equals(project.getAreaCode())) - .throwMessage("项目和标签不是一个区域的!"); + UserInfoDetails user = LoginUserUtil.loginUserDetail(); - ProjectTag projectTag = new ProjectTag(); - projectTag.setProjectCode(projectCode); - projectTag.setTagId(tagId); - projectTag.setCreateOn(LocalDateTime.now()); - projectTag.setCreateBy(user.getUsername()); - projectTagService.save(projectTag); + Integer successNum = 0; + for(TagToProjectDTO dto : dtos){ + String projectCode = dto.getProjectCode(); + Project project = projectService.getProjectByCode(projectCode); + VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!"); + Long tagId = dto.getTagId(); + Tag tag = tagService.getById(tagId); + VUtils.isTrue(Objects.isNull(tag)).throwMessage("标签不存在!"); + + VUtils.isTrue(!tag.getAreaCode().equals(project.getAreaCode())) + .throwMessage("项目和标签不是一个区域的!"); + + ProjectTag projectTag = new ProjectTag(); + projectTag.setProjectCode(projectCode); + projectTag.setTagId(tagId); + projectTag.setCreateOn(LocalDateTime.now()); + projectTag.setCreateBy(user.getUsername()); + if(projectTagService.save(projectTag)){ + successNum ++; + } + } - return "保存成功"; + return "保存成功" + successNum + "条"; } public String removeTagToProject(TagToProjectDTO dto) { - UserInfoDetails user = LoginUserUtil.loginUserDetail(); - String projectCode = dto.getProjectCode(); Project project = projectService.getProjectByCode(projectCode); VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!"); @@ -171,4 +179,23 @@ public class TagManage { return "删除成功"; } + + /** + * 删除标签 + * @param id + * @return + */ + public String delete(Long id) { + Tag tag = tagService.getById(id); + VUtils.isTrue(Objects.isNull(tag)) + .throwMessage("删除失败 此标签ID不存在!"); + + if(tagService.removeById(id)){ + //关联关系 也要删 + projectTagService.remove(Wrappers.lambdaQuery(ProjectTag.class) + .eq(ProjectTag::getTagId,id)); + return "删除成功"; + } + return "删除失败"; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 1bbb04f..4cbc593 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -60,6 +60,13 @@ import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import com.ningdatech.pmapi.projectlib.service.*; +import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; +import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; +import com.ningdatech.pmapi.safety.model.vo.PersonSafetyInfoVO; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; +import com.ningdatech.pmapi.safety.model.vo.SupplierSafetyQualificationVO; +import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; +import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq; import com.ningdatech.pmapi.todocenter.service.ITodoService; import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; @@ -116,6 +123,10 @@ public class ProjectLibManage { private final IOperationService operationService; + private final ISupplierSafetyQualificationService supplierSafetyQualificationService; + + private final IPersonSafetyInfoService personSafetyInfoService; + public PageVo projectLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); query.eq(Project::getNewest, Boolean.TRUE); @@ -790,6 +801,25 @@ public class ProjectLibManage { .last(BizConst.LIMIT_1)); vo.setOperation(BeanUtil.copyProperties(operation, OperationVO.class)); + SafetyMonitorVO safetyVo = new SafetyMonitorVO(); + //查询风险监测 + List 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 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 acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) .in(PreInsAcceptancePerson::getProjectId, allVersionProjectId) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 06b5e94..d1443ec 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -13,6 +13,7 @@ import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; +import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -445,4 +446,7 @@ public class ProjectDetailVO { } return StringUtils.EMPTY; } + + @ApiModelProperty("安全风险监测信息") + private SafetyMonitorVO safetyInfo; } From f6a93d24c3ba6286a6ba3576b212f89be7ac3a70 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 10:34:49 +0800 Subject: [PATCH 129/137] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index b5a9110..d101a89 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -122,8 +122,6 @@ public class ProjectLibManage { private final IProjectTagService projectTagService; private final ITagService tagService; - private final IOperationService operationService; - private final ISupplierSafetyQualificationService supplierSafetyQualificationService; private final IPersonSafetyInfoService personSafetyInfoService; From 9e0ac92fe151bbef2cd39c771ff48501809e9d48 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 3 Aug 2023 10:46:15 +0800 Subject: [PATCH 130/137] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=A5=E8=81=8C?= =?UTF-8?q?=E8=AF=84=E4=BB=B7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit a1d8bf52c7752b824e1752b888efe7019cf82c66) --- .../controller/MeetingExpertJudgeController.java | 4 +- .../entity/enumeration/ExpertJudgeEnum.java | 49 ++++++++++++++++++++++ .../meeting/entity/req/MeetingExpertJudgeReq.java | 34 +++++++++++---- .../meeting/manage/MeetingExpertJudgeManage.java | 13 ++++++ 4 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertJudgeEnum.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExpertJudgeController.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExpertJudgeController.java index 5aaed94..2398c1f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExpertJudgeController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExpertJudgeController.java @@ -2,10 +2,12 @@ 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; @@ -28,7 +30,7 @@ public class MeetingExpertJudgeController { @ApiOperation("保存履职评价") @PostMapping("/submit") - public void saveExpertJudge(@Valid @RequestBody MeetingExpertJudgeReq req) { + public void saveExpertJudge(@Validated(Basic.class) @RequestBody MeetingExpertJudgeReq req) { expertJudgeManage.saveExpertJudge(req); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertJudgeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertJudgeEnum.java new file mode 100644 index 0000000..cfea76b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertJudgeEnum.java @@ -0,0 +1,49 @@ +package com.ningdatech.pmapi.meeting.entity.enumeration; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + *

+ * ExpertJudgeEnum + *

+ * + * @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); + } + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingExpertJudgeReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingExpertJudgeReq.java index e31da87..841c551 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingExpertJudgeReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingExpertJudgeReq.java @@ -7,6 +7,9 @@ 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; + /** *

* MeetingExpertJudgeReq @@ -20,34 +23,41 @@ public class MeetingExpertJudgeReq { private Long id; - @NotNull(message = "会议ID不能为空") + @NotNull(message = "会议ID不能为空", groups = Basic.class) private Long meetingId; - @NotNull(message = "会议专家ID不能为空") + @NotNull(message = "会议专家ID不能为空", groups = Basic.class) private Long meetingExpertId; @ApiModelProperty("评分(1~10)") - @NotNull(message = "评分不能为空") + @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 = "是否参加不能为空") + @NotNull(message = "是否参加不能为空", groups = Basic.class) private Integer attended; + /** + * @see ExpertJudgeEnum.Performance + */ @ApiModelProperty("参与程度:1 积极、2 消极") - @NotNull(message = "参与度不能为空") + @NotNull(message = "参与度不能为空", groups = Attend.class) private Integer performance; @ApiModelProperty("是否提出建议:true 是、false 否") - @NotNull(message = "是否提出建议不能为空") + @NotNull(message = "是否提出建议不能为空", groups = Attend.class) private Boolean advised; @ApiModelProperty("是否早退:true 早退、false 未早退") - @NotNull(message = "是否早退不能为空") + @NotNull(message = "是否早退不能为空", groups = Attend.class) private Boolean leaveEarly; @ApiModelProperty("是否违规:true 是、false 否") - @NotNull(message = "是否违规不能为空") + @NotNull(message = "是否违规不能为空", groups = Attend.class) private Boolean brokeRule; @ApiModelProperty("违规内容") @@ -56,4 +66,12 @@ public class MeetingExpertJudgeReq { @JSONField(format = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createOn; + //================================================================================================================== + + public interface Attend { + } + + public interface Basic { + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java index 94d1dde..f16ff12 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java @@ -4,19 +4,25 @@ 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; + /** *

* MeetingExpertJudgeManage @@ -46,6 +52,13 @@ public class MeetingExpertJudgeManage { throw BizException.wrap("履职评价失败,请重试"); } try { + if (!ExpertJudgeEnum.AttendStatus.ABSENT.eq(req.getAttended())) { + Map 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())) { From e1d8a1248cd2b14f96cd5117bb494a801d188e3d Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Thu, 3 Aug 2023 11:11:38 +0800 Subject: [PATCH 131/137] =?UTF-8?q?=E8=AF=84=E4=BB=B7=E8=AE=A1=E5=88=92-?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E8=87=AA=E8=AF=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/manage/OrgSelfAppraisalManage.java | 48 +++++++++++++++++----- .../model/vo/PerformanceAppraisalProjectVO.java | 16 ++++++++ 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java index bcb8322..30f3c57 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java @@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal; @@ -15,9 +16,14 @@ import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO; import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalApplicationService; import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectService; import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalService; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.sys.model.entity.Role; +import com.ningdatech.pmapi.sys.service.IRoleService; +import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; import com.ningdatech.pmapi.user.util.LoginUserUtil; import lombok.AllArgsConstructor; @@ -49,6 +55,7 @@ public class OrgSelfAppraisalManage { private final IProjectService projectService; private final IProjectApplicationService applicationService; + private final IRoleService roleService; /** * 绩效列表 @@ -60,23 +67,37 @@ public class OrgSelfAppraisalManage { //当前登录用户 单位code String empPosUnitCode = user.getEmpPosUnitCode(); + // 获取当前登录用户的角色列表,只有单位管理员才能查看该列表 + List userRoleList = user.getUserRoleList(); + List roleIdList = userRoleList.stream().map(Role::getId).collect(Collectors.toList()); + Role role = roleService.getOne(Wrappers.lambdaQuery(Role.class) + .eq(Role::getName, RoleEnum.COMPANY_MANAGER.getDesc())); + if (Objects.isNull(role)){ + throw new BizException("系统没有单位管理员角色!"); + } + + // 登录用户不是单位管理员,不能查看本单位的自评计划列表 + if (!roleIdList.contains(role.getId())){ + return PageVo.empty(); + } + + // 获取登录用户所在单位的所有已终验项目信息 List projectLists = projectService.list(Wrappers.lambdaQuery(Project.class) + .eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()) .eq(Project::getBuildOrgCode, empPosUnitCode)); if(CollUtil.isEmpty(projectLists)){ return PageVo.empty(); } - List projectIds = projectLists.stream().map(Project::getId).collect(Collectors.toList()); - + // 获取添加过该单位项目的所有评价计划信息 List paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) .in(PerformanceAppraisalProject::getProjectId, projectIds)); if(CollUtil.isEmpty(paps)){ return PageVo.empty(); } - Set paIds = paps.stream().map(PerformanceAppraisalProject::getAppraisalId).collect(Collectors.toSet()); - + // 获取评价计划列表 Page page = req.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) .in(PerformanceAppraisal::getId,paIds) @@ -86,10 +107,9 @@ public class OrgSelfAppraisalManage { return PageVo.empty(); } - List res = page.getRecords().stream().map(p -> { - PerformanceAppraisalVO vo = BeanUtil.copyProperties(p,PerformanceAppraisalVO.class); - return vo; - }).collect(Collectors.toList()); + List res = page.getRecords().stream() + .map(p -> BeanUtil.copyProperties(p, PerformanceAppraisalVO.class)) + .collect(Collectors.toList()); return PageVo.of(res,page.getTotal()); } @@ -97,8 +117,9 @@ public class OrgSelfAppraisalManage { UserInfoDetails user = LoginUserUtil.loginUserDetail(); PerformanceAppraisal plan = performanceAppraisalService.getById(planId); - VUtils.isTrue(Objects.isNull(plan)).throwMessage("该计划不存在!"); + VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!"); + // 获取评价计划内已添加的待评价项目信息 List paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) .eq(PerformanceAppraisalProject::getAppraisalId, plan.getId())); Map papsMap = paps.stream().collect(Collectors.toMap(PerformanceAppraisalProject::getProjectId, p -> p)); @@ -106,11 +127,12 @@ public class OrgSelfAppraisalManage { if(CollUtil.isEmpty(paps)){ return PageVo.empty(); } - Set projectIds = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet()); + // 获取本单位在当前评价计划内的项目 + Set projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet()); Page page = req.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(Project.class) - .in(Project::getProjectCode, projectIds) + .in(Project::getProjectCode, projectCodes) .eq(Project::getNewest, Boolean.TRUE) .eq(Project::getBuildOrgCode, user.getEmpPosUnitCode()) .like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()); @@ -124,6 +146,10 @@ public class OrgSelfAppraisalManage { .map(p -> { PerformanceAppraisalProjectVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalProjectVO.class); PerformanceAppraisalProject appraisalProject = papsMap.get(p.getId()); + vo.setProjectTypeName(ProjectTypeEnum.getDesc(p.getProjectType())); + vo.setIsReAppraisal(appraisalProject.getIsReAppraisal()); + vo.setSelfAppraisalStart(appraisalProject.getSelfAppraisalStart()); + vo.setSelfAppraisalEnd(appraisalProject.getSelfAppraisalEnd()); vo.setCanSelfAppraisal(checkCanSelfAppraisal(appraisalProject)); return vo; }) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java index af24f9a..c96768b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.performance.model.vo; +import com.alibaba.fastjson.annotation.JSONField; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -51,4 +52,19 @@ public class PerformanceAppraisalProjectVO implements Serializable { @ApiModelProperty("是否可自评") private Boolean canSelfAppraisal = Boolean.FALSE; + + @ApiModelProperty("自评开始时间") + private LocalDateTime selfAppraisalStart; + + @ApiModelProperty("自评结束时间") + private LocalDateTime selfAppraisalEnd; + + @ApiModelProperty("自评总分") + private BigDecimal selfAppraisalScore; + + @ApiModelProperty("打分时间") + @JSONField(format = "yyyy-MM-dd HH:mm") + private LocalDateTime scoreTime; + + } From bbb399e9813794c5aa23c75a166140073a7635b3 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 15:12:27 +0800 Subject: [PATCH 132/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduler/listener/EarlyWarningListener.java | 142 +++++++++++++++++++++ .../sys/mapper/EarlyWarningRecordsMapper.java | 17 +++ .../sys/model/entity/WflowEarlyWarningRecords.java | 108 ++++++++++++++++ .../sys/model/vo/WflowEarlyWarningRecordsVO.java | 106 +++++++++++++++ .../sys/service/IEarlyWarningRecordsService.java | 11 ++ .../impl/EarlyWarningRecordsServiceImpl.java | 26 ++++ 6 files changed, 410 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/EarlyWarningRecordsMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/WflowEarlyWarningRecords.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IEarlyWarningRecordsService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java new file mode 100644 index 0000000..9217caa --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java @@ -0,0 +1,142 @@ +package com.ningdatech.pmapi.scheduler.listener; + +import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.common.helper.UserInfoHelper; +import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; +import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; +import com.ningdatech.pmapi.projectlib.service.IProjectInstService; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.sys.model.entity.WflowEarlyWarningRecords; +import com.ningdatech.pmapi.sys.service.IEarlyWarningRecordsService; +import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; +import com.wflow.enums.WarningRuleTypeEnum; +import com.wflow.workflow.notify.event.EarlyWarningEvent; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.flowable.engine.HistoryService; +import org.flowable.engine.history.HistoricActivityInstance; +import org.flowable.engine.history.HistoricProcessInstance; +import org.springframework.context.event.EventListener; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.List; +import java.util.Objects; + +/** + * 预警规则触发 + * + * @author ZPF + * @return + * @since 2023/08/03 14:19 + */ +@Slf4j +@Component +@RequiredArgsConstructor +public class EarlyWarningListener { + private final HistoryService historyService; + private final IProjectInstService projectInstService; + + private final IProjectService projectService; + + private final IEarlyWarningRecordsService earlyWarningRecordsService; + + private final UserInfoHelper userInfoHelper; + + @Async + @EventListener + public void onApplicationEvent(EarlyWarningEvent event) { + log.info("进入预警规则触发的 事件监听!"); + log.info("event:{}", JSON.toJSONString(event)); + String nodeId = event.getNodeId(); + Integer timeout = event.getTimeout(); + String noticeMethod = event.getNoticeMethod(); + String noticeContent = event.getNoticeContent(); + + //1.根据nodeId 查询到 node 去查找 未完成 项目实例关系表 找到实例 + List hais = historyService.createHistoricActivityInstanceQuery() + .activityId(nodeId) + .unfinished() + .orderByHistoricActivityInstanceStartTime() + .asc() + .list(); + + if (CollUtil.isEmpty(hais)) { + log.info("没有查到 历史实例"); + return; + } + + String instanceId = hais.get(0).getProcessInstanceId(); + + //查询当前未完成的此实例 + HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery() + .processInstanceId(instanceId) + .unfinished() + .singleResult(); + + if (Objects.isNull(instance)) { + log.info("没有查到实例 或者 实例已经结束"); + return; + } + + //2.查到 此流程实例的 项目 + ProjectInst pi = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) + .eq(ProjectInst::getInstCode, instanceId) + .last(BizConst.LIMIT_1)); + + if (Objects.isNull(pi)) { + log.info("没有查到实例项目关联信息"); + return; + } + + Long projectId = pi.getProjectId(); + Project project = projectService.getById(projectId); + + if (Objects.isNull(project)) { + log.info("没有查到该项目信息"); + return; + } + + for(HistoricActivityInstance hai : hais){ + String assignee = hai.getAssignee(); + UserFullInfoDTO user = userInfoHelper.getUserFullInfoByEmployeeCode(assignee); + WflowEarlyWarningRecords records = new WflowEarlyWarningRecords(); + records.setAreaCode(project.getAreaCode()); + records.setBuildOrgCode(project.getBuildOrgCode()); + records.setBuildOrgName(project.getBuildOrgName()); + records.setCreateOn(LocalDateTime.now()); + records.setWarningTime(LocalDateTime.now()); + records.setInstStart(hai.getStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); + records.setInstType(pi.getInstType()); + records.setNoticeMethod(noticeMethod); + records.setNoticeContent(convertContent(noticeContent,project.getProjectName(),InstTypeEnum.getByCode(pi.getInstType()),timeout)); + records.setProjectName(project.getProjectName()); + records.setRuleType(WarningRuleTypeEnum.PROCESS_WARNING.getCode()); + records.setWarningUsername(Objects.nonNull(user) ? user.getUsername() : StringUtils.EMPTY); + records.setWarningEmployeecode(assignee); + earlyWarningRecordsService.save(records); + } + } + + /** + * 转换出 通知的内容 + * @param noticeContent + * @param projectName + * @param byCode + * @param timeout + * @return + */ + private String convertContent(String noticeContent, String projectName, InstTypeEnum instTypeEnum, Integer timeout) { + noticeContent = noticeContent.replace("{projectName}",projectName) + .replace("{flowType}",Objects.nonNull(instTypeEnum) ? instTypeEnum.getDesc() : "{flowType}") + .replace("{time}",String.valueOf(timeout)); + log.info("通知内容 :{}",noticeContent); + return noticeContent; + } +} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/EarlyWarningRecordsMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/EarlyWarningRecordsMapper.java new file mode 100644 index 0000000..5c3174f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/EarlyWarningRecordsMapper.java @@ -0,0 +1,17 @@ +package com.ningdatech.pmapi.sys.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.sys.model.entity.WflowEarlyWarningRecords; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author PoffyZhang + */ +@Repository +public interface EarlyWarningRecordsMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/WflowEarlyWarningRecords.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/WflowEarlyWarningRecords.java new file mode 100644 index 0000000..c130f7f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/WflowEarlyWarningRecords.java @@ -0,0 +1,108 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 实体类 + * 角色分配 + * 预警触发通知记录 + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@Accessors(chain = true) +@TableName("wflow_early_warning_records") +@ApiModel(value = "WflowEarlyWarningRecords", description = "预警触发通知记录") +public class WflowEarlyWarningRecords implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 区域CODE + */ + @ApiModelProperty(value = "区域CODE") + private String areaCode; + + /** + * 项目名称 + */ + @ApiModelProperty(value = "项目名称") + private String projectName; + + + /** + * 流程类型 + */ + @ApiModelProperty(value = "流程类型") + private Integer instType; + + /** + * 任务开始时间 + */ + @ApiModelProperty(value = "任务开始时间") + private LocalDateTime instStart; + + /** + * 预警时间 + */ + @ApiModelProperty(value = "预警时间") + private LocalDateTime warningTime; + + /** + * 通知人名 + */ + @ApiModelProperty(value = "通知人名") + private String warningUsername; + + /** + * 预警员工号 + */ + @ApiModelProperty(value = "预警员工号") + private String warningEmployeecode; + + /** + * 通知方式 + */ + @ApiModelProperty(value = "通知方式 0浙政钉 1短信 逗号分隔") + private String noticeMethod; + + /** + * 通知内容 + */ + @ApiModelProperty(value = "通知内容") + private String noticeContent; + + /** + * 申报单位 + */ + @ApiModelProperty(value = "申报单位CODE") + private String buildOrgCode; + @ApiModelProperty(value = "申报单位") + private String buildOrgName; + + /** + * 规则 + */ + @ApiModelProperty(value = "规则类型 1.流程预警规则 2.填报预警规则 3.实施监督") + private Integer ruleType; + + + private LocalDateTime createOn; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java new file mode 100644 index 0000000..6b8675b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java @@ -0,0 +1,106 @@ +package com.ningdatech.pmapi.sys.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 实体类 + * 角色分配 + * 预警触发通知记录 + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@Accessors(chain = true) +@ApiModel(value = "WflowEarlyWarningRecords", description = "预警触发通知记录") +public class WflowEarlyWarningRecordsVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + private Long id; + + /** + * 区域CODE + */ + @ApiModelProperty(value = "区域CODE") + private String areaCode; + + /** + * 项目名称 + */ + @ApiModelProperty(value = "项目名称") + private String projectName; + + + /** + * 流程类型 + */ + @ApiModelProperty(value = "流程类型") + private Integer instType; + + /** + * 任务开始时间 + */ + @ApiModelProperty(value = "任务开始时间") + private LocalDateTime instStart; + + /** + * 预警时间 + */ + @ApiModelProperty(value = "预警时间") + private LocalDateTime warningTime; + + /** + * 通知人名 + */ + @ApiModelProperty(value = "通知人名") + private String warningUsername; + + /** + * 预警员工号 + */ + @ApiModelProperty(value = "预警员工号") + private String warningEmployeecode; + + /** + * 通知方式 + */ + @ApiModelProperty(value = "通知方式 0浙政钉 1短信 逗号分隔") + private String noticeMethod; + + /** + * 通知内容 + */ + @ApiModelProperty(value = "通知内容") + private String noticeContent; + + /** + * 申报单位 + */ + @ApiModelProperty(value = "申报单位CODE") + private String buildOrgCode; + @ApiModelProperty(value = "申报单位") + private String buildOrgName; + + /** + * 规则 + */ + @ApiModelProperty(value = "规则类型 1.流程预警规则 2.填报预警规则 3.实施监督") + private Integer ruleType; + + + private LocalDateTime createOn; + private String createBy; + private LocalDateTime updateOn; + private String updateBy; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IEarlyWarningRecordsService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IEarlyWarningRecordsService.java new file mode 100644 index 0000000..34339ed --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IEarlyWarningRecordsService.java @@ -0,0 +1,11 @@ +package com.ningdatech.pmapi.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.sys.model.entity.WflowEarlyWarningRecords; + +/** + * @author PoffyZhang + */ +public interface IEarlyWarningRecordsService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java new file mode 100644 index 0000000..d952a55 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java @@ -0,0 +1,26 @@ +package com.ningdatech.pmapi.sys.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.sys.mapper.EarlyWarningRecordsMapper; +import com.ningdatech.pmapi.sys.model.entity.WflowEarlyWarningRecords; +import com.ningdatech.pmapi.sys.service.IEarlyWarningRecordsService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + + +/** + *

+ * 业务实现类 + * 菜单 + *

+ * + * @author ZPF + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class EarlyWarningRecordsServiceImpl extends ServiceImpl + implements IEarlyWarningRecordsService { + +} From 4a18a6f39ee02e2038f81e7468f9d5c3be8d9096 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 15:31:49 +0800 Subject: [PATCH 133/137] =?UTF-8?q?=E6=A0=87=E7=AD=BE=20=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=A0=E9=99=A4=20=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/portrait/manage/TagManage.java | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java index dbb16e5..75a7998 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java @@ -28,6 +28,7 @@ import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * @Classname TagManage @@ -130,32 +131,29 @@ public class TagManage { if(CollUtil.isEmpty(dtos)){ return "参入的标签为空"; } - UserInfoDetails user = LoginUserUtil.loginUserDetail(); - - Integer successNum = 0; + String projectCode = dtos.get(0).getProjectCode(); + Project project = projectService.getProjectByCode(projectCode); + VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!"); + projectTagService.remove(Wrappers.lambdaQuery(ProjectTag.class) + .eq(ProjectTag::getProjectCode,projectCode)); + //去重 + dtos = dtos.stream().distinct().collect(Collectors.toList()); for(TagToProjectDTO dto : dtos){ - String projectCode = dto.getProjectCode(); - Project project = projectService.getProjectByCode(projectCode); - VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!"); Long tagId = dto.getTagId(); Tag tag = tagService.getById(tagId); VUtils.isTrue(Objects.isNull(tag)).throwMessage("标签不存在!"); - VUtils.isTrue(!tag.getAreaCode().equals(project.getAreaCode())) .throwMessage("项目和标签不是一个区域的!"); - ProjectTag projectTag = new ProjectTag(); projectTag.setProjectCode(projectCode); projectTag.setTagId(tagId); projectTag.setCreateOn(LocalDateTime.now()); projectTag.setCreateBy(user.getUsername()); - if(projectTagService.save(projectTag)){ - successNum ++; - } + projectTagService.save(projectTag); } - return "保存成功" + successNum + "条"; + return "保存成功"; } public String removeTagToProject(TagToProjectDTO dto) { From ac5e10d26b47f7f7d449d1b4001b9d44fe34b511 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 15:38:46 +0800 Subject: [PATCH 134/137] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java index 9217caa..56aa2e6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java @@ -128,7 +128,7 @@ public class EarlyWarningListener { * 转换出 通知的内容 * @param noticeContent * @param projectName - * @param byCode + * @param instTypeEnum * @param timeout * @return */ From c80c7a3e7caec73e3a99f2002f6b7cca8033726e Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 16:15:09 +0800 Subject: [PATCH 135/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/controller/EarlyWarningController.java | 12 ++++++++ .../pmapi/sys/model/req/WarningListReq.java | 35 ++++++++++++++++++++++ .../sys/model/vo/WflowEarlyWarningRecordsVO.java | 24 ++++++++++++++- .../sys/service/IEarlyWarningRecordsService.java | 4 +++ .../impl/EarlyWarningRecordsServiceImpl.java | 34 +++++++++++++++++++++ 5 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/WarningListReq.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index a4dd3d8..84c9d30 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -1,6 +1,10 @@ package com.ningdatech.pmapi.sys.controller; +import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; +import com.ningdatech.pmapi.sys.model.req.WarningListReq; +import com.ningdatech.pmapi.sys.model.vo.WflowEarlyWarningRecordsVO; +import com.ningdatech.pmapi.sys.service.IEarlyWarningRecordsService; import com.wflow.bean.dto.WflowEarlyWarningDTO; import com.wflow.bean.vo.WflowEarlyWarningVO; import com.wflow.service.IEarlyWarningService; @@ -29,6 +33,8 @@ public class EarlyWarningController { private final IEarlyWarningService earlyWarningService; + private final IEarlyWarningRecordsService earlyWarningRecordsService; + @ApiOperation(value = "预警规则获取", notes = "预警规则获取") @GetMapping("/detail/{areaCode}") public List detail(@PathVariable String areaCode) { @@ -41,4 +47,10 @@ public class EarlyWarningController { public String save(@Validated @RequestBody WflowEarlyWarningDTO dto) { return earlyWarningService.saveByDto(dto); } + + @ApiOperation(value = "预警记录查询", notes = "预警记录查询") + @GetMapping("/records/{ruleType}") + public PageVo records(@PathVariable Integer ruleType, WarningListReq req) { + return earlyWarningRecordsService.records(ruleType,req); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/WarningListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/WarningListReq.java new file mode 100644 index 0000000..1e8e3a6 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/WarningListReq.java @@ -0,0 +1,35 @@ +package com.ningdatech.pmapi.sys.model.req; + +import com.ningdatech.basic.model.PagePo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.LocalDateTime; + +/** + *

+ * WarningListReq + *

+ * + * @author ZPF + * @since 00:32 2022/7/23 + */ +@Data +@ApiModel("预警记录查询参数类") +@EqualsAndHashCode(callSuper = true) +public class WarningListReq extends PagePo { + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位") + private String buildOrgName; + + @ApiModelProperty("提醒开始时间") + private LocalDateTime startTime; + + @ApiModelProperty("提醒结束时间") + private LocalDateTime endTime; +} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java index 6b8675b..e6d8b64 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java @@ -1,14 +1,17 @@ package com.ningdatech.pmapi.sys.model.vo; +import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; +import com.wflow.enums.WarningRuleTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; import lombok.experimental.Accessors; - +import org.apache.commons.lang3.StringUtils; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.Objects; /** * 实体类 @@ -103,4 +106,23 @@ public class WflowEarlyWarningRecordsVO implements Serializable { private LocalDateTime updateOn; private String updateBy; + public String getInstTypeName(){ + if(Objects.nonNull(this.instType)){ + InstTypeEnum instEnum = InstTypeEnum.getByCode(this.instType); + if(Objects.nonNull(instEnum)){ + return instEnum.getDesc(); + } + } + return StringUtils.EMPTY; + } + + public String getRuleTypeName(){ + if(Objects.nonNull(this.ruleType)){ + WarningRuleTypeEnum warningEnum = WarningRuleTypeEnum.checkByCode(this.instType); + if(Objects.nonNull(warningEnum)){ + return warningEnum.getDesc(); + } + } + return StringUtils.EMPTY; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IEarlyWarningRecordsService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IEarlyWarningRecordsService.java index 34339ed..8ebc57c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IEarlyWarningRecordsService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IEarlyWarningRecordsService.java @@ -1,11 +1,15 @@ package com.ningdatech.pmapi.sys.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.sys.model.entity.WflowEarlyWarningRecords; +import com.ningdatech.pmapi.sys.model.req.WarningListReq; +import com.ningdatech.pmapi.sys.model.vo.WflowEarlyWarningRecordsVO; /** * @author PoffyZhang */ public interface IEarlyWarningRecordsService extends IService { + PageVo records(Integer ruleType, WarningListReq req); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java index d952a55..af2411e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java @@ -1,13 +1,25 @@ package com.ningdatech.pmapi.sys.service.impl; +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.sys.mapper.EarlyWarningRecordsMapper; import com.ningdatech.pmapi.sys.model.entity.WflowEarlyWarningRecords; +import com.ningdatech.pmapi.sys.model.req.WarningListReq; +import com.ningdatech.pmapi.sys.model.vo.WflowEarlyWarningRecordsVO; import com.ningdatech.pmapi.sys.service.IEarlyWarningRecordsService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + /** *

@@ -23,4 +35,26 @@ import org.springframework.stereotype.Service; public class EarlyWarningRecordsServiceImpl extends ServiceImpl implements IEarlyWarningRecordsService { + @Override + public PageVo records(Integer ruleType, WarningListReq req) { + Page page = req.page(); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) + .eq(WflowEarlyWarningRecords::getRuleType, ruleType) + .like(StringUtils.isNotBlank(req.getProjectName()), WflowEarlyWarningRecords::getProjectName, req.getProjectName()) + .like(StringUtils.isNotBlank(req.getBuildOrgName()), WflowEarlyWarningRecords::getBuildOrgName, req.getBuildOrgName()) + .ge(Objects.nonNull(req.getStartTime()),WflowEarlyWarningRecords::getWarningTime,req.getStartTime()) + .le(Objects.nonNull(req.getEndTime()),WflowEarlyWarningRecords::getWarningTime,req.getEndTime()); + + this.page(page,wrapper); + + if(0L == page.getTotal()){ + return PageVo.empty(); + } + + List res = page.getRecords().stream() + .map(p -> BeanUtil.copyProperties(p,WflowEarlyWarningRecordsVO.class)) + .collect(Collectors.toList()); + + return PageVo.of(res,page.getTotal()); + } } From 10f1e6fa351732baf301cbb6d5dc01ef0e032414 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 16:26:53 +0800 Subject: [PATCH 136/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/EarlyWarningController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java index 84c9d30..9c36213 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -27,7 +27,7 @@ import java.util.List; @Validated @RestController @RequestMapping("/api/v1/sys/early-warning") -@Api(value = "EarlyWarning", tags = "系统管理-预警规则") +@Api(value = "EarlyWarning", tags = "预警管理") @RequiredArgsConstructor public class EarlyWarningController { From 005bf0a700f78d6eb117898ef120850cedc41ef7 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 16:44:05 +0800 Subject: [PATCH 137/137] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=AE=B0=E5=BD=95=20?= =?UTF-8?q?=E9=99=8D=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java index af2411e..99ab9a3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java @@ -43,7 +43,8 @@ public class EarlyWarningRecordsServiceImpl extends ServiceImpl