From 2bb3673239583ad491a6247de834ef80c079f5bb Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 18 十月 2023 13:35:20 +0800
Subject: [PATCH] 凯贝生成送货单
---
WebAPI/Controllers/QuotePriceBilController.cs | 220 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 220 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/QuotePriceBilController.cs b/WebAPI/Controllers/QuotePriceBilController.cs
index f286c0b..aa2f3b3 100644
--- a/WebAPI/Controllers/QuotePriceBilController.cs
+++ b/WebAPI/Controllers/QuotePriceBilController.cs
@@ -62,5 +62,225 @@
}
#endregion
+
+ #region 渚涘簲鍟嗘姤浠峰崟 淇濆瓨/缂栬緫
+ /// <summary>
+ /// 渚涘簲鍟嗘姤浠峰崟 淇濆瓨
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Sup_QuotePriceBill/SaveQuotePriceBill")]
+ [HttpPost]
+ public object SaveQuotePriceBill([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 msg4 = sArray[2].ToString();
+
+
+ string UserName = "";
+ ListModels oListModels = new ListModels();
+ try
+ {
+ DAL.ClsSup_QuotePriceBill oBill = new DAL.ClsSup_QuotePriceBill();
+ List<Model.ClsSup_QuotePriceBillMain> lsmain = new List<Model.ClsSup_QuotePriceBillMain>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_ClsSup_QuotePriceBillMain(msg2);
+ foreach (Model.ClsSup_QuotePriceBillMain oItem in lsmain)
+ {
+ //oItem.HMaker = "";
+ UserName = oItem.HMaker; //鍒跺崟浜�
+ oItem.HBillType = "1121";
+ oItem.HBillSubType = "1121";
+ oItem.HBillStatus = 1;
+ DBUtility.ClsPub.CurUserName = UserName;
+ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+
+ 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.ClsSup_QuotePriceBillSub> ls = new List<Model.ClsSup_QuotePriceBillSub>();
+ ls = oListModels.getObjectByJson_ClsSup_QuotePriceBillSub(msg3);
+ int i = 0;
+ foreach (Model.ClsSup_QuotePriceBillSub oItemSub in ls)
+ {
+
+ i++;
+ oItemSub.HEntryID = i;
+ //oItemSub.HCloseMan = ""; //琛屽叧闂�
+ oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+ oItemSub.HCloseType = false; //鍏抽棴绫诲瀷
+ //oItemSub.HRemark = ""; //澶囨敞
+ oItemSub.HSourceInterID = oItemSub.HSourceInterID; // 婧愬崟涓诲唴鐮�
+ oItemSub.HSourceEntryID = oItemSub.HSourceEntryID; //婧愬崟瀛愬唴鐮�
+ oItemSub.HSourceBillNo = oItemSub.HSourceBillNo; //婧愬崟鍗曞彿
+ oItemSub.HSourceBillType = oItemSub.HSourceBillType; //婧愬崟绫诲瀷
+ oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺
+
+ oBill.DetailColl.Add(oItemSub);
+
+ }
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.omodel.HInterID == 0)
+ {
+ // 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 = "淇濆瓨鎴愬姛锛�";
+ 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
+
+ //#region 渚涘簲鍟嗘姤浠峰崟 鍒犻櫎
+ [Route("Sup_QuotePriceBill/DelQuotePriceBill")]
+ [HttpGet]
+ public object DelQuotePriceBill(string HInterID, string user)
+ {
+ Int64 lngBillKey = 0;
+ lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+ if (lngBillKey == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ DAL.ClsSup_QuotePriceBill oBill = new DAL.ClsSup_QuotePriceBill();
+ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ ds = oCN.RunProcReturn("select * from Sup_QuotePriceBillMain where HInterID=" + lngBillKey, "Sup_QuotePriceBillMain");
+ if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo);
+ if (IsDete)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //#endregion
+
+ #region 鑾峰彇婧愬崟淇℃伅-璇环鍗�
+ [Route("GetAskPriceInfo")]
+ [HttpGet]
+ public object GetAskPriceInfo(string HInterID, string HEntryID,string HIEs)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ string sql = "select * from h_v_Sup_AskPriceBill where HIEs in ( " + HIEs + ")";
+ ds = oCN.RunProcReturn(sql, "h_v_Sup_QuotePriceBill");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.list = columnNameList;
+ 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
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1