From b85b664124f698f38c0f27b5d67f491bf9a176fd Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期一, 08 九月 2025 16:34:40 +0800
Subject: [PATCH] 新增凯贝元脑、顺达、锐捷、华勤、英业达客户条码生成,夏宝到货确认审核调用方法修改(不删除源单分行数据)

---
 WarM/条码打印/Gy_CusBarCodeBill_KaiBei.cs          |  157 +++++++++++++++++++++++++++++++++++----
 WarM/条码打印/Gy_CusBarCodeBill_KaiBei_LangChao.cs |   58 ++++++++++---
 WebAPI/Controllers/POStockInBillController.cs  |    2 
 3 files changed, 185 insertions(+), 32 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs"
index 3ac1fd8..10a9269 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs"
@@ -8,6 +8,7 @@
 using gregn6Lib;
 using Pub_Class;
 using System.Threading;
+using System.Globalization;
 
 namespace WarM
 {
@@ -62,6 +63,7 @@
         public const Int16 HEXPPERIODCol = 41;
         public const Int16 HLSHCol = 42;
         public const Int16 HBaNoCol = 43;
+        public const Int16 HCusModelCol = 44;
         //
         public  string ModName = "85";
         public  string ModCaption = "瀹㈡埛鏍囩鐢熸垚";
@@ -81,6 +83,9 @@
         public string sYear4 = "";         //骞达紙4浣嶏級
         public string sPeriod = "";        //鏈�
         public string sDay = "";           //鏃�
+        public string sWeek = "";          //鍛�
+        public string sYearWeek = "";      //骞达紙2浣嶏級鍛紙2浣嶏級
+        public string sYearPeriodDay = ""; //骞达紙4浣嶏級鏈堬紙2浣嶏級鏃ワ紙2浣嶏級
         public string HBarCodeType = "瓒呰仛鍙樺唴鏍囩";   //鏉$爜绫诲瀷
 
 
@@ -275,6 +280,27 @@
             cmbHCusName.DataSource = ds.Tables[0];
             cmbHCusName.DisplayMember = "HName";
             cmbHCusName.ValueMember = "HItemID";
+
+            if (cmbHCusName.Text.Contains("椤鸿揪"))
+            {
+                HBarCodeType = "椤鸿揪鏍囩";
+            }
+            else if (cmbHCusName.Text.Contains("閿愭嵎"))
+            {
+                HBarCodeType = "閿愭嵎鏍囩";
+            }
+            else if (cmbHCusName.Text.Contains("鏅澘浜戝垱"))
+            {
+                HBarCodeType = "鍗庡嫟鏍囩";
+            }
+            else if (cmbHCusName.Text.Contains("鑻变笟杈�"))
+            {
+                HBarCodeType = "鑻变笟杈炬爣绛�";
+            }
+            else
+            {
+                HBarCodeType = "瓒呰仛鍙樺唴鏍囩";
+            }
         }
 
         //绐椾綋灏哄鍙樺寲鏃�
@@ -452,6 +478,14 @@
             sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
             sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
             sDay = sDay.Substring(sDay.Length - 2, 2);
+            //鑾峰彇鍛�
+            GregorianCalendar calendar = new GregorianCalendar();
+            int weekNumber = calendar.GetWeekOfYear(dtpHDate.Value, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
+            sWeek = "0" + weekNumber.ToString();
+            sWeek = sWeek.Substring(sWeek.Length - 2, 2);
+            sYearWeek = sYear + sWeek;
+            //鑾峰彇骞存湀鏃�
+            sYearPeriodDay = sYear4 + sPeriod + sDay;
             //==================================
             switch (sPeriod)
             {
@@ -611,6 +645,7 @@
                 double HQty = 0;            //鏁伴噺
                 Int64 HCusID = 0;           //瀹㈡埛ID
                 string HCusModelName = "";  //瀹㈡埛鐗╂枡缂栫爜
+                string HCusModel = "";      //瀹㈡埛鐗╂枡鍚嶇О
                 bool HGiveAwayFlag = false; //璧犲搧鏍囪
                 string HProduceDate;        //鐢熶骇鏃ユ湡锛堜繚璐ㄦ湡鐢級
                 string HExpiryDate;         //淇濊川鏈熻嚦锛堜繚璐ㄦ湡鐢級
@@ -641,10 +676,59 @@
                         HMaterNumber = HMaterNumber.Substring(HMaterNumber.Length - 3, 3);  //鍙栫墿鏂欎唬鐮佸悗涓変綅
                         string sHCusModelName = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelNameCol].Value);   //瀹㈡埛浠g爜锛堝彇閲戣澏瀹㈡埛鐗╂枡瀵瑰簲琛ㄥ鎴风墿鏂欑紪鐮侊級
 
-                        //鏉$爜鍓嶇紑 = 骞� + 鏈�
-                        sTMNumber = sYear + sPeriod;
-                        Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+                        if (HBarCodeType == "椤鸿揪鏍囩")
+                        {
+                            LSHlen = 6;
+                            //鏉$爜鍓嶇紑 = 'B103288'+骞村懆
+                            sTMNumber = "B103288" + sYearWeek;
+                            Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
+                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+                        }
+                        else if (HBarCodeType == "閿愭嵎鏍囩")
+                        {
+                            LSHlen = 5;
+                            //鏉$爜鍓嶇紑 = 瀹㈡埛鏂欏彿+渚涘簲鍟嗕唬鐮侊紙鍥哄畾'264'锛�+骞存湀鏃ワ紙20250705锛�
+                            sTMNumber = sHCusModelName + "264" + sYearPeriodDay;
+                            Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
+                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+                        }
+                        else if (HBarCodeType == "鍗庡嫟鏍囩")
+                        {
+                            LSHlen = 4;
+                            //鏉$爜鍓嶇紑 = 瀹㈡埛鏂欏彿+骞村懆
+                            sTMNumber = sHCusModelName + sYearWeek;
+                            Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
+                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+                        }
+                        else if (HBarCodeType == "鑻变笟杈炬爣绛�")
+                        {
+                            LSHlen = 3;
+                            string sPN = "";
+                            string sBB = "";
+                            if (sHCusModelName.Length >= 6)
+                            {
+                                sPN = sHCusModelName.Substring(sHCusModelName.Length - 6, 4);  //PN  瀹㈡埛鏂欏彿鍚庡叚浣嶄腑鐨勫墠鍥涗綅
+                                sBB = sHCusModelName.Substring(sHCusModelName.Length - 2, 2);  //鐗堟湰  鍙栧鎴锋枡鍙峰悗涓や綅
+                            }
+                            else
+                            {
+                                MessageBox.Show("鑻变笟杈惧鎴锋枡鍙蜂负[" + sHCusModelName + "]锛岄暱搴﹀繀椤诲ぇ浜庢垨绛変簬6浣嶏紒");
+                                return;
+                            }
+
+                            //鏉$爜鍓嶇紑 = 1浣嶅浐瀹氱爜锛�9锛�+4浣峆N锛堝鎴锋枡鍙峰悗鍏綅涓殑鍓嶅洓浣嶏級+2浣嶅巶鍟嗕唬鐮侊紙鍥哄畾33锛�+2浣嶇増鏈紙瀹㈡埛鏂欏彿鍚庝袱浣嶏級+1浣嶅勾浠斤紙骞存渶鍚庝竴浣嶏級+2浣嶅懆锛堜竴骞翠腑鐨勭鍑犲懆锛�
+                            sTMNumber = "9" + sPN + "33" + sBB + sYearWeek.Substring(sYearWeek.Length - 3, 3);
+                            Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
+                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+                        }
+                        else
+                        //瓒呰仛鍙樺唴鏍囩
+                        {
+                            //鏉$爜鍓嶇紑 = 骞� + 鏈�
+                            sTMNumber = sYear + sPeriod;
+                            Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
+                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+                        }
 
                         HBQty = ClsPub.isInt(grdMain.Rows[j].Cells[HBQtyCol].Value);
                         HMinQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value);
@@ -665,20 +749,37 @@
                                 HMinQty = HSumQty;
                             }
                             //
-                            LSH = LSH + 1;
-                            LSH2 = LSH.ToString();
+                            LSH = LSH + 1; 
+                            if (HBarCodeType == "鑻变笟杈炬爣绛�")
+                            {
+                                LSH2 = ConvertToBase(ClsPub.isInt(LSH), 34);
+                            }
+                            else
+                            {
+                                LSH2 = LSH.ToString();
+                            }
+
                             while (LSH2.Length < LSHlen)  //濡傛灉娴佹按鍙蜂綅鏁板皬浜� 娴佹按鍙烽暱搴� 鍓嶉潰琛�0
                             {
                                 LSH2 = "0" + LSH2;
                             }
-                            if (LSH2.Length != 7)
+
+                            if (HBarCodeType == "椤鸿揪鏍囩" || HBarCodeType == "閿愭嵎鏍囩" || HBarCodeType == "鍗庡嫟鏍囩" || HBarCodeType == "鑻变笟杈炬爣绛�")
                             {
-                                MessageBox.Show("鏉$爜娴佹按鍙蜂负[" + LSH2 + "]锛岄暱搴︿笉鍏佽瓒呰繃7浣嶏紒");
-                                return;
+                                TM = sTMNumber + LSH2;
                             }
-                            //瓒呰仛鍙樻暟瀛楁妧鏈湁闄愬叕鍙�   鏉$爜缂栧彿锛堝叡26浣嶏級 = 浠g爜锛�1浣嶅浐瀹氣�楽鈥欙級 + 鍘傚晢浠g爜锛�2浣嶅浐瀹氣�榊3鈥欙級 + 骞达紙2浣嶅勾鍚庝袱浣嶏級 + 鏈堬紙1浣�10=A,11=B,12=C锛� + 娴佹按鍙凤紙7浣嶏級 + 浠e彿锛�2浣嶅浐瀹氣��1P鈥欙級 + 瀹㈡埛浠g爜锛�8浣嶅彇閲戣澏瀹㈡埛鐗╂枡瀵瑰簲琛ㄥ鎴风墿鏂欑紪鐮侊級 + 鐗╂枡鐗堟湰锛�3浣嶅彇鐗╂枡缂栫爜鍚庝笁浣嶏級
-                            TM = "SY3" + sYear + sPeriod + LSH2 + "1P" + sHCusModelName;
-                            //TM = "SY3" + sYear + sPeriod + LSH2 + "1P" + sHCusModelName + HMaterNumber;
+                            else
+                            //瓒呰仛鍙樺唴鏍囩
+                            {
+                                if (LSH2.Length != 7)
+                                {
+                                    MessageBox.Show("鏉$爜娴佹按鍙蜂负[" + LSH2 + "]锛岄暱搴︿笉鍏佽瓒呰繃7浣嶏紒");
+                                    return;
+                                }
+                                //瓒呰仛鍙樻暟瀛楁妧鏈湁闄愬叕鍙�   鏉$爜缂栧彿锛堝叡26浣嶏級 = 浠g爜锛�1浣嶅浐瀹氣�楽鈥欙級 + 鍘傚晢浠g爜锛�2浣嶅浐瀹氣�榊3鈥欙級 + 骞达紙2浣嶅勾鍚庝袱浣嶏級 + 鏈堬紙1浣�10=A,11=B,12=C锛� + 娴佹按鍙凤紙7浣嶏級 + 浠e彿锛�2浣嶅浐瀹氣��1P鈥欙級 + 瀹㈡埛浠g爜锛�8浣嶅彇閲戣澏瀹㈡埛鐗╂枡瀵瑰簲琛ㄥ鎴风墿鏂欑紪鐮侊級 + 鐗╂枡鐗堟湰锛�3浣嶅彇鐗╂枡缂栫爜鍚庝笁浣嶏級
+                                TM = "SY3" + sYear + sPeriod + LSH2 + "1P" + sHCusModelName;
+                                //TM = "SY3" + sYear + sPeriod + LSH2 + "1P" + sHCusModelName + HMaterNumber;
+                            }
 
                             HEntryID = j + 1;
                             HBarCode = TM.ToUpper();
@@ -688,6 +789,7 @@
                             HQty = HMinQty;
                             HCusID = ClsPub.isLong(cmbHCusName.SelectedValue);
                             HCusModelName = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelNameCol].Value);
+                            HCusModel = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelCol].Value);
                             HGiveAwayFlag = ClsPub.isBool(grdMain.Rows[j].Cells[HGiveAwayFlagCol].Value);
                             HISKFPERIOD = ClsPub.isBool(grdMain.Rows[j].Cells[HISKFPERIODCol].Value);
                             HProduceDate = ClsPub.isStrNull(grdMain.Rows[j].Cells[HProduceDateCol].Value);
@@ -706,7 +808,7 @@
                             HBoxNo = sTMNumber;
                             sHBaNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HBaNoCol].Value);                        // 鐣岄潰涓婅緭鍏ョ殑鎵规浣�
 
-                            //瓒呰仛鍙樻暟瀛楁妧鏈湁闄愬叕鍙�   瀹㈡埛鐗╂枡缂栫爜HCusModelName銆佹祦姘村彿HSno銆佹祦姘村彿HSupNumber銆佹祦姘村彿鐢熸垚鍓嶇紑HBoxNo銆佺墿鏂欑増鏈琀Code3
+                            //瓒呰仛鍙樻暟瀛楁妧鏈湁闄愬叕鍙�   瀹㈡埛鐗╂枡缂栫爜HCusModelName銆佸鎴风墿鏂欏悕绉癏CusModel銆佹祦姘村彿HSno銆佹祦姘村彿HSupNumber銆佹祦姘村彿鐢熸垚鍓嶇紑HBoxNo銆佺墿鏂欑増鏈琀Code3
                             oCn.RunProc("insert into Gy_BarCodeBill_Cus" +
                                     "(HInterID,HEntryID,HBillType,HBarCode,HBarCodeType" +
                                     ",HMaterID,HUnitID,HAuxPropID,HBatchNo,HQty" +
@@ -722,7 +824,7 @@
                                     ",HCode2,HCode3,HBackDataFlag,HSno,HBoxNo" +
                                     ") values (" + HInterID + "," + HEntryID + ",'','" + HBarCode + "','" + HBarCodeType + "'"
                                     + "," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HAuxPropID.ToString() + ",'" + HBatchNo + "'," + HQty.ToString()
-                                    + "," + HCusID.ToString() + ",'','" + HCusModelName + "','" + sDate + "',''"
+                                    + "," + HCusID.ToString() + ",'" + HCusModel + "','" + HCusModelName + "','" + sDate + "',''"
                                     + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",''"
                                     + "," + (HProduceDate == "" ? "NULL" : "'" + HProduceDate + "'") + "," + (HExpiryDate == "" ? "NULL" : "'" + HExpiryDate + "'")
                                     + "," + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + ",1,0"
@@ -786,7 +888,7 @@
         #region  灏嗗崄杩涘埗鏁板�艰浆鎴愭寚瀹氳繘鍒舵暟鍊硷紙num涓鸿杞崲鐨勫崄杩涜鏁板�硷紝nbase涓烘寚瀹氳繘鍒讹級
         public string ConvertToBase(int num, int nbase)
         {
-            string chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+            string chars = "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
             if (nbase < 2 || nbase > chars.Length)
                 return "";
             int r;
@@ -811,7 +913,7 @@
         private void initGrid()
         {
             grdMain.RowCount = 0;
-            grdMain.ColumnCount = 44;                       //鎬诲垪鏁�
+            grdMain.ColumnCount = 45;                       //鎬诲垪鏁�
             DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
             grdMain.Columns[HSnoCol].HeaderText = "搴忓彿";
             grdMain.Columns[HMainIDCol].HeaderText = "婧愬崟涓籌D";
@@ -823,6 +925,7 @@
             grdMain.Columns[HMaterNameCol].HeaderText = "鐗╂枡鍚嶇О";
             grdMain.Columns[HMaterModelCol].HeaderText = "瑙勬牸鍨嬪彿";
             grdMain.Columns[HCusModelNameCol].HeaderText = "瀹㈡埛鐗╂枡缂栫爜";
+            grdMain.Columns[HCusModelCol].HeaderText = "瀹㈡埛鐗╂枡鍚嶇О";
             grdMain.Columns[HUnitIDCol].HeaderText = "璁¢噺鍗曚綅ID";
             grdMain.Columns[HUnitNumberCol].HeaderText = "璁¢噺鍗曚綅浠g爜";
             grdMain.Columns[HUnitNameCol].HeaderText = "璁¢噺鍗曚綅鍚嶇О";
@@ -1557,10 +1660,12 @@
                     if (ds == null || ds.Tables[0].Rows.Count == 0)
                     {
                         grdMain.Rows[j].Cells[HCusModelNameCol].Value = "";
+                        grdMain.Rows[j].Cells[HCusModelCol].Value = "";
                     }
                     else
                     {
                         grdMain.Rows[j].Cells[HCusModelNameCol].Value = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HCusRelationNumber"]);
+                        grdMain.Rows[j].Cells[HCusModelCol].Value = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HCusRelationName"]);
                         if (num == 2)
                         {
                             grdMain.Rows[j].Cells[HCode1Col].Value = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HCode1"]);
@@ -1577,6 +1682,26 @@
         #region 閫夋嫨瀹㈡埛
         private void cmbHCusName_TextChanged(object sender, EventArgs e)
         {
+            if (cmbHCusName.Text.Contains("椤鸿揪"))
+            {
+                HBarCodeType = "椤鸿揪鏍囩";
+            }
+            else if (cmbHCusName.Text.Contains("閿愭嵎"))
+            {
+                HBarCodeType = "閿愭嵎鏍囩";
+            }
+            else if (cmbHCusName.Text.Contains("鏅澘浜戝垱"))
+            {
+                HBarCodeType = "鍗庡嫟鏍囩";
+            }
+            else if (cmbHCusName.Text.Contains("鑻变笟杈�"))
+            {
+                HBarCodeType = "鑻变笟杈炬爣绛�";
+            }
+            else
+            {
+                HBarCodeType = "瓒呰仛鍙樺唴鏍囩";
+            }
             GetCusMatNo(1);
         }
 
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_LangChao.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_LangChao.cs"
index c4c4fac..a4189fb 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_LangChao.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_LangChao.cs"
@@ -8,6 +8,7 @@
 using gregn6Lib;
 using Pub_Class;
 using System.Threading;
+using System.Globalization;
 
 namespace WarM
 {
@@ -66,7 +67,7 @@
         public const Int16 HBaNoCol = 45;
         //
         public  string ModName = "85";
-        public  string ModCaption = "娴疆瀹㈡埛鏍囩鐢熸垚";
+        public  string ModCaption = "娴疆銆佸厓鑴戝鎴锋爣绛剧敓鎴�";
         public const string ModRightName = "Gy_CusBarCodeBill_KaiBei_LangChao";
 
         public DBUtility.ClsPub.Enum_BillStatus BillStatus;
@@ -85,6 +86,8 @@
         public string sPeriod = "";        //鏈�
         public string sPeriod2 = "";       //鏈堬紙姝e父锛�
         public string sDay = "";           //鏃�
+        public string sWeek = "";          //鍛�
+        public string sYearWeek = "";      //骞达紙2浣嶏級鍛紙2浣嶏級
 
 
         #region 鍥哄畾浠g爜
@@ -460,6 +463,12 @@
             sPeriod2 = sPeriod.Substring(sPeriod.Length - 2, 2);
             sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
             sDay = sDay.Substring(sDay.Length - 2, 2);
+            //鑾峰彇鍛�
+            GregorianCalendar calendar = new GregorianCalendar();
+            int weekNumber = calendar.GetWeekOfYear(dtpHDate.Value, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
+            sWeek = "0" + weekNumber.ToString();
+            sWeek = sWeek.Substring(sWeek.Length - 2, 2);
+            sYearWeek = sYear + sWeek;
             //==================================
             switch (sYear)
             {
@@ -573,7 +582,7 @@
                 string HCode3 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value);                 // 鐗堟湰鍙�
                 string HBatchNoNumber = HCode1 + sYear + sPeriod + sDay + HCusModel;                                // 鎵规鐢熸垚鍓嶇紑
                 HBatchNoNumber = HBatchNoNumber.ToUpper();
-                string HBarCodeType = "";                                                                           // 鏉$爜绫诲瀷
+                string HBarCodeType = cmbHCusName.Text;                                                             // 鏉$爜绫诲瀷
                 string HInnerBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HInnerBillNoCol].Value);     // 瀹㈡埛璁㈠崟鍙�
 
                 if (HMaterID != 0)
@@ -784,7 +793,14 @@
 
                             HEntryID = j + 1;
                             HBarCode = TM.ToUpper();
-                            HBarCodeType = "鍐呯鐮�";
+                            if(cmbHCusName.Text.Contains("鍏冭剳"))
+                            {
+                                HBarCodeType = "鍏冭剳鍐呯鐮�";
+                            }
+                            else
+                            {
+                                HBarCodeType = "鍐呯鐮�";
+                            }
                             HMaterID = ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value);
                             HUnitID = ClsPub.isLong(grdMain.Rows[j].Cells[HUnitIDCol].Value);
                             HAuxPropID = ClsPub.isLong(grdMain.Rows[j].Cells[HAuxPropIDCol].Value);
@@ -813,7 +829,7 @@
                             sHBaNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HBaNoCol].Value);                        // 鐣岄潰涓婅緭鍏ョ殑鎵规浣�
 
                             //瀹㈡埛鏂欏彿HCusModelName銆佺墿鏂欑被鍒獺Code1銆佹壒娆′綅HCode2銆佺増鏈彿HCode3銆佹壒娆″簭鍒楀彿HSno銆佹壒娆$敓鎴愬墠缂�HBoxNo銆佸巶鍟嗕唬鐮丠CusModel
-                            //鐣岄潰涓婅緭鍏ョ殑鎵规浣岺SupName銆�36杩涘埗鎵规搴忓垪鍙稨SupNumber銆佸鎴疯鍗曞彿HInnerBillNo
+                            //鐣岄潰涓婅緭鍏ョ殑鎵规浣岺SupName銆�36杩涘埗鎵规搴忓垪鍙稨SupNumber銆佸鎴疯鍗曞彿HInnerBillNo銆佸勾鍛℉WorkLineName
                             oCn.RunProc("insert into Gy_BarCodeBill_Cus" +
                                     "(HInterID,HEntryID,HBillType,HBarCode,HBarCodeType" +
                                     ",HMaterID,HUnitID,HAuxPropID,HBatchNo,HQty" +
@@ -835,7 +851,7 @@
                                     + "," + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + ",1,0"
                                     + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'"
                                     + ",0,'','" + HRemark + "'," + HOrgID.ToString() + "," + HOrgID.ToString()
-                                    + ",'" + ClsPub.CurUserName + "',getdate(),'','','" + HMTONo + "'"
+                                    + ",'" + ClsPub.CurUserName + "',getdate(),'','" + sYearWeek + "','" + HMTONo + "'"
                                     + ",0,'','','" + HInnerBillNo + "'"
                                     + ",'','','" + LSH2 + "','" + sHBaNo + "','" + HCode1 + "'"
                                     + ",'" + HCode2 + "','" + HCode3 + "',''," + HSno.ToString() + ",'" + HBoxNo + "')");
@@ -852,11 +868,24 @@
                     {
                         HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value);
                         HCode3 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value);
-                        //鑾峰彇鏈�澶ф祦姘村彿
-                        //鏉$爜鍓嶇紑 = 渚涘簲鍟嗕唬鐮� + 骞� + 鏈� + 鏃�
-                        sTMNumber = HCusModel + sYear4 + sPeriod2 + sDay;
-                        Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                        LWSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+                        if (cmbHCusName.Text.Contains("鍏冭剳"))
+                        {
+                            HBarCodeType = "鍏冭剳澶栫鐮�";
+                            //鑾峰彇鏈�澶ф祦姘村彿
+                            //鏉$爜鍓嶇紑 = 'CA'+骞村懆
+                            sTMNumber = "CA" + sYearWeek;
+                            Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
+                            LWSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+                        }
+                        else
+                        {
+                            HBarCodeType = "澶栫鐮�";
+                            //鑾峰彇鏈�澶ф祦姘村彿
+                            //鏉$爜鍓嶇紑 = 渚涘簲鍟嗕唬鐮� + 骞� + 鏈� + 鏃�
+                            sTMNumber = HCusModel + sYear4 + sPeriod2 + sDay;
+                            Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
+                            LWSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+                        }
 
                         HWBQty = ClsPub.isInt(grdMain.Rows[j].Cells[HWBQtyCol].Value);
                         HWMinQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HWMinQtyCol].Value);
@@ -884,7 +913,6 @@
 
                             HEntryID = j + 1;
                             HBarCode = TM.ToUpper();
-                            HBarCodeType = "澶栫鐮�";
                             HMaterID = ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value);
                             HUnitID = ClsPub.isLong(grdMain.Rows[j].Cells[HUnitIDCol].Value);
                             HAuxPropID = ClsPub.isLong(grdMain.Rows[j].Cells[HAuxPropIDCol].Value);
@@ -913,7 +941,7 @@
                             sHBaNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HBaNoCol].Value);                        // 鐣岄潰涓婅緭鍏ョ殑鎵规浣�
 
                             //瀹㈡埛鏂欏彿HCusModelName銆佺墿鏂欑被鍒獺Code1銆佹壒娆′綅HCode2銆佺増鏈彿HCode3銆佹壒娆″簭鍒楀彿HSno銆佹壒娆$敓鎴愬墠缂�HBoxNo銆佸巶鍟嗕唬鐮丠CusModel
-                            //鐣岄潰涓婅緭鍏ョ殑鎵规浣岺SupName銆�36杩涘埗鎵规搴忓垪鍙稨SupNumber銆佸鎴疯鍗曞彿HInnerBillNo
+                            //鐣岄潰涓婅緭鍏ョ殑鎵规浣岺SupName銆�36杩涘埗鎵规搴忓垪鍙稨SupNumber銆佸鎴疯鍗曞彿HInnerBillNo銆佸勾鍛℉WorkLineName
                             oCn.RunProc("insert into Gy_BarCodeBill_Cus" +
                                     "(HInterID,HEntryID,HBillType,HBarCode,HBarCodeType" +
                                     ",HMaterID,HUnitID,HAuxPropID,HBatchNo,HQty" +
@@ -935,7 +963,7 @@
                                     + "," + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + ",1,0"
                                     + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'"
                                     + ",0,'','" + HRemark + "'," + HOrgID.ToString() + "," + HOrgID.ToString()
-                                    + ",'" + ClsPub.CurUserName + "',getdate(),'','','" + HMTONo + "'"
+                                    + ",'" + ClsPub.CurUserName + "',getdate(),'','" + sYearWeek + "','" + HMTONo + "'"
                                     + ",0,'','','" + HInnerBillNo + "'"
                                     + ",'','','" + LSH2 + "','" + sHBaNo + "','" + HCode1 + "'"
                                     + ",'" + HCode2 + "','" + HCode3 + "',''," + HSno.ToString() + ",'" + HBoxNo + "')");
@@ -965,7 +993,7 @@
         private void Display()
         {
             //鍒锋柊鍐呯鐮佸垪琛�
-            DataSet DSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and 鏉$爜绫诲瀷='鍐呯鐮�' order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
+            DataSet DSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and (鏉$爜绫诲瀷='鍐呯鐮�' or 鏉$爜绫诲瀷='鍏冭剳鍐呯鐮�') order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
             //鐢熸垚棣栬鏍囬
             if (DSet == null)
             {
@@ -976,7 +1004,7 @@
             grdSub.DataSource = DSet.Tables[0].DefaultView;
 
             //鍒锋柊澶栫鐮佸垪琛�
-            DataSet DWSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and 鏉$爜绫诲瀷='澶栫鐮�' order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
+            DataSet DWSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and (鏉$爜绫诲瀷='澶栫鐮�' or 鏉$爜绫诲瀷='鍏冭剳澶栫鐮�') order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
             //鐢熸垚棣栬鏍囬
             if (DWSet == null)
             {
diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs
index 80202ac..8aa14f2 100644
--- a/WebAPI/Controllers/POStockInBillController.cs
+++ b/WebAPI/Controllers/POStockInBillController.cs
@@ -5236,7 +5236,7 @@
                     jsonRoot.Add("Creator", "");
                     jsonRoot.Add("NeedUpDateFields", new JArray());
                     jsonRoot.Add("NeedReturnFields", new JArray());
-                    jsonRoot.Add("IsDeleteEntry", "True"); //娉ㄦ剰IsDeleteEntry鍙傛暟锛屽涓篢rue锛屽垯鍘熷垎褰曡鐨凢EntryId鏈湪鍒嗗綍json鍑虹幇鐨勮锛屽皢浼氳鍒犻櫎 锛堝鏃犻渶鍒犻櫎鍒嗗綍琛岋紝鍙敼涓篺asle锛�
+                    jsonRoot.Add("IsDeleteEntry", "false"); //娉ㄦ剰IsDeleteEntry鍙傛暟锛屽涓篢rue锛屽垯鍘熷垎褰曡鐨凢EntryId鏈湪鍒嗗綍json鍑虹幇鐨勮锛屽皢浼氳鍒犻櫎 锛堝鏃犻渶鍒犻櫎鍒嗗綍琛岋紝鍙敼涓篺asle锛�
                     jsonRoot.Add("SubSystemId", "");
                     jsonRoot.Add("IsVerifyBaseDataField", "");
 

--
Gitblit v1.9.1