From debfb742b27f7a5e668e6cd3f52db2ee8ddfe815 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 13 四月 2026 10:08:35 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs | 378 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 299 insertions(+), 79 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 8082513..d423f0a 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"
@@ -188,9 +188,17 @@
switch (HSouceBillType)
{
case "鐢熶骇璁㈠崟":
- tabname = "h_v_IFCLD_ICMOBillList_Source";
- count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IFCLD_ICMOBillList_Source "+sWhere+ " and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0) and 鐘舵��<>'缁撴' order by 鍗曟嵁鍙�", tabname).Tables[0].Rows.Count;
- sql = string.Format(@"select * from(select row_number() over (order by 鍗曟嵁鍙�) as HRowNumber,* from h_v_IFCLD_ICMOBillList_Source " + sWhere + " and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0) and 鐘舵��<>'缁撴') as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ tabname = "h_v_IFCLD_ICMOBillList_Source";
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
+ {
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IFCLD_ICMOBillList_Source " + sWhere + " order by 鍗曟嵁鍙�", tabname).Tables[0].Rows.Count;
+ sql = string.Format(@"select * from(select row_number() over (order by 鍗曟嵁鍙�) as HRowNumber,* from h_v_IFCLD_ICMOBillList_Source " + sWhere + " ) as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ }
+ else
+ {
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IFCLD_ICMOBillList_Source " + sWhere + " and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0) and 鐘舵��<>'缁撴' order by 鍗曟嵁鍙�", tabname).Tables[0].Rows.Count;
+ sql = string.Format(@"select * from(select row_number() over (order by 鍗曟嵁鍙�) as HRowNumber,* from h_v_IFCLD_ICMOBillList_Source " + sWhere + " and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0) and 鐘舵��<>'缁撴') as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ }
break;
case "鐢熶骇姹囨姤鍗�":
tabname = "h_v_IF_ICMOReportBillList_Source";
@@ -207,11 +215,11 @@
if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
{
count = new SQLHelper.ClsCN().RunProcReturn("select top 1000 * from h_v_IF_POInStockBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid", tabname).Tables[0].Rows.Count;
- sql = string.Format(@"select * from(select top 1000 row_number() over (order by 鍗曟嵁鍙� desc,hsubid) as HRowNumber,* from h_v_IF_POInStockBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ sql = string.Format(@"select * from(select top 1000 row_number() over (order by 鍗曟嵁鍙� desc,hsubid) as HRowNumber,* from h_v_IF_POInStockBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
}
else
{
- count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POInStockBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid", tabname).Tables[0].Rows.Count;
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POInStockBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid ", tabname).Tables[0].Rows.Count;
sql = string.Format(@"select * from(select row_number() over (order by 鍗曟嵁鍙� desc,hsubid) as HRowNumber,* from h_v_IF_POInStockBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
}
break;
@@ -303,6 +311,148 @@
return objJsonResult;
}
#endregion
+
+ #region [閫氳繃婧愬崟绫诲瀷鏌ユ壘涓嶅悓鍗曟嵁淇℃伅] 浣跨敤鏂扮殑鍒嗛〉鏂瑰紡
+ [Route("Sc_BarCode/ReportFromBillList_New")]
+ [HttpGet]
+ public object ReportFromBillList_New(int page, int limit, string sWhere, string HSouceBillType, string HOrgID)
+ {
+ oSystemParameter.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ List<object> columnNameList = new List<object>();
+ try
+ {
+ int count = 0;
+ int pageNum = page;
+ int pageSize = limit;
+ string sql = "";
+ string tabname = "";
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ sWhere = " where 1=1 and HOrgID='" + HOrgID + "' ";
+ }
+ else
+ {
+ sWhere = " where 1=1 and HOrgID='" + HOrgID + "' " + sWhere;
+ }
+ switch (HSouceBillType)
+ {
+ case "鐢熶骇璁㈠崟":
+ tabname = "h_v_IFCLD_ICMOBillList_Source";
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IFCLD_ICMOBillList_Source " + sWhere + " and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0) and 鐘舵��<>'缁撴' order by 鍗曟嵁鍙�", tabname).Tables[0].Rows.Count;
+ sql = string.Format($@"select * from h_v_IFCLD_ICMOBillList_Source {sWhere} and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0) and 鐘舵��<>'缁撴' order by 鍗曟嵁鍙� offset {(pageNum - 1)*pageSize} rows fetch next {pageSize} rows only;");
+ break;
+ case "鐢熶骇姹囨姤鍗�":
+ tabname = "h_v_IF_ICMOReportBillList_Source";
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_ICMOReportBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid", tabname).Tables[0].Rows.Count;
+ sql = string.Format(@"select * from(select row_number() over (order by 鍗曟嵁鍙� desc,hsubid) as HRowNumber,* from h_v_IF_ICMOReportBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ break;
+ case "閲囪喘璁㈠崟":
+ tabname = "h_v_IF_POOrderBillList_Source";
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POOrderBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid", tabname).Tables[0].Rows.Count;
+ sql = string.Format($@"select * from h_v_IF_POOrderBillList_Source {sWhere} order by 鍗曟嵁鍙� offset {(pageNum - 1)*pageSize} rows fetch next {pageSize} rows only;");
+ break;
+ case "鏀舵枡閫氱煡鍗�":
+ tabname = "h_v_IF_POInStockBillList_Source";
+ if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
+ {
+ count = new SQLHelper.ClsCN().RunProcReturn("select top 1000 * from h_v_IF_POInStockBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid", tabname).Tables[0].Rows.Count;
+ sql = string.Format(@"select * from(select top 1000 row_number() over (order by 鍗曟嵁鍙� desc,hsubid) as HRowNumber,* from h_v_IF_POInStockBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ }
+ else
+ {
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POInStockBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid ", tabname).Tables[0].Rows.Count;
+ sql = string.Format($@"select * from h_v_IF_POInStockBillList_Source {sWhere} order by 鍗曟嵁鍙� offset {(pageNum - 1) * pageSize} rows fetch next {pageSize} rows only; ");
+ }
+ break;
+ case "濮斿璁㈠崟":
+ tabname = "h_v_IF_EntrustOrderBillList_Source";
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_EntrustOrderBillList_Source " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid", tabname).Tables[0].Rows.Count;
+ sql = string.Format(@"select * from(select row_number() over (order by 鍗曟嵁鍙� desc,hsubid) as HRowNumber,* from h_v_IF_EntrustOrderBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ break;
+ case "鐢熶骇鍏ュ簱鍗�":
+ tabname = "h_v_IF_ProductInBillList_Source";
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_ProductInBillList_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_ProductInBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ break;
+ case "閲囪喘鍏ュ簱鍗�":
+ tabname = "h_v_IF_POStockInBillList_Source";
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_POStockInBillList_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_POStockInBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ break;
+ case "閿�鍞��璐у崟":
+ tabname = "h_v_IF_SellOutBackBillList_Source";
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_SellOutBackBillList_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_SellOutBackBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ break;
+ case "鐢熶骇閫�鏂欏崟":
+ tabname = "h_v_IF_MateOutBackBillList_Source";
+ count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_MateOutBackBillList_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_MateOutBackBillList_Source " + sWhere + ") as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+ break;
+ case "宸ュ簭娴佽浆鍗�":
+ 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;
+ }
+ ds = new SQLHelper.ClsCN().RunProcReturn(sql, tabname);
+ string aa = ds.Tables[0].Columns[0].ToString();
+ //ds.Tables[0].Columns["hmainid"].ColumnName.ToUpper();
+ //ds.Tables[0].Columns["hsubid"].ColumnName.ToUpper();
+ ds.Tables[0].Columns["hmainid"].ColumnName = "HMainID";
+ ds.Tables[0].Columns["hsubid"].ColumnName = "HSubID";
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = count;
+ objJsonResult.Message = "鑾峰彇璧勬簮缁戝畾鏁版嵁鎴愬姛锛�";
+ objJsonResult.data = JsonConvert.DeserializeObject<DataTable>(JsonConvert.SerializeObject(ds.Tables[0], new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" })); //搴忓垪鍖朌ataSet涓殑鏃堕棿鏍煎紡锛岀劧鍚庡啀鍙嶅簭鍒楀寲鍥炴潵
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏆傛棤璧勬簮缁戝畾锛�";
+ objJsonResult.data = null;
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = e.Message.ToString();
+ objJsonResult.data = null;
+ objJsonResult.list = columnNameList;
+ }
+ return objJsonResult;
+ }
+ #endregion
+
#region [閫氳繃鏉$爜缂栧彿鑾峰彇HItemId]
[Route("Sc_BarCode/Get_HItemId")]
@@ -559,7 +709,8 @@
ordrlist.HMTONo = dt.Rows[i]["璁″垝璺熻釜鍙�"].ToString();
ordrlist.HProduceDate = DBUtility.ClsPub.isDate(dt.Rows[i]["鐢熶骇鏃ユ湡"]);
ordrlist.HExpiryDate = DBUtility.ClsPub.isDate(dt.Rows[i]["鏈夋晥鏈熻嚦"]);
- ordrlist.HISKFPERIOD = int.Parse(dt.Rows[i]["HISKFPERIOD"].ToString());
+ //ordrlist.HISKFPERIOD = int.Parse(dt.Rows[i]["HISKFPERIOD"].ToString());
+ ordrlist.HISKFPERIOD = DBUtility.ClsPub.isInt(dt.Rows[i]["HISKFPERIOD"]);
ordrlist.HEXPUNIT = dt.Rows[i]["HEXPUNIT"].ToString(); //鏈夋晥鏈熷崟浣�(鏃ャ�佹湀銆佸勾)
ordrlist.HEXPPERIOD = double.Parse(dt.Rows[i]["HEXPPERIOD"].ToString()); //鏈夋晥鏈熷��
@@ -926,7 +1077,6 @@
string HPOInStockBillNo = ""; // 鏀舵枡閫氱煡鍗曞彿
string HPOOrderBillNo = ""; // 閲囪喘璁㈠崟鍙�
-
DataSet Ds;
msg2 = msg2.Replace("\\", "");
msg2 = msg2.Replace("\n", ""); //\n
@@ -937,6 +1087,7 @@
if (ClsPub.isLong(ordrlist[j].HMaterID) != 0)
{
HNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HMaterID);
+ HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HSupNumber);//渚涘簲鍟�
HMaterNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HMaterNumber);
HBatchNo = ClsPub.isStrNull(ordrlist[j].HBatchNo);
@@ -1092,11 +1243,24 @@
}
else if (CampanyName.Contains("灏忓崼"))
{
- // 灏忓崼鐢靛櫒
- // 鏉$爜鍓嶇紑 = 鍗曟嵁鍙� + 鐗╂枡缂栫爜 + 鎵规鍙�
- sTMNumber = HPOOrderBillNo + "@" + HMaterNumber + "@" + HBatchNo;
- Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+ if(HSourceBillTypeName== "閲囪喘璁㈠崟")
+ {
+
+ //鏉$爜瑙勫垯涓猴細鐗╂枡缂栫爜-渚涘簲鍟嗙紪鐮�-鏉ユ枡鎵瑰彿-鏉ユ枡鏁伴噺-閲囪喘璁㈠崟缂栫爜
+ sTMNumber = HMaterNumber + "-" + HSupNumber + "-" + HBatchNo + "-" + HBQty + "-" + HPOInStockBillNo;
+
+ Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+ }
+ else
+ {
+ // 灏忓崼鐢靛櫒
+ // 鏉$爜鍓嶇紑 = 鍗曟嵁鍙� + 鐗╂枡缂栫爜 + 鎵规鍙�
+ sTMNumber = HPOOrderBillNo + "@" + HMaterNumber + "@" + HBatchNo;
+ Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+ }
+
}
else //閫氱敤鏂规硶
{
@@ -1295,6 +1459,14 @@
TM = HNumber + "@" + sHMTONo.Replace(" ","") + "@" + HBatchNo.Replace(" ","") + "@" + sHQty;
}
}
+ if (CampanyName == "鍗庤垷") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉�
+ {
+ barcode.JMHSupID = ordrlist[j].JMHSupID;
+ barcode.JMHSupNumber = ordrlist[j].JMHSupNumber;
+ barcode.JMHSupName = ordrlist[j].JMHSupName;
+ barcode.HTH = ordrlist[j].HTH;
+ barcode.HZQty = ordrlist[j].HZQty;
+ }
barcode.HBarCode2 = TM;
barcode.HEntryID2 = ClsPub.isStrNull(j + 1);
@@ -1417,6 +1589,13 @@
string HCusMaterName2 = "";
string HCheckEmpName2 = "";
+ //鍗庤垷
+ Int64 JMHSupID = 0;
+ string JMHSupNumber = "";
+ string JMHSupName = "";
+ string HTH = "";
+ double HZQty = 0;
+
try
{
oCN.BeginTran();
@@ -1436,7 +1615,15 @@
{
HBarCode = HBarCode + ClsPub.isStrNull(ListRows[i].HMTONo2);
}
- //
+ if (CampanyName == "鍗庤垷")
+ {
+ JMHSupID = ClsPub.isLong(ListRows[i].JMHSupID);
+ JMHSupNumber = ClsPub.isStrNull(ListRows[i].JMHSupNumber);
+ JMHSupName = ClsPub.isStrNull(ListRows[i].JMHSupName);
+ HTH = ClsPub.isStrNull(ListRows[i].HTH);
+ HZQty = ClsPub.isDoule(ListRows[i].HZQty);
+ }
+
HMaterID = ClsPub.isLong(ListRows[i].HMaterID2);
HEntryID = ClsPub.isLong(ListRows[i].HEntryID2);
HAuxPropID = ClsPub.isLong(ListRows[i].HAuxPropID2);
@@ -1478,25 +1665,51 @@
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 " +
- ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
- ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
- ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
- ",HGiveAwayFlag " +
- ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
- ",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()
- + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
- + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
- + ", " + 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 + "','" + HCheckEmpName2 + "'" + ")");
+ if (CampanyName == "鍗庤垷")
+ {
+ oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
+ ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
+ ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
+ ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
+ ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
+ ",HGiveAwayFlag,JMHSupID,JMHSupNumber,JMHSupName,HTH,HZQty" +
+ ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
+ ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName,HBarCodeStatus " +
+ ") values ("
+ + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
+ + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID2.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
+ + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
+ + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
+ + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
+ + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + ""
+ + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)+",'"+ JMHSupID.ToString()+"','"+ JMHSupNumber+"','"+ JMHSupName+"','"+ HTH + "','" + HZQty
+ + "','" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "'"
+ + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "','鍚堟牸'" + ")");
+ }
+ else
+ {
+ oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
+ ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
+ ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
+ ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
+ ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
+ ",HGiveAwayFlag " +
+ ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
+ ",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()
+ + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
+ + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
+ + ", " + 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 + "','" + HCheckEmpName2 + "'" + ")");
+ }
+
//HNumber = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterID2Col].Value);
@@ -2669,9 +2882,10 @@
string HMaterNumber_BarCode = DBUtility.ClsPub.isStrNull(ordrlist[i].HMaterNumber);
string HInspectionDate_BarCode = DBUtility.ClsPub.isStrNull(ordrlist[i].HInspectionDate).Replace("-", "/");
string HQty_BarCode = ClsPub.isStrNull(HMinQty);
- HBarCode_Temp = HPOOrderBillMTO_TMN + HMaterNumber_BarCode + HInspectionDate_BarCode + HQty_BarCode + LSH;
+ HBarCode_Temp = HPOOrderBillMTO_TMN + "|" + HMaterNumber_BarCode + "|" + HInspectionDate_BarCode + "|" + HQty_BarCode + "|" + LSH;
HBarCodeList barcode = new HBarCodeList();
+ barcode.HSourceBillSEQ = ordrlist[i].HSourceBillSEQ; // 婧愬崟琛屽彿
barcode.HBarCode2 = HBarCode_Temp;
barcode.HBarCodeType2 = "鍞竴鏉$爜";
barcode.HBarCodeSubType2 = "";
@@ -2737,9 +2951,12 @@
barcode.HCusMaterName2 = ordrlist[i].HCusMaterName;
barcode.HCheckEmpName2 = ordrlist[i].HCheckEmpName;
barcode.HReInspectionFlag = ordrlist[i].HReInspectionFlag ? 1 : 0;
- barcode.HInspectionDate = ordrlist[i].HReInspectionFlag? ordrlist[i].HInspectionDate:null;
+ barcode.HInspectionDate = ordrlist[i].HInspectionDate;
barcode.HInspectionCycle = ordrlist[i].HReInspectionFlag ? ordrlist[i].HInspectionCycle : 0;
barcode.HReInspectionDate = ordrlist[i].HReInspectionFlag ? ordrlist[i].HReInspectionDate : null;
+ barcode.HPOOrderBillMTO = DBUtility.ClsPub.isStrNull(ordrlist[i].HPOOrderBillMTO);
+ barcode.HSeOrderBillNo2 = DBUtility.ClsPub.isStrNull(ordrlist[i].HSeOrderBillNo);
+ barcode.HCusModel2 = DBUtility.ClsPub.isStrNull(ordrlist[i].HCusModel);
ListRows.Add(barcode);
n += 1; //鏇存柊鍚屾壒鐢熸垚鐨勬潯鐮佹暟
@@ -2814,9 +3031,10 @@
string HInspectionDate = ListRows[i].HInspectionDate;
int HInspectionCycle = ClsPub.isInt(ListRows[i].HInspectionCycle);
string HReInspectionDate = ListRows[i].HInspectionDate;
+ int HSourceBillSEQ = ClsPub.isInt(ListRows[i].HSourceBillSEQ);
string HCustomBatchNo = ClsPub.isStrNull(ListRows[i].HInspectionDate).Replace("-","");
string HBarCodeStatus = "姝e父";
-
+ string HPOOrderBillNoMTO = ClsPub.isStrNull(ListRows[i].HPOOrderBillMTO);
string sql_produceBarCode = "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HBarCodeSubType,HMaterID,HUnitID,HQty" +
",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -2825,8 +3043,8 @@
",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
",HGiveAwayFlag " +
",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
- ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName,HCustomBatchNo,HBarCodeStatus" +
- ",HReInspectionFlag,HInspectionDate,HInspectionCycle,HReInspectionDate " +
+ ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName,HCustomBatchNo,HBarCodeStatus,HOrderBillNo" +
+ ",HReInspectionFlag,HInspectionDate,HInspectionCycle,HReInspectionDate,HSourceBillSEQ " +
") values ("
+ "'" + HBarCode + "','" + HBarCodeType + "','" + HBarCodeSubType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
+ ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID2.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
@@ -2836,8 +3054,9 @@
+ ", " + 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 + "','" + HCheckEmpName2 + "','" + HCustomBatchNo + "','" + HBarCodeStatus + "'" +
+ + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "','" + HCustomBatchNo + "','" + HBarCodeStatus + "','" + HPOOrderBillNoMTO + "'" +
"," + HReInspectionFlag + "," + (HInspectionDate == null ? "null" : "'" + HInspectionDate + "'") + "," + HInspectionCycle + "," + (HReInspectionDate == null ? "null" : "'" + HReInspectionDate + "'") +
+ "," + HSourceBillSEQ +
")";
oCN.RunProc(sql_produceBarCode);
@@ -3038,7 +3257,7 @@
"'" + ds.Tables[0].Rows[0]["HCusType"].ToString() + "', " +
"'" + ds.Tables[0].Rows[0]["HEndDate"].ToString() + "', " +
"'" + ds.Tables[0].Rows[0]["HWorkLineName"].ToString() + "', " +
- "'" + ds.Tables[0].Rows[0]["HBarCodeDate"].ToString() + "', " +
+ "getdate()," +
"'" + ds.Tables[0].Rows[0]["HSTOCKORGID"].ToString() + "', " +
"'" + ds.Tables[0].Rows[0]["HOWNERID"].ToString() + "', " +
"'" + ds.Tables[0].Rows[0]["HSeOrderBillNo"].ToString() + "', " +
@@ -3162,35 +3381,35 @@
{
try
{
- if(oWebs.GetWebAPIToLocal_ICMO(HBillNo, "3710", "admin", ref DBUtility.ClsPub.sErrInfo)==false)
+ //if(oWebs.GetWebAPIToLocal_ICMO(HBillNo, "3710", "admin", ref DBUtility.ClsPub.sErrInfo)==false)
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "[0000-2-020]鍗曟嵁鍚屾澶辫触璇疯仈绯荤鐞嗗憳,"+ DBUtility.ClsPub.sErrInfo;
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //else
+ //{
+ ds = oCN.RunProcReturn("exec h_p_WMS_SaveSNByICMO_XW '" + @HBillNo + "','" + HSN +"',"+HBeginNo+","+HEndNo+","+HCount+",'"+HMachineCode+"'", "h_p_WMS_SaveSNByICMO_XW");
+
+ if (ds == null)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "[0000-2-020]鍗曟嵁鍚屾澶辫触璇疯仈绯荤鐞嗗憳,"+ DBUtility.ClsPub.sErrInfo;
+ objJsonResult.Message = "[0000-2-020]娌℃湁杩斿洖浠讳綍缁撴灉,鏉$爜淇濆瓨澶辫触锛�";
objJsonResult.data = null;
return objJsonResult;
}
- else
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
{
- ds = oCN.RunProcReturn("exec h_p_WMS_SaveSNByICMO_XW '" + @HBillNo + "', " + HSN +","+HBeginNo+","+HEndNo+","+HCount+",'"+HMachineCode+"'", "h_p_WMS_SaveSNByICMO_XW");
-
- if (ds == null)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "[0000-2-020]娌℃湁杩斿洖浠讳綍缁撴灉,鏉$爜淇濆瓨澶辫触锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "[0000-2-020]鏉$爜缁戝畾澶辫触锛�"+ ds.Tables[0].Rows[0]["HRemark"].ToString();
- objJsonResult.data = null;
- return objJsonResult;
- }
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-2-020]鏉$爜缁戝畾澶辫触锛�"+ ds.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
}
+ //}
@@ -3229,6 +3448,7 @@
string HSelectBarCodeType = "鎵樼洏鏉$爜";
string CampanyName = "灏忓崼";
string UserName = sArray[2].ToString();//鐢ㄦ埛
+ string barCode_middle = sArray[3].ToString();//涓鐮�
ClsPub.CurUserName = UserName;
//鑾峰彇鍐呯爜
@@ -3258,7 +3478,7 @@
else
{
//鐢熸垚鏉$爜
- SaveBarCode_xiaowei(msg2, HSelectBarCodeType, CampanyName, HSourceBillTypeName);
+ SaveBarCode_xiaowei(msg2, HSelectBarCodeType, CampanyName, HSourceBillTypeName, barCode_middle);
}
}
catch (Exception e)
@@ -3273,7 +3493,7 @@
#endregion
#region[鏉$爜鐢熸垚鏂规硶_xiaowei]
- private object SaveBarCode_xiaowei(string msg2, string HSelectBarCodeType, string CampanyName, string HSourceBillTypeName)
+ private object SaveBarCode_xiaowei(string msg2, string HSelectBarCodeType, string CampanyName, string HSourceBillTypeName,string barCode_middle)
{
DateTime sDate = DateTime.Now; //鏃ユ湡
string HSourceBillType_Temp = ""; //婧愬崟绫诲瀷
@@ -3288,6 +3508,7 @@
List<HBarCodeList> ListRows = new List<HBarCodeList>();
DataSet Ds;
+ DataSet Ds2;
for (int i = 0; i < 1; i++)
{
HSourceBillType_Temp = ordrlist.HBillType;
@@ -3309,32 +3530,31 @@
string sTMNumber = ""; //鏉$爜鍓嶇紑
string LSH = ""; //鏈�澶ф祦姘村彿
int HLen = 6; //娴佹按鍙烽暱搴�
-
+
//鏉$爜鎷兼帴鎵�闇�瀛楁
string HMaterialName = DBUtility.ClsPub.isStrNull(ordrlist.HMaterName);
string HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist.HSupNumber).Replace(".", ""); //渚涘簲鍟嗕唬鐮侊紙鍘绘帀鍒嗛殧绗︼級
- int lastDigit = int.Parse(DateTime.Today.Year.ToString().Last().ToString());
- char productionMonth = DateTime.Today.Month <= 9
- ? (char)(DateTime.Today.Month + '0')
- : (char)('A' + DateTime.Today.Month - 10);
- if (HMaterialName.Trim() == "")
+
+ DataSet dds= oCN.RunProcReturn("exec h_p_rule_BarCodePack_xiaowei "+ ordrlist.HMaterID+",'"+ barCode_middle+"'", "h_p_rule_BarCodePack_xiaowei");
+ //todo
+ if (dds.Tables[0].Rows[0]["HBack"]=="1")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鐗╂枡涓嶈兘涓虹┖锛屼笉鑳界敓鎴愭潯鐮侊紒";
+ objJsonResult.Message = "鐢熸垚鏉$爜澶辫触锛�" + dds.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
return objJsonResult;
}
- //todo
+ else if(dds == null || dds.Tables[0].Rows.Count <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鐢熸垚鏉$爜澶辫触锛屾湭鎵惧埌鏉$爜锛�" ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
//鏉$爜鍓嶇紑 = p+鍟嗗搧SKU+鐢熶骇骞翠唤+鐢熶骇鏈堜唤+6浣嶆祦姘村彿+鐢熶骇宸ュ巶浠g爜
- sTMNumber = "P" + HMaterialName + 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 = dds.Tables[0].Rows[0]["HRemark"].ToString();
if (HSumQty - HMinQty > 0)
{
--
Gitblit v1.9.1