From e35f35bcec9ce83198515ee2dd89e91034992e3a Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 28 四月 2025 15:44:01 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/条码管理/WEBSController.cs | 267 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 262 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 fbdc464..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"
@@ -3431,6 +3431,61 @@
#endregion
+ #region 鐩存帴璋冩嫧 鏍¢獙妯″紡
+
+ /// <summary>
+ /// 鐩存帴璋冩嫧鏍¢獙涓婁紶
+ /// </summary>
+ /// <returns></returns>
+ [Route("WEBSController/set_SaveMoveStockBill_BillCheck_Json")]
+ [HttpPost]
+ public object set_SaveMoveStockBill_BillCheck_Json([FromBody] JObject oMain)
+ {
+ var _value = oMain["oMain"].ToString();
+ string msg1 = _value.ToString();
+
+ try
+ {
+ List<Model.ClsKf_MoveStockBillMain> lsmain = new List<Model.ClsKf_MoveStockBillMain>();
+ ListModels oListModels = new ListModels();
+ lsmain = oListModels.getMoveStockBillMainByJson(msg1);
+
+ WebAPI.WebS.ClsKf_MoveStockBillMain websLsmain = new WebS.ClsKf_MoveStockBillMain();
+
+ websLsmain.HInterID = lsmain[0].HInterID;
+ websLsmain.HBillNo = lsmain[0].HBillNo;
+ websLsmain.HBillType = "1207";
+ websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+ if (oWebs.set_SaveMoveStockBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛�
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鐩存帴璋冩嫧鏍¢獙澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
#region 鎹㈡墭璋冩嫧鍗�
/// <summary>
@@ -3807,6 +3862,92 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "鐢熶骇閫�鏂欏崟涓婁紶澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region 閿�鍞��璐� 涓婁紶鐢熷崟
+
+ #region 閿�鍞��璐� 鏂板妯″紡
+
+ /// <summary>
+ /// 閿�鍞��璐ф柊澧炰笂浼�
+ /// </summary>
+ /// <returns></returns>
+ [Route("WEBSController/set_SaveSellOutBackBill_Json")]
+ [HttpPost]
+ public object set_SaveSellOutBackBill_Json([FromBody] JObject oMain)
+ {
+ var _value = oMain["oMain"].ToString();
+ string msg1 = _value.ToString();
+ try
+ {
+ List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>();
+ ListModels oListModels = new ListModels();
+ lsmain = oListModels.getICStockBillMainByJson(msg1);
+ WebS.ClsKf_ICStockBillMain websLsmain = new WebS.ClsKf_ICStockBillMain();
+ string sSourceType = lsmain[0].HMainSourceBillType;
+ websLsmain.HInterID = lsmain[0].HInterID;
+ websLsmain.HBillNo = lsmain[0].HBillNo;
+ websLsmain.HBillType = lsmain[0].HBillType;
+ websLsmain.HDate = lsmain[0].HDate;
+ websLsmain.HDeptID = lsmain[0].HDeptID;
+ websLsmain.HWHID = lsmain[0].HWHID;
+ websLsmain.HSCWHID = lsmain[0].HSCWHID;
+ websLsmain.HSupID = lsmain[0].HSupID;
+ websLsmain.HKeeperID = lsmain[0].HKeeperID;
+ websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
+ websLsmain.HEmpID = lsmain[0].HEmpID;
+ websLsmain.HManagerID = lsmain[0].HManagerID;
+ websLsmain.HRemark = lsmain[0].HRemark;
+ websLsmain.HExplanation = lsmain[0].HExplanation;
+ websLsmain.HInnerBillNo = lsmain[0].HInnerBillNo;
+ websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag;
+ websLsmain.HBillSubType = lsmain[0].HBillSubType;
+ if (lsmain[0].HMainSourceBillType == "1403")
+ {
+ websLsmain.HMainSourceBillType = "閫�璐ч�氱煡鍗�";
+ }
+ else if (lsmain[0].HMainSourceBillType == "1401")
+ {
+ websLsmain.HMainSourceBillType = "閿�鍞鍗�";
+ }
+ else
+ {
+ websLsmain.HMainSourceBillType = "鎵嬪伐褰曞叆";
+ }
+ websLsmain.HMaker = lsmain[0].HMaker;
+ websLsmain.HBillerID = lsmain[0].HBillerID;
+ websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+ websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
+
+ if (oWebs.set_SaveSellOutBackBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛�
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "閿�鍞��璐у崟涓婁紶澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
@@ -4635,6 +4776,48 @@
try
{
WebSoBar = oWebs.get_SourceBarCode_MateOutBack(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
+ if (WebSoBar == null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛";
+ objJsonResult.data = WebSoBar;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵弿婧愬崟鏉$爜澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+ #region 閿�鍞��璐� 鎵弿婧愬崟鏉$爜
+
+ /// <summary>
+ /// 閿�鍞��璐� 鎵弿婧愬崟鏉$爜
+ /// </summary>
+ /// <returns></returns>
+ [Route("WEBSController/Get_SourceBarCode_SellOutBack_Json")]
+ [HttpGet]
+ public object Get_SourceBarCode_SellOutBack_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID)
+ {
+ try
+ {
+ WebSoBar = oWebs.get_SourceBarCode_SellOutBack(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
if (WebSoBar == null)
{
objJsonResult.code = "0";
@@ -10305,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");
//鍏ュ簱鐢宠鍗曟病鏈夊悓姝ュ埌閲戣澏鍒欒繘琛屽悓姝�
@@ -10451,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)
@@ -10508,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