WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
@@ -99,6 +99,7 @@
            public long HSourceEntryID = 0;//HSourceEntryIDCol
            public int? 叫料数量 = 0;//HBHGQtyCol
            public int? 已叫料数量 = 0;//HBHGQtyCol
            public int? 已配送数量 = 0;//HBHGQtyCol
            public double? 退料数量 = 0;//退料数量
            public long HSTOCKID = 0;//HSTOCKID
            public string 退料原因 { get; set; }//退料原因
@@ -384,23 +385,23 @@
                {
                    if (listCa[i].退料数量 > 0)
                    {
                        if (listCa[i].退料数量 > listCa[i].已叫料数量)
                        if (listCa[i].退料数量 > listCa[i].已配送数量)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "退料数量大于已叫料数量!";
                            objJsonResult.Message = "退料数量大于已配送数量!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        ds = oCN.RunProcReturn("select sum(HQty) from JIT_CallGoodsBackRequestBillSub " +
                   $"where HSourceInterID={listCa[i].HSouceInterID} and HSourceEntryID ={listCa[i].HSourceEntryID} and HSourceBillNo = '{listCa[i].HSourceBillNo}' and HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
                        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 " +
                   $"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())+listCa[i].退料数量) > listCa[i].已叫料数量)
                        if ((double.Parse(ds.Tables[0].Rows[0][0].ToString()==""?"0": ds.Tables[0].Rows[0][0].ToString()) +listCa[i].退料数量) > listCa[i].已叫料数量)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"已经退料申请数量:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},可退料数量为:{(listCa[i].已叫料数量 - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
                            objJsonResult.Message = $"已经退料数量:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},可退料数量为:{(listCa[i].已叫料数量 - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -521,23 +522,23 @@
                {
                    if (listCa[i].退料数量 > 0)
                    {
                        if (listCa[i].退料数量 > listCa[i].已叫料数量)
                        if (listCa[i].退料数量 > listCa[i].已配送数量)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "退料数量大于已叫料数量!";
                            objJsonResult.Message = "退料数量大于已配送数量!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        ds = oCN.RunProcReturn("select sum(HQty) from JIT_CallGoodsBackRequestBillSub " +
                $"where HSourceInterID={listCa[i].HSouceInterID} and HSourceEntryID ={listCa[i].HSourceEntryID} and HSourceBillNo = '{listCa[i].HSourceBillNo}' and HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
                        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 " +
                   $"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()) + listCa[i].退料数量) > listCa[i].已叫料数量)
                        if ((double.Parse(ds.Tables[0].Rows[0][0].ToString() == "" ? "0" : ds.Tables[0].Rows[0][0].ToString()) + listCa[i].退料数量) > listCa[i].已叫料数量)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"已经退料申请数量:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},可退料数量为:{(listCa[i].已叫料数量 - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
                            objJsonResult.Message = $"已经退料数量:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},可退料数量为:{(listCa[i].已叫料数量 - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -618,23 +619,23 @@
                {
                    if (listCa[i].退料数量 > 0)
                    {
                        if (listCa[i].退料数量 > listCa[i].已叫料数量)
                        if (listCa[i].退料数量 > listCa[i].已配送数量)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "退料数量大于已叫料数量!";
                            objJsonResult.Message = "退料数量大于已配送数量!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        ds = oCN.RunProcReturn("select sum(HQty) from JIT_CallGoodsBackRequestBillSub " +
               $"where HSourceInterID={listCa[i].HSouceInterID} and HSourceEntryID ={listCa[i].HSourceEntryID} and HSourceBillNo = '{listCa[i].HSourceBillNo}' and HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
                        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 " +
                   $"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()) + listCa[i].退料数量) > listCa[i].已叫料数量)
                        if ((double.Parse(ds.Tables[0].Rows[0][0].ToString() == "" ? "0" : ds.Tables[0].Rows[0][0].ToString()) + listCa[i].退料数量) > listCa[i].已叫料数量)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"已经退料申请数量:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},可退料数量为:{(listCa[i].已叫料数量 - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
                            objJsonResult.Message = $"已经退料数量:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},可退料数量为:{(listCa[i].已叫料数量 - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }