lyh
昨天 0d06048c5d560e301bf17fad476975c8ffffcb56
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentExtendServiceImpl.java
@@ -4,9 +4,15 @@
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;
@@ -28,6 +34,13 @@
    @Resource
    private EamEquipmentExtendMapper eamEquipmentExtendMapper;
    @Autowired
    private IEamThirdMaintenanceWorkPlanSheetService eamThirdMaintenanceWorkPlanSheetService;
    @Resource
    private EamEquipmentMapper eamEquipmentMapper;
    @Override
    @Transactional(rollbackFor = Exception.class)
@@ -98,6 +111,10 @@
                entity.setNextThirdMaintenance(DateUtils.addYear(entity.getLatestThirdMaintenance(), entity.getThirdMaintenancePeriod()));
            }
        }
        EamEquipment eamEquipment = eamEquipmentMapper.selectById(equipmentId);
        eamThirdMaintenanceWorkPlanSheetService.createMaintenancePlan(eamEquipment, entity.getLatestThirdMaintenance());
        eamThirdMaintenanceWorkPlanSheetService.createMaintenancePlan(eamEquipment, entity.getNextThirdMaintenance());
        return this.getBaseMapper().updateById(entity) > 0;
    }