| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.OrderCreationMethodEnum; |
| | | import org.jeecg.modules.eam.constant.WeekMaintenanceStatusEnum; |
| | | import org.jeecg.modules.eam.entity.EamWeekMaintenanceOrder; |
| | | import org.jeecg.modules.eam.request.EamWeekMaintenanceQuery; |
| | |
| | | } |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.WEEK_MAINTENANCE_CODE_RULE); |
| | | request.setOrderNum(codeSeq); |
| | | request.setCreationMethod(OrderCreationMethodEnum.MANUAL.name()); |
| | | boolean b = eamWeekMaintenanceOrderService.addWeekMaintenance(request); |
| | | if (!b) { |
| | | return Result.error("添加失败!"); |
| | |
| | | EamWeekMaintenanceOrder eamWeekMaintenanceOrder = eamWeekMaintenanceOrderService.getById(id); |
| | | return Result.OK(eamWeekMaintenanceOrder); |
| | | } |
| | | |
| | | /** |
| | | * 我的待办,审批动作 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "周保工单-执行操作", notes = "周保工单-执行操作") |
| | | @PutMapping(value = "/approval") |
| | | public Result<?> approval(@RequestBody EamWeekMaintenanceRequest request) { |
| | | if (request == null) { |
| | | return Result.error("审批的对象不能为空!"); |
| | | } |
| | | if (CollectionUtil.isEmpty(request.getTableDetailList())) { |
| | | return Result.error("保养项不能为空!"); |
| | | } |
| | | // 检查请求参数 |
| | | if (StrUtil.isBlank(request.getTaskId()) || StrUtil.isBlank(request.getDataId()) || StrUtil.isBlank(request.getInstanceId())) { |
| | | return Result.error("审批任务错误或不存在!"); |
| | | } |
| | | EamWeekMaintenanceOrder b = eamWeekMaintenanceOrderService.approval(request); |
| | | if(b == null) { |
| | | return Result.error("操作失败!"); |
| | | } |
| | | return Result.ok("操作成功!"); |
| | | } |
| | | } |