From 7953aa09d09ed7889f8806f1e4fe2ccc18c1f548 Mon Sep 17 00:00:00 2001 From: WYB <908761037@qq.com> Date: 星期二, 06 四月 2021 17:34:44 +0800 Subject: [PATCH] 工序计划单下推-保存逻辑编写 --- WebAPI/Controllers/Sc_ProcessMangementController.cs | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 105 insertions(+), 6 deletions(-) diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs index f8db5fe..2b9db17 100644 --- a/WebAPI/Controllers/Sc_ProcessMangementController.cs +++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs @@ -215,15 +215,114 @@ try { - DAL.ClsSc_ProcessSendWork dal = new DAL.ClsSc_ProcessSendWork(); + DAL.ClsSc_ProcessSendWork Sendwork = new DAL.ClsSc_ProcessSendWork(); List<Model.ClsSc_ProcessSendWorkMain> lsmain = new List<Model.ClsSc_ProcessSendWorkMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); + lsmain = oListModels.getObjectByJson_SendWorkMain(msg2); + foreach ( Model.ClsSc_ProcessSendWorkMain oItem in lsmain) + { + UserName = oItem.HMaker; + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HDate = DateTime.Now; + oItem.HMainSourceInterID = oItem.HInterID; + oItem.HInterID = 0; + + if (DBUtility.ClsPub.isStrNull(oItem.HPlanBeginDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊~鍐欒鍒掑紑宸ユ棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + + Sendwork.omodel = oItem; - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; - objJsonResult.data = 1; - return objJsonResult; + } + + //琛ㄤ綋鏁版嵁 + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + List<WebAPI.Models.Sc_ProcessPlanViewModel> ls = new List<WebAPI.Models.Sc_ProcessPlanViewModel>(); + ls = oListModels.getObjectByJson_SendWorkSub(msg3); + int i = 0; + Model.ClsSc_ProcessSendWorkSub sendworksub = new Model.ClsSc_ProcessSendWorkSub(); + foreach (WebAPI.Models.Sc_ProcessPlanViewModel oItemSub in ls) + { + + //foreach (var item in collection) + //{ + + //} + //i++; + //if (oItemSub.HQty <= 0) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛屾暟閲忎笉澶т簬0鏃犳硶淇濆瓨锛�"; + // objJsonResult.data = 1; + // return objJsonResult; + //} + //if (oItemSub.HQty > oItemSub.HRelationQty) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛屾暟閲忎笉鑳藉ぇ浜庢湭鍏宠仈鏁伴噺锛�"; + // objJsonResult.data = 1; + // return objJsonResult; + //} + //if (DBUtility.ClsPub.isStrNull(oItemSub.HBatChNo) == "") + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛屾湭濉啓鎵瑰彿锛�"; + // objJsonResult.data = 1; + // return objJsonResult; + //} + + //oItemSub.HEntryID = i; + //oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + //oItemSub.HRemark = ""; + //oItemSub.HCloseMan = ""; + //oItemSub.HCloseType = false; + //Sendwork.DetailColl.Add(oItemSub); + + + } + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (Sendwork.omodel.HInterID == 0) + { + // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + bResult = Sendwork.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = Sendwork.ModifyBill(Sendwork.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } } catch (Exception e) { -- Gitblit v1.9.1