From 7a72361cf3b374329ac8cf7b3c75d6308b124111 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 02 一月 2024 13:49:41 +0800
Subject: [PATCH] 生成条码时新增写入字段,列表改为动态列;退货单列表;同步送货单时新增字段,夏宝得先在金蝶删除收料通知单才能在供应商平台删除送货单
---
WebAPI/Controllers/BarCodeController.cs | 52 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/WebAPI/Controllers/BarCodeController.cs b/WebAPI/Controllers/BarCodeController.cs
index 6e9d2a5..fe0ca61 100644
--- a/WebAPI/Controllers/BarCodeController.cs
+++ b/WebAPI/Controllers/BarCodeController.cs
@@ -1,4 +1,5 @@
锘縰sing DBUtility;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
@@ -628,6 +629,9 @@
bar.HSupID = oItemSub.HSupID;
bar.HEndQty = WeiShu;
bar.HMTONO = oItemSub.HMTONO;
+ bar.HSupBatchNo = oItemSub.HSupBatchNo;
+ bar.HSupMaterNumber = oItemSub.HSupMaterNumber;
+ bar.HISKFPERIOD = oItemSub.HISKFPERIOD;
ls2.Add(bar);
}
}
@@ -708,6 +712,9 @@
bar2.HSupID = oItemSub2.HSupID;
bar2.HEndQty = WeiShu1;
bar2.HMTONO = oItemSub2.HMTONO;
+ bar2.HSupBatchNo = DBUtility.ClsPub.isStrNull(oItemSub2.HSupBatchNo);
+ bar2.HSupMaterNumber = DBUtility.ClsPub.isStrNull(oItemSub2.HSupMaterNumber);
+ bar2.HISKFPERIOD = DBUtility.ClsPub.isInt(oItemSub2.HISKFPERIOD);
ls3.Add(bar2);
//LogService.Write("娴嬭瘯鍔�+++" + oItemSub2.HSupID);
}
@@ -732,6 +739,9 @@
string HKFDQDate = "";
string HWei = "";
string HMTONO = "";
+ string HSupBatchNo = "";
+ string HSupMaterNumber = "";
+ Int64 HISKFPERIOD = 0;
oCn.BeginTran();
foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
{
@@ -760,6 +770,10 @@
HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
HWei = ClsPub.isStrNull(oItemSub.HEndQty);
+ HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo);
+ HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber);
+ HISKFPERIOD = DBUtility.ClsPub.isInt(oItemSub.HISKFPERIOD);
+
if (FCusName.Contains("澶忓疂"))
{
HBarCode = $"{oItemSub.HMaterID}";
@@ -767,11 +781,12 @@
}
string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
- ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HSupBatchNo,HSupMaterNumber,HProduceDate,HExpiryDate,HISKFPERIOD " +
") values ("
+ linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
+ "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
- + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
+ + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + HSupBatchNo+ "','" + HSupMaterNumber + "','" + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD +
+ ")";
oCn.RunProc(sql);
//LogService.Write(sql);
sql = "exec setLSH '" + DateTime.Today + "'";
@@ -800,6 +815,9 @@
HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
HWei = ClsPub.isStrNull(oItemSub.HEndQty);
+ HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo);
+ HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber);
+ HISKFPERIOD = ClsPub.isInt(oItemSub.HISKFPERIOD);
if (FCusName.Contains("澶忓疂"))
{
HBarCode = $"{oItemSub.HMaterID}";
@@ -807,11 +825,12 @@
}
string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
- ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO ,HSupBatchNo,HSupMaterNumber,HProduceDate,HExpiryDate,HISKFPERIOD" +
") values ("
+ linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
+ "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
- + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
+ + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" +
+ HSupBatchNo + "','" + HSupMaterNumber + "','" + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")";
oCn.RunProc(sql);
//LogService.Write(sql);
}
@@ -1350,6 +1369,8 @@
public object GetBarCodeShowList([FromBody] JObject msg)
{
string HSupNo = msg["HSupNo"].ToString(); string sqlWhere = msg["sqlWhere"].ToString();
+ //娣诲姞鍒楀悕
+ List<object> columnNameList = new List<object>();
try
{
string VsWhere = "";
@@ -1380,10 +1401,18 @@
}
else
{
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
objjson.code = "0";
objjson.count = 10000;
objjson.Message = "鑾峰彇鎴愬姛";
objjson.data = ds.Tables[0];
+ objjson.list = columnNameList;
return objjson;
}
}
@@ -1692,6 +1721,7 @@
bar.HSupID = oItemSub.HSupID;
bar.HEndQty = WeiShu;
bar.HMTONO = oItemSub.HMTONO;
+ bar.HISKFPERIOD = oItemSub.HISKFPERIOD;
ls2.Add(bar);
}
}
@@ -1773,6 +1803,7 @@
bar2.HSupID = oItemSub2.HSupID;
bar2.HEndQty = WeiShu1;
bar2.HMTONO = oItemSub2.HMTONO;
+ bar2.HISKFPERIOD = oItemSub2.HISKFPERIOD;
ls3.Add(bar2);
}
}
@@ -1795,6 +1826,7 @@
string HKFDQDate = "";
string HWei = "";
string HMTONO = "";
+ Int64 HISKFPERIOD = 0;
oCn.BeginTran();
foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
{
@@ -1826,6 +1858,7 @@
HSourceEntryID = ClsPub.isLong(oItemSub.HSourceEntryID);
HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
+ HISKFPERIOD = ClsPub.isInt(oItemSub.HISKFPERIOD);
HWei = ClsPub.isStrNull(oItemSub.HEndQty);
if (FCusName.Contains("澶忓疂"))
{
@@ -1834,11 +1867,12 @@
}
string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
",HBatchNo,HBarcodeQtys,HBarcodeNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
- ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HProduceDate,HExpiryDate,HISKFPERIOD" +
") values ("
+ linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
+ "','" + HBatchNo + "','" + SubModel.Count + "','" + count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
- + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
+ + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','"
+ + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")";
oCn.RunProc(sql);
oCn.RunProc("exec setLSH '" + DateTime.Today + "'");
count++;
@@ -1871,6 +1905,7 @@
HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
HWei = ClsPub.isStrNull(oItemSub.HEndQty);
+ HISKFPERIOD = ClsPub.isInt(oItemSub.HISKFPERIOD);
if (FCusName.Contains("澶忓疂"))
{
HBarCode = $"{oItemSub.HMaterID}";
@@ -1878,11 +1913,12 @@
}
string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
",HBatchNo,HBarcodeQtys,HBarcodeNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
- ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HProduceDate,HExpiryDate,HISKFPERIOD" +
") values ("
+ linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
+ "','" + HBatchNo + "','" + SubModel.Count + "','" + _count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
- + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
+ + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','"
+ + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")";
oCn.RunProc(sql);
_count++;
}
--
Gitblit v1.9.1