From 2ee2d1c8c05fce44e3e01ea8bcf8c81fab88afb0 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期一, 02 二月 2026 14:10:40 +0800
Subject: [PATCH] 优化拆分条码
---
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs | 110 ++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 85 insertions(+), 25 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 5ce0990..538830e 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -1728,11 +1728,11 @@
ds = oCN.RunProcReturn("select * from Sc_SourceLineRepairBillSub_Mater where HInterID=" + model.HInterID+ " order by HEntryID desc", "Sc_SourceLineRepairBillSub_Mater");
oCN.RunProc($@"insert into Sc_SourceLineRepairBillSub_Mater
-(HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID
-,HSourceEntryID,HSourceBillNo,HSourceBillType,HMaterID
-,HUnitID,HBarCode,HBatchNo )values
-({model.HInterID},{(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)},'{model.HBillNo}','',{temp.HProcExchInterID}
-,{temp.HProcExchEntryID},'{temp.HProcExchBillNo}','',{temp.HMaterID},0,'{temp.HBarCode}','{temp.HBatchNo}')");
+ (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID
+ ,HSourceEntryID,HSourceBillNo,HSourceBillType,HMaterID
+ ,HUnitID,HBarCode,HBatchNo )values
+ ({model.HInterID},{(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)},'{model.HBillNo}','',{temp.HProcExchInterID}
+ ,{temp.HProcExchEntryID},'{temp.HProcExchBillNo}','',{temp.HMaterID},0,'{temp.HBarCode}','{temp.HBatchNo}')");
//淇敼浜х嚎杩芥函鍗曠粦瀹氱殑鏉$爜鎵瑰彿
oCN.RunProc("update Sc_AssemblyBillSub set HBarCode='" + temp.HBarCode + "' where HInterID=" + temp.HInterID + " and HEntryID=" + temp.HEntryID);
@@ -1743,21 +1743,21 @@
model = JsonConvert.DeserializeObject<Model.ClsSc_SourceLineRepairBillMain>(sMainStr);
oCN.RunProc($@"insert into Sc_SourceLineRepairBillMain(HYear, HPeriod, HBillType, HBillSubType, HInterID,
-HDate, HBillNo, HBillStatus, HRemark, HEmpID, HDeptID, HSourceID, HProdOrgID, HMaterID, HWorkStationID,
-HProcess, HIPAddr, HMacAddr, HProdMac, HBarCode,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo)
-values('{DateTime.Now.Year}','{DateTime.Now.Month}','3748','3748',{model.HInterID}
-,getdate(),'{model.HBillNo}','1','{HResult}',{model.HEmpID},{model.HDeptID},{model.HSourceID},{model.HProdOrgID},{model.HMaterID},0
-,{model.HProcess},'','','','{model.HBarCode}','{user}',getdate(),{model.HICMOInterID},{model.HICMOEntryID},'{model.HICMOBillNo}')");
+ HDate, HBillNo, HBillStatus, HRemark, HEmpID, HDeptID, HSourceID, HProdOrgID, HMaterID, HWorkStationID,
+ HProcess, HIPAddr, HMacAddr, HProdMac, HBarCode,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo)
+ values('{DateTime.Now.Year}','{DateTime.Now.Month}','3748','3748',{model.HInterID}
+ ,getdate(),'{model.HBillNo}','1','{HResult}',{model.HEmpID},{model.HDeptID},{model.HSourceID},{model.HProdOrgID},{model.HMaterID},0
+ ,{model.HProcess},'','','','{model.HBarCode}','{user}',getdate(),{model.HICMOInterID},{model.HICMOEntryID},'{model.HICMOBillNo}')");
List<Model.ClsSc_SourceLineRepairBillSub> subLsit = new List<Model.ClsSc_SourceLineRepairBillSub>();
sMainStr = "[" + sMainStr + "]";
subLsit = JsonConvert.DeserializeObject<List<Model.ClsSc_SourceLineRepairBillSub>>(sMainStr);
oCN.RunProc($@"insert into Sc_SourceLineRepairBillSub
-(HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType
-,HBadReasonID,HBadTypeID,HBadResultID,HBadProcID,HRepairResult,HCreator,HCreateDate)
-values({model.HInterID},1,'{model.HBillNo}','',{subLsit[0].HProcExchInterID},{subLsit[0].HProcExchEntryID},'{subLsit[0].HProcExchBillNo}',''
-,{subLsit[0].HBadReasonID},{subLsit[0].HBadTypeID},{subLsit[0].HBadResultID},{model.HBadProcID},'{HResult}','{subLsit[0].HCreator}',getdate())");
+ (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType
+ ,HBadReasonID,HBadTypeID,HBadResultID,HBadProcID,HRepairResult,HCreator,HCreateDate)
+ values({model.HInterID},1,'{model.HBillNo}','{model.HRemark}',{subLsit[0].HProcExchInterID},{subLsit[0].HProcExchEntryID},'{subLsit[0].HProcExchBillNo}',''
+ ,{subLsit[0].HBadReasonID},{subLsit[0].HBadTypeID},{subLsit[0].HBadResultID},{model.HBadProcID},'{HResult}','{subLsit[0].HCreator}',getdate())");
if (HResult == "OK")
{
@@ -3005,18 +3005,18 @@
try
{
//鍒ゆ柇鎵�鎵潯鐮佹槸鍚﹀瓨鍦ㄦ潯鐮佹。妗堝綋涓�
- ds = oCN.RunProcReturn(@"select 1 from Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill");
- if (ds.Tables[0].Rows.Count == 0)
- {
- //鏉$爜妗f涓病鏈夋湰娆℃壂鎻忕殑鏉$爜锛屽垯鏍规嵁瑙勫垯瑙f瀽鐢熸垚鏉$爜
+ //ds = oCN.RunProcReturn(@"select 1 from Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill");
+ //if (ds.Tables[0].Rows.Count == 0)
+ //{
+ // //鏉$爜妗f涓病鏈夋湰娆℃壂鎻忕殑鏉$爜锛屽垯鏍规嵁瑙勫垯瑙f瀽鐢熸垚鏉$爜
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "璇ユ潯鐮佷笉瀛樺湪锛�" + HBarCode;
- objJsonResult.data = "";
- return objJsonResult;
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "璇ユ潯鐮佷笉瀛樺湪锛�" + HBarCode;
+ // objJsonResult.data = "";
+ // return objJsonResult;
- }
+ //}
//鏉$爜妗f涓凡鏈夋湰娆℃壂鎻忕殑鏉$爜锛屾煡璇㈤厤浠朵俊鎭紙鎵弿鏉$爜淇℃伅鍐欏叆涓存椂琛級
ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomBindByHProcExch_XW '" + HBillNo + "','" + HBarCode + "','" + HBarCode_P + "','" + HProcID + "','" + HOrgID + "'", "h_p_Gy_BarCodeBillBomBindByHProcExch_XW");
@@ -3446,7 +3446,8 @@
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from h_v_Sc_UnbindStation_BarList order by 鏉$爜鏃ユ湡 desc", "h_v_Sc_UnbindStation_BarList");
+ ds = oCN.RunProcReturn("select * from h_v_Sc_UnbindStation_BarList" +
+ " order by 鏉$爜鏃ユ湡 desc", "h_v_Sc_UnbindStation_BarList");
}
else
{
@@ -3481,6 +3482,65 @@
}
#endregion
+ #region 杩囩珯瑙g粦鍒楄〃 鏌ヨ
+ [Route("Cj_SingleStation/ShippingExportList")]
+ [HttpGet]
+ public object ShippingExportList(string sWhere, string user, string gnsy)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ if (gnsy != "" && gnsy != null)
+ {
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(gnsy, 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Cj_SingleStation_ShippingExportList" +
+ " order by 鏍堟澘鐮� desc,涓鐮�,SN鐮�", "h_v_Cj_SingleStation_ShippingExportList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Cj_SingleStation_ShippingExportList where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by 鏍堟澘鐮� desc,涓鐮�,SN鐮�";
+ ds = oCN.RunProcReturn(sql, "h_v_Cj_SingleStation_ShippingExportList");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 閲嶅伐鏉$爜淇℃伅 鏌ヨ
[Route("Cj_SingleStation/UnbindBarInfo")]
[HttpGet]
--
Gitblit v1.9.1