zss
2024-09-02 a42e0989485009e7196a8e8a7d25473b3d827cff
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java
@@ -21,6 +21,7 @@
import com.yuanchu.mom.mapper.UserMapper;
import com.yuanchu.mom.pojo.InsOrder;
import com.yuanchu.mom.pojo.InsReport;
import com.yuanchu.mom.pojo.User;
import com.yuanchu.mom.service.InsReportService;
import com.yuanchu.mom.utils.QueryWrappers;
import com.yuanchu.mom.vo.Result;
@@ -81,7 +82,19 @@
        map.put("head", PrintChina.printChina(ReportPageDto.class));
        Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("pageInsReport");
        if (map1.get("look") == 1) reportPageDto.setCreateUser(map1.get("userId"));
        map.put("body", insReportMapper.pageInsReport(page, QueryWrappers.queryWrappers(reportPageDto)));
        User user = userMapper.selectById(map1.get("userId"));//当前登录的人
        //获取当前人所属实验室id
        String departLimsId = user.getDepartLimsId();
        String laboratory = null;
        if (ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) {
            String[] split = departLimsId.split(",");
            //查询对应架构名称(通信实验室,电力实验室,检测办)
            String departLims = insOrderMapper.seldepLimsId(Integer.parseInt(split[split.length - 1]));
            if (departLims.contains("实验室")) {
                laboratory = departLims;
            }
        }
        map.put("body", insReportMapper.pageInsReport(page, QueryWrappers.queryWrappers(reportPageDto),laboratory));
        return map;
    }
@@ -158,7 +171,7 @@
    //批准
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int ratifyReport(Integer id, Integer isRatify, String ratifyTell) {
    public int ratifyReport(Integer id, Integer isRatify, String ratifyTell,String sealUrl) {
        InsReport insReport = insReportMapper.selectById(id);
        insReport.setIsRatify(isRatify);
        if (ObjectUtils.isNotEmpty(ratifyTell)) {
@@ -179,14 +192,14 @@
            throw new ErrorException("找不到批准人的签名");
        }
        //获取场所的报告专用章
        String sealUrl;
       /* String sealUrl;
        try {
            String laboratory = insOrderMapper.selectById(insReport.getInsOrderId()).getLaboratory();
            sealUrl = insReportMapper.getLaboratoryByName(laboratory);
        } catch (Exception e) {
            throw new ErrorException("找不到报告专用章");
        }
        if (sealUrl == null) throw new ErrorException("找不到报告专用章");
        if (sealUrl == null) throw new ErrorException("找不到报告专用章");*/
        //系统生成报告地址
        String url = insReport.getUrl();
        //手动上传报告地址
@@ -198,20 +211,6 @@
            put("seal2", Pictures.ofLocal(imgUrl + "/" + sealUrl).create());
        }}, finalUrl);
        wordToPdf(finalUrl, sealUrl);
       /* String replace = finalUrl.replace(".docx", ".pdf");
        CompletableFuture.supplyAsync(() -> {
            try {
                stamperCheckMarkPDF(replace,replace,sealUrl);
                return null;
            } catch (Exception e) {
                throw new ErrorException("骑缝章插入失败");
            }
        }).thenAccept(res -> {
        }).exceptionally(e -> {
            e.printStackTrace();
            return null;
        });*/
        InsOrder insOrder = new InsOrder();
        insOrder.setId(insReportMapper.selectById(id).getInsOrderId());