From 221e2c1be8053f750805c1335fc32b1bafe1c76b Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 02 四月 2025 09:27:13 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/条码管理/WEBSController.cs | 84 +++++++++++++++++++++++++++++++++++++++--
1 files changed, 79 insertions(+), 5 deletions(-)
diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
index 6f9dd00..90fb3c9 100644
--- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
+++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
@@ -10488,7 +10488,7 @@
HSourceBillNo_TB = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSourceBillNo"]);
HSourceInterID = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HSourceInterID"]);
//鏍规嵁鍏ュ簱鐢宠鍗曞崟鍙峰垽鏂崟鎹俊鎭槸鍚﹀凡缁忓悓姝ュ埌閲戣澏
- sql = string.Format(@"select FID,FBILLNO from {0}..TFKO_t_Cust100009 with(nolock) where FBILLNO = '" + HSourceBillNo_TB + "'", HDataBaseName);
+ sql = string.Format(@"select FID,FBILLNO,FDOCUMENTSTATUS from {0}..TFKO_t_Cust100009 with(nolock) where FBILLNO = '" + HSourceBillNo_TB + "'", HDataBaseName);
ds = oCn.RunProcReturn(sql, "TFKO_t_Cust100009");
//鍏ュ簱鐢宠鍗曟病鏈夊悓姝ュ埌閲戣澏鍒欒繘琛屽悓姝�
@@ -10634,10 +10634,7 @@
LogService.Write("鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍚屾鑾峰彇鐧诲綍璐﹀彿瀵嗙爜澶辫触锛侊細" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID);
return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍚屾鑾峰彇鐧诲綍璐﹀彿瀵嗙爜澶辫触锛�";
}
- LogService.Write("鍏朵粬鍏ュ簱,鍗冲皢鐧诲綍閲戣澏");
var loginRet = InvokeHelper.Login();
- LogService.Write("鍏朵粬鍏ュ簱,鐧诲綍閲戣澏缁撴灉1锛�" + loginRet);
- LogService.Write("鍏朵粬鍏ュ簱,鐧诲綍閲戣澏缁撴灉2锛�" + JObject.Parse(loginRet)["LoginResultType"].Value<int>());
var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
if (isSuccess == 0)
@@ -10691,11 +10688,88 @@
}
//鏇存柊鏉$爜婧愬崟id淇℃伅
- sql = string.Format($@"update a set HSourceInterID = isnull(b.FID,0),HSourceEntryID = isnull(c.FEntryID,0) from Gy_BarCodeBill a left join AIS20220609121235..TFKO_t_Cust100009 b on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'");
+ sql = string.Format($@"update a set HSourceInterID = isnull(b.FID,0),HSourceEntryID = isnull(c.FEntryID,0) from Gy_BarCodeBill a with(nolock) left join AIS20220609121235..TFKO_t_Cust100009 b with(nolock) on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c with(nolock) on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'");
//鎵ц鏇存柊璇彞
oCn.RunProc(sql);
}
+ //鍒ゆ柇鐢熶骇鍏ュ簱鐢宠鍗曟槸鍚︽槸瀹℃牳鐘舵�侊紝鑻ユ湭瀹℃牳鍒欐墽琛屾彁浜ゅ鏍告柟娉�
+ else
+ {
+ //--Z 鏆傚瓨锛孉 鍒涘缓锛孊 瀹℃牳涓紝C 宸插鏍革紝D 閲嶆柊瀹℃牳
+
+ //鑾峰彇鍏ュ簱鐢宠鍗曞崟鎹彿
+ string HBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FBILLNO"]);
+ //鍖呰绾跨敓鎴愮殑鐢熶骇鍏ュ簱鐢宠鍗曞弬涓庤嚜鍔ㄥ鏍�
+ if (HBillNo.Substring(0,2) == "RK" )
+ {
+ //鑾峰彇鍏ュ簱鐢宠鍗曞崟鎹姸鎬�
+ string HBillStatus = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FDOCUMENTSTATUS"]);
+ //鑾峰彇鍏ュ簱鐢宠鍗旾D
+ var json = new
+ {
+ Ids = ds.Tables[0].Rows[0]["FID"].ToString(),
+ };
+ LogService.Write("鎻愪氦瀹℃牳ID锛�" + DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["FID"]));
+
+ //浠庨厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮�
+ if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo))
+ {
+ LogService.Write("鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍚屾鑾峰彇鐧诲綍璐﹀彿瀵嗙爜澶辫触锛侊細" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID);
+ return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍚屾鑾峰彇鐧诲綍璐﹀彿瀵嗙爜澶辫触锛�";
+ }
+
+ //鐧诲綍閲戣澏
+ var loginRet = InvokeHelper.Login();
+ //鍒ゆ柇鏄惁鐧诲綍鎴愬姛
+ var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
+ if (isSuccess == 0)
+ {
+ LogService.Write("鍏朵粬鍏ュ簱,鐧诲綍閲戣澏澶辫触锛�" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID);
+ return "鍙戠敓寮傚父锛岀櫥褰曢噾铦跺け璐ワ紒";
+ }
+
+ //鎻愪氦瀹℃牳
+ string result1 = string.Empty;
+ string result2 = string.Empty;
+ //鍒涘缓锛岄噸鏂板鏍哥姸鎬佽皟鐢ㄦ彁浜わ紝瀹℃牳鎸夐挳
+ if (HBillStatus == "A" || HBillStatus == "D")
+ {
+ LogService.Write("鐢熶骇鍏ュ簱鐢宠鍗曞彿锛�" + HBillNo + ",閲嶆柊杩涜鎻愪氦瀹℃牳");
+ result1 = InvokeHelper.Submit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//鎻愪氦
+ result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//瀹℃牳
+
+ if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+ {
+ LogService.Write("鍏ュ簱鐢宠鍗曞崟鍙�:" + ",鎻愪氦澶辫触" + result1);
+ return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍗曞彿:" + ",鎻愪氦澶辫触" + result1;
+ }
+
+ if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+ {
+ LogService.Write("鍏ュ簱鐢宠鍗曞崟鍙�:" + ",瀹℃牳澶辫触" + result2);
+ return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍗曞彿:" + ",瀹℃牳澶辫触" + result2;
+ }
+ }
+ //瀹℃牳涓姸鎬佽皟鐢ㄥ鏍告寜閽�
+ else if (HBillStatus == "B")
+ {
+ LogService.Write("鐢熶骇鍏ュ簱鐢宠鍗曞彿锛�" + HBillNo + ",閲嶆柊杩涜瀹℃牳");
+ result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//瀹℃牳
+ if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+ {
+ LogService.Write("鍏ュ簱鐢宠鍗曞崟鍙�:" + ",瀹℃牳澶辫触" + result2);
+ return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍗曞彿:" + ",瀹℃牳澶辫触" + result2;
+ }
+ }
+
+ //鏇存柊鏉$爜婧愬崟id淇℃伅
+ sql = string.Format($@"update a set HSourceInterID = isnull(b.FID,0),HSourceEntryID = isnull(c.FEntryID,0) from Gy_BarCodeBill a with(nolock) left join AIS20220609121235..TFKO_t_Cust100009 b with(nolock) on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c with(nolock) on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'");
+ //鎵ц鏇存柊璇彞
+ oCn.RunProc(sql);
+ }
+
+ }
}
HReturnResult = sBarCode;
--
Gitblit v1.9.1