| | |
| | | package com.ruoyi.inspect.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | |
| | | || StringUtils.isBlank(report.getSealNames())) { |
| | | throw new ErrorException("报告批准信息不完整,无法生成用印台账"); |
| | | } |
| | | // 报告退回后重新批准仍属于同一份报告;保留首次批准生成的独立用印记录, |
| | | // 避免唯一键冲突导致重新批准事务整体回滚。 |
| | | if (ledgerMapper.selectCount(Wrappers.<SealUsageLedger>lambdaQuery() |
| | | .eq(SealUsageLedger::getReportId, report.getId())) > 0) { |
| | | return; |
| | | } |
| | | User ratifyUser = userMapper.selectById(report.getRatifyUserId()); |
| | | if (ratifyUser == null || StringUtils.isBlank(ratifyUser.getName())) { |
| | | throw new ErrorException("找不到报告批准人,无法生成用印台账"); |