| | |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.OrderCreationMethodEnum; |
| | | import org.jeecg.modules.eam.entity.EamInspectionOrder; |
| | | import org.jeecg.modules.eam.request.EamInspectionOrderRequest; |
| | | import org.jeecg.modules.eam.service.IEamInspectionOrderService; |
| | | import org.jeecg.modules.eam.service.IEamMaintenanceStandardService; |
| | | 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; |
| | |
| | | @RequestMapping("/eam/eamInspectionOrder") |
| | | @Slf4j |
| | | public class EamInspectionOrderController extends JeecgController<EamInspectionOrder, IEamInspectionOrderService> { |
| | | @Autowired |
| | | private IEamInspectionOrderService eamInspectionOrderService; |
| | | |
| | | @Autowired |
| | | private IEamInspectionOrderService eamInspectionOrderService; |
| | | @Autowired |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | @Autowired |
| | | private IEamMaintenanceStandardService eamMaintenanceStandardService; |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 查询点检工单基本信息 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询点检工单基本信息", notes = "查询点检工单基本信息") |
| | | @GetMapping(value = "/selectVoById") |
| | | public Result<?> selectVoById(@RequestParam(name="id") String id){ |
| | | return eamInspectionOrderService.selectVoById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param eamInspectionOrder |
| | | * @param eamInspectionOrderRequest |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "点检工单-添加") |
| | | @ApiOperation(value="点检工单-添加", notes="点检工单-添加") |
| | | //@RequiresPermissions("org.jeecg.modules:点检工单:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody EamInspectionOrder eamInspectionOrder) { |
| | | eamInspectionOrderService.save(eamInspectionOrder); |
| | | public Result<String> add(@RequestBody EamInspectionOrderRequest eamInspectionOrderRequest) { |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.INSPECTION_ORDER_CODE_RULE); |
| | | eamInspectionOrderRequest.setOrderNum(codeSeq); |
| | | eamInspectionOrderRequest.setCreationMethod(String.valueOf(OrderCreationMethodEnum.AUTO)); |
| | | eamInspectionOrderService.addInspectionOrder(eamInspectionOrderRequest); |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param eamInspectionOrder |
| | | * @param eamInspectionOrderRequest |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "点检工单-编辑") |
| | | @ApiOperation(value="点检工单-编辑", notes="点检工单-编辑") |
| | | //@RequiresPermissions("org.jeecg.modules:点检工单:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody EamInspectionOrder eamInspectionOrder) { |
| | | eamInspectionOrderService.updateById(eamInspectionOrder); |
| | | public Result<String> edit(@RequestBody EamInspectionOrderRequest eamInspectionOrderRequest) { |
| | | eamInspectionOrderService.editInspectionOrder(eamInspectionOrderRequest); |
| | | return Result.OK("编辑成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 领取点检工单 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "点检工单-领取点检工单") |
| | | @ApiOperation(value="点检工单-领取点检工单", notes="点检工单-领取点检工单") |
| | | @GetMapping(value = "/receiveInspectionOrder") |
| | | public Result<String> receiveInspectionOrder(@RequestParam(name="id") String id) { |
| | | eamInspectionOrderService.takeInspectionOrder(id); |
| | | return Result.OK("领取成功"); |
| | | } |
| | | |
| | | /** |
| | | * 作废点检工单 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "点检工单-作废点检工单") |
| | | @ApiOperation(value="点检工单-作废点检工单", notes="点检工单-作废点检工单") |
| | | @GetMapping(value = "/cancelInspectionOrder") |
| | | public Result<String> cancelInspectionOrder(@RequestParam(name="id") String id) { |
| | | eamInspectionOrderService.cancelInspectionOrder(id); |
| | | return Result.OK("作废成功"); |
| | | } |
| | | |
| | | /** |
| | | * 批量作废与领取 |
| | | * @param ids |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "点检工单-批量作废与领取") |
| | | @ApiOperation(value="点检工单-批量作废与领取", notes="点检工单-批量作废与领取") |
| | | @GetMapping(value = "/cancelOrReceive") |
| | | public Result<?> cancelOrReceive(@RequestParam(name="ids") String ids, @RequestParam(name="type") String type) { |
| | | return eamInspectionOrderService.batchCancelOrTakeInspectionOrder(ids, type); |
| | | } |
| | | |
| | | /** |
| | | * 点检流程 |
| | | * @param eamInspectionOrderRequest |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "点检流程") |
| | | @ApiOperation(value="点检工单-点检流程", notes="点检工单-点检流程") |
| | | @PostMapping("/approval") |
| | | public Result<?> approval(@RequestBody EamInspectionOrderRequest eamInspectionOrderRequest) { |
| | | return eamInspectionOrderService.inspectionProcess(eamInspectionOrderRequest); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |