maven
2025-08-06 108cd2008535e1fc703032cbe5bbbd3145e90ddc
src/main/java/com/ruoyi/measuringinstrumentledger/service/impl/MeasuringInstrumentLedgerRecordServiceImpl.java
@@ -35,6 +35,7 @@
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/**
 * @author :yys
@@ -88,14 +89,12 @@
        if(!measuringInstrumentLedgerRecord1.getValid().equals(measuringInstrumentLedgerRecord.getValid())){
            MeasuringInstrumentLedger measuringInstrumentLedger = measuringInstrumentLedgerMapper.selectById(measuringInstrumentLedgerRecord1.getMeasuringInstrumentLedgerId());
            if(measuringInstrumentLedger != null){
                measuringInstrumentLedger.setValid(measuringInstrumentLedgerRecord.getValid());
                measuringInstrumentLedger.setNextDate(new Date(measuringInstrumentLedger.getMostDate().getTime() + measuringInstrumentLedgerRecord.getValid() * 24 * 60 * 60 * 1000L));
            }
            measuringInstrumentLedgerMapper.updateById(measuringInstrumentLedger);
        }
        // 删除附件
        LambdaQueryWrapper<CommonFile> delWrapper = new LambdaQueryWrapper<>();
        delWrapper.eq(CommonFile::getCommonId, measuringInstrumentLedgerRecord.getId());
        commonFileMapper.delete(delWrapper);
        measuringInstrumentLedgerRecordMapper.updateById(measuringInstrumentLedgerRecord);
        // 记录附件绑定
        migrateTempFilesToFormal(measuringInstrumentLedgerRecord.getId(), measuringInstrumentLedgerRecord.getTempFileIds(), FileNameType.MEASURINGRecord.getValue());
        return true;