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..00ca26a 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,17 +1,12 @@ 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; import com.hnac.hzinfo.inspect.plan.service.IPlanObjectTemplateService; import com.hnac.hzinfo.inspect.plan.service.IPlanService; @@ -24,7 +19,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 +26,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; @@ -83,9 +73,9 @@ public class PlanController extends BladeController { if(plan.getEndTime()!=null){ queryWrapper.le(PlanEntity::getEndTime,plan.getEndTime()); } - if(plan.getStatus()==null){ - queryWrapper.ne(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_AUTH.getStatus()); - } +// if(plan.getStatus()==null){ +// queryWrapper.ne(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_AUTH.getStatus()); +// } if(plan.getCreateDept()!=null){ queryWrapper.eq(PlanEntity::getCreateDept,plan.getCreateDept()); } @@ -113,7 +103,15 @@ public class PlanController extends BladeController { public R> addAndChecked(@Valid @RequestBody PlanVO plan) { return R.data(planService.addAndChecked(plan)); } - + /** + * 撤销 + */ + @GetMapping("/revoke") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "撤销", notes = "传入plan") + public R revoke(@RequestParam 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..b060ace 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.getStatus()); + uw.eq(PlanEntity::getId, planId); + re = update(uw); + return re; + } + + /** * 保存巡检计划 */ @Transactional(rollbackFor = Exception.class) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java index 92435c4..13b9364 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java @@ -80,13 +80,13 @@ public class OperAccessStatisticsController extends BladeController { * 分页 */ @ApiLog - @PostMapping("/list") + @GetMapping("/list") @ApiOperationSupport(order = 50) @ApiOperation(value = "分页 查询参数:pid,taskId,manager") @OperationAnnotation(moduleName = "检修管理",title = "检修记录",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页查询检修记录列表") - public R> list(@RequestBody OperAccessStatisticsDTO req, Query query) { + public R> list(OperAccessStatisticsDTO req, Query query) { return service.list(req, Condition.getPage(query)); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java index 9e40bf2..de3219d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java @@ -87,6 +87,7 @@ public class OperAccessTaskController extends BladeController { return service.detail(id); } + /** * 分页 */ @@ -100,7 +101,22 @@ public class OperAccessTaskController extends BladeController { public R> list(OperAccessTaskDTO req, Query query) { return service.list(req, query); } - + /** + * 分页 + */ + @ApiLog + @PostMapping("/listByStatus") + @ApiOperationSupport(order = 50) + @OperationAnnotation(moduleName = "检修管理",title = "检修任务",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "分页查询我的检修任务列表") + @ApiOperation(value = "分页 查询参数:name,code,handler,status,planId,planCode") + public R> list(@RequestBody OperAccessTaskDTO req) { + Query query=new Query(); + query.setCurrent(req.getCurrent()); + query.setSize(req.getSize()); + return service.listByStatus(req, query); + } /** * 获取检修台账 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java index ae0d3b3..a3a3508 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java @@ -21,7 +21,8 @@ public class OperAccessTaskDTO extends OperAccessTaskEntity { @ApiModelProperty(value = "创建机构集合") private List deptIds; - + @ApiModelProperty(value = "ids") + private List ids; @ApiModelProperty(value = "工作流Key") private String procDefId; @@ -39,4 +40,8 @@ public class OperAccessTaskDTO extends OperAccessTaskEntity { @ApiModelProperty("结束时间") private String endTime; + @ApiModelProperty("当前页") + private Integer current; + @ApiModelProperty("每页的数量") + private Integer size; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml index 994ab75..e390f35 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml @@ -28,12 +28,6 @@ JOIN hzims_oper_access_task OT ON OS.`TASK_ID` = OT.`ID` WHERE OS.IS_DELETED = 0 - - and OS.id in - - #{item} - - and OT.`NAME` like concat('%',#{dto.taskName},'%') diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java index b9ca2b3..b45f846 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java @@ -28,6 +28,9 @@ public interface OperAccessTaskMapper extends UserDataScopeBaseMapper pageCondition(IPage page, @Param("req") OperAccessTaskDTO req); + + List pageConditionByStatus(IPage page, @Param("req") OperAccessTaskDTO req); + List selectByEmCode(String emCode,List list); @SqlParser(filter = true) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml index 640690d..6efe664 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml @@ -65,6 +65,7 @@ AND t.`CODE` LIKE CONCAT('%',#{req.code},'%') + AND t.`HANDLER`=#{req.handler} @@ -91,7 +92,48 @@ ORDER BY t.create_time DESC - +