From b3ef7eb53d17bd775a9a63f9023b87fda8387e2b Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期日, 12 六月 2022 16:09:15 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs | 37 +++++++++++++++++++------------------
1 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs b/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
index 8475e02..51bce5f 100644
--- a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
+++ b/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;
}
--
Gitblit v1.9.1