Browse Source

巡检计划可撤销

zhongwei
tyty 1 year ago
parent
commit
cc1669d244
  1. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java
  2. 19
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java
  3. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java
  4. 15
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java

2
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 class OperationalConstants {
public final static String APP_NAME = "hzims-operational"; public final static String APP_NAME = "hzims-operational-ty";

19
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; package com.hnac.hzinfo.inspect.plan.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType; 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.obj.utils.CodeUtils;
import com.hnac.hzinfo.inspect.plan.PlanContants; import com.hnac.hzinfo.inspect.plan.PlanContants;
import com.hnac.hzinfo.inspect.plan.entity.PlanEntity; 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.log.exception.ServiceException;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser; 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.api.R;
import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -32,11 +27,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; 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.LocalDate;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -113,7 +104,15 @@ public class PlanController extends BladeController {
public R<List<Long>> addAndChecked(@Valid @RequestBody PlanVO plan) { public R<List<Long>> addAndChecked(@Valid @RequestBody PlanVO plan) {
return R.data(planService.addAndChecked(plan)); return R.data(planService.addAndChecked(plan));
} }
/**
* 撤销
*/
@PostMapping("/revoke")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "撤销", notes = "传入plan")
public R<Boolean> revoke(@Valid @RequestBody Long planId) {
return R.data(planService.revoke(planId));
}
/** /**
* 删除 * 删除

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java

@ -59,4 +59,6 @@ public interface IPlanService extends BaseService<PlanEntity> {
Boolean deletePlanAndRelatives(Long id); Boolean deletePlanAndRelatives(Long id);
List<PlanOfflineVO> getPlans(List<Long> planIds); List<PlanOfflineVO> getPlans(List<Long> planIds);
Boolean revoke(Long planId);
} }

15
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java

@ -109,6 +109,21 @@ public class PlanServiceImpl extends BaseServiceImpl<PlanMapper, PlanEntity> imp
} }
/** /**
*巡检计划撤销
* @param planId
* @return
*/
@Override
public Boolean revoke(Long planId) {
boolean re;
LambdaUpdateWrapper<PlanEntity> uw = new UpdateWrapper<PlanEntity>().lambda();
uw.set(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_SUBMIT);
uw.eq(PlanEntity::getId, planId);
re = update(uw);
return re;
}
/**
* 保存巡检计划 * 保存巡检计划
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)

Loading…
Cancel
Save