From 6dcf44dea4b07c494eb6541d913687bb5eaa012b Mon Sep 17 00:00:00 2001 From: zgq <519541279@qq.com> Date: 星期五, 20 八月 2021 14:36:01 +0800 Subject: [PATCH] 整理工序进站接收代码格式 --- WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs | 102 +++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 86 insertions(+), 16 deletions(-) diff --git a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs index 62efa49..3077862 100644 --- a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs +++ b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs @@ -2458,7 +2458,7 @@ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); - + string msg4 = sArray[2].ToString(); string UserName = ""; ListModels oListModels = new ListModels(); @@ -2471,10 +2471,10 @@ lsmain = oListModels.getObjectByJson_Sc_MouldMaintainBillMain(msg2); foreach (Model.ClsSc_MouldMaintainBillMain oItem in lsmain) { - //oItem.HMaker = ""; UserName = oItem.HMaker; //鍒跺崟浜� - oItem.HBillType = "3818"; - oItem.HBillSubType = "3818"; + DBUtility.ClsPub.CurUserName = UserName; + oItem.HBillType = "3819"; + oItem.HBillSubType = "3819"; //oItem.HInterID =0; //oItem.HBillNo = ""; @@ -2502,16 +2502,16 @@ } oBill.omodel = oItem; } - //琛ㄤ綋鏁版嵁 + //淇濆吇椤硅〃浣撴暟鎹� //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� msg3 = msg3.Substring(1, msg3.Length - 2); msg3 = msg3.Replace("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "鈥�"); - List<Model.ClsSc_MouldMaintainBillSub> ls = new List<Model.ClsSc_MouldMaintainBillSub>(); - ls = oListModels.getObjectByJson_Sc_MouldMaintainBillSub(msg3); + List<Model.ClsSc_MouldMaintainRuleBillSub_Item> ls = new List<Model.ClsSc_MouldMaintainRuleBillSub_Item>(); + ls = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillSub_Item(msg3); int i = 0; - foreach (Model.ClsSc_MouldMaintainBillSub oItemSub in ls) + foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item oItemSub in ls) { i++; @@ -2525,6 +2525,32 @@ //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺 + oBill.DetailCol.Add(oItemSub); + + } + //閰嶄欢椤硅〃浣撴暟鎹� + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg4 = msg4.Substring(1, msg4.Length - 2); + msg4 = msg4.Replace("\\", ""); + msg4 = msg4.Replace("\n", ""); //\n + //msg2 = msg2.Replace("'", "鈥�"); + List<Model.ClsSc_MouldMaintainBillSub> ls1 = new List<Model.ClsSc_MouldMaintainBillSub>(); + ls1 = oListModels.getObjectByJson_Sc_MouldMaintainBillSub(msg4); + int j = 0; + foreach (Model.ClsSc_MouldMaintainBillSub Sub in ls1) + { + + j++; + Sub.HEntryID = j; + //oItemSub.HCloseMan = ""; //琛屽叧闂� + Sub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + Sub.HCloseType = false; //鍏抽棴绫诲瀷 + //oItemSub.HRemark = ""; //澶囨敞 + Sub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� + Sub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� + //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 + //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 + Sub.HRelationQty = 0; //鍏宠仈鏁伴噺 //oItemSub.HRelationMoney = 0; //鍏宠仈閲戦 //HMaterID = "";//閰嶄欢浠g爜 //HUnitID = "";//鍗曚綅浠g爜 @@ -2532,7 +2558,7 @@ //HQtyMust = "";//鍗曚綅鐢ㄩ噺 //HRemark = "";//澶囨敞 - oBill.DetailColl.Add(oItemSub); + oBill.DetailColl.Add(Sub); } //淇濆瓨 @@ -2585,7 +2611,7 @@ if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldMaintainBillList where hmainid= " + HID + " ", "h_v_Sc_MouldMaintainBillList"); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldMaintain where hmainid= " + HID + " ", "h_v_Sc_MouldMaintain"); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄤ繚鍏昏褰曡〃" }; return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; @@ -2630,13 +2656,57 @@ } #endregion + #region[妯″叿淇濆吇璁板綍琛ㄧ紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁鏂�(淇濆吇椤瑰垪琛ㄣ�侀厤浠堕」鍒楄〃)] + [Route("Sc_MouldMaintainBill/Sc_MouldMaintainBillListProjectDetaiNew")] + [HttpGet] + public object Sc_MouldMaintainBillListProjectDetaiNew(string HInterID) + { - #region [妯″叿淇濆吇璁板綍琛ㄥ垹闄ゅ姛鑳絔 - /// <summary> - /// 妯″叿缁翠慨鍗曞垹闄ゅ姛鑳� - /// </summary> - /// <returns></returns> - [Route("Sc_MouldMaintainBill/DeltetSc_MouldMaintainBill")] + DataSet ds,ds1; + List<object> list = new List<object>(); + string Swhere = ""; + try + { + if (HInterID != "" || HInterID != null) + { + Swhere = " and hmainid='" + HInterID + "'"; + } + else + { + Swhere = HInterID; + } + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + //鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁 + string sql = "select HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰鍚嶇О HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_MouldMaintainBillListItem where 1 = 1 " + Swhere + ""; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainBillListItem"); + //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁 + string sql1 = "select HMaterID, 閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HUnitID,鍗曚綅浠g爜 HUnitNumber,鍗曚綅鍚嶇О HUnitName,瀹為檯鐢ㄩ噺 HQty,鏍囧噯鐢ㄩ噺 HQtyMust,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_MouldMaintainBillListItem where 1 = 1 " + Swhere + ""; + ds1 = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainBillListItem"); + list.Add(ds.Tables[0]); + list.Add(ds1.Tables[0]); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.list = list; + } + 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("Sc_MouldMaintainBill/DeltetSc_MouldMaintainBill")] [HttpGet] public object DeltetSc_MouldMaintainBill(string HInterID) { -- Gitblit v1.9.1