tuqin
2026-09-24 034f720f0bbc7f253c15613c28d994d7abf401eb
src/main/java/com/ruoyi/measuringinstrumentledger/service/impl/MeasuringInstrumentLedgerServiceImpl.java
@@ -76,7 +76,8 @@
        if(measuringInstrumentLedger == null) {
            return false;
        }
        SysUser sysUser = sysUserMapper.selectUserById(measuringInstrumentLedger.getUserId());
        Long nameUserId = measuringInstrumentLedger.getUserId() != null ? measuringInstrumentLedger.getUserId() : req.getUserId();
        SysUser sysUser = nameUserId == null ? null : sysUserMapper.selectUserById(nameUserId);
        measuringInstrumentLedger.setValid(req.getValid());
        measuringInstrumentLedger.setMostDate(req.getRecordDate());
        measuringInstrumentLedger.setNextDate(new Date(req.getRecordDate().getTime() + 1000L * 60 * 60 * 24 * req.getValid()));
@@ -87,7 +88,7 @@
            measuringInstrumentLedgerRecord.setEntryDate(req.getEntryDate());
            measuringInstrumentLedgerRecord.setValid(req.getValid());
            measuringInstrumentLedgerRecord.setUserId(req.getUserId());
            measuringInstrumentLedgerRecord.setUserName(sysUser.getUserName());
            measuringInstrumentLedgerRecord.setUserName(sysUser == null ? null : sysUser.getUserName());
            measuringInstrumentLedgerRecordMapper.insert(measuringInstrumentLedgerRecord);
            // 台账绑定一次
//            if(!CollectionUtils.isEmpty(req.getTempFileIds())){
@@ -200,4 +201,10 @@
        return true;
    }
    @Override
    public List<MeasuringInstrumentLedger> listOptions() {
        Long tenantId = SecurityUtils.getLoginUser().getTenantId();
        return measuringInstrumentLedgerMapper.listOptions(tenantId);
    }
}