From 3780c5e65b05bf23020810798babc6d20311fa79 Mon Sep 17 00:00:00 2001 From: hjg <hjg@123.com> Date: 星期五, 17 十一月 2023 09:53:23 +0800 Subject: [PATCH] 加强回滚限制 --- JavaSource/com/mandi/fendan/service/impl/ErpService.java | 52 +++++++++++++--------------------------------------- 1 files changed, 13 insertions(+), 39 deletions(-) diff --git a/JavaSource/com/mandi/fendan/service/impl/ErpService.java b/JavaSource/com/mandi/fendan/service/impl/ErpService.java index cf311e3..2be6e21 100644 --- a/JavaSource/com/mandi/fendan/service/impl/ErpService.java +++ b/JavaSource/com/mandi/fendan/service/impl/ErpService.java @@ -89,6 +89,9 @@ @Resource private SqlSessionFactory sqlSessionFactory; + @Resource + private FdVehicleRemarkMapper fdVehicleRemarkMapper; + @Override public ObjectResult<String> tzPrint(Login lg, String bssNo, String ipadd) { ObjectResult<String> orr = new ObjectResult<String>(); @@ -796,7 +799,7 @@ } @Override - @Transactional + @Transactional(rollbackFor = Exception.class) public ObjectResult<Boolean> delFdsheet(Login lg, String bsNo) throws Exception{ ObjectResult<Boolean> or = new ObjectResult<Boolean>(); if (lg == null) { @@ -981,7 +984,8 @@ } } - + // 鍒犻櫎杞﹁締鍒嗗崟鐨勫娉╮emark + fdVehicleRemarkMapper.deleteByBusinessNo(bsNo); or.setCode(0); or.setItem(true); return or; @@ -1114,7 +1118,7 @@ String tdNo = tdje.getAsString(); if (StringUtils.isNotBlank(tdNo)) { Fd_XSTD td = this.tdper.getbyTDBH(tdNo); - if (td == null || td.getTd_wfdsl()<=0 ) { //|| td.isTd_zcwcbz() 瑁呰溅瀹屾垚鏍囧織 涓嶉渶瑕佷簡 + if (td == null || td.getTd_wfdsl()<=0 ) { continue; } @@ -1123,45 +1127,13 @@ //褰撳墠鐢ㄦ埛鍙兘鐪嬪埌鍙互鎿嶄綔鐨勬彁鍗� 涓嶅彲浠ユ搷浣滅殑鎻愬崟鐪嬩笉鍒� //鎵�鏈変互涓媏lse鎿嶄綔鍘绘帀 if (StringUtils.isBlank(bsDE)) { - /*bsDE = td.getTd_cqNo().equals(Contants.nc_ywdy_ZZ) ? Contants.zzSdepartNo : - td.getTd_cqNo().equals(Contants.nc_ywdy_MS)? Contants.msSdepartNo : - td.getTd_cqNo().equals(Contants.nc_ywdy_YR)? Contants.yrSdepartNo : - Contants.kjSdepartNo;*/ bsDE = ConvertTool.ncCovertToYkt(td.getTd_cqNo()); } -// else { -// // 閮戝窞 -// if (bsDE.equals(Contants.zzSdepartNo)) { -// if (!td.getTd_ywdybh().equals(Contants.nc_ywdy_ZZ)) { -// orr.setCode(1); -// orr.setErrmsg("鎻愬崟锛�"+td.getTd_ywdybh()+"涓嶆槸閮戝窞鍘傚尯鐨勬彁鍗曪紝涓嶈兘鍚屾椂閰嶅崟锛�"); -// return orr; -// } -// } else if(bsDE.equals(Contants.msSdepartNo)) { -// if (!td.getTd_ywdybh().equals(Contants.nc_ywdy_MS)) { -// orr.setCode(1); -// orr.setErrmsg("鎻愬崟锛�"+td.getTd_ywdybh()+"涓嶆槸鏄庢櫉鍘傚尯鐨勬彁鍗曪紝涓嶈兘鍚屾椂閰嶅崟锛�"); -// return orr; -// } -// }else { -// if (!td.getTd_ywdybh().equals(Contants.nc_ywdy_KJ)) { -// orr.setCode(1); -// orr.setErrmsg("鎻愬崟锛�"+td.getTd_ywdybh()+"涓嶆槸鏄庢櫉鍘傚尯鐨勬彁鍗曪紝涓嶈兘鍚屾椂閰嶅崟锛�"); -// return orr; -// } -// } -// } if (StringUtils.isBlank(ziti)) { ziti = td.getTd_ztbz() == 2 ? "鑷彁" : "闈炶嚜鎻�"; } if (StringUtils.isBlank(Rcompany)) { Map<String, Object> mm = this.dqper.getKH(td.getTd_khbh()); - if(mm == null || mm.size() == 0) { // 瀹㈡埛蹇呴』瀛樺湪锛屽惁鍒欐棤娉曞垎鍗� - orr.setCode(1); - orr.setErrmsg("璇ユ彁鍗曞鎴蜂笉瀛樺湪锛岃妫�鏌ユ暟鎹紒"); - return orr; - } - // /* * 1銆佸璐告湁鍙戠エ缂栧彿锛屽唴璐告病鏈夊彂绁ㄧ紪鍙� * 2銆佸唴璐稿彇瀹為檯鍏徃鍚嶇О锛屽璐稿彇鐩稿簲缁勭粐鐨勫叕鍙哥畝绉�+鈥樻姤鍏斥�� @@ -1170,11 +1142,12 @@ if (mm != null) { Rcompany = mm.get("name") == null ? "" : mm.get("name").toString(); } + if(mm == null || mm.size() == 0) { // 瀹㈡埛蹇呴』瀛樺湪锛屽惁鍒欐棤娉曞垎鍗� + orr.setCode(1); + orr.setErrmsg("璇ユ彁鍗曞鎴蜂笉瀛樺湪锛岃妫�鏌ユ暟鎹紒"); + return orr; + } } else { - /*Rcompany = (td.getTd_ywdybh().equals(Contants.nc_ywdy_ZZ)?"閮戝窞鎶ュ叧": - td.getTd_ywdybh().equals(Contants.nc_ywdy_MT)?"娌冲崡鎶ュ叧": - td.getTd_ywdybh().equals(Contants.nc_ywdy_MS)?"鏄庢櫉鎶ュ叧": - "绉戞妧鎶ュ叧");*/ Rcompany = ConvertTool.covertToCustoms(td.getTd_ywdybh()); } } @@ -1655,6 +1628,7 @@ } } } catch (Exception e) { + log.error("閿�鍞笟鍔¤溅杈嗗嚭鍘傜▼搴�" + e.getMessage(),e); throw new Exception(StringUtils.isEmpty(e.getMessage()) ? "閿�鍞笟鍔¤溅杈嗗嚭鍘傜▼搴忓嚭閿欙紒" : e.getMessage()); } orr.setCode(0); -- Gitblit v1.9.3