| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | |
| | | import org.jeecg.modules.eam.dto.EamReportProductHazardsDto; |
| | | import org.jeecg.modules.eam.dto.EamReportRepairDto; |
| | | import org.jeecg.modules.eam.entity.EamReportProductHazards; |
| | | import org.jeecg.modules.eam.entity.EamReportRepair; |
| | | import org.jeecg.modules.eam.request.EamReportProductHazardsQuery; |
| | | import org.jeecg.modules.eam.service.IEamReportProductHazardsService; |
| | | |
| | |
| | | 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.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | public class EamReportProductHazardsController extends JeecgController<EamReportProductHazards, IEamReportProductHazardsService> { |
| | | @Autowired |
| | | private IEamReportProductHazardsService eamReportProductHazardsService; |
| | | |
| | | @Autowired |
| | | private IEamReportRepairService eamReportRepairService; |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | |
| | | eamReportProductHazardsService.save(eamReportProductHazards); |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 操作工提交-发起流程 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "设备事故登记表-提交", notes = "设备事故登记表-提交") |
| | | @GetMapping(value = "/submit") |
| | | public Result<?> submit(String id){ |
| | | // 校验领取权限 |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (!BusinessCodeConst.PCR0001.equals(user.getPost())) { |
| | | return Result.error("提交失败,没有提交权限!,需操作工提交"); |
| | | } |
| | | eamReportProductHazardsService.submit(id); |
| | | return Result.OK("提交成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 我的待办 执行/审批 |
| | | * |
| | | * @param eamReportProductHazardsDto |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设备事故登记表-执行/审批") |
| | | @ApiOperation(value = "设备事故登记表-执行/审批", notes = "设备事故登记表-执行/审批") |
| | | @PostMapping(value = "/perform") |
| | | public Result<?> audit(@RequestBody EamReportProductHazardsDto eamReportProductHazardsDto){ |
| | | if (eamReportProductHazardsDto == null) { |
| | | return Result.error("审批的对象不能为空!"); |
| | | } |
| | | // 检查请求参数 |
| | | if (StrUtil.isBlank(eamReportProductHazardsDto.getTaskId()) || StrUtil.isBlank(eamReportProductHazardsDto.getDataId()) || StrUtil.isBlank(eamReportProductHazardsDto.getInstanceId())) { |
| | | return Result.error("审批任务错误或不存在!"); |
| | | } |
| | | return eamReportProductHazardsService.audit(eamReportProductHazardsDto); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | |
| | | if(eamReportProductHazards==null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | EamReportRepair eamReportRepair=eamReportRepairService.getById(eamReportProductHazards.getReportId()); |
| | | eamReportProductHazards.setBatchNumber(eamReportRepair.getBatchNumber()); |
| | | eamReportProductHazards.setProcessingPart(eamReportRepair.getProcessingPart()); |
| | | eamReportProductHazards.setQuantity(eamReportRepair.getQuantity()); |
| | | return Result.OK(eamReportProductHazards); |
| | | } |
| | | |