From 48b5decba526435c701a1c9ca4171eaa4f5e7e8e Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期四, 08 一月 2026 15:40:21 +0800
Subject: [PATCH] 凯贝紫光华智客户条码内箱、外箱条码规则变更;联想客户条码8S码、外箱、栈板码流水号获取变更,增加尾箱栈板毛重输入列
---
WarM/条码打印/Gy_CusBarCodeBill_KaiBei_HuaSan.cs | 26 ++++++++++--
WarM/条码打印/Gy_CusBarCodeBill_KaiBei_LianXiang.cs | 93 ++++++++++++++++++++++++++++++----------------
2 files changed, 82 insertions(+), 37 deletions(-)
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_HuaSan.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_HuaSan.cs"
index 80d82dc..8808d13 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_HuaSan.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_HuaSan.cs"
@@ -678,8 +678,18 @@
HMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HMaterNumberCol].Value); // 鐗╂枡浠g爜
HCode3 = HMaterNumber.Substring(HMaterNumber.Length - 2, 2); //鐗堟湰 鍙栫墿鏂欎唬鐮佸悗涓や綅
- //鏉$爜鍓嶇紑 = 鐗╂枡瑙勬牸鍨嬪彿+渚涘簲鍟嗕唬鐮侊紙鍥哄畾'151091'锛�+骞存湀鏃ワ紙YYMMDD锛�
- sTMNumber = HMaterModel + "151091" + sYear + sPeriod2 + sDay;
+ if (cmbHCusName.Text.Contains("绱厜鍗庢櫤"))
+ {
+ //鏉$爜鍓嶇紑 = 鐗╂枡瑙勬牸鍨嬪彿+渚涘簲鍟嗕唬鐮侊紙鍥哄畾'151003'锛�+骞存湀鏃ワ紙YYMMDD锛�
+ sTMNumber = HMaterModel + "151003" + sYear + sPeriod2 + sDay;
+ }
+ //鏂板崕涓夈�佷笢鏂归�氫俊銆佺粺鍚�
+ else
+ {
+ //鏉$爜鍓嶇紑 = 鐗╂枡瑙勬牸鍨嬪彿+渚涘簲鍟嗕唬鐮侊紙鍥哄畾'151091'锛�+骞存湀鏃ワ紙YYMMDD锛�
+ sTMNumber = HMaterModel + "151091" + sYear + sPeriod2 + sDay;
+ }
+
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
@@ -705,7 +715,7 @@
{
LSH2 = "0" + LSH2;
}
- //鏉$爜缂栧彿 = 8浣嶇墿鏂欒鏍煎瀷鍙� + 6浣嶄緵搴斿晢浠g爜锛堝浐瀹�'151091'锛�+ 6浣嶅勾鏈堟棩锛圷YMMDD锛�+ 2浣嶇増鏈� + 1浣嶅伐鍘傦紙鍥哄畾'0'锛�+ 5浣嶆祦姘村彿
+ //鏉$爜缂栧彿 = 鏉$爜鍓嶇紑 + 2浣嶇増鏈� + 1浣嶅伐鍘傦紙鍥哄畾'0'锛�+ 5浣嶆祦姘村彿
TM = sTMNumber + HCode3 + "0" + LSH2;
HEntryID = j + 1;
@@ -807,7 +817,13 @@
//鏉$爜鍓嶇紑 = 2浣嶅浐瀹氱爜锛�'09'锛� + CPN瀹㈡埛缂栫爜锛堣鏍煎瀷鍙凤級+ 2浣嶉鐣欑爜锛堝浐瀹�'01'锛�+ 5浣嶅勾骞存湀鏃ユ棩锛圷YMDD锛� + 3浣�09鐮佹祦姘村彿锛堝浐瀹�'001'锛� + 渚涘簲鍟嗕唬鐮侊紙鍥哄畾'105652'锛�
sWTMNumber = "09" + HMaterModel + "01" + sYear + sPeriod + sDay + "001105652";
}
- //鏂板崕涓夈�佺粺鍚堛�佺传鍏夊崕鏅�
+ //绱厜鍗庢櫤
+ else if (cmbHCusName.Text.Contains("绱厜鍗庢櫤"))
+ {
+ //鏉$爜鍓嶇紑 = 2浣嶅浐瀹氱爜锛�'09'锛� + CPN瀹㈡埛缂栫爜锛堣鏍煎瀷鍙凤級+ 2浣嶉鐣欑爜锛堝浐瀹�'01'锛�+ 5浣嶅勾骞存湀鏃ユ棩锛圷YMDD锛� + 3浣�09鐮佹祦姘村彿锛堝浐瀹�'001'锛� + 渚涘簲鍟嗕唬鐮侊紙鍥哄畾'151003'锛�
+ sWTMNumber = "09" + HMaterModel + "01" + sYear + sPeriod + sDay + "001151003";
+ }
+ //鏂板崕涓夈�佺粺鍚�
else
{
//鏉$爜鍓嶇紑 = 2浣嶅浐瀹氱爜锛�'09'锛� + CPN瀹㈡埛缂栫爜锛堣鏍煎瀷鍙凤級+ 2浣嶉鐣欑爜锛堝浐瀹�'01'锛�+ 5浣嶅勾骞存湀鏃ユ棩锛圷YMDD锛� + 3浣�09鐮佹祦姘村彿锛堝浐瀹�'001'锛� + 渚涘簲鍟嗕唬鐮侊紙鍥哄畾'151091'锛�
@@ -839,7 +855,7 @@
LSH2 = "0" + LSH2;
}
- //鏉$爜缂栧彿 = 2浣嶅浐瀹氱爜锛�'09'锛� + CPN瀹㈡埛缂栫爜锛堣鏍煎瀷鍙凤級+ 2浣嶉鐣欑爜锛堝浐瀹�'01'锛�+ 5浣嶅勾骞存湀鏃ユ棩锛圷YMDD锛� + 3浣�09鐮佹祦姘村彿锛堝浐瀹�'001'锛� + 渚涘簲鍟嗕唬鐮侊紙鍥哄畾'151091'锛�+ 3浣嶆祦姘村彿
+ //鏉$爜缂栧彿 = 鏉$爜鍓嶇紑 + 3浣嶆祦姘村彿
TM = sWTMNumber + LSH2;
HEntryID = j + 1;
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_LianXiang.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_LianXiang.cs"
index c1bf32c..d2cf588 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_LianXiang.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_LianXiang.cs"
@@ -55,27 +55,29 @@
public const Int16 HWMinQtyCol = 33;
public const Int16 HWBQtyCol = 34;
public const Int16 HCustomQty1Col = 35;
- public const Int16 HZMinQtyCol = 36;
- public const Int16 HZBQtyCol = 37;
- public const Int16 HCustomQty2Col = 38;
- public const Int16 HProduceDateCol = 39;
- public const Int16 HExpiryDateCol = 40;
- public const Int16 HCusIDCol = 41;
- public const Int16 HCusNumberCol = 42;
- public const Int16 HCusNameCol = 43;
- public const Int16 HSourceInterIDCol = 44;
- public const Int16 HSourceEntryIDCol = 45;
- public const Int16 HSourceBillNoCol = 46;
- public const Int16 HSourceBillTypeCol = 47;
- public const Int16 HInitQtyCol = 48;
- public const Int16 HMTONoCol = 49;
- public const Int16 HISKFPERIODCol = 50;
- public const Int16 HEXPUNITCol = 51;
- public const Int16 HEXPPERIODCol = 52;
- public const Int16 HLSHCol = 53;
- public const Int16 HBaNoCol = 54;
- public const Int16 HCusModelCol = 55;
- public const Int16 HRemarkCol = 56;
+ public const Int16 HCustomQty3Col = 36;
+ public const Int16 HZMinQtyCol = 37;
+ public const Int16 HZBQtyCol = 38;
+ public const Int16 HCustomQty2Col = 39;
+ public const Int16 HCustomQty4Col = 40;
+ public const Int16 HProduceDateCol = 41;
+ public const Int16 HExpiryDateCol = 42;
+ public const Int16 HCusIDCol = 43;
+ public const Int16 HCusNumberCol = 44;
+ public const Int16 HCusNameCol = 45;
+ public const Int16 HSourceInterIDCol = 46;
+ public const Int16 HSourceEntryIDCol = 47;
+ public const Int16 HSourceBillNoCol = 48;
+ public const Int16 HSourceBillTypeCol = 49;
+ public const Int16 HInitQtyCol = 50;
+ public const Int16 HMTONoCol = 51;
+ public const Int16 HISKFPERIODCol = 52;
+ public const Int16 HEXPUNITCol = 53;
+ public const Int16 HEXPPERIODCol = 54;
+ public const Int16 HLSHCol = 55;
+ public const Int16 HBaNoCol = 56;
+ public const Int16 HCusModelCol = 57;
+ public const Int16 HRemarkCol = 58;
//
public string ModName = "85";
public string ModCaption = "鑱旀兂瀹㈡埛鏍囩鐢熸垚";
@@ -783,6 +785,7 @@
string HCustom6 = ""; //鎴愬搧鏂欏彿
double HCustomQty1 = 0; //鏁寸姣涢噸
double HCustomQty2 = 0; //鏁存爤姣涢噸
+ string HWei = ""; //灏剧/灏炬爤鏍囪
Int64 HSno = 0; //鎵规搴忓垪鍙�
string HBoxNo = ""; //鎵规鐢熸垚鍓嶇紑
string sHBaNo = ""; //鐣岄潰涓婅緭鍏ョ殑鎵规浣�
@@ -831,7 +834,7 @@
}
//
LSH = LSH + 1;
- LSH2 = ConvertToBase(ClsPub.isInt(LSH), 33);
+ LSH2 = ConvertToBase(ClsPub.isInt(LSH), 32);
while (LSH2.Length < LSHlen) //濡傛灉娴佹按鍙蜂綅鏁板皬浜� LSHlen 鍓嶉潰琛�0
{
LSH2 = "0" + LSH2;
@@ -934,17 +937,28 @@
nn = 0; //鏈娴佹按鍙风疮璁′娇鐢ㄤ釜鏁�
for (int i = 0; i < HWBQty; i++)
{
- if (HSumQty - HWMinQty > 0)
+ if (HSumQty - HWMinQty >= 0)
{
+ HWei = "";
HSumQty = HSumQty - HWMinQty;
+ HCustomQty1 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty1Col].Value); // 鏁寸姣涢噸 鐣岄潰涓婅緭鍏�
}
else
{
+ HWei = "灏炬暟";
HWMinQty = HSumQty;
+ HCustomQty1 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty3Col].Value); // 灏剧姣涢噸 鐣岄潰涓婅緭鍏�
+ if (HCustomQty1 <= 0)
+ {
+ MessageBox.Show("绗� " + ClsPub.isStrNull(grdMain.Rows[j].Cells[HSnoCol].Value) + " 琛岀墿鏂欙紝灏剧姣涢噸涓嶅厑璁稿皬浜� 0 锛�");
+ bc.Enabled = true;
+ oCn.RollBack();
+ return;
+ }
}
//
LWSH = LWSH + 1;
- LSH2 = ConvertToBase(ClsPub.isInt(LWSH), 33);
+ LSH2 = LWSH.ToString();
while (LSH2.Length < LWSHlen) //濡傛灉澶栫娴佹按鍙蜂綅鏁板皬浜� 澶栫娴佹按鍙烽暱搴� 鍓嶉潰琛�0
{
LSH2 = "0" + LSH2;
@@ -987,7 +1001,6 @@
HCustom4 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom4Col].Value); // FRU 鐣岄潰涓婅緭鍏�
HCustom5 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom5Col].Value); // EC 鐣岄潰涓婅緭鍏�
HCustom6 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom6Col].Value); // 鎴愬搧鏂欏彿 鐣岄潰涓婅緭鍏�
- HCustomQty1 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty1Col].Value); // 鏁寸姣涢噸 鐣岄潰涓婅緭鍏�
HCustomQty2 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty2Col].Value); // 鏁存爤姣涢噸 鐣岄潰涓婅緭鍏�
//FRU HCustom4銆丒C HCustom5銆佹垚鍝佹枡鍙� HCustom6銆佹暣绠辨瘺閲岺CustomQty1銆佹暣鏍堟瘺閲岺CustomQty2
@@ -1009,7 +1022,7 @@
") values (" + HInterID + "," + HEntryID + ",'','" + HBarCode + "','" + HBarCodeType + "'"
+ "," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HAuxPropID.ToString() + ",'" + HBatchNo + "'," + HQty.ToString()
+ "," + HCusID.ToString() + ",'" + HCusModel + "','" + HCusModelName + "','" + sDate + "',''"
- + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",''"
+ + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",'" + HWei + "'"
+ "," + (HProduceDate == "" ? "NULL" : "'" + HProduceDate + "'") + "," + (HExpiryDate == "" ? "NULL" : "'" + HExpiryDate + "'")
+ "," + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + ",1,0"
+ "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'"
@@ -1048,17 +1061,28 @@
nn = 0; //鏈娴佹按鍙风疮璁′娇鐢ㄤ釜鏁�
for (int i = 0; i < HZBQty; i++)
{
- if (HSumQty - HZMinQty > 0)
+ if (HSumQty - HZMinQty >= 0)
{
+ HWei = "";
HSumQty = HSumQty - HZMinQty;
+ HCustomQty2 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty2Col].Value); // 鏁存爤姣涢噸 鐣岄潰涓婅緭鍏�
}
else
{
+ HWei = "灏炬暟";
HZMinQty = HSumQty;
+ HCustomQty2 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty4Col].Value); // 灏炬爤姣涢噸 鐣岄潰涓婅緭鍏�
+ if (HCustomQty2 <= 0)
+ {
+ MessageBox.Show("绗� "+ClsPub.isStrNull(grdMain.Rows[j].Cells[HSnoCol].Value)+" 琛岀墿鏂欙紝灏炬爤姣涢噸涓嶅厑璁稿皬浜� 0 锛�");
+ bc.Enabled = true;
+ oCn.RollBack();
+ return;
+ }
}
//
LZSH = LZSH + 1;
- LSH2 = ConvertToBase(ClsPub.isInt(LZSH), 33);
+ LSH2 = LZSH.ToString();
while (LSH2.Length < LWSHlen) //濡傛灉澶栫娴佹按鍙蜂綅鏁板皬浜� 澶栫娴佹按鍙烽暱搴� 鍓嶉潰琛�0
{
LSH2 = "0" + LSH2;
@@ -1102,7 +1126,6 @@
HCustom5 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom5Col].Value); // EC 鐣岄潰涓婅緭鍏�
HCustom6 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom6Col].Value); // 鎴愬搧鏂欏彿 鐣岄潰涓婅緭鍏�
HCustomQty1 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty1Col].Value); // 鏁寸姣涢噸 鐣岄潰涓婅緭鍏�
- HCustomQty2 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty2Col].Value); // 鏁存爤姣涢噸 鐣岄潰涓婅緭鍏�
//FRU HCustom4銆丒C HCustom5銆佹垚鍝佹枡鍙� HCustom6銆佹暣绠辨瘺閲岺CustomQty1銆佹暣鏍堟瘺閲岺CustomQty2
oCn.RunProc("insert into Gy_BarCodeBill_Cus" +
@@ -1123,7 +1146,7 @@
") values (" + HInterID + "," + HEntryID + ",'','" + HBarCode + "','" + HBarCodeType + "'"
+ "," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HAuxPropID.ToString() + ",'" + HBatchNo + "'," + HQty.ToString()
+ "," + HCusID.ToString() + ",'" + HCusModel + "','" + HCusModelName + "','" + sDate + "',''"
- + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",''"
+ + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",'" + HWei + "'"
+ "," + (HProduceDate == "" ? "NULL" : "'" + HProduceDate + "'") + "," + (HExpiryDate == "" ? "NULL" : "'" + HExpiryDate + "'")
+ "," + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + ",1,0"
+ "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'"
@@ -1221,7 +1244,7 @@
#region 灏嗗崄杩涘埗鏁板�艰浆鎴愭寚瀹氳繘鍒舵暟鍊硷紙num涓鸿杞崲鐨勫崄杩涜鏁板�硷紝nbase涓烘寚瀹氳繘鍒讹級
public string ConvertToBase(int num, int nbase)
{
- string chars = "0123456789ABCDEFGHJKLMNPQRSTVWXYZ";
+ string chars = "0123456789ABCDEFGHJKLMNPRSTVWXYZ"; //鏁板瓧+瀛楁瘝缁勫悎锛屽瓧姣嶄笉鍖呭惈IOQU
if (nbase < 2 || nbase > chars.Length)
return "";
int r;
@@ -1246,7 +1269,7 @@
private void initGrid()
{
grdMain.RowCount = 0;
- grdMain.ColumnCount = 57; //鎬诲垪鏁�
+ grdMain.ColumnCount = 59; //鎬诲垪鏁�
DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
grdMain.Columns[HSnoCol].HeaderText = "搴忓彿";
grdMain.Columns[HMainIDCol].HeaderText = "婧愬崟涓籌D";
@@ -1297,6 +1320,8 @@
grdMain.Columns[HCustom6Col].HeaderText = "鎴愬搧鏂欏彿";
grdMain.Columns[HCustomQty1Col].HeaderText = "鏁寸姣涢噸";
grdMain.Columns[HCustomQty2Col].HeaderText = "鏁存爤姣涢噸";
+ grdMain.Columns[HCustomQty3Col].HeaderText = "灏剧姣涢噸";
+ grdMain.Columns[HCustomQty4Col].HeaderText = "灏炬爤姣涢噸";
//鏍煎紡鍖� 闅愯棌鍒�
grdMain.Columns[HTagCol].Visible = false;
@@ -1355,6 +1380,8 @@
"," + HCustom6Col.ToString() +
"," + HCustomQty1Col.ToString() +
"," + HCustomQty2Col.ToString() +
+ "," + HCustomQty3Col.ToString() +
+ "," + HCustomQty4Col.ToString() +
"," + HRemarkCol.ToString();
//璁剧疆鍚堣鍒�
@@ -1811,6 +1838,8 @@
"," + HCustom6Col.ToString() +
"," + HCustomQty1Col.ToString() +
"," + HCustomQty2Col.ToString() +
+ "," + HCustomQty3Col.ToString() +
+ "," + HCustomQty4Col.ToString() +
"," + HRemarkCol.ToString();
grdMain.Columns[HBillNoCol].ReadOnly = true;
//璁剧疆鍚堣鍒�
--
Gitblit v1.9.1