| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentExtend; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceWorkPlanSheet; |
| | | import org.jeecg.modules.eam.mapper.EamEquipmentExtendMapper; |
| | | import org.jeecg.modules.eam.mapper.EamEquipmentMapper; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentExtendService; |
| | | import org.jeecg.modules.eam.service.IEamThirdMaintenanceWorkPlanSheetService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | |
| | | @Resource |
| | | private EamEquipmentExtendMapper eamEquipmentExtendMapper; |
| | | |
| | | @Autowired |
| | | private IEamThirdMaintenanceWorkPlanSheetService eamThirdMaintenanceWorkPlanSheetService; |
| | | |
| | | @Resource |
| | | private EamEquipmentMapper eamEquipmentMapper; |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | entity.setNextThirdMaintenance(DateUtils.addYear(entity.getLatestThirdMaintenance(), entity.getThirdMaintenancePeriod())); |
| | | } |
| | | } |
| | | |
| | | EamEquipment eamEquipment = eamEquipmentMapper.selectById(equipmentId); |
| | | EamThirdMaintenanceWorkPlanSheet eamThirdMaintenanceWorkPlanSheet=new EamThirdMaintenanceWorkPlanSheet(); |
| | | BeanUtils.copyProperties(eamEquipment,eamThirdMaintenanceWorkPlanSheet); |
| | | eamThirdMaintenanceWorkPlanSheet.setId(null); |
| | | eamThirdMaintenanceWorkPlanSheet.setMaintenanceDate(eamEquipment.getLatestThirdMaintenance()); |
| | | eamThirdMaintenanceWorkPlanSheetService.add(eamThirdMaintenanceWorkPlanSheet); |
| | | |
| | | return this.getBaseMapper().updateById(entity) > 0; |
| | | } |
| | | |