| | |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.constant.MaintenanceStatusEnum; |
| | | import org.jeecg.modules.eam.constant.WeekMaintenanceStatusEnum; |
| | | import org.jeecg.modules.eam.constant.OrderCreationMethodEnum; |
| | | import org.jeecg.modules.eam.entity.EamWeekMaintenanceOrder; |
| | | import org.jeecg.modules.eam.entity.EamWeekMaintenanceOrderDetail; |
| | |
| | | order.setOperator(request.getOperator()); |
| | | order.setRemark(request.getRemark()); |
| | | //状态初始化 |
| | | order.setMaintenanceStatus(MaintenanceStatusEnum.WAIT_MAINTENANCE.name()); |
| | | order.setMaintenanceStatus(WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name()); |
| | | order.setCreationMethod(OrderCreationMethodEnum.MANUAL.name()); |
| | | //删除标记 |
| | | order.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | |
| | | if(entity == null){ |
| | | throw new JeecgBootException("编辑的数据已删除,请刷新重试!"); |
| | | } |
| | | if(!MaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())){ |
| | | if(!WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())){ |
| | | throw new JeecgBootException("只有待保养状态的数据才可编辑!"); |
| | | } |
| | | entity.setMaintenanceDate(request.getMaintenanceDate()); |
| | |
| | | if(entity == null) { |
| | | throw new JeecgBootException("要领取的工单不存在,请刷新重试!"); |
| | | } |
| | | if(!MaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { |
| | | if(!WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { |
| | | throw new JeecgBootException("该工单已进行过领取!"); |
| | | } |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | entity.setOperator(sysUser.getUsername()); |
| | | entity.setMaintenanceStatus(MaintenanceStatusEnum.UNDER_MAINTENANCE.name()); |
| | | entity.setMaintenanceStatus(WeekMaintenanceStatusEnum.UNDER_MAINTENANCE.name()); |
| | | eamWeekMaintenanceOrderMapper.updateById(entity); |
| | | |
| | | //启动流程 |