liding
3 小时以前 51786b723d0a91d11476776d9ce50af7994dc4bd
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsReportServiceImpl.java
@@ -6,6 +6,7 @@
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.aspose.words.FontSettings;
import com.aspose.words.License;
import com.aspose.words.SaveFormat;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -87,6 +88,12 @@
@Slf4j
public class InsReportServiceImpl extends ServiceImpl<InsReportMapper, InsReport>
        implements InsReportService {
    static {
        // Linux 服务器缺少中文字体,报告转 PDF 时中文会变成方块;将模板字体映射到 Noto CJK 兜底。
        FontSettings.addFontSubstitutes("宋体", "Noto Serif CJK SC");
        FontSettings.addFontSubstitutes("黑体", "Noto Sans CJK SC");
    }
    private static final int DETECTION_REPORT = 0;
    private static final int INSPECTION_REPORT = 1;
@@ -307,6 +314,9 @@
            if (userId == null) {
                throw new ErrorException("缺少批准人");
            }
            if (Objects.equals(insReport.getExamineUserId(), userId)) {
                throw new ErrorException("审核人和批准人不能为同一人,请重新选择批准人");
            }
        }
        insReport.setRatifyUserId(userId);//批准人
        //获取审核人的签名地址
@@ -389,6 +399,9 @@
    @Transactional(rollbackFor = Exception.class)
    public int ratifyReport(Integer id, Integer isRatify, String ratifyTell) {
        InsReport insReport = insReportMapper.selectById(id);
        if (Objects.equals(insReport.getExamineUserId(), SecurityUtils.getUserId().intValue())) {
            throw new ErrorException("审核人和批准人不能为同一人,请重新选择批准人");
        }
        insReport.setIsRatify(isRatify);
        if (ObjectUtils.isNotEmpty(ratifyTell)) {
            insReport.setRatifyTell(ratifyTell);