| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.eam.constant.MaintenanceCategoryEnum; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentExtend; |
| | | import org.jeecg.modules.eam.mapper.EamEquipmentExtendMapper; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentExtendService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @Description: 设备台账扩展表 |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateEquipmentMaintenanceStatus(String equipmentId, String status) { |
| | | public boolean updateEquipmentMaintenanceStatus(String equipmentId, String status, String maintenanceCategory, Date date) { |
| | | EamEquipmentExtend entity = eamEquipmentExtendMapper.selectById(equipmentId); |
| | | if (entity == null) { |
| | | return false; |
| | | } |
| | | |
| | | entity.setMaintenanceStatus(status); |
| | | if (Objects.nonNull(date)) { |
| | | if (MaintenanceCategoryEnum.SECOND_MAINTENANCE.name().equals(maintenanceCategory)) { |
| | | entity.setLatestSecondMaintenance(new Date()); |
| | | entity.setNextSecondMaintenance(date); |
| | | }else if (MaintenanceCategoryEnum.THIRD_MAINTENANCE.name().equals(maintenanceCategory)) { |
| | | entity.setLatestThirdMaintenance(new Date()); |
| | | entity.setNextThirdMaintenance(date); |
| | | } |
| | | } |
| | | eamEquipmentExtendMapper.updateById(entity); |
| | | return true; |
| | | } |