From 2f21e4d7ef8c407e67a2f9880a0a6af3ad2e354f Mon Sep 17 00:00:00 2001 From: YL <YL@LAPTOP-SE03PLUR> Date: 星期一, 07 二月 2022 22:09:03 +0800 Subject: [PATCH] 班组职员清单 --- WebAPI/Controllers/博日自动扫码线/ScanlineAPIController.cs | 76 +++++++++++++++++++++++++++++++++++--- 1 files changed, 70 insertions(+), 6 deletions(-) diff --git "a/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs" "b/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs" index 1b23643..98467d9 100644 --- "a/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs" +++ "b/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs" @@ -9,6 +9,7 @@ using System.Net.Http; using System.Web.Http; using System.Web.Script.Serialization; +using ViewAPI; using WebAPI.Models; namespace WebAPI.Controllers.鍗氭棩鑷姩鎵爜绾� @@ -74,11 +75,12 @@ { try { + Log.LogInfo(msg.ToString()); //璁板綍鎻愪氦鏁版嵁 JavaScriptSerializer js = new JavaScriptSerializer(); //瀹炰緥鍖栦竴涓兘澶熷簭鍒楀寲鏁版嵁鐨勭被 ScanLineCode list = js.Deserialize<ScanLineCode>(msg.ToString()); //灏唈son鏁版嵁杞寲涓哄璞$被鍨嬪苟璧嬪�肩粰list if (list.billno != "" && list.billno != null) //浠诲姟鍗曞彿锛岄潪蹇呴』锛岄潪绌哄垯鏍¢獙barcodes閲宐arcode鏄惁鐢辨浠诲姟鍗曞埗浣滅敓鎴愮殑 { - ds = oCN.RunProcReturn("Select HBarCode barcode from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim()+"' Order by HItemID ", "Gy_BarCodeBill"); + ds = oCN.RunProcReturn("Select HBarCode barcode,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim()+"' Order by HItemID ", "Gy_BarCodeBill"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.status = -1; @@ -108,6 +110,14 @@ objJsonResult.data = null; return objJsonResult; } + ds = oCN.RunProcReturn("Select * from Gy_BarCodeBill where HBarCode='" + list.packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill"); + if (ds != null && ds.Tables[0].Rows.Count > 0) + { + objJsonResult.status = -1; + objJsonResult.msg = "姝ょ鏉$爜宸蹭綔搴�"; + objJsonResult.data = null; + return objJsonResult; + } Models.ClsSc_PackUnionBillMain oItem = new ClsSc_PackUnionBillMain(); oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); @@ -120,7 +130,7 @@ oItem.HCheckItemNowID = 0; oItem.HCheckItemNextID = 0; oItem.HCheckFlowID = 0; - oItem.HRemark = "鑷姩鍖呰绾跨敓杈扮鏉$爜"; + oItem.HRemark = "鑷姩鍖呰绾跨敓鎴愮鏉$爜"; oItem.HBacker = ""; oItem.HBackDate = ""; oItem.HMaker = ""; @@ -192,6 +202,7 @@ objJsonResult.status = 0; objJsonResult.msg = "success"; objJsonResult.data = null; + Log.LogSaveInfo("鎻愪氦鎴愬姛绠辨潯鐮侊細"+ list.packagebarcode); //璁板綍鎻愪氦鏁版嵁 return objJsonResult; } else @@ -219,14 +230,43 @@ { try { + //鍒ゆ柇鏄惁鍏ュ簱 + ds = oCN.RunProcReturn("select * from Sc_ScanLineInStock where HBarCode_Pack='" + packagebarcode + "'", "Sc_ScanLineInStock"); + if (ds!= null && ds.Tables[0].Rows.Count>0) + { + objJsonResult.status = -1; + objJsonResult.msg = "璇ョ鏉$爜宸插叆搴撲笉鍏佽鍙栨秷!"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = oCN.RunProcReturn("Select 1 from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "'", "Gy_BarCodeBill"); + if (ds == null && ds.Tables[0].Rows.Count == 0) + { + objJsonResult.status = -1; + objJsonResult.msg = "鏃犳晥绠辨潯鐮�"; + objJsonResult.data = null; + return objJsonResult; + } + ds = oCN.RunProcReturn("Select 1 from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill"); + if (ds != null && ds.Tables[0].Rows.Count>0) + { + objJsonResult.status = -1; + objJsonResult.msg = "姝ょ鏉$爜宸蹭綔搴�"; + objJsonResult.data = null; + return objJsonResult; + } + // oCN.BeginTran(); + //鍒犻櫎SUM涓昏〃 + oCN.RunProc("Delete From Sc_PackUnionBillSub_Sum where HBarCode_Pack='" + packagebarcode.ToString() + "'"); //鍒犻櫎瀛愯〃 - oCN.RunProc("Delete From Sc_PackUnionBillSub where HBarCode_Pack=" + packagebarcode.ToString()); + oCN.RunProc("Delete From Sc_PackUnionBillSub where HBarCode_Pack='"+ packagebarcode.ToString() + "'"); //鍒犻櫎涓昏〃 - oCN.RunProc("Delete From Sc_PackUnionBillMain where HBarCode_Pack=" + packagebarcode.ToString()); - //鍒犻櫎鏉$爜妗f琛� - oCN.RunProc("Delete From Gy_BarCodeBill where HBarCode=" + packagebarcode.ToString()); + oCN.RunProc("Delete From Sc_PackUnionBillMain where HBarCode_Pack='" + packagebarcode.ToString() + "'"); + //浣滃簾鏉$爜妗f琛� + oCN.RunProc("Update Gy_BarCodeBill set HStopflag='1' where HBarCode='"+ packagebarcode.ToString()+ "'"); oCN.Commit(); @@ -244,5 +284,29 @@ } } #endregion + + + [Route("packagebarcode/week")] + [HttpPost] + public object week(string tim) + { + try + { + GetWeekList list = new GetWeekList(); + //string aa=list.getWeek(Convert.ToDateTime(tim)); + string aa = list.GetCodeDateStr(Convert.ToDateTime(tim)); + objJsonResult.status = 0; + objJsonResult.msg =aa.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.status = -1; + objJsonResult.msg = e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } } } \ No newline at end of file -- Gitblit v1.9.1