From 9dfddcb21acd47446a612ea64582d45c705548e4 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期五, 01 十一月 2024 11:16:51 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 127 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 126 insertions(+), 1 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs index 997ba74..4cb3ccf 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs @@ -226,6 +226,12 @@ string Ret = ""; if (oSystemParameter.ShowBill(ref Ret)) { + //鍒ゆ柇瀹㈡埛涓轰箶涓� + if(oSystemParameter.omodel.WMS_CampanyName == "涔斾竴") + { + HDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + } + //鍒ゆ柇瀹㈡埛涓嶄负榫欏北姹介厤 if (oSystemParameter.omodel.WMS_CampanyName != "榫欏北姹介厤" && oSystemParameter.omodel.WMS_CampanyName != "鐟炰笌绁�" && oSystemParameter.omodel.WMS_CampanyName != "娣诲悍绉戞妧") //绯荤粺鍙傛暟 { @@ -444,6 +450,7 @@ ",HSourceID4=" + HSourceID4 + ",HSourceID5=" + HSourceID5 + ",HPayProcID=" + HPayProcID + + ",HGroupID=" + HGroupID + ",HWorkTimes=" + HWorkTimes + ",HSaveBillFlag=0 " + ",HBadCount=" + HBadCount + @@ -1780,7 +1787,7 @@ } } - sWhere = sWhere.Replace("'", "''"); + //sWhere = sWhere.Replace("'", "''"); if (sWhere == null || sWhere.Equals("")) { @@ -3829,5 +3836,123 @@ } } #endregion + + #region 淇濆瓨鐢熸垚鐧芥爣 + public class WhiteLabelGeneration { + public string ProjectNo { get; set; } + public string OrderingCode { get; set; } + public string DrawVersionNumber { get; set; } + public string CustomerOrderNumber { get; set; } + public string WaybillNumber { get; set; } + public string HRemark { get; set; } + public string HBarCode_Pack { get; set; } + public string HBillType { get; set; } + } + [Route("Cj_StationOutBill_Detail/MES_WhiteLabelGeneration")] + [HttpPost] + public object MES_WhiteLabelGeneration([FromBody] JObject oMain) + { + try + { + oCN.BeginTran(); + + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); //涓昏〃鏁版嵁 + WhiteLabelGeneration Main = Newtonsoft.Json.JsonConvert.DeserializeObject<WhiteLabelGeneration>(msg2); + + string HBillType = Main.HBillType; + string ProjectNo = Main.ProjectNo; + string OrderingCode = Main.OrderingCode; + string DrawVersionNumber = Main.DrawVersionNumber; + string CustomerOrderNumber = Main.CustomerOrderNumber; + string WaybillNumber = Main.WaybillNumber; + string HRemark = Main.HRemark; + string HBarCode_Pack = Main.HBarCode_Pack; + + ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR_15 '{HBillType}','{ProjectNo}','{OrderingCode}','{DrawVersionNumber}','{CustomerOrderNumber}','{WaybillNumber}','{HRemark}','{HBarCode_Pack}'", "h_p_MES_HBarCode_White_SMR_15"); + + string HBarCode_White = ds.Tables[0].Rows[0]["HBarCode_White"].ToString(); + + if (HBarCode_White == "") + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鐢熸垚鐧芥爣澶辫触,鍗曟嵁鏍囪瘑:" + HBarCode_Pack + "锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + oCN.RunProc("update Sc_PackUnionBillMain set HBarCode_White='" + HBarCode_White + "' where HBarCode_Pack='" + HBarCode_Pack + "'"); + + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 涓嬫帹璐ㄩ噺姹囨姤鍗曟椂杩斿洖宸ュ簭鍑虹珯姹囨姤鍗曚俊鎭� + [Route("Cj_StationOutBill/PushDownBackInfo")] + [HttpGet] + public object PushDownBackInfo(string linterid, string user) + { + try + { + List<object> columnNameList = new List<object>(); + + ds = oCN.RunProcReturn("select * from h_v_Sc_StationOutBill_PushDownBackInfo where hmainid in (" + linterid + ")", "h_v_Sc_StationOutBill_PushDownBackInfo"); + + if (ds.Tables[0].Rows.Count > 0 && ds != null) + { + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳暟鎹�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion } } \ No newline at end of file -- Gitblit v1.9.1