From 7eb2427db47b9cd9413a3ef51afd34658ed71c3d Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期三, 26 三月 2025 10:58:25 +0800 Subject: [PATCH] 销售核销 --- WebAPI/Controllers/EntrustOutController.cs | 118 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 93 insertions(+), 25 deletions(-) diff --git a/WebAPI/Controllers/EntrustOutController.cs b/WebAPI/Controllers/EntrustOutController.cs index 9fd45b4..c427c0f 100644 --- a/WebAPI/Controllers/EntrustOutController.cs +++ b/WebAPI/Controllers/EntrustOutController.cs @@ -100,6 +100,71 @@ } + ///// <summary> + ///// 鍐欏叆涓存椂琛� 鎵簮鍗曠殑鏂规硶 + ///// </summary> + ///// <param name="HSourceBillNo"></param> + ///// <returns></returns> + //[Route("EntrustOut/set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json")] + //[HttpGet] + //public object set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json(long sNewInterID, string sNewBillNo,string sSourceBillNo, string HSourceBillType ) + //{ + // string sNewBillType = "1211"; + // string sSourceBillType = "1604"; + // string sRedBlueflag = "钃濆瓧"; + // try + // { + + // string sWhere = "where 鍗曟嵁鍙� like '%" + sSourceBillNo + "%'"; + // //ds = BLL.ClsSourceBill.getSourceBillList(sWhere, HSourceBillType); + // ds = new BLL.ClsKf_EntrustOutBill().GetWW_WWPPBomList(sWhere, ref DBUtility.ClsPub.sExeReturnInfo); + // if (ds == null) + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犳婧愬崟鍙凤紒"; + // objJsonResult.data = null; + // return objJsonResult; + // } + + // //else + // //{ + // // objJsonResult.code = "0"; + // // objJsonResult.count = 1; + // // objJsonResult.Message = "Success"; + // // objJsonResult.data = ds; + // // return objJsonResult; + // //} + // DAL.ClsKF_PonderationBillMain_Temp_Ctl dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl(); + // if (dal.AddNew_Source(sNewInterID, sNewBillNo, sNewBillType, sSourceBillNo, sSourceBillType, sRedBlueflag, ref DBUtility.ClsPub.sExeReturnInfo)) + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 1; + // objJsonResult.Message = "淇濆瓨鍒板嚭鍏ュ簱鏉$爜涓存椂琛ㄦ垚鍔燂紒"; + // objJsonResult.data = ds; + // return objJsonResult; + // } + // else + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "淇濆瓨鍒板嚭鍏ュ簱鏉$爜涓存椂琛ㄥけ璐ワ紒"; + // objJsonResult.data = null; + // return objJsonResult; + // } + // } + // catch (Exception ex) + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛佸紓甯�"+ex.ToString(); + // objJsonResult.data = null; + // return objJsonResult; + // } + //} + + + /// <summary> /// 鍐欏叆涓存椂琛� 鎵簮鍗曠殑鏂规硶 /// </summary> @@ -107,7 +172,7 @@ /// <returns></returns> [Route("EntrustOut/set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json")] [HttpGet] - public object set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json(long sNewInterID, string sNewBillNo,string sSourceBillNo, string HSourceBillType ) + public object set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json(string HSourceBillType, string HSourceBillNo, Int64 sInterID, string sBillNo) { string sNewBillType = "1211"; string sSourceBillType = "1604"; @@ -115,40 +180,34 @@ try { - string sWhere = "where 鍗曟嵁鍙� like '%" + sSourceBillNo + "%'"; - //ds = BLL.ClsSourceBill.getSourceBillList(sWhere, HSourceBillType); - ds = new BLL.ClsKf_EntrustOutBill().GetWW_WWPPBomList(sWhere, ref DBUtility.ClsPub.sExeReturnInfo); - if (ds == null) + string sWhere = "where 鍗曟嵁鍙� like '%" + HSourceBillNo.Trim() + "%'"; + ds = webserver.GetWW_WWPPBomList(sWhere); + if (ds == null || ds.Tables[0].Rows.Count <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鏃犳婧愬崟鍙凤紒"; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍,婧愬崟绫诲瀷鏈夐敊璇紒"; objJsonResult.data = null; return objJsonResult; } + HSupID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HSupID"]); + HSupName = Convert.ToString(ds.Tables[0].Rows[0]["HSupName"]); + HDeptID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HDeptID"]); + HDeptName = Convert.ToString(ds.Tables[0].Rows[0]["HDeptName"]); - //else - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 1; - // objJsonResult.Message = "Success"; - // objJsonResult.data = ds; - // return objJsonResult; - //} - DAL.ClsKF_PonderationBillMain_Temp_Ctl dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl(); - if (dal.AddNew_Source(sNewInterID, sNewBillNo, sNewBillType, sSourceBillNo, sSourceBillType, sRedBlueflag, ref DBUtility.ClsPub.sExeReturnInfo)) + if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, HBillType, HSourceBillNo, HSourceBillType, "钃濆瓧", ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "淇濆瓨鍒板嚭鍏ュ簱鏉$爜涓存椂琛ㄦ垚鍔燂紒"; - objJsonResult.data = ds; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨鍒板嚭鍏ュ簱鏉$爜涓存椂琛ㄥけ璐ワ紒"; + objJsonResult.Message = "鍐欏叆涓存椂琛ㄥけ璐ワ紒" + DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } @@ -157,11 +216,12 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛佸紓甯�"+ex.ToString(); + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛佸紓甯�" + ex.ToString(); objJsonResult.data = null; return objJsonResult; } } + public bool AddNew_Source(long sNewInterID, string sNewBillNo, string sNewBillType, string sSourceBillNo, string sSourceBillType, string sRedBlueflag, ref string sReturn) { @@ -400,17 +460,22 @@ websLsmain.HBillNo = lsmain[0].HBillNo; websLsmain.HDeptID = lsmain[0].HDeptID; //websLsmain.HEmpID = lsmain[0].HEmpID; + websLsmain.HKeeperID = lsmain[0].HKeeperID; + websLsmain.HSecManagerID = lsmain[0].HSecManagerID; websLsmain.HRemark = lsmain[0].HRemark; websLsmain.HMaker = lsmain[0].HMaker; + websLsmain.HBillerID = lsmain[0].HBillerID; websLsmain.HWHID = lsmain[0].HWHID; websLsmain.HMainSourceBillType = "濮斿璁㈠崟-鎶曟枡"; websLsmain.HSupID = lsmain[0].HSupID; + websLsmain.HBillType = "1211";//鍥哄畾鍊� if (webserver.set_SaveEntrustOutBill_New(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "鐢熸垚濮斿鍑哄簱鍗曟垚鍔燂紒鍗曟嵁鍙蜂负锛�"; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + //objJsonResult.Message = "鐢熸垚濮斿鍑哄簱鍗曟垚鍔燂紒鍗曟嵁鍙蜂负锛�"; objJsonResult.data = null; return objJsonResult; } @@ -418,8 +483,9 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "涓婁紶澶辫触锛乕webserver.set_SaveEntrustOutBill_New]" + DBUtility.ClsPub.sErrInfo; - objJsonResult.data = websLsmain; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� + //objJsonResult.Message = "涓婁紶澶辫触锛乕webserver.set_SaveEntrustOutBill_New]" + DBUtility.ClsPub.sErrInfo; + objJsonResult.data = null; return objJsonResult; } } @@ -477,7 +543,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "鐢熸垚浜у搧閫�搴撳崟鎴愬姛锛佸崟鎹彿涓猴細"; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + //objJsonResult.Message = "鐢熸垚浜у搧閫�搴撳崟鎴愬姛锛佸崟鎹彿涓猴細"; objJsonResult.data = null; return objJsonResult; } @@ -485,7 +552,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� + //objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } -- Gitblit v1.9.1