From 8f822ae2ea4a1045274c9ea47e94a884361ad385 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期二, 05 八月 2025 09:30:24 +0800
Subject: [PATCH] 网页端条码生成模块,条码生成调用方法增加客户海诚品种条码生成规则
---
WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs | 66 +++++++++++++++++++++++++-------
WebAPI/Models/HSouceOrderList.cs | 1
2 files changed, 52 insertions(+), 15 deletions(-)
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
index 423f9d1..6b657eb 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
@@ -132,6 +132,10 @@
list.Add("鍞竴鏉$爜");
list.Add("鎵规鏉$爜");
}
+ else if (sCapName == "娴疯瘹")
+ {
+ list.Add("鍝佺鏉$爜");
+ }
else
{
list.Add("鍞竴鏉$爜");
@@ -589,6 +593,10 @@
ordrlist.HGiveAwayFlag = 0;
}
}
+ if (HSourceBillType == "閲囪喘璁㈠崟")
+ {
+ ordrlist.HSourceBillSEQ = dt.Rows[i]["HSEQ"].ToString();
+ }
}
if (HSourceBillType == "閫�璐ч�氱煡鍗�")
{
@@ -801,12 +809,13 @@
long HMaterID = DBUtility.ClsPub.isLong(ordrlist[i].HMaterID); // 鐗╂枡鍐呯爜
string HBatchNo = DBUtility.ClsPub.isStrNull(ordrlist[i].HBatchNo); // 鎵瑰彿
long HAuxPropID = DBUtility.ClsPub.isLong(ordrlist[i].HAuxPropID); // 杈呭姪灞炴�D
+ string HMTONo = DBUtility.ClsPub.isStrNull(ordrlist[i].HMTONo); // 璁″垝璺熻釜鍙�
double HSourceQty = DBUtility.ClsPub.isDoule(ordrlist[i].HMinQty); // 婧愬崟鏁伴噺
double HQty = DBUtility.ClsPub.isDoule(ordrlist[i].HQty); // 鏁伴噺
double HMinQty = DBUtility.ClsPub.isDoule(ordrlist[i].HMinQty); // 鏈�灏忓寘瑁呮暟
if (HMaterID != 0)
{
- DataSet oDsCheck = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_AddCheck " + HSno.ToString() + ",'" + HBarCodeType + "','" + HSourceBillNo + "'," + HMaterID.ToString() + ",'" + HBatchNo + "'," + HAuxPropID.ToString() + "," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + "," + HOrgID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_AddCheck");
+ DataSet oDsCheck = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_AddCheck_New " + HSno.ToString() + ",'" + HBarCodeType + "','" + HSourceBillNo + "'," + HMaterID.ToString() + ",'" + HBatchNo + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "'," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + "," + HOrgID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_AddCheck_New");
if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
@@ -845,7 +854,7 @@
int HBQty = 0; //绠辨暟
double HQty = 0; //鏁伴噺
string WeiShu = ""; //灏炬暟
- int LSH = 0; //娴佹按鍙�
+ Int64 LSH = 0; //娴佹按鍙�
string LSH2 = ""; //娴佹按鍙疯浆鎹㈡垚瀛楃
string sDate = ""; //鏃ユ湡
string sYear = ""; //骞�
@@ -935,7 +944,7 @@
sTMNumber = HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (CampanyName == "椋為緳")
{
@@ -952,7 +961,7 @@
sTMNumber = HWorksNumber + HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (CampanyName == "鐟炰笌绁�") {
var date = DateTime.Now.ToString("yyMMdd");//鏃ユ湡
@@ -977,7 +986,7 @@
//sTMNumber = ordrlist[j].HMaterNumber + "-鍖呰鏍囪瘑-" + date + "-" + ordrlist[j].HSupNumber + "-";
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (HSourceBillTypeName == "鐢熶骇鍏ュ簱鍗�")
{
@@ -1011,13 +1020,13 @@
//sTMNumber = ordrlist[j].HMaterNumber + "-鍖呰鏍囪瘑-"+ date + "-缁勭粐浠g爜-";
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else
{
sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
}
else //閫氱敤鏂规硶
@@ -1026,7 +1035,7 @@
sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
}
else if (HSelectBarCodeType == "鍝佺鏉$爜")
@@ -1050,7 +1059,7 @@
sTMNumber = HMaterNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 4;
}
else if (HSelectBarCodeType == "浠櫒鎴愬搧鏉$爜瑙勫垯") //鍙﹀澶勭悊浜�
@@ -1067,7 +1076,7 @@
sTMNumber = HMaterNumber + HBatchNo;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 6;
}
else if (HSelectBarCodeType == "鍐呴攢鏈烘潯鐮�")
@@ -1077,7 +1086,7 @@
sTMNumber = "1" + HModelName + HBarCodeDate + HBarCodeBatchNo + HYasuoji + "00";
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 5;
if (sTMNumber.Length != 16)
{
@@ -1094,7 +1103,7 @@
sTMNumber = HMaterNumber.Replace(".", "") + HBarCodeDate + HBarCodeBatchNo;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 5;
if (sTMNumber.Length != 18)
{
@@ -1110,7 +1119,7 @@
sTMNumber = HICMOBillNo;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 5;
}
else if (HSelectBarCodeType == "鎵樼洏鏉$爜")
@@ -1119,7 +1128,7 @@
//鏉$爜鍓嶇紑 = 鐗╂枡鍐呯爜 + 骞� + 鏈� + 鏃�
sTMNumber = HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else
{
@@ -1183,7 +1192,34 @@
objJsonResult.Message = "鏉″舰鐮佷笉鑳戒负绌猴紝涓嶈兘鐢熸垚鏉$爜锛�";
return objJsonResult;
}
- HBarCodeList barcode = new HBarCodeList();
+ HBarCodeList barcode = new HBarCodeList();
+
+ if (CampanyName == "娴疯瘹") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉�
+ {
+ string sHMTONo = ""; //璁″垝璺熻釜鍙�
+ string sHSourceBillNo = ""; //婧愬崟鍗曞彿
+ string sHSourceBillSEQ = ""; //婧愬崟琛屽彿
+ string sSupNumber = ""; //渚涘簲鍟嗕唬鐮�
+ string sHQty = ""; //鏁伴噺
+
+ sHMTONo = DBUtility.ClsPub.isStrNull(ordrlist[j].HMTONo);
+ sHSourceBillNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HBillNo);
+ sHSourceBillSEQ = DBUtility.ClsPub.isStrNull(ordrlist[j].HSourceBillSEQ);
+ sSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HSupNumber);
+ sHQty = DBUtility.ClsPub.isStrNull(HMinQty);
+
+ if (DBUtility.ClsPub.isStrNull(ordrlist[j].HBillType) == "1102") //婧愬崟锛氶噰璐鍗�
+ {
+ //鏉$爜瑙勫垯锛氶噰璐鍗曞崟鍙稝琛屽彿@鐗╂枡浠g爜@MTO@鏁伴噺@渚涘簲鍟嗕唬鐮�
+ TM = sHSourceBillNo + "@" + sHSourceBillSEQ + "@" + HMaterNumber + "@" + sHMTONo + "@" + sHQty + "@" + sSupNumber;
+ }
+ else
+ {
+ //鏉$爜瑙勫垯锛氱墿鏂欏唴鐮丂MTO@鏁伴噺
+ TM = HNumber + "@" + sHMTONo + "@" + sHQty;
+ }
+ }
+
barcode.HBarCode2 = TM;
barcode.HEntryID2 = ClsPub.isStrNull(j + 1);
barcode.HMaterID2 = ordrlist[j].HMaterID;
diff --git a/WebAPI/Models/HSouceOrderList.cs b/WebAPI/Models/HSouceOrderList.cs
index 4d93a89..f7e9d34 100644
--- a/WebAPI/Models/HSouceOrderList.cs
+++ b/WebAPI/Models/HSouceOrderList.cs
@@ -9,6 +9,7 @@
{
public string HMainID { get; set; } //婧愬崟涓籌D
public string HSubID { get; set; } //婧愬崟瀛怚D
+ public string HSourceBillSEQ { get; set; } //婧愬崟琛屽彿
public string HBillNo{get;set;} // "婧愬崟鍗曞彿";
public string HSourceBillNo { get; set; } // "婧愬崟鍗曞彿";
public string HBillType{get;set;} // "鍗曟嵁绫诲瀷";
--
Gitblit v1.9.1