| | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.DailyMaintenanceOrder; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.MaintenanceThreeAcceptance; |
| | | import org.jeecg.modules.eam.service.IDailyMaintenanceOrderService; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IMaintenanceThreeAcceptanceService; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | |
| | | @Autowired |
| | | private IDailyMaintenanceOrderService dailyMaintenanceOrderService; |
| | | |
| | | @Autowired |
| | | private IEamEquipmentService equipmentService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = sysUser.getId(); |
| | | String maintenanceOrderId = maintenanceThreeAcceptance.getMaintenanceOrderId(); |
| | | String equipmentId = maintenanceThreeAcceptance.getEquipmentId(); |
| | | int maintenanceCycle = Integer.parseInt(maintenanceThreeAcceptance.getMaintenanceCycle()); |
| | | List<MaintenanceThreeAcceptance> maintenanceThreeAcceptances = maintenanceThreeAcceptance.getMaintenanceThreeAcceptances(); |
| | | String checkStatus = "1";//三级保养验收状态(1通过,2未通过) |
| | | for (MaintenanceThreeAcceptance threeAcceptance : maintenanceThreeAcceptances) { |
| | |
| | | maintenanceOrder.setInspectDate(new Date()); |
| | | // maintenanceOrder.setStatus("8"); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | |
| | | if("1".equals(checkStatus)){ |
| | | Equipment equipment = equipmentService.getById(equipmentId); |
| | | Date dayAfter = DateUtils.getYearAfter(new Date(), maintenanceCycle); |
| | | equipment.setNextThirdMaintenanceTime(dayAfter); |
| | | equipment.setThirdMaintenanceTime(new Date()); |
| | | equipmentService.updateById(equipment); |
| | | } |
| | | |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |