From 89793cb2f9d4eb80582d0b5dda465881ff9a8382 Mon Sep 17 00:00:00 2001 From: chenhaozhe <cgz@hz-kingdee.com> Date: 星期三, 21 五月 2025 19:58:54 +0800 Subject: [PATCH] feat: 系统参数 Xt_SystemParameter 添加删除方法 Xt_SystemParameterDelete --- WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs | 472 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 439 insertions(+), 33 deletions(-) diff --git "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs" "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs" index cd518ae..fc0c05d 100644 --- "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs" +++ "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs" @@ -62,6 +62,54 @@ } } + [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillListExtendMakeDate")] + [HttpGet] + public object JIT_DayPlanPlatFormBillListExtendMakeDate(string sWhere, string user) + { + try + { + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillSortBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺 + omdelMian = JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(sWhere); + + ds = oCN.RunProcReturn($"exec h_p_JIT_Sc_WorkBillSortBill_Query_ExtendMakeDate '{omdelMian.HPlanBeginDate}',{(omdelMian.HProdORGID == null ? 0 : omdelMian.HProdORGID)},'{omdelMian.HSeOrderBillNo}'" + + $",'{omdelMian.HPlanEndDate.AddDays(1)}',{omdelMian.HMaterID},'{omdelMian.HICMOBillNo}',{omdelMian.HWorkShopID}" + + $",'{omdelMian.HMastersDate}','{ omdelMian.HMakeDate }','{omdelMian.sWheres}'", "h_p_JIT_Sc_WorkBillSortBill_QueryExtendMakeDate"); + + + foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢� + { + Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆 + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> /// 鏍规嵁ID鏌ヨ 榻愬鐘舵�� 鍜� 閿佸畾鐘舵�� /// </summary> @@ -242,7 +290,7 @@ LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd")); - if (oSystemParameter.omodel.WMS_CampanyName != "娣诲悍绉戞妧") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 + if (oSystemParameter.omodel.WMS_CampanyName != "娣诲悍绉戞妧"&& oSystemParameter.omodel.WMS_CampanyName != "涓夊崌") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { if (HSourceID == "" || HSourceID == "0") { @@ -254,7 +302,7 @@ } } ds = oCN.RunProcReturn($"select HInterID,HICMOBillNo from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" + - $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain"); + $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID} and ISNULL(HDeleteMan,'')=''", "Sc_WorkBillSortBillMain"); if (ds.Tables[0].Rows.Count > 0) { @@ -333,7 +381,7 @@ LogService.CustomWriteLog("2.1:"+i, DateTime.Now.ToString("yyyy-MM-dd")); - if (oSystemParameter.omodel.WMS_CampanyName != "娣诲悍绉戞妧") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 + if (oSystemParameter.omodel.WMS_CampanyName != "娣诲悍绉戞妧" && oSystemParameter.omodel.WMS_CampanyName != "涓夊崌") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { if (HSourceID == "" || HSourceID == "0") { @@ -470,13 +518,13 @@ else { ds = oCN.RunProcReturn($"select HInterID,HICMOBillNo from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" + - $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain"); + $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID} and ISNULL(HDeleteMan,'') = ''", "Sc_WorkBillSortBillMain"); if (ds.Tables[0].Rows.Count > 1) { LogService.CustomWriteLog("绗�" + i + 1 + "琛岀敓浜ц祫婧愭湁閲嶅,璇蜂慨鏀�", DateTime.Now.ToString("yyyy-MM-dd")); LogService.CustomWriteLog($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + - $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", DateTime.Now.ToString("yyyy-MM-dd")); + $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID} and ISNULL(HDeleteMan,'')=''", DateTime.Now.ToString("yyyy-MM-dd")); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = $"绗瑊i + 1}琛岀敓浜ц祫婧愭湁閲嶅,璇蜂慨鏀�!"; @@ -518,7 +566,7 @@ for (int j = 0; j < SumDay; j++) { //涓昏〃瀛愯〃閮芥湁鏁版嵁 - if (list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString() != "") + if (list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString() != ""&& Math.Round(double.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()),1)>0) { SumCount += 1; ////淇濆瓨瀛愯〃 @@ -580,35 +628,64 @@ } public json AddBillSub(string HInterID, string HBillNo, DateTime date, double HQTY, Dictionary<string, string> dic) - { + { + string sReturn = ""; + oSystemParameter.ShowBill(ref sReturn); + //鑾峰彇琛ㄦ牸鏁版嵁 ds = oCN.RunProcReturn($"select * from h_v_JIT_Sc_WorkBillSortBill_PC where 鍗曟嵁鍙�='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBill_PC"); int count = 0; if (ds.Tables[0].Rows.Count > 0) { - //鍒ゆ柇瀛愯〃鏄惁鏈夊綋鏃ョ殑鏃ユ湡浠ュ強鏃ユ湡鎵�瀵瑰簲鐨勬暟閲� - for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + if (oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { - if (DateTime.Parse(ds.Tables[0].Rows[i]["鏃ヨ鍒掔敓浜ф棩鏈�"].ToString()) == date) + //鍒ゆ柇瀛愯〃鏄惁鏈夊綋鏃ョ殑鏃ユ湡浠ュ強鏃ユ湡鎵�瀵瑰簲鐨勬暟閲� + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { - oCN.RunProc($"update Sc_WorkBillSortBillSub set HMasterDate='{date}',HQty={HQTY},HUseTimes={(dic["灏忔椂浜ц兘"]=="0"?0: HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString()))}" + - $" where HInterID={HInterID} and HEntryID={ds.Tables[0].Rows[i]["hsubid"].ToString()}"); - count += 1; + if (DateTime.Parse(ds.Tables[0].Rows[i]["鏃ヨ鍒掔敓浜ф棩鏈�"].ToString()) == date) + { + oCN.RunProc($"update Sc_WorkBillSortBillSub set HMasterDate='{date}',HQty={HQTY},HUseTimes={(dic["浜х嚎鎬讳骇鑳�"] == "0" ? 0 : HQTY / float.Parse(dic["浜х嚎鎬讳骇鑳�"].ToString()))}" + + $" where HInterID={HInterID} and HEntryID={ds.Tables[0].Rows[i]["hsubid"].ToString()}"); + count += 1; + } } } + else + { + //鍒ゆ柇瀛愯〃鏄惁鏈夊綋鏃ョ殑鏃ユ湡浠ュ強鏃ユ湡鎵�瀵瑰簲鐨勬暟閲� + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + if (DateTime.Parse(ds.Tables[0].Rows[i]["鏃ヨ鍒掔敓浜ф棩鏈�"].ToString()) == date) + { + oCN.RunProc($"update Sc_WorkBillSortBillSub set HMasterDate='{date}',HQty={HQTY},HUseTimes={(dic["灏忔椂浜ц兘"] == "0" ? 0 : HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString()))}" + + $" where HInterID={HInterID} and HEntryID={ds.Tables[0].Rows[i]["hsubid"].ToString()}"); + count += 1; + } + } + } } if (count != 1) { - //鎻掑叆瀛愯〃 - oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," + - "HMasterDate,HQty,HUseTimes)" + - $"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," + - $" '{date}', {HQTY},{ ((dic["灏忔椂浜ц兘"] == "0.0000" ? 0 : dic["灏忔椂浜ц兘"] == "0" ? 0 : HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString())).ToString() == "闈炴暟瀛�" ? 0 : dic["灏忔椂浜ц兘"] == "0.0000" ? 0 : dic["灏忔椂浜ц兘"] == "0" ? 0 : HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString())) })"); + if (oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 + { + //鎻掑叆瀛愯〃 + oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," + + "HMasterDate,HQty,HUseTimes)" + + $"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," + + $" '{date}', {HQTY},{ ((dic["浜х嚎鎬讳骇鑳�"] == "0.0000" ? 0 : dic["浜х嚎鎬讳骇鑳�"] == "0" ? 0 : HQTY / float.Parse(dic["浜х嚎鎬讳骇鑳�"].ToString())).ToString() == "闈炴暟瀛�" ? 0 : dic["浜х嚎鎬讳骇鑳�"] == "0.0000" ? 0 : dic["浜х嚎鎬讳骇鑳�"] == "0" ? 0 : HQTY / float.Parse(dic["浜х嚎鎬讳骇鑳�"].ToString())) })"); + } + else + { + //鎻掑叆瀛愯〃 + oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," + + "HMasterDate,HQty,HUseTimes)" + + $"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," + + $" '{date}', {HQTY},{ ((dic["灏忔椂浜ц兘"] == "0.0000" ? 0 : dic["灏忔椂浜ц兘"] == "0" ? 0 : HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString())).ToString() == "闈炴暟瀛�" ? 0 : dic["灏忔椂浜ц兘"] == "0.0000" ? 0 : dic["灏忔椂浜ц兘"] == "0" ? 0 : HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString())) })"); + } } - string sReturn = ""; - oSystemParameter.ShowBill(ref sReturn); + if (oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { //鎶婃帓浜ц鍗曞畬宸ユ棩鏈熷弽鍐欏埌閲戣澏閿�鍞鍗曚笂 @@ -961,9 +1038,9 @@ } #endregion - [Route("JIT_DayPlanPlatFormBill/JIT_CompleteSetAnalysis")] - [HttpGet] - public object JIT_CompleteSetAnalysis(string sWhere, string user) + #region 榻愬鍒嗘瀽 鍘熻皟鐢ㄦ柟娉� + + public object JIT_CompleteSetAnalysis_Old(string sWhere, string user) { try { @@ -1410,6 +1487,103 @@ return objJsonResult; } } + + #endregion + + #region 榻愬鍒嗘瀽璋冪敤鏂规硶 20250402 + + [Route("JIT_DayPlanPlatFormBill/JIT_CompleteSetAnalysis")] + [HttpGet] + public object JIT_CompleteSetAnalysis(string sWhere, string user) + { + try + { + string sErrMsg = ""; + if (oSystemParameter.ShowBill(ref sErrMsg) == true) + { + if (oSystemParameter.omodel.WMS_CampanyName == "甯呭▉" + || oSystemParameter.omodel.WMS_CampanyName == "鍑礉濂堢壒" + || oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧" + || oSystemParameter.omodel.WMS_CampanyName == "瀹濆伐") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 + { + objJsonResult = (json)JIT_CompleteSetAnalysis_Old(sWhere, user); + } + else + { + objJsonResult = (json)JIT_CompleteSetAnalysis_New(sWhere, user); + } + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + LogService.Write("榻愬鍒嗘瀽鎿嶄綔澶辫触锛�" + e.Message.ToString()); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 榻愬鍒嗘瀽 鏂拌皟鐢ㄦ柟娉� + /// </summary> + /// <returns></returns> + public object JIT_CompleteSetAnalysis_New(string sWhere, string user) + { + try + { + omdelMian = JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(sWhere); + string HWorkShopID = omdelMian.HWorkShopID.ToString(); + var HStockOrgID = omdelMian.HProdORGID; + + ds = oCN.RunProcReturn("exec h_p_JIT_CompleteSetAnalysis " + HWorkShopID.ToString() + ",'" + user + "'," + HStockOrgID.ToString(), "h_p_JIT_CompleteSetAnalysis"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "榻愬鍒嗘瀽鍙戠敓閿欒锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); //杩愮畻鎴愬姛 + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "榻愬鍒嗘瀽澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + #endregion #region 鐢熶骇鏃ヨ鍒掑钩鍙� 鎻愭枡杩愮畻 @@ -1775,6 +1949,7 @@ string fProWorkShopId = omdelMian.HWorkShopID.ToString(); var fPrdOrgId = omdelMian.HProdORGID; string sqlName = "";//AIS20210811135644 + string WMS_CampanyName = ""; //瀹㈡埛鍚嶇О //瀹㈡埛鍒跺畾 string sErr = ""; if (oSystemParameter.ShowBill(ref sErr)) @@ -1782,36 +1957,58 @@ if (oSystemParameter.omodel.WMS_CampanyName == "甯呭▉") { sqlName = "AIS20230129011339"; + WMS_CampanyName = "甯呭▉"; } else if (oSystemParameter.omodel.WMS_CampanyName == "鍑礉濂堢壒") { sqlName = "AIS20210820164804"; + WMS_CampanyName = "鍑礉濂堢壒"; } else if (oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧") { sqlName = "AIS20240809105013"; + WMS_CampanyName = "娣诲悍绉戞妧"; } else if (oSystemParameter.omodel.WMS_CampanyName == "瀹濆伐") { sqlName = "AIS20250102123554"; + WMS_CampanyName = "瀹濆伐"; } else { sqlName = "AIS20210811135644"; } + + if (WMS_CampanyName == "瀹濆伐") + { + objJsonResult = (json)JIT_MOMaterLack(fProWorkShopId, fPrdOrgId, user); + } + else if (HTLType == "缂烘枡") + { + if (WMS_CampanyName == "甯呭▉" || WMS_CampanyName == "鍑礉濂堢壒" || WMS_CampanyName == "娣诲悍绉戞妧") + { + objJsonResult = (json)JIT_QL(fProWorkShopId, fPrdOrgId, user, sqlName); + } + else + { + objJsonResult = (json)JIT_MOMaterReady(fProWorkShopId, fPrdOrgId, user); + } + } + else if (HTLType == "鐢熶骇鐢ㄦ枡娓呭崟") + { + objJsonResult = (json)JIT_PPBOM(fProWorkShopId, fPrdOrgId, user, sqlName); + } + + return objJsonResult; } - - - if (HTLType == "缂烘枡") + else { - objJsonResult = (json)JIT_QL(fProWorkShopId, fPrdOrgId, user, sqlName); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErr; + objJsonResult.data = null; + return objJsonResult; } - else if (HTLType == "鐢熶骇鐢ㄦ枡娓呭崟") - { - objJsonResult=(json)JIT_PPBOM(fProWorkShopId, fPrdOrgId, user, sqlName); - } - - return objJsonResult; } catch (Exception e) { @@ -2733,6 +2930,145 @@ return objJsonResult; } } + + /// <summary> + /// 閫氳繃娆犳枡琛� 绠楁彁鏂� 瀹濆伐 + /// </summary> + /// <returns></returns> + public object JIT_MOMaterLack(string HWorkShopID, int? HProdORGID, string user) + { + try + { + ds = oCN.RunProcReturn("exec h_p_JIT_PODemandPlanBill_MOMaterLack " + HWorkShopID.ToString() + ",'" + user + "'," + HProdORGID.ToString(), "h_p_JIT_PODemandPlanBill_MOMaterLack"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎻愭枡杩愮畻鍙戠敓閿欒锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); //杩愮畻鎴愬姛 + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎻愭枡杩愮畻澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 閫氳繃榻愬琛� 绠楁彁鏂� + /// </summary> + /// <returns></returns> + public object JIT_MOMaterReady(string HWorkShopID, int? HProdORGID, string user) + { + try + { + ds = oCN.RunProcReturn("exec h_p_JIT_PODemandPlanBill_MOMaterReady " + HWorkShopID.ToString() + ",'" + user + "'," + HProdORGID.ToString(), "h_p_JIT_PODemandPlanBill_MOMaterReady"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎻愭枡杩愮畻鍙戠敓閿欒锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); //杩愮畻鎴愬姛 + 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 鐢熶骇鏃ヨ鍒掑钩鍙� 瑕佹枡杩愮畻 + + [Route("JIT_DayPlanPlatFormBill/JIT_YLYS")] + [HttpGet] + public object JIT_YLYS(string sWhere, string user) + { + try + { + omdelMian = JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(sWhere); + string HWorkShopID = omdelMian.HWorkShopID.ToString(); + var HStockOrgID = omdelMian.HProdORGID; + + ds = oCN.RunProcReturn("exec h_p_JIT_WorkDemandPlanBill_MOMaterReady " + HWorkShopID.ToString() + ",'" + user + "'," + HStockOrgID.ToString(), "h_p_JIT_WorkDemandPlanBill_MOMaterReady"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瑕佹枡杩愮畻鍙戠敓閿欒锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); //杩愮畻鎴愬姛 + 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 鐢熶骇鏃ヨ鍒掑钩鍙� 閿佸畾 @@ -2956,6 +3292,74 @@ else { DataRow dr = dt.NewRow(); + dr["灏忔椂浜ц兘"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["浜ц兘"]); + dr["鐢熶骇鍛ㄦ湡"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["鐢熶骇鍛ㄦ湡"]); + dr["寮�宸ヤ綑閲�"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["寮�宸ヤ綑閲�"]); + dr["鏈�杩熷紑宸ユ棩鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["鏈�杩熷紑宸ユ棩鏈�"]); + dr["鏈�杩熷畬宸ユ棩鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["鏈�杩熷畬宸ユ棩鏈�"]); + dr["璁㈠崟闇�姹傛暟閲�"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["璁㈠崟闇�姹傛暟"]); + dr["璁㈠崟浜よ揣鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["璁㈠崟浜よ揣鏈�"]); + dr["HICMOInterID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOInterID"]); + dr["HICMOEntryID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOEntryID"]); + dt.Rows.Add(dr); + } + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = dt; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鐢熶骇鏃ヨ鍒掑钩鍙� 鏁版嵁鍑嗗 璁剧疆浠诲姟鍗曠浉鍏充俊鎭�(涓夊崌) + [Route("JIT_DayPlanPlatFormBill/ReadyData_SS")] + [HttpGet] + public object ReadyData_SS(string SWhere) + { + try + { + var list = SWhere.Split(','); + DataTable dt = new DataTable("date"); + dt.Columns.Add("HICMOInterID", typeof(string)); + dt.Columns.Add("HICMOEntryID", typeof(string)); + dt.Columns.Add("灏忔椂浜ц兘", typeof(string)); + dt.Columns.Add("鐢熶骇鍛ㄦ湡", typeof(decimal)); + dt.Columns.Add("寮�宸ヤ綑閲�", typeof(decimal)); + dt.Columns.Add("鏈�杩熷紑宸ユ棩鏈�", typeof(DateTime)); + dt.Columns.Add("鏈�杩熷畬宸ユ棩鏈�", typeof(DateTime)); + dt.Columns.Add("璁㈠崟闇�姹傛暟閲�", typeof(decimal)); + dt.Columns.Add("璁㈠崟浜よ揣鏈�", typeof(DateTime)); + dt.Columns.Add("HSourceID", typeof(decimal)); + dt.Columns.Add("鐢熶骇璧勬簮", typeof(string)); + + for (int i = 0; i < list.Length; i++) + { + string HICMOInterID = list[i].Split(';')[0].ToString(); + string HICMOEntryID = list[i].Split(';')[1].ToString(); + string HSourceID = list[i].Split(';')[2].ToString(); + + Thread.Sleep(100); + ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID + "," + HICMOEntryID + "," + HSourceID, "h_p_Sc_GetInfoByICMOBillNo"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + + } + else + { + DataRow dr = dt.NewRow(); + dr["HSourceID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HSourceID"]); + dr["鐢熶骇璧勬簮"] = ds.Tables[0].Rows[0]["鐢熶骇璧勬簮"].ToString(); dr["灏忔椂浜ц兘"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["浜ц兘"]); dr["鐢熶骇鍛ㄦ湡"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["鐢熶骇鍛ㄦ湡"]); dr["寮�宸ヤ綑閲�"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["寮�宸ヤ綑閲�"]); @@ -3376,5 +3780,7 @@ } #endregion + + } } \ No newline at end of file -- Gitblit v1.9.1