From 60c33d122fed78adebb7cb9e85ab8dff3d7aa72a Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期四, 12 六月 2025 16:26:25 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs |   74 +++++++++++++++++++++++++++++++------
 1 files changed, 62 insertions(+), 12 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 d66e65e..8409a77 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"
@@ -127,6 +127,11 @@
                     list.Add("浠櫒鎴愬搧鏉$爜瑙勫垯");
                     list.Add("璇曞墏鎴愬搧鏉$爜瑙勫垯");
                 }
+                else if (sCapName == "娣诲悍绉戞妧")
+                {
+                    list.Add("鍞竴鏉$爜");
+                    list.Add("鎵规鏉$爜");
+                }
                 else
                 {
                     list.Add("鍞竴鏉$爜");
@@ -232,6 +237,16 @@
                         tabname = "h_v_IF_ProcessExchangeBillList_Source";
                         count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_ProcessExchangeBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid", tabname).Tables[0].Rows.Count;
                         sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by 鍗曟嵁鍙� desc,hsubid) as HRowNumber,* from h_v_IF_ProcessExchangeBillList_Source " + sWhere + ")   as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+                        break;
+                    case "閿�鍞嚭搴撳崟":
+                        tabname = "h_v_IF_SellOutBillList_Source";
+                        count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_SellOutBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid", tabname).Tables[0].Rows.Count;
+                        sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by 鍗曟嵁鍙� desc,hsubid) as HRowNumber,* from h_v_IF_SellOutBillList_Source " + sWhere + ")   as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+                        break;
+                    case "棰嗘枡鍑哄簱鍗�":
+                        tabname = "h_v_IF_MateOutBillList_Source";
+                        count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_MateOutBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid", tabname).Tables[0].Rows.Count;
+                        sql = string.Format(@"select top " + pageSize + " * from(select row_number() over (order by 鍗曟嵁鍙� desc,hsubid) as HRowNumber,* from h_v_IF_MateOutBillList_Source " + sWhere + ")   as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
                         break;
                     default:
                         break;
@@ -349,6 +364,12 @@
                             //鍐欏叆淇℃伅
                             ListRows.Add(HSourceOrderList1(ds.Tables[0], ordrlist, HBarCodeType, HSourceBillType));
                             break;
+                        case "1205": //閿�鍞嚭搴撳崟
+                            //寰楀埌淇℃伅
+                            ds = oCN.RunProcReturn("select * from h_v_IF_SellOutBillList_BarCode where hmainid=" + oSelectRow.BillMainID + " and hsubid=" + oSelectRow.BillSubID, "h_v_IF_SellOutBillList_BarCode");
+                            //鍐欏叆淇℃伅
+                            ListRows.Add(HSourceOrderList1(ds.Tables[0], ordrlist, HBarCodeType, HSourceBillType));
+                            break;
                         case "1102": //閲囪喘璁㈠崟
                             //寰楀埌淇℃伅
                             ds = oCN.RunProcReturn("select * from h_v_IF_POOrderList where hmainid=" + oSelectRow.BillMainID + " and hsubid=" + oSelectRow.BillSubID, "h_v_IF_POOrderList");
@@ -404,6 +425,12 @@
                         case "3772": //宸ュ簭娴佽浆鍗�
                                      //寰楀埌淇℃伅
                             ds = oCN.RunProcReturn("select * from h_v_IF_ProcessExchangeList where HMainID=" + oSelectRow.BillMainID + " and HSubID=" + oSelectRow.BillSubID, "h_v_IF_ProcessExchangeList", ref DBUtility.ClsPub.sExeReturnInfo);
+                            //鍐欏叆淇℃伅
+                            ListRows.Add(HSourceOrderList1(ds.Tables[0], ordrlist, HBarCodeType, HSourceBillType));
+                            break;
+                        case "1204": //棰嗘枡鍑哄簱鍗�
+                            //寰楀埌淇℃伅
+                            ds = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_MateOutBillList " + oSelectRow.BillMainID.ToString() + "," + oSelectRow.BillSubID.ToString(), "h_p_Gy_BarCodeBill_MateOutBillList");
                             //鍐欏叆淇℃伅
                             ListRows.Add(HSourceOrderList1(ds.Tables[0], ordrlist, HBarCodeType, HSourceBillType));
                             break;
@@ -569,7 +596,7 @@
                     ordrlist.HCusNumber = dt.Rows[i]["瀹㈡埛浠g爜"].ToString();
                     ordrlist.HCusName= dt.Rows[i]["瀹㈡埛"].ToString();
                 }
-                if (HSourceBillType == "鍏朵粬鍏ュ簱鍗�")
+                if (HSourceBillType == "鍏朵粬鍏ュ簱鍗�" || HSourceBillType == "棰嗘枡鍑哄簱鍗�")
                 {
                     ordrlist.HWhID = dt.Rows[i]["HWhID"].ToString();
                     ordrlist.HWhNumber = dt.Rows[i]["浠撳簱浠g爜"].ToString();
@@ -577,6 +604,15 @@
                     ordrlist.HSPID = dt.Rows[i]["HSPID"].ToString();
                     ordrlist.HSPNumber = dt.Rows[i]["浠撲綅浠g爜"].ToString();
                     ordrlist.HSPName = dt.Rows[i]["浠撲綅"].ToString();
+                }
+                if(HSourceBillType == "閿�鍞嚭搴撳崟")
+                {
+                    ordrlist.HWhID = dt.Rows[i]["HWhID"].ToString();
+                    ordrlist.HWhNumber = dt.Rows[i]["浠撳簱浠g爜"].ToString();
+                    ordrlist.HWhName = dt.Rows[i]["浠撳簱"].ToString();
+                    //ordrlist.HSPID = dt.Rows[i]["HSPID"].ToString();
+                    //ordrlist.HSPNumber = dt.Rows[i]["浠撲綅浠g爜"].ToString();
+                    //ordrlist.HSPName = dt.Rows[i]["浠撲綅"].ToString();
                 }
             }
             return ordrlist;
@@ -663,13 +699,13 @@
                 if (oDs == null && oDs.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "1";
-                    objJsonResult.Message="鐢熸垚鎵规澶辫触锛�";
+                    objJsonResult.Message= "[0000-2-053]鐢熸垚鎵规澶辫触锛�";
                     return objJsonResult;
                 }
                 else if (DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0][0]) == "1")
                 {
                     objJsonResult.code = "1";
-                    objJsonResult.Message = "鐢熸垚鎵规鎴愬姛锛�";
+                    objJsonResult.Message = "[0000-2-054]鐢熸垚鎵规鎴愬姛锛�";
                     objJsonResult.data = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]);
                     HBatchNo = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]);
                     b = true;
@@ -680,7 +716,7 @@
             if (b == false)
             {
                 objJsonResult.code = "1";
-                objJsonResult.Message="娌℃湁闇�瑕佺敓鎴愭壒娆$殑鏄庣粏琛岋紒";
+                objJsonResult.Message= "[3899-2-003]娌℃湁闇�瑕佺敓鎴愭壒娆$殑鏄庣粏琛岋紒";
                 return objJsonResult;
             }
             else //瀹屽叏灏侀棴
@@ -721,7 +757,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "閫夋嫨缁勭粐鏈夐敊璇�!";
+                    objJsonResult.Message = "[0000-2-055]閫夋嫨缁勭粐鏈夐敊璇�!";
                     return objJsonResult;
                 }
                 if (!Sub_AllowSave(msg2, HSelectBarCodeType))//鍗曟嵁瀹屾暣鎬у垽鏂�
@@ -742,7 +778,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鏉$爜鐢熸垚澶辫触!"+e.Message;
+                objJsonResult.Message = "[3899-2-006]鏉$爜鐢熸垚澶辫触!" + e.Message;
                 return objJsonResult;
             }
             return objJsonResult;
@@ -775,7 +811,7 @@
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "鏉$爜鐢熸垚瀹屾暣鎬у垽鏂敊璇�";
+                        objJsonResult.Message = "[3899-2-007]鏉$爜鐢熸垚瀹屾暣鎬у垽鏂敊璇�";
                         return false;
                     }
                     else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "1")
@@ -835,6 +871,7 @@
             long HEmpID = 0;
             string HCusModel = ""; //瀹㈡埛鐗╂枡瑙勬牸
             string HCusMaterName = ""; //瀹㈡埛鐗╂枡鍚嶇О
+            string HCheckEmpName = ""; //妫�楠屽憳鍚嶇О
 
             DataSet Ds;
             msg2 = msg2.Replace("\\", "");
@@ -858,6 +895,7 @@
                     HEmpID = ClsPub.isLong(ordrlist[j].HEmpID);
                     HCusModel = ClsPub.isStrNull(ordrlist[j].HCusModel);
                     HCusMaterName = ClsPub.isStrNull(ordrlist[j].HCusMaterName);
+                    HCheckEmpName = ClsPub.isStrNull(ordrlist[j].HCheckEmpName);
                     //鏃ユ湡鑾峰彇鏂瑰紡
                     sDate = DateTime.Now.ToString();
                     //
@@ -870,6 +908,10 @@
                         sDate = DBUtility.ClsPub.isStrNull(ordrlist[j].HEndDate);
                     }
                     else if (CampanyName == "澶忓疂鐢靛櫒")// 鏃ユ湡锛氱敓浜ц鍗� 鏉$爜鏃ユ湡
+                    {
+                        sDate = DBUtility.ClsPub.isStrNull(ordrlist[j].HDate);
+                    }
+                    else if (CampanyName == "涔濊彵")// 鏃ユ湡锛氱敓浜ц鍗� 鏉$爜鏃ユ湡
                     {
                         sDate = DBUtility.ClsPub.isStrNull(ordrlist[j].HDate);
                     }
@@ -1209,6 +1251,7 @@
                         barcode.HEmpID2 = ordrlist[j].HEmpID;
                         barcode.HCusModel2 = ordrlist[j].HCusModel;
                         barcode.HCusMaterName2 = ordrlist[j].HCusMaterName;
+                        barcode.HCheckEmpName2 = ordrlist[j].HCheckEmpName;
                         ListRows.Add(barcode);
                         k = k + 1;
                         n = n + 1;
@@ -1260,6 +1303,7 @@
             long HEmpID2 = 0;
             string HCusModel2 = "";
             string HCusMaterName2 = "";
+            string HCheckEmpName2 = "";
 
             try
             {
@@ -1275,6 +1319,10 @@
                         if (CampanyName == "鍗氭棩绉戞妧" || CampanyName == "澶忓疂鐢靛櫒")
                         {
                             HBarCodeType = "鍞竴鏉$爜";
+                        }
+                        if (CampanyName == "涔濊彵")
+                        {
+                            HBarCode = HBarCode + ClsPub.isStrNull(ListRows[i].HMTONo2);
                         }
                         //
                         HMaterID = ClsPub.isLong(ListRows[i].HMaterID2);
@@ -1317,6 +1365,7 @@
                         HEmpID2 = ClsPub.isLong(ListRows[i].HEmpID2);
                         HCusModel2 = ClsPub.isStrNull(ListRows[i].HCusModel2);
                         HCusMaterName2 = ClsPub.isStrNull(ListRows[i].HCusMaterName2);
+                        HCheckEmpName2 = ClsPub.isStrNull(ListRows[i].HCheckEmpName2);
                         oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                     ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -1325,7 +1374,7 @@
                                     ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
                                     ",HGiveAwayFlag " +
                                     ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
-                                    ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName " +
+                                    ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName " +
                                     ") values ("
                                     + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
                                     + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID2.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
@@ -1334,7 +1383,8 @@
                                     + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
                                     + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + ""
                                     + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)
-                                    + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "','" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "'" + ")");
+                                    + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "'"
+                                    + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "'" + ")");
 
 
                         //HNumber = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterID2Col].Value);
@@ -1396,7 +1446,7 @@
                 {
                     objJsonResult.code = "1";
                     objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇璧勬簮缁戝畾鏁版嵁鎴愬姛锛�";
+                    objJsonResult.Message = "[0000-1-037]鑾峰彇璧勬簮缁戝畾鏁版嵁鎴愬姛锛�";
                     objJsonResult.data = JsonConvert.DeserializeObject<DataTable>(JsonConvert.SerializeObject(ds.Tables[0], new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" }));  //搴忓垪鍖朌ataSet涓殑鏃堕棿鏍煎紡锛岀劧鍚庡啀鍙嶅簭鍒楀寲鍥炴潵
                     objJsonResult.list = listobj;
                     return objJsonResult;
@@ -1405,7 +1455,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍缁撴灉,鏉$爜涓嶅瓨鍦紒";
+                    objJsonResult.Message = "[0000-2-020]娌℃湁杩斿洖浠讳綍缁撴灉,鏉$爜涓嶅瓨鍦紒";
                     objJsonResult.data = null;
                     objJsonResult.list = listobj;
                     return objJsonResult;
@@ -1416,7 +1466,7 @@
                 oCN.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鏉$爜鐢熸垚澶辫触锛�" + e.Message;
+                objJsonResult.Message = "[3899-2-006]鏉$爜鐢熸垚澶辫触锛�" + e.Message;
                 return objJsonResult;
             }
         }

--
Gitblit v1.9.1