| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.ReportRepairEnum; |
| | | import org.jeecg.modules.eam.entity.EamRepairOrder; |
| | | import org.jeecg.modules.eam.entity.EamReportRepair; |
| | | import org.jeecg.modules.eam.request.EamRepairOrderQuery; |
| | | import org.jeecg.modules.eam.request.EamRepairOrderRequest; |
| | | import org.jeecg.modules.eam.request.EamRepairOrderResponse; |
| | | import org.jeecg.modules.eam.service.IEamRepairOrderService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.service.IEamReportRepairService; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCommonService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import io.swagger.annotations.Api; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 执行维修 |
| | | * 我的待办 执行/审批 |
| | | * |
| | | * @param eamRepairOrder |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "维修工单-执行") |
| | | @ApiOperation(value = "维修工单-执行", notes = "维修工单-执行") |
| | | @AutoLog(value = "维修工单-执行/审批") |
| | | @ApiOperation(value = "维修工单-执行/审批", notes = "维修工单-执行/审批") |
| | | @PostMapping(value = "/perform") |
| | | public Result<?> perform(@RequestBody EamRepairOrder eamRepairOrder) { |
| | | |
| | | // eamRepairOrderService.updateById(eamRepairOrder); |
| | | return Result.OK("执行成功!"); |
| | | public Result<?> perform(@RequestBody EamRepairOrderRequest request) { |
| | | if (request == null) { |
| | | return Result.error("审批的对象不能为空!"); |
| | | } |
| | | // 检查请求参数 |
| | | if (StrUtil.isBlank(request.getTaskId()) || StrUtil.isBlank(request.getDataId()) || StrUtil.isBlank(request.getInstanceId())) { |
| | | return Result.error("审批任务错误或不存在!"); |
| | | } |
| | | EamRepairOrder b = eamRepairOrderService.perform(request); |
| | | if(b == null) { |
| | | return Result.error("操作失败!"); |
| | | } |
| | | return Result.OK("操作成功!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "维修工单-通过id查询", notes = "维修工单-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | EamRepairOrder eamRepairOrder = eamRepairOrderService.getById(id); |
| | | EamRepairOrderResponse eamRepairOrder = eamRepairOrderService.findById(id); |
| | | return Result.OK(eamRepairOrder); |
| | | } |
| | | |