From bfec4da315abe8013a1683325bcf434c492dba0f Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 12 十月 2022 18:51:17 +0800
Subject: [PATCH] 问题处理

---
 WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs b/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
index f29456c..cb4170a 100644
--- a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
@@ -40,6 +40,7 @@
             public DateTime HEndDate { get; set; }//缁撴潫鏃堕棿
             public int ps { get; set; }//浠呮樉绀烘湭瀹屽叏閰嶉��
             public string user { get; set; }//褰撳墠鐧诲綍浜�
+            public string Arbitrarily { get; set; }//浠绘剰鍙傛暟
         }
 
         [Route("Sc_ComplementGoodBill/ComplementGoodBillList")]
@@ -69,7 +70,7 @@
                 ComplementGoodBill com = JsonConvert.DeserializeObject<ComplementGoodBill>(sWhere.ToString());
 
                 ds = oCN.RunProcReturn($"exec h_p_JIT_CallGoodsPlatForm_Query '{com.HSeOrderBillNo}','{com.DepartmentName}','{com.MaterialNumber}','{com.MaterialName}'," +
-                    $"'{com.MaterialModel}','{com.HICMOBillNo}','{com.CPNumber}','{com.CPName}','{com.CPModel}','{com.HBeginDate}','{com.HEndDate.AddDays(1).AddSeconds(-1)}'," +
+                    $"'{com.MaterialModel}','{com.HICMOBillNo}','{com.CPNumber}','{com.CPName}','{com.CPModel}'," +
                     $"{com.ps},{com.Organization},'{com.user}' ", "h_p_JIT_CallGoodsPlatForm_Query");
 
                 objJsonResult.code = "1";
@@ -228,6 +229,15 @@
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;
                             objJsonResult.Message = "璇烽�夋嫨璋冨嚭浠撳簱!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+
+                        if (listCa[i].璋冨嚭浠撳簱id == listCa[i].璋冨叆浠撳簱id)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "璋冨嚭浠撳簱鍜岃皟鍏ヤ粨搴撲笉鑳戒竴鏍�!";
                             objJsonResult.data = null;
                             return objJsonResult;
                         }
@@ -415,7 +425,7 @@
                 {
                     if (listCa[i].閫�鏂欐暟閲� > 0)
                     {
-                        if (listCa[i].閫�鏂欐暟閲� > listCa[i].宸查厤閫佹暟閲�)
+                        if (listCa[i].閫�鏂欐暟閲� > listCa[i].宸查厤閫佹暟閲�&& listCa[i].宸查厤閫佹暟閲�>0)
                         {
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;
@@ -424,7 +434,7 @@
                             return objJsonResult;
                         }
 
-                        ds = oCN.RunProcReturn("select sum(d.HQty) HQty from JIT_CallGoodsBackRequestBillSub c inner join JIT_CallGoodsBackBillSub d on c.HInterID = d.HSourceInterID and c.HEntryID = d.HSourceEntryID and c.HMaterID = d.HMaterID " +
+                        ds = oCN.RunProcReturn("select isnull(sum(d.HQty),0) HQty from JIT_CallGoodsBackRequestBillSub c inner join JIT_CallGoodsBackBillSub d on c.HInterID = d.HSourceInterID and c.HEntryID = d.HSourceEntryID and c.HMaterID = d.HMaterID " +
                    $"where c.HSourceInterID={listCa[i].HSouceInterID} and c.HSourceEntryID ={listCa[i].HSourceEntryID} and c.HSourceBillNo = '{listCa[i].HSourceBillNo}' and c.HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
 
                         if ((double.Parse(ds.Tables[0].Rows[0][0].ToString()==""?"0": ds.Tables[0].Rows[0][0].ToString()) +listCa[i].閫�鏂欐暟閲�) > listCa[i].宸插彨鏂欐暟閲�)
@@ -570,7 +580,7 @@
                 {
                     if (listCa[i].閫�鏂欐暟閲� > 0)
                     {
-                        if (listCa[i].閫�鏂欐暟閲� > listCa[i].宸查厤閫佹暟閲�)
+                        if (listCa[i].閫�鏂欐暟閲� > listCa[i].宸查厤閫佹暟閲� && listCa[i].宸查厤閫佹暟閲� > 0)
                         {
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;
@@ -667,7 +677,7 @@
                 {
                     if (listCa[i].閫�鏂欐暟閲� > 0)
                     {
-                        if (listCa[i].閫�鏂欐暟閲� > listCa[i].宸查厤閫佹暟閲�)
+                        if (listCa[i].閫�鏂欐暟閲� > listCa[i].宸查厤閫佹暟閲� && listCa[i].宸查厤閫佹暟閲� > 0)
                         {
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;

--
Gitblit v1.9.1