From 08cad817f057c4a10e1ea59e362fbb492f3381df Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期三, 22 五月 2024 16:14:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java | 33 +++++++++++++++++++++++++++++---- 1 files changed, 29 insertions(+), 4 deletions(-) diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java index 52eded4..ea79da8 100644 --- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java +++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java @@ -95,7 +95,12 @@ insReport.setWriteUserId(getLook.selectPowerByMethodAndUserId(null).get("userId"));//鎻愪氦浜� insReport.setWriteTime(LocalDateTime.now());//鎻愪氦鏃堕棿 //鑾峰彇鎻愪氦浜虹殑绛惧悕鍦板潃 - String signatureUrl = userMapper.selectById(insReport.getWriteUserId()).getSignatureUrl(); + String signatureUrl; + try { + signatureUrl = userMapper.selectById(insReport.getWriteUserId()).getSignatureUrl(); + }catch (Exception e){ + throw new ErrorException("鎵句笉鍒扮紪鍒朵汉鐨勭鍚�"); + } //绯荤粺鐢熸垚鎶ュ憡鍦板潃 String url = insReport.getUrl(); //鎵嬪姩涓婁紶鎶ュ憡鍦板潃 @@ -122,7 +127,12 @@ return insReportMapper.updateById(insReport); } //鑾峰彇瀹℃牳浜虹殑绛惧悕鍦板潃 - String signatureUrl = userMapper.selectById(insReport.getExamineUserId()).getSignatureUrl(); + String signatureUrl; + try { + signatureUrl = userMapper.selectById(insReport.getExamineUserId()).getSignatureUrl(); + }catch (Exception e){ + throw new ErrorException("鎵句笉鍒板鏍镐汉鐨勭鍚�"); + } //绯荤粺鐢熸垚鎶ュ憡鍦板潃 String url = insReport.getUrl(); //鎵嬪姩涓婁紶鎶ュ憡鍦板潃 @@ -149,14 +159,29 @@ insReport.setState(0);//鎻愪氦鐘舵�佹敼涓哄緟鎻愪氦 return insReportMapper.updateById(insReport); } - //鑾峰彇瀹℃牳浜虹殑绛惧悕鍦板潃 - String signatureUrl = userMapper.selectById(insReport.getRatifyUserId()).getSignatureUrl(); + //鑾峰彇鎵瑰噯浜虹殑绛惧悕鍦板潃 + String signatureUrl; + try { + signatureUrl = userMapper.selectById(insReport.getRatifyUserId()).getSignatureUrl(); + }catch (Exception e){ + throw new ErrorException("鎵句笉鍒版壒鍑嗕汉鐨勭鍚�"); + } + 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("鎵句笉鍒版姤鍛婁笓鐢ㄧ珷"); //绯荤粺鐢熸垚鎶ュ憡鍦板潃 String url = insReport.getUrl(); //鎵嬪姩涓婁紶鎶ュ憡鍦板潃 String urlS = insReport.getUrlS(); wordInsertUrl(new HashMap<String, Object>(){{ put("ratifyUrl", Pictures.ofLocal(imgUrl+"/"+signatureUrl).create()); + put("seal1", Pictures.ofLocal(imgUrl+"/"+sealUrl).create()); + put("seal2", Pictures.ofLocal(imgUrl+"/"+sealUrl).create()); }}, (urlS==null?url:urlS).replace("/word", wordUrl)); wordToPdf((urlS == null ? url : urlS).replace("/word", wordUrl)); InsOrder insOrder = new InsOrder(); -- Gitblit v1.9.3