From 8783f2569f42b12bb5be50e054abd49ba67a3a4b Mon Sep 17 00:00:00 2001
From: cwjbxqmz <1134865194@qq.com>
Date: 星期四, 12 十月 2023 10:24:56 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 170 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs b/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs
index d20314f..841791d 100644
--- a/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs
+++ b/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs
@@ -257,5 +257,175 @@
}
}
#endregion
+
+ #region 閿�鍞嚭搴�
+ /// <summary>
+ /// 淇濆瓨閿�鍞嚭搴撳崟
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Kf_SellOutBill/SaveSellOutBillList")]
+ [HttpPost]
+ public object SaveSellOutBillList([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 msg3 = sArray[1].ToString();
+ string user = sArray[2].ToString();
+ string OperationType = sArray[3].ToString();
+
+ string UserName = "";
+ ListModels oListModels = new ListModels();
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Kf_SellOutBill_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ DAL.ClsKf_SellOutBillForLayUI oBill = new DAL.ClsKf_SellOutBillForLayUI();
+ List<Model.ClsKf_SellOutBillMain> lsmain = new List<Model.ClsKf_SellOutBillMain>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getSellOutBillMainByJson(msg2);
+ foreach (Model.ClsKf_SellOutBillMain oItem in lsmain)
+ {
+ //oItem.HMaker = "";
+ UserName = oItem.HMaker;
+ oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+ oItem.HBillType = "1205";
+ oItem.HBillSubType = "1205";
+ oItem.HBillStatus = 0;
+ oItem.HPeriod = 0;
+ oItem.HMaker = user;
+ oItem.HMainSourceInterID = oItem.HInterID;
+
+ //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+ if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ oBill.omodel = oItem;
+ }
+ //琛ㄤ綋鏁版嵁
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ msg3 = msg3.Substring(1, msg3.Length - 2);
+ msg3 = msg3.Replace("\\", "");
+ msg3 = msg3.Replace("\n", ""); //\n
+ //msg2 = msg2.Replace("'", "鈥�");
+ List<Model.ClsKf_SellOutBillSub> ls = new List<Model.ClsKf_SellOutBillSub>();
+ ls = oListModels.getSellOutBillSubByJson(msg3);
+ int i = 0;
+ foreach (Model.ClsKf_SellOutBillSub oItemSub in ls)
+ {
+ i++;
+ oItemSub.HSourceEntryID = 0;
+ oItemSub.HSourceInterID = 0;
+ oItemSub.HEntryID = i;
+ // DBUtility.ClsPub.isDate(DateTime.Now);
+ oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+ oItemSub.HCloseType = false;
+ oItemSub.HSourceBillNo = "";
+ oItemSub.HSourceBillType = "";
+ oItemSub.HRelationQty = 0;
+ oItemSub.HRelationMoney = 0;
+ oItemSub.HCloseMan = "";
+ //oItemSub.HRemark = "";
+ oBill.DetailColl.Add(oItemSub);
+
+ }
+
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (Convert.ToInt32(OperationType) == 1)
+ {
+ // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else
+ {
+ bResult = oBill.ModifyBill(oBill.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)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ /// <summary>
+ /// 鏍规嵁ID 鏌ユ壘璁板綍
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Kf_SellOutBill/cx")]
+ [HttpGet]
+ public object cx(long HInterID)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("select * from h_v_IF_SellOutBillList where hmainid=" + HInterID, "h_v_IF_SellOutBillList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "false锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ 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;
+ }
+ }
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1