From 4a3404efc438b16044fd9170814e6545a3f86fae Mon Sep 17 00:00:00 2001
From: hjg <hjg@123.com>
Date: 星期六, 20 一月 2024 18:32:22 +0800
Subject: [PATCH] 提交时无提单无法删除的问题

---
 JavaSource/com/mandi/fendan/service/impl/ErpService.java |   53 ++++++++++++++---------------------------------------
 1 files changed, 14 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..8331c99 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) {
@@ -878,6 +881,7 @@
 				String xstdNo = VX.getXstdNo();
 				List<Fd_XSTDMX> mxl = new ArrayList<Fd_XSTDMX>();
 				Fd_XSTD xstd = this.tdper.getbyTDBH(xstdNo);
+				if(xstd==null) continue;
 				List<Fd_XSTDMX> MXL = this.tdmxper.getbyBsNoandcmNo(xstd.getTd_tdls(), bsNo, lg.getDepartno());
 				double ZZL = 0;
 				int ZZS = 0;
@@ -981,7 +985,8 @@
 			}
 
 		}
-
+		// 鍒犻櫎杞﹁締鍒嗗崟鐨勫娉╮emark
+		fdVehicleRemarkMapper.deleteByBusinessNo(bsNo);
 		or.setCode(0);
 		or.setItem(true);
 		return or;
@@ -1114,7 +1119,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 +1128,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 +1143,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 +1629,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