From c16d33963f594c4231cdddbf35025cf7fa3dd693 Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期四, 28 七月 2022 15:36:01 +0800
Subject: [PATCH] 单据校验扫码模块,新增扫描物料条码功能:源单中存在多行相同物料时自动拆分换行匹配源单数据
---
CLOUDWEB/WebService1.asmx.cs | 136 +++++++++++++++++++++++++++++++--------------
1 files changed, 94 insertions(+), 42 deletions(-)
diff --git a/CLOUDWEB/WebService1.asmx.cs b/CLOUDWEB/WebService1.asmx.cs
index a990ea6..e071ee7 100644
--- a/CLOUDWEB/WebService1.asmx.cs
+++ b/CLOUDWEB/WebService1.asmx.cs
@@ -40592,8 +40592,25 @@
sWHSPCtl = "Y";
}
- //鍒ゆ柇鏄惁瀛樺湪鐩稿悓鏉$爜锛屽垽鏂槸鍚﹀惎鐢ㄤ竴娆℃壂鐮佹帶鍒讹紝鍒ゆ柇鎵�鎵潯鐮佹槸鍚﹀湪鍗曟嵁涓�
- DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_BillCheck '" + omodel_View.HBarCode + "'," + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "'," + HWhID + "," + HSPID + ",'" + sWHSPCtl + "'", "h_p_WMS_AddBarCode_BillCheck");
+ string sMultilineCtl = "N"; //鏍¢獙-澶氳鐩稿悓鐗╂枡鑷姩鎷嗗垎鎹㈣鍖归厤锛�'Y'涓鸿嚜鍔ㄦ媶鍒嗭級
+ if (HBillType == "1203")
+ {
+ //鍏朵粬鍏ュ簱鍗�
+ sMultilineCtl = "N";
+ }
+ else if (HBillType == "1204" && oSystemParameterMain.Kf_MateOutBillCheck_MultilineCtl == "Y")
+ {
+ //棰嗘枡鍑哄簱鍗�
+ sMultilineCtl = "Y";
+ }
+ else if (HBillType == "1206")
+ {
+ //鍏朵粬鍑哄簱鍗�
+ sMultilineCtl = "N";
+ }
+
+ //鍒ゆ柇鏄惁瀛樺湪鐩稿悓鏉$爜锛屽垽鏂墍鎵潯鐮佹槸鍚﹀湪鍗曟嵁涓�
+ DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_BillCheck_New '" + omodel_View.HBarCode + "'," + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "'," + HWhID + "," + HSPID + ",'" + sWHSPCtl + "','" + sMultilineCtl + "'", "h_p_WMS_AddBarCode_BillCheck_New");
if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
{
sErrMsg = "鍒ゆ柇鎵�鎵潯鐮佹槸鍚﹀湪鍗曟嵁涓彂鐢熼敊璇紒";
@@ -40604,10 +40621,7 @@
if (DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0][0]) == 0)
{
omodel_View.HMaterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HMaterID"]);
- omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillNo"]);
- omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceEntryID"]);
- omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceInterID"]);
- omodel_View.HSourceQty = DBUtility.ClsPub.isDoule(ds1.Tables[0].Rows[0]["HQtyMust"]); //婧愬崟鍙壂鏁伴噺
+ omodel_View.HSourceQty = DBUtility.ClsPub.isDoule(ds1.Tables[0].Rows[0]["HSumQtyMust"]); //HSumQtyMust涓烘簮鍗曠浉鍚岀墿鏂欏墿浣欏彲鎵暟閲�
HWhID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HWhID"]);
HSPID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSPID"]);
}
@@ -40838,43 +40852,81 @@
}
}
- oMain.HInterID = HBillID;
- oMain.HBillNo = HBillNo;
- oMain.HBillType = HBillType;
- oMain.HMaker = HMaker;
- oMain.HMaterID = omodel_View.HMaterID;
- oMain.HAuxPropID = omodel_View.HAuxPropID;
- oMain.HQty = sRelQty;
- oMain.HQtyMust = 0;
- oMain.HBarCode = omodel_View.HBarCode;
- oMain.HBatchNo = omodel_View.HBatchNo;
- oMain.HMTONo = omodel_View.HMTONo;
- oMain.HWhID = HWhID;
- oMain.HStockPlaceID = HSPID;
- oMain.HSourceInterID = omodel_View.HSourceInterID;
- oMain.HSourceEntryID = omodel_View.HSourceEntryID;
- oMain.HSourceBillNo = omodel_View.HSourceBillNo;
- oMain.HSourceBillType = HBillType;
- oMain.HRedBlueFlag = false;
- oMain.HPieceQty = 1;
- oMain.HSTOCKORGID = HOWNERID;
- oMain.HOWNERID = HOWNERID;
+ double sSumQty = 0;
+ double sRemQty = 0;
+ for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
+ {
+ omodel_View.HSourceQty = DBUtility.ClsPub.isDoule(ds1.Tables[0].Rows[i]["HQtyMust"]); //瀛樺湪鐩稿悓鐗╂枡鏃讹紝鍏朵腑涓�琛屾簮鍗曞墿浣欏彲鎵暟閲�
+ sSumQty = sSumQty + omodel_View.HSourceQty;
+ sRemQty = sRelQty - sSumQty;
- oCn.RunProc("Insert into KF_PonderationBillMain_Temp " +
- "(HInterID,HBillNo,HBillType,HMaterID,HAuxPropID,HProcID" +
- ",HWhID,HSCWHID,HStockPlaceID,HOutStockPlaceID,HGroupID,HAddr" +
- ",HQtyMust,HQty,HPieceQty,HBatchNo,HBarCode,HBarCode_Pack" +
- ",HMaker,HMakeDate,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo" +
- ",HRelationInterID,HRelationEntryID,HRelationBillNo,HRedBlueFlag,HMTONo,HPlanMode" +
- ",HSTOCKORGID,HOtherOrgID,HOWNERID,HOWNERTYPEID,HExpressNumber,HSubBillType" +
- ",HCusID,HDeptID,HCusBarCode,HMulSourceBill) " +
- " Values(" + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'," + oMain.HMaterID.ToString() + "," + oMain.HAuxPropID.ToString() + "," + oMain.HProcID.ToString() +
- "," + oMain.HWhID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HStockPlaceID.ToString() + "," + oMain.HOutStockPlaceID.ToString() + "," + oMain.HGroupID.ToString() + ",'" + oMain.HAddr + "'" +
- "," + oMain.HQtyMust.ToString() + "," + oMain.HQty.ToString() + "," + oMain.HPieceQty.ToString() + ",'" + oMain.HBatchNo + "','" + oMain.HBarCode + "',''" +
- ",'" + oMain.HMaker + "',getdate()," + oMain.HSourceInterID.ToString() + "," + oMain.HSourceEntryID.ToString() + ",'" + oMain.HSourceBillType + "','" + oMain.HSourceBillNo + "'" +
- "," + oMain.HRelationInterID.ToString() + "," + oMain.HRelationEntryID.ToString() + ",'" + oMain.HRelationBillNo + "'," + Convert.ToString(oMain.HRedBlueFlag ? 1 : 0) + ",'" + oMain.HMTONo + "',0" +
- "," + oMain.HSTOCKORGID.ToString() + "," + oMain.HSTOCKORGID.ToString() + "," + oMain.HOWNERID.ToString() + ",'','鏍¢獙妯″紡',1" +
- ",0,0,'" + oMain.HCusBarCode + "',0)");
+ //鏁伴噺
+ //鍙瓨鍦ㄤ竴琛屾暟鎹椂锛屾暟閲�=鏉$爜鍙壂鏁伴噺
+ if (ds1.Tables[0].Rows.Count == 1)
+ {
+ oMain.HQty = sRelQty;
+ }
+ //瀛樺湪澶氳鐩稿悓鐗╂枡锛屾潯鐮佸墿浣欐暟閲�<鎵�閫夎婧愬崟鍓╀綑鍙壂鏁伴噺 鎴� 鎵�閫夎婧愬崟涓烘渶鍚庝竴鏉℃暟鎹椂 锛屾暟閲�=鏉$爜鍓╀綑鏁伴噺
+ else if (sRemQty <= 0 || (i == ds1.Tables[0].Rows.Count - 1 && sRemQty > 0))
+ {
+ oMain.HQty = sRemQty + omodel_View.HSourceQty;
+ }
+ //瀛樺湪澶氳鐩稿悓鐗╂枡锛屾潯鐮佸墿浣欐暟閲�>鎵�閫夎婧愬崟鍓╀綑鍙壂鏁伴噺 锛屾暟閲�=鎵�閫夎婧愬崟鍓╀綑鍙壂鏁伴噺
+ else
+ {
+ oMain.HQty = omodel_View.HSourceQty;
+ }
+ //鏉$爜鏉℃暟
+ if (i == 0)
+ {
+ oMain.HPieceQty = 1;
+ }
+ else
+ {
+ oMain.HPieceQty = 0;
+ }
+
+ oMain.HInterID = HBillID;
+ oMain.HBillNo = HBillNo;
+ oMain.HBillType = HBillType;
+ oMain.HMaker = HMaker;
+ oMain.HMaterID = omodel_View.HMaterID;
+ oMain.HAuxPropID = omodel_View.HAuxPropID;
+ oMain.HQtyMust = 0;
+ oMain.HBarCode = omodel_View.HBarCode;
+ oMain.HBatchNo = omodel_View.HBatchNo;
+ oMain.HMTONo = omodel_View.HMTONo;
+ oMain.HWhID = HWhID;
+ oMain.HStockPlaceID = HSPID;
+ oMain.HSourceInterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[i]["HSourceInterID"]);
+ oMain.HSourceEntryID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[i]["HSourceEntryID"]);
+ oMain.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[i]["HSourceBillNo"]);
+ oMain.HSourceBillType = HBillType;
+ oMain.HRedBlueFlag = false;
+ oMain.HSTOCKORGID = HOWNERID;
+ oMain.HOWNERID = HOWNERID;
+
+ oCn.RunProc("Insert into KF_PonderationBillMain_Temp " +
+ "(HInterID,HBillNo,HBillType,HMaterID,HAuxPropID,HProcID" +
+ ",HWhID,HSCWHID,HStockPlaceID,HOutStockPlaceID,HGroupID,HAddr" +
+ ",HQtyMust,HQty,HPieceQty,HBatchNo,HBarCode,HBarCode_Pack" +
+ ",HMaker,HMakeDate,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo" +
+ ",HRelationInterID,HRelationEntryID,HRelationBillNo,HRedBlueFlag,HMTONo,HPlanMode" +
+ ",HSTOCKORGID,HOtherOrgID,HOWNERID,HOWNERTYPEID,HExpressNumber,HSubBillType" +
+ ",HCusID,HDeptID,HCusBarCode,HMulSourceBill) " +
+ " Values(" + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'," + oMain.HMaterID.ToString() + "," + oMain.HAuxPropID.ToString() + "," + oMain.HProcID.ToString() +
+ "," + oMain.HWhID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HStockPlaceID.ToString() + "," + oMain.HOutStockPlaceID.ToString() + "," + oMain.HGroupID.ToString() + ",'" + oMain.HAddr + "'" +
+ "," + oMain.HQtyMust.ToString() + "," + oMain.HQty.ToString() + "," + oMain.HPieceQty.ToString() + ",'" + oMain.HBatchNo + "','" + oMain.HBarCode + "',''" +
+ ",'" + oMain.HMaker + "',getdate()," + oMain.HSourceInterID.ToString() + "," + oMain.HSourceEntryID.ToString() + ",'" + oMain.HSourceBillType + "','" + oMain.HSourceBillNo + "'" +
+ "," + oMain.HRelationInterID.ToString() + "," + oMain.HRelationEntryID.ToString() + ",'" + oMain.HRelationBillNo + "'," + Convert.ToString(oMain.HRedBlueFlag ? 1 : 0) + ",'" + oMain.HMTONo + "',0" +
+ "," + oMain.HSTOCKORGID.ToString() + "," + oMain.HSTOCKORGID.ToString() + "," + oMain.HOWNERID.ToString() + ",'','鏍¢獙妯″紡',1" +
+ ",0,0,'" + oMain.HCusBarCode + "',0)");
+
+ if (sRemQty <= 0)
+ {
+ break;
+ }
+ }
return true;
}
--
Gitblit v1.9.1