From cc1669d24458e5cfb6b198a2e162ca6d5ca4d0d4 Mon Sep 17 00:00:00 2001 From: tyty Date: Tue, 22 Aug 2023 11:22:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E8=AE=A1=E5=88=92=E5=8F=AF?= =?UTF-8?q?=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/operational/OperationalConstants.java | 2 +- .../inspect/plan/controller/PlanController.java | 19 +++++++++---------- .../hzinfo/inspect/plan/service/IPlanService.java | 2 ++ .../inspect/plan/service/impl/PlanServiceImpl.java | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java index 93810fc..16f31e5 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java @@ -4,7 +4,7 @@ import lombok.Getter; public class OperationalConstants { - public final static String APP_NAME = "hzims-operational"; + public final static String APP_NAME = "hzims-operational-ty"; diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java index df2452c..bc04f66 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java @@ -1,15 +1,11 @@ package com.hnac.hzinfo.inspect.plan.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; -import com.hnac.hzinfo.inspect.Constants; -import com.hnac.hzinfo.inspect.invalid.DictInvalid; import com.hnac.hzinfo.inspect.obj.utils.CodeUtils; import com.hnac.hzinfo.inspect.plan.PlanContants; import com.hnac.hzinfo.inspect.plan.entity.PlanEntity; @@ -24,7 +20,6 @@ import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.BladeUser; -import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.utils.Func; @@ -32,11 +27,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.Size; import java.time.LocalDate; -import java.time.LocalDateTime; import java.util.List; @@ -113,7 +104,15 @@ public class PlanController extends BladeController { public R> addAndChecked(@Valid @RequestBody PlanVO plan) { return R.data(planService.addAndChecked(plan)); } - + /** + * 撤销 + */ + @PostMapping("/revoke") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "撤销", notes = "传入plan") + public R revoke(@Valid @RequestBody Long planId) { + return R.data(planService.revoke(planId)); + } /** * 删除 diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java index e3ce4ec..bf491d2 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java @@ -59,4 +59,6 @@ public interface IPlanService extends BaseService { Boolean deletePlanAndRelatives(Long id); List getPlans(List planIds); + + Boolean revoke(Long planId); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java index 6c1b0b7..81ae5a8 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java @@ -109,6 +109,21 @@ public class PlanServiceImpl extends BaseServiceImpl imp } /** + *巡检计划撤销 + * @param planId + * @return + */ + @Override + public Boolean revoke(Long planId) { + boolean re; + LambdaUpdateWrapper uw = new UpdateWrapper().lambda(); + uw.set(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_SUBMIT); + uw.eq(PlanEntity::getId, planId); + re = update(uw); + return re; + } + + /** * 保存巡检计划 */ @Transactional(rollbackFor = Exception.class)