inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java
@@ -41,6 +41,7 @@
import org.apache.logging.log4j.util.Strings;
import org.apache.poi.xwpf.usermodel.*;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service;
@@ -84,6 +85,9 @@
    @Resource
    private InsReportMapper insReportMapper;
    @Autowired
    ProcessReportMapper1 processReportMapper;
    @Value("${wordUrl}")
    private String wordUrl;
@@ -226,6 +230,7 @@
            insReport.setState(0);//提交状态改为待提交
            return insReportMapper.updateById(insReport);
        }
        insReportMapper.updateById(insReport);
        //获取批准人的签名地址
        String signatureUrl;
        try {
@@ -244,7 +249,19 @@
            put("seal2", Pictures.ofLocal(imgUrl + "/" + sealUrl).create());
        }}, finalUrl);
        wordToPdf(finalUrl, sealUrl);
        return insReportMapper.updateById(insReport);
        /*新增cnas7.8报告结果*/
        ProcessReport processReport = new ProcessReport();
        processReport.setInsReportCode(insReport.getCode());
        processReportMapper.insert(processReport);
        /*检验单结束*/
        List<InsReport> insReports = insReportMapper.selectList(Wrappers.<InsReport>lambdaQuery().eq(InsReport::getInsOrderId, insReport.getInsOrderId()));
        List<Integer> list = insReports.stream().map(InsReport::getIsRatify).distinct().collect(Collectors.toList());
        if (list.size()==1 && list.contains(1)){
            InsOrder insOrder = insOrderMapper.selectById(insReport.getInsOrderId());
            insOrder.setState(4);
            insOrderMapper.updateById(insOrder);
        }
        return 0;
    }
    @Override
@@ -360,7 +377,9 @@
            if (insReportDto.getState() == 1) {
                List<InsReportDto1> insReportDto1s = insReportDto.getInsReportDto1s();
                for (InsReportDto1 insReportDto1 : insReportDto1s) {
                    wordUtils.generateReport(insReportDto.getId(), insReportDto1);
                    if (ObjectUtils.isNotEmpty(insReportDto1.getInsReportDto2s())){
                        wordUtils.generateReport(insReportDto.getId(), insReportDto1);
                    }
                }
            }
        } else {