From f1b726d853f242c5558239138defcd5d0b1636df Mon Sep 17 00:00:00 2001
From: hjg <hjg@123.com>
Date: 星期四, 20 二月 2025 17:24:49 +0800
Subject: [PATCH] erp分单

---
 JavaSource/com/mandi/fendan/mapper/xmls/Fd_XSTDMapper.xml |   33 ++++++++++++++++++---------------
 JavaSource/com/mandi/fendan/service/impl/ErpService.java  |   16 ++++++++++------
 2 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/JavaSource/com/mandi/fendan/mapper/xmls/Fd_XSTDMapper.xml b/JavaSource/com/mandi/fendan/mapper/xmls/Fd_XSTDMapper.xml
index 1cc04bf..06a639f 100644
--- a/JavaSource/com/mandi/fendan/mapper/xmls/Fd_XSTDMapper.xml
+++ b/JavaSource/com/mandi/fendan/mapper/xmls/Fd_XSTDMapper.xml
@@ -5,7 +5,7 @@
 	a.td_bmbh,a.td_bmmc,a.td_bz,a.td_djrq,a.td_fpbh, a.td_jylx, a.td_khbh,a.td_cqNo,a.committime,
     CASE WHEN a.td_fpbh IS NULL THEN b.name WHEN a.td_fpbh= '' THEN b.name
 <!--    WHEN a.td_ywdybh= '101' THEN '娌冲崡鎶ュ叧'  WHEN a.td_ywdybh= '102' THEN '閮戝窞鎶ュ叧' WHEN a.td_ywdybh= '111' THEN '鏄庢櫉鎶ュ叧' WHEN a.td_ywdybh= '114' THEN '涔夌憺鎶ュ叧' ELSE '绉戞妧鎶ュ叧'-->
-    WHEN a.td_cqNo= '101' THEN '娌冲崡鎶ュ叧'  WHEN a.td_ywdybh= '102' THEN '閮戝窞鎶ュ叧' WHEN a.td_ywdybh= '111' THEN '鏄庢櫉鎶ュ叧' WHEN a.td_ywdybh= '114' THEN '涔夌憺鎶ュ叧' ELSE '绉戞妧鎶ュ叧'
+    WHEN a.td_cqNo= '101' THEN '娌冲崡鎶ュ叧'  WHEN a.td_cqNo= '102' THEN '閮戝窞鎶ュ叧' WHEN a.td_cqNo= '111' THEN '鏄庢櫉鎶ュ叧' WHEN a.td_cqNo= '114' THEN '涔夌憺鎶ュ叧' ELSE '绉戞妧鎶ュ叧'
 	END td_khmc,
 	a.td_shddbh,
 	c.name as td_shdd,
@@ -25,8 +25,10 @@
 	<!--鏌ヨ鍦板尯鐨勫巶鍖� -->
 	<sql id="sqlDq">
 		ISNULL((select STUFF((select distinct ','+b.name from fd_wlgs_fhdq f left join fd_company b on f.wlgsNo=b.companyNo where f.fhdqNo=a.td_shddbh
-		and f.ywdyNo=(case when a.td_ywdybh in ('102','111','114')  then a.td_ywdybh  else '103' end)
-			 and EXISTS (SELECT 1 from fd_company_ywdy c where b.companyNo=c.companyNo and c.ywdyNo=a.td_ywdybh )
+<!--		and f.ywdyNo=(case when a.td_ywdybh in ('102','111','114')  then a.td_ywdybh  else '103' end)-->
+		and f.ywdyNo=(case when a.td_cqNo in ('102','111','114')  then a.td_cqNo  else '103' end)
+<!--			 and EXISTS (SELECT 1 from fd_company_ywdy c where b.companyNo=c.companyNo and c.ywdyNo=a.td_ywdybh )-->
+<!--			 and EXISTS (SELECT 1 from fd_company_ywdy c where b.companyNo=c.companyNo and c.ywdyNo=a.td_cqNo )-->  <!--涓嶅啀鑰冭檻鍒嗗崟涓氬姟鍗曞厓-->
 			  for xml path('')
 		),1,1,'' ) ),'')
 	</sql>
@@ -41,7 +43,7 @@
 
 	<!-- 鏍规嵁鍦板尯鏉ュ喅瀹氭槸鍚︽樉绀� -->
 	<sql id="changqu">
-		<if test=" cqV !=null and cqV !='' ">
+<!--		<if test=" cqV !=null and cqV !='' ">-->
 			<if test="companyNo!=null and companyNo!=''">  <!--瑕佺‘淇濇槸绠$悊鍛樻垨鑰呮槸fdAdmin鐨勬椂鍊檆ompanyNo鏄┖-->
 				and ( (a.td_ztbz not in (1,3) and EXISTS ( select * from fd_company_ywdy cy left join fd_company fc on
 				cy.companyNo = fc.companyNo where hasSPR=1 and cy.companyNo=#{companyNo} ) )   <!-- 鎷ユ湁鑷彁鏉冮檺鐨勫彧鑳界湅鍒板巶鍖鸿寖鍥寸殑 -->
@@ -61,15 +63,16 @@
 				) )
 				)
 			</if>
-			<choose>
-				<when test="cqV=='102' || cqV=='111' || cqV=='114'">
-					and a.td_cqNo=#{cqV}
-				</when>
-				<otherwise>
-					and a.td_cqNo !='102' and a.td_cqNo !='111' and a.td_cqNo !='114'
-				</otherwise>
-			</choose>
-		</if>
+			<if test=" cqV !=null and cqV !='' ">
+				<choose>
+					<when test="cqV=='102' || cqV=='111' || cqV=='114'">
+						and a.td_cqNo=#{cqV}
+					</when>
+					<otherwise>
+						and a.td_cqNo !='102' and a.td_cqNo !='111' and a.td_cqNo !='114'
+					</otherwise>
+				</choose>
+			</if>
 	</sql>
    <sql id="condition">
 	   <if test="companyNo !=null and companyNo !='' ">
@@ -125,7 +128,7 @@
 		   and ( a.td_zdr like '%'+#{zdr}+'%')
 	   </if>
 	   <!-- 鍏宠仈娴佹按鍙蜂腑鐨勫彲瑙佺墿娴佸叕鍙革紙鍏ㄩ儴涓虹┖锛屾樉绀哄湴鍖猴紱涓嶅叏閮ㄤ负绌猴紝鏄剧ず鍦板尯+鍙锛涘叏閮ㄤ笉涓虹┖锛屾樉绀哄彲瑙佺墿娴佸叕鍙革級 -->
-	   <if test=" cqV !=null and cqV !='' ">
+<!--	   <if test=" cqV !=null and cqV !='' ">-->
 		  and case when not exists (select * from fd_mx_wlgs where td_tdls=a.td_tdls)
 		   <include refid="changqu"/> <!--  鍘傚尯鍙 -->
 		   then 1
@@ -137,7 +140,7 @@
 			   or exists(select * from fd_mx_wlgs where td_tdls=a.td_tdls and wlgs_no=#{companyNo}) then 1
 		   </if>
 		   else 0 end > 0
-	   </if>
+<!--	   </if>-->
    </sql>
 
 
diff --git a/JavaSource/com/mandi/fendan/service/impl/ErpService.java b/JavaSource/com/mandi/fendan/service/impl/ErpService.java
index de552bc..eaaaf09 100644
--- a/JavaSource/com/mandi/fendan/service/impl/ErpService.java
+++ b/JavaSource/com/mandi/fendan/service/impl/ErpService.java
@@ -283,7 +283,7 @@
 		}
 		// 濡傛灉鏄鐞嗗憳鎴栬�呴潪鎻愬崟鏇寸墿娴佸叕鍙哥殑鎿嶄綔
 		boolean isAdminOrFdAdmin = UserType.admin.toString().equals(lg.getWorkerno())  || StringUtils.isNotBlank(fdAdmin);
-		if (StringUtils.isEmpty(companyNo)) {
+ 		if (StringUtils.isEmpty(companyNo)) {
 			if (!isAdminOrFdAdmin) { // 濡傛灉涓嶆槸鏇存敼杞﹁締鍒嗗崟绠$悊鍛樺拰涔熶笉鏄郴缁熺鐞嗗憳锛岄渶瑕佸姞涓婂叕鍙竛o
 				companyNo = lg.getDepartno();
 			}
@@ -569,7 +569,8 @@
 						/*xstd.getTd_ywdybh().equals(Contants.nc_ywdy_ZZ) ? Contants.nc_ywdy_ZZ:
 								xstd.getTd_ywdybh().equals(Contants.nc_ywdy_MS) ? Contants.nc_ywdy_MS
 								: Contants.nc_ywdy_KJ*/
-						ConvertTool.ncGetDefault(xstd.getTd_ywdybh())
+//						ConvertTool.ncGetDefault(xstd.getTd_ywdybh())
+						ConvertTool.ncGetDefault(xstd.getTd_cqNo())
 				);
 				// 杩欎釜鍦版柟鏀逛竴涓嬶紝鍏佽fd_mx_wlgs涓瓨鍦ㄧ殑鍗曟煡鐪�
 				int total = fdMxWlgsMapper.selectCountByTdTdls(xstd.getTd_tdls());
@@ -655,7 +656,8 @@
 						/*xstd.getTd_ywdybh().equals(Contants.nc_ywdy_ZZ) ? Contants.nc_ywdy_ZZ:
 								xstd.getTd_ywdybh().equals(Contants.nc_ywdy_MS) ? Contants.nc_ywdy_MS
 								: Contants.nc_ywdy_KJ*/
-						ConvertTool.ncGetDefault(xstd.getTd_ywdybh())
+//						ConvertTool.ncGetDefault(xstd.getTd_ywdybh())
+						ConvertTool.ncGetDefault(xstd.getTd_cqNo())
 				);
 				int total = fdMxWlgsMapper.selectCountByTdTdls(xstd.getTd_tdls());
 				if (ccr == null && total == 0) {
@@ -1147,7 +1149,8 @@
 							return orr;
 						}
 					} else {
-						Rcompany = ConvertTool.covertToCustoms(td.getTd_ywdybh());
+//						Rcompany = ConvertTool.covertToCustoms(td.getTd_ywdybh());
+						Rcompany = ConvertTool.covertToCustoms(td.getTd_cqNo());
 					}
 				}
 				tdl.add(td);
@@ -1695,10 +1698,11 @@
 					/*td.getTd_ywdybh().equals(Contants.nc_ywdy_ZZ) ? Contants.nc_ywdy_ZZ
 							:td.getTd_ywdybh().equals(Contants.nc_ywdy_MS) ? Contants.nc_ywdy_MS
 							: Contants.nc_ywdy_KJ*/
-					ConvertTool.ncGetDefault(td.getTd_ywdybh())
+//					ConvertTool.ncGetDefault(td.getTd_ywdybh())
+					ConvertTool.ncGetDefault(td.getTd_cqNo())
 			);
 
-			int total = fdMxWlgsMapper.selectCountByTdTdls(td.getTd_tdls());
+			int total = fdMxWlgsMapper.selectCountByTdTdls(td.getTd_cqNo());
 			if (wldq == null && total == 0) {
 				orr.setCode(1);
 				orr.setErrmsg("褰撳墠璐﹀彿鎵�灞炵墿娴佸叕鍙告病鏈夐厤缃鍦板尯鐨勫垎鍗曟潈闄愶紒");

--
Gitblit v1.9.3