From 2566524594675a8d742f9ba0eff35dd5d8d33fa2 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期一, 31 三月 2025 12:43:22 +0800 Subject: [PATCH] 排产:Excel导入功能,上传文件时,如果时宝工,则返回excel文件中维护的数量,不然则取生产订单的数量 --- WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs | 73 ++++++++++++++++++++++++++++++++---- 1 files changed, 64 insertions(+), 9 deletions(-) diff --git a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs index 6d03813..6cf5e4b 100644 --- a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs +++ b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs @@ -530,7 +530,7 @@ string sql =string.Format(@"select A.HInterID,b.HEntryID,A.HBillStatus,A.HBillNo,A.HDate,A.HContext,A.HDescription,A.HRemark, A.HQty,A.HSendType,a.HForm,a.HChangeNote,a.HNote,a.HBadProcMan,f1.HName HBadProcManName, a.HQEMan,f2.HName HQEManName,a.HSourceID,s.HName HSourceName,a.HShiftsID,s1.HName HShiftsName, - A.HDeptID,D.HName HDeptName, A.HSendMan, + A.HDeptID,D.HName HDeptName, A.HSendMan,a.HCenterID HCenterID,wo.HName HCenterName, A.HReceiveMan,A.HCopyMan,A.HHasten, A.HLevel,A.HMaterNumber,A.HMaterName,A.HMaterModel, B.HReadFlag, A.HMaker,A.HMakeDate,A.HUpDater,A.HUpDateDate,A.HChecker,A.HCheckDate,A.HCloseMan,A.HCloseDate,A.HDeleteMan,A.HDeleteDate, @@ -545,6 +545,7 @@ left join Gy_Employee f2 on a.HQEMan=f2.HItemID left join Gy_Source s on a.HSourceID=s.HItemID left join Gy_Shifts s1 on a.HShiftsID=s1.HItemID + left join Gy_WorkCenter wo on a.HCenterID=wo.HItemID where A.HInterID='" + HID + "' and b.HEntryID='" + HEntryID + "'"); var dataSet = oCN.RunProcReturn(sql, "OA_ErrMsgBackBillMain"); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) @@ -5484,8 +5485,32 @@ //杩涜闇�瑕佽繘琛岀殑浣滃簾/鍙嶄綔搴熸搷浣� if (IsAudit == 0) //浣滃簾鎻愪氦 { - //浣滃簾鎻愪氦 - if (oBill.Cancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) + //瀹℃牳鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_OA_AndengFlowRuleBill_BeforeDropCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_OA_AndengFlowRuleBill_BeforeDropCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + //瀹℃牳鎻愪氦 + if (oBill.Cancelltion(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_OA_AndengFlowRuleBill_AfterDropCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; @@ -5502,10 +5527,32 @@ return objJsonResult; } } - if (IsAudit == 1) //鍙嶅叧闂彁浜� + if (IsAudit == 1) //鍙嶄綔搴熸彁浜� { - //鍙嶅叧闂彁浜� - if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) + //鍙嶅鏍稿墠鎺у埗========================================= + string sql1 = "exec h_p_OA_AndengFlowRuleBill_BeforeUnDropCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_OA_AndengFlowRuleBill_BeforeUnDropCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //=========================================================== + + //鍙嶄綔搴熸彁浜� + if (oBill.AbandonCancelltion(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldMaintainRuleBill_AfterUnDropCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; @@ -6770,13 +6817,21 @@ [Route("Sc_MESTransFerWorkBill/GetSc_MESTransFerWorkBillQuery")] [HttpGet] - public object GetSc_MESTransFerWorkBillQuery(string user) + public object GetSc_MESTransFerWorkBillQuery(string sWhere, string user) { try { + Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere); + + + string HStatus = dic["HStatus"].ToString();//鏃堕棿鐘舵�� + string HBeginDate = dic["HBeginDate"].ToString();//寮�濮嬫棩鏈� + string HEndDate = dic["HEndDate"].ToString();//缁撴潫鏃ユ湡 + string HSourceID = dic["HSourceID"].ToString();//鐢熶骇璧勬簮 + List<object> columnNameList = new List<object>(); - ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSelfQuery " + user, "h_p_OA_ErrMsgBackSelfQuery"); + ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSelfQuery '" + HStatus + "','" + HBeginDate + "','" + HEndDate + "','" + HSourceID + "','" + user + "'" , "h_p_OA_ErrMsgBackSelfQuery"); if (ds.Tables[0].Rows.Count != 0 || ds != null) { @@ -6826,7 +6881,7 @@ List<object> columnNameList = new List<object>(); string sql = "select a.HSourceBillNo 娴佽浆鍗″彿,a.HSourceBillType 娴佽浆鍗$被鍨�,a.HSourceInterID 娴佽浆鍗′富鍐呯爜,a.HSourceEntryID 娴佽浆鍗″瓙鍐呯爜,b.HNumber 鐗╂枡浠g爜,b.HName 鐗╂枡鍚嶇О,b.HModel 瑙勬牸鍨嬪彿,a.HDatePlanQty 璁″垝鏁伴噺,a.HSourceID,c.HName 鐢熶骇璧勬簮 from Sc_ICMOBillStatus_Tmp a " + - "left join Gy_Material b on a.HMaterID=b.HItemID left join Gy_Source c on a.HSourceID=c.HItemID where HSourceBillNo='" + HSourceBill + "'"; + "left join Gy_Material b on a.HMaterID=b.HItemID left join Gy_Source c on a.HSourceID=c.HItemID where HSourceBillNo='" + HSourceBill + "' and a.HICMOStatus=1"; ds = oCN.RunProcReturn(sql, "Sc_ICMOBillStatus_Tmp"); //娣诲姞鍒楀悕 -- Gitblit v1.9.1