From 9e3536c0dc929c3353408a9b5614322de2803b29 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期日, 04 一月 2026 13:46:59 +0800
Subject: [PATCH] 小卫栈板码规则调整;

---
 WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 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 b818d4d..b4b43ef 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"
@@ -3100,6 +3100,7 @@
             List<HBarCodeList> ListRows = new List<HBarCodeList>();
 
             DataSet Ds;
+            DataSet Ds2;
             for (int i = 0; i < 1; i++)
             {
                 HSourceBillType_Temp = ordrlist.HBillType;
@@ -3136,16 +3137,32 @@
                                 objJsonResult.Message = "鐗╂枡涓嶈兘涓虹┖锛屼笉鑳界敓鎴愭潯鐮侊紒";
                                 return objJsonResult;
                             }
+
+                            Ds2 = oCN.RunProcReturn("select top 1 HCusRelationNumber from Gy_Material m with(nolock) left join Gy_MateNumRelation_Sec b with(nolock) on m.HMASTERID = b.HMaterID where m.HItemID = " + ordrlist.HMaterID, "Gy_MateNumRelation_Sec");
+
+                            string HSKU = "";//鍟嗗搧SKU
+                            if (Ds2.Tables[0].Rows.Count > 0)
+                            {
+                                HSKU = Ds2.Tables[0].Rows[0]["HCusRelationNumber"].ToString();
+                            }
+                            else
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "娌℃湁鍖归厤鍒板搴旂殑鍟嗗搧SKU!";
+                                return objJsonResult;
+                            }
+
                             //todo
                             //鏉$爜鍓嶇紑 = p+鍟嗗搧SKU+鐢熶骇骞翠唤+鐢熶骇鏈堜唤+6浣嶆祦姘村彿+鐢熶骇宸ュ巶浠g爜
-                            sTMNumber = "P" + HMaterialName + lastDigit+ productionMonth;
+                            sTMNumber = "P" + HSKU + lastDigit+ productionMonth;
 
                             //鏍规嵁鏉$爜鍓嶇紑鑾峰彇鏈�澶ф祦姘村彿
                             Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");
                             LSH = String.Format("{0:D" + HLen + "}", ClsPub.isInt(Ds.Tables[0].Rows[0][0]) + 1);
 
                             //鎷兼帴鏉$爜
-                            HBarCode_Temp = sTMNumber + LSH+"XXX";
+                            HBarCode_Temp = sTMNumber + "A" + LSH + "AHW";
 
 
                             if (HSumQty - HMinQty > 0)

--
Gitblit v1.9.1