From f896cf78d10458574f50265c7d0ece09e15dc005 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期五, 08 三月 2024 11:56:06 +0800 Subject: [PATCH] 销售出库单:取消手动审核、反审核反写销售订单数据 --- WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 165 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs index 14811d3..830ec93 100644 --- a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs +++ b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs @@ -581,5 +581,170 @@ } #endregion + + #region 鎶ュ伐骞冲彴寮傚父鍙嶉鍗曞洖澶� + /// <summary> + /// 寮傚父鍙嶉鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sc_MESTransFerWorkBill/ReplyMESTransFerWorkFrom")] + [HttpPost] + public object ReplyMESTransFerWorkFrom([FromBody] JObject msg) + { + + var _value = msg["msg"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string UserName = sArray[1].ToString(); + string refSav = sArray[2].ToString(); + DBUtility.ClsPub.CurUserName = UserName; + + //淇濆瓨鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second("OA_ErrMsgBackBill_Edit", 1, false, DBUtility.ClsPub.CurUserName)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DateTime.Now, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s; + objJsonResult.data = null; + return objJsonResult; + } + + ListModels oListModels = new ListModels(); + try + { + DLL.ClsOA_ErrMsgBackBill oBill = new DLL.ClsOA_ErrMsgBackBill(); + List<Models.ClsOA_ErrMsgBackBillSub> lsmain = new List<Models.ClsOA_ErrMsgBackBillSub>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_MESTransFerWorkBillSub(msg2); + + foreach (Models.ClsOA_ErrMsgBackBillSub DetailReply in lsmain) + { + oBill.DetailReply = DetailReply; + } + + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + + if (oBill.DetailReply.HInterID != 0) + { + bResult = oBill.ReplyBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = false; + } + + if (bResult) + { + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍥炲鎴愬姛锛�"; + 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) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = e.Message; + objJsonResult.data = 1; + return objJsonResult; + } + } + #endregion + + #region 寮傚父鍙嶉鍒楄〃鍥炲鑾峰彇鏁版嵁 + [Route("Sc_MESTransFerWorkBill/Get_TransFerReplyBill")] + [HttpGet] + public object Get_TransFerReplyBill(string sWhere, string user) + { + try + { + + string sql1 = "select * from h_v_OA_ErrMsgBackBillSubList where 1 = 1 "; + string sql = sql1 + sWhere + " order by HInterID desc"; + ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackBillSubList"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 寮傚父鍙嶉鍒楄〃鍥炲鏇存敼鐘舵�� + [Route("Sc_MESTransFerWorkBill/Update_TransFerReplyBill")] + [HttpGet] + public object Update_TransFerReplyBill(Int64 HInterID, string HEntryID,Int64 Type) + { + try + { + string sql = ""; + switch (Type) + { + case 9: + sql = "update OA_ErrMsgBackBillSub set HSendStatus = 9 where HInterID = " + HInterID + " and HEntryID in (" + HEntryID + ")"; + break; + case 10: + sql = "update OA_ErrMsgBackBillSub set HSendStatus = 10 where HInterID = " + HInterID + " and HEntryID in (" + HEntryID + ")"; + break; + } + + oCN.RunProc(sql); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = 1; + 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