From 3e58dee31a30ee20770803a7035deb4890156bb4 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期五, 16 九月 2022 13:25:26 +0800
Subject: [PATCH] 采购订单生成送货单保存方法修改 解决多次保存时的报错
---
WebAPI/Controllers/EntrustOrderController.cs | 117 ++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 72 insertions(+), 45 deletions(-)
diff --git a/WebAPI/Controllers/EntrustOrderController.cs b/WebAPI/Controllers/EntrustOrderController.cs
index 71eb83b..1b286f2 100644
--- a/WebAPI/Controllers/EntrustOrderController.cs
+++ b/WebAPI/Controllers/EntrustOrderController.cs
@@ -18,6 +18,7 @@
{
private JsonResult objJsonResult = new JsonResult();
private json objjson = new json();
+ SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
/// <summary>
/// 閲囪喘鍗曞垪琛�
@@ -54,7 +55,7 @@
{
objjson.code = "0";
objjson.count = 0;
- objjson.Message = "鑾峰彇澶辫触";
+ objjson.Message = "杞崲鐗规畩瀛楃澶辫触";
objjson.data = null;
return objjson;
}
@@ -62,22 +63,11 @@
Int64 RowTotal = Common.GetRowTotal("H_v_SRM_EntrustOrderBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
//鑾峰彇杩斿洖鏁版嵁
ds = oCn.RunProcReturn("exec H_p_SRM_EntrustOrderBillList '" + PcWhere + "'", "H_p_SRM_EntrustOrderBillList");
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objjson.code = "0";
- objjson.count = 0;
- objjson.Message = "鑾峰彇澶辫触";
- objjson.data = null;
- return objjson;
- }
- else
- {
- objjson.code = "0";
- objjson.count = 10000;
- objjson.Message = "鑾峰彇鎴愬姛";
- objjson.data = ds.Tables[0];
- return objjson;
- }
+ objjson.code = "0";
+ objjson.count = 10000;
+ objjson.Message = "鑾峰彇鎴愬姛";
+ objjson.data = ds.Tables[0];
+ return objjson;
}
catch (Exception e)
{
@@ -224,48 +214,85 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鎺ュ彈澶辫触锛�"+e.ToString();
+ objJsonResult.Message = "鎺ュ彈澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
- [Route("EntrustOrderRefuse")]
- [HttpGet]
- /// <summary>
- /// 璁㈠崟鎷掔粷
- /// </summary>
- /// <param name="HInterID"></param>
- /// <returns></returns>
+ [Route("EntrustOrderRefuse")]
+ [HttpGet]
+ /// <summary>
+ /// 璁㈠崟鎷掔粷
+ /// </summary>
+ /// <param name="HInterID"></param>
+ /// <returns></returns>
public object EntrustOrderRefuse(string HInterID, string HBillNo, string HUser, string HBackRemark)
+ {
+ try
{
- try
- {
- if (DBUtility.ClsPub.isLong(HInterID) == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "澶辫触锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- DAL.ClsWW_EntrustOrderBill oBill = new DAL.ClsWW_EntrustOrderBill();
- oBill.WebRefuse(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), DBUtility.ClsPub.isStrNull(HBackRemark), ref DBUtility.ClsPub.sExeReturnInfo);
- objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鎷掔粷鎴愬姛锛�";
- objJsonResult.data = 1;
- return objJsonResult;
- }
- catch (Exception e)
+ if (DBUtility.ClsPub.isLong(HInterID) == 0)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "澶辫触锛�" + e.ToString();
+ objJsonResult.Message = "澶辫触锛�";
objJsonResult.data = null;
return objJsonResult;
}
+ DAL.ClsWW_EntrustOrderBill oBill = new DAL.ClsWW_EntrustOrderBill();
+ oBill.WebRefuse(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), DBUtility.ClsPub.isStrNull(HBackRemark), ref DBUtility.ClsPub.sExeReturnInfo);
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎷掔粷鎴愬姛锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
}
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ [Route("EntrustOrderBack")]
+ [HttpGet]
+ /// <summary>
+ /// 璁㈠崟鍙嶉鐘舵��
+ /// </summary>
+ /// <param name=""></param>
+ /// <returns></returns>
+ public object EntrustOrderBack(string HmainidList, string OrderBackId)
+ {
+ try
+ {
+ string sql = "";
+ for (int i = 0; i < HmainidList.Split(',').Length; i++)
+ {
+ var Hmainid = HmainidList.Split(',')[i];
+ sql = string.Format(@"
+ update WW_EntrustOrderBillSub set
+ HFeedback ='{0}'
+ where HInterID = '{1}' and HEntryID = '{2}' ", OrderBackId, Hmainid.Split('-')[0], Hmainid.Split('-')[1]);
+ oCn.RunProc(sql);
+ }
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎿嶄綔鎴愬姛锛�";
+ //objJsonResult.Message = string.Join(",", HmainidList.ToArray());
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.1