From 82de67c48acaf472a6f8bb8b53f3f4feec9f5e54 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期五, 17 十月 2025 10:42:18 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs | 670 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 653 insertions(+), 17 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 e8bdc10..7a9af28 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"
@@ -6,9 +6,11 @@
using System;
using System.Collections.Generic;
using System.Data;
+using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
+using System.Web;
using System.Web.Http;
using WebAPI.Models;
@@ -131,6 +133,10 @@
{
list.Add("鍞竴鏉$爜");
list.Add("鎵规鏉$爜");
+ }
+ else if (sCapName == "娴疯瘹")
+ {
+ list.Add("鍝佺鏉$爜");
}
else
{
@@ -522,6 +528,8 @@
return ordrlist;
}
+
+
public object HSourceOrderList1(DataTable dt, HSouceOrderList ordrlist, string HBarCodeType,string HSourceBillType)
{
oSystemParameter.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo);
@@ -589,6 +597,16 @@
ordrlist.HGiveAwayFlag = 0;
}
}
+ if (HSourceBillType == "鏀舵枡閫氱煡鍗�" || HSourceBillType == "閲囪喘璁㈠崟")
+ {
+ if (oSystemParameter.omodel.WMS_CampanyName == "娴疯瘹") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ ordrlist.HSourceBillSEQ = dt.Rows[i]["HSEQ"].ToString();
+ ordrlist.HFactory = dt.Rows[i]["瀹㈡埛缂栧彿"].ToString();
+ ordrlist.HCoilNO = dt.Rows[i]["娆惧彿"].ToString();
+ ordrlist.HFurnaceNO = dt.Rows[i]["鍒嗙粍"].ToString();
+ }
+ }
}
if (HSourceBillType == "閫�璐ч�氱煡鍗�")
{
@@ -621,7 +639,7 @@
//鏍规嵁TABLE鍐欏叆鐣岄潰(鍑哄叆搴撳崟鎹�)
private object Sub_WriteInForm_InOut(DataTable dt, HSouceOrderList ordrlist, string HBarCodeType, string HSourceBillType)
{
-
+ oSystemParameter.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo);
for (int i = 0; i < dt.Rows.Count; i++)
{
ordrlist.HQty = dt.Rows[i]["鍙敓鎴愭潯鐮佹暟閲�"].ToString();
@@ -654,6 +672,20 @@
ordrlist.HMTONo = dt.Rows[i]["璁″垝璺熻釜鍙�"].ToString();
ordrlist.HDate = dt.Rows[i]["鏃ユ湡"].ToString();
ordrlist.HShowDate = DateTime.Now.ToString();
+
+ if(HSourceBillType=="閲囪喘鍏ュ簱鍗�")
+ {
+ if(oSystemParameter.omodel.WMS_CampanyName=="娴疯瘹") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ ordrlist.HInnerBillNo = dt.Rows[i]["閲囪喘璁㈠崟鍙�"].ToString();
+ ordrlist.HSupID = dt.Rows[i]["HSupID"].ToString();
+ ordrlist.HSupNumber = dt.Rows[i]["渚涘簲鍟嗕唬鐮�"].ToString();
+ ordrlist.HSupName = dt.Rows[i]["渚涘簲鍟�"].ToString();
+ ordrlist.HFactory = dt.Rows[i]["瀹㈡埛缂栧彿"].ToString();
+ ordrlist.HCoilNO = dt.Rows[i]["娆惧彿"].ToString();
+ ordrlist.HFurnaceNO = dt.Rows[i]["鍒嗙粍"].ToString();
+ }
+ }
}
return ordrlist;
}
@@ -801,12 +833,13 @@
long HMaterID = DBUtility.ClsPub.isLong(ordrlist[i].HMaterID); // 鐗╂枡鍐呯爜
string HBatchNo = DBUtility.ClsPub.isStrNull(ordrlist[i].HBatchNo); // 鎵瑰彿
long HAuxPropID = DBUtility.ClsPub.isLong(ordrlist[i].HAuxPropID); // 杈呭姪灞炴�D
+ string HMTONo = DBUtility.ClsPub.isStrNull(ordrlist[i].HMTONo); //璁″垝璺熻釜鍙�
double HSourceQty = DBUtility.ClsPub.isDoule(ordrlist[i].HMinQty); // 婧愬崟鏁伴噺
double HQty = DBUtility.ClsPub.isDoule(ordrlist[i].HQty); // 鏁伴噺
double HMinQty = DBUtility.ClsPub.isDoule(ordrlist[i].HMinQty); // 鏈�灏忓寘瑁呮暟
if (HMaterID != 0)
{
- DataSet oDsCheck = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_AddCheck " + HSno.ToString() + ",'" + HBarCodeType + "','" + HSourceBillNo + "'," + HMaterID.ToString() + ",'" + HBatchNo + "'," + HAuxPropID.ToString() + "," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + "," + HOrgID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_AddCheck");
+ DataSet oDsCheck = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_AddCheck_New " + HSno.ToString() + ",'" + HBarCodeType + "','" + HSourceBillNo + "'," + HMaterID.ToString() + ",'" + HBatchNo + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "'," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + "," + HOrgID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_AddCheck_New");
if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
@@ -845,7 +878,7 @@
int HBQty = 0; //绠辨暟
double HQty = 0; //鏁伴噺
string WeiShu = ""; //灏炬暟
- int LSH = 0; //娴佹按鍙�
+ Int64 LSH = 0; //娴佹按鍙�
string LSH2 = ""; //娴佹按鍙疯浆鎹㈡垚瀛楃
string sDate = ""; //鏃ユ湡
string sYear = ""; //骞�
@@ -872,6 +905,11 @@
string HCusModel = ""; //瀹㈡埛鐗╂枡瑙勬牸
string HCusMaterName = ""; //瀹㈡埛鐗╂枡鍚嶇О
string HCheckEmpName = ""; //妫�楠屽憳鍚嶇О
+
+ string HSupNumber = ""; // 渚涘簲鍟嗙紪鐮�
+ string HPOInStockBillNo = ""; // 鏀舵枡閫氱煡鍗曞彿
+
+ string HPOOrderBillNo = ""; // 閲囪喘璁㈠崟鍙�
DataSet Ds;
msg2 = msg2.Replace("\\", "");
@@ -920,6 +958,11 @@
HICMOBillNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HSourceBillNo); //鐢熶骇璁㈠崟鍙凤紙澶忓疂鐢靛櫒锛�
HBarCodeBatchNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HPinfanBarCode); //鏉$爜鎵规鍙凤紙澶忓疂鐢靛櫒锛�
HBarCodeDate = DBUtility.ClsPub.isStrNull(ordrlist[j].HSupNumber); //鏉$爜鏃ユ湡锛堝瀹濈數鍣級
+
+ HPOInStockBillNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HBillNo); // 鏀舵枡閫氱煡鍗曞彿 鍏磋揪鏉$爜
+ HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HSupNumber);// 渚涘簲鍟嗙紪鍙� 鍏磋揪鏉$爜
+
+ HPOOrderBillNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HBillNo); // 閲囪喘璁㈠崟鍙� 灏忓崼鐢靛櫒
//
sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
@@ -935,7 +978,7 @@
sTMNumber = HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (CampanyName == "椋為緳")
{
@@ -952,7 +995,7 @@
sTMNumber = HWorksNumber + HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (CampanyName == "鐟炰笌绁�") {
var date = DateTime.Now.ToString("yyMMdd");//鏃ユ湡
@@ -977,7 +1020,7 @@
//sTMNumber = ordrlist[j].HMaterNumber + "-鍖呰鏍囪瘑-" + date + "-" + ordrlist[j].HSupNumber + "-";
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (HSourceBillTypeName == "鐢熶骇鍏ュ簱鍗�")
{
@@ -1011,14 +1054,33 @@
//sTMNumber = ordrlist[j].HMaterNumber + "-鍖呰鏍囪瘑-"+ date + "-缁勭粐浠g爜-";
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else
{
sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
+ }
+ else if (CampanyName.Contains("鍏磋揪"))
+ {
+
+ // 鍏磋揪鏉$爜
+ //鏉$爜鍓嶇紑 = 鏀舵枡閫氱煡鍗曞彿 + 渚涘簲鍟嗙紪鐮� + 骞� + 鏈� + 鏃� + 3浣嶆祦姘村彿
+
+ sTMNumber = HPOInStockBillNo + "@" + HSupNumber + "@" + sYear + sPeriod + sDay;
+ Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
+ LSHlen = 3; // 涓変綅娴佹按鍙�
+ }
+ 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]);
}
else //閫氱敤鏂规硶
{
@@ -1026,7 +1088,7 @@
sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
}
else if (HSelectBarCodeType == "鍝佺鏉$爜")
@@ -1050,7 +1112,7 @@
sTMNumber = HMaterNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 4;
}
else if (HSelectBarCodeType == "浠櫒鎴愬搧鏉$爜瑙勫垯") //鍙﹀澶勭悊浜�
@@ -1067,7 +1129,7 @@
sTMNumber = HMaterNumber + HBatchNo;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 6;
}
else if (HSelectBarCodeType == "鍐呴攢鏈烘潯鐮�")
@@ -1077,7 +1139,7 @@
sTMNumber = "1" + HModelName + HBarCodeDate + HBarCodeBatchNo + HYasuoji + "00";
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 5;
if (sTMNumber.Length != 16)
{
@@ -1094,7 +1156,7 @@
sTMNumber = HMaterNumber.Replace(".", "") + HBarCodeDate + HBarCodeBatchNo;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 5;
if (sTMNumber.Length != 18)
{
@@ -1110,7 +1172,7 @@
sTMNumber = HICMOBillNo;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 5;
}
else if (HSelectBarCodeType == "鎵樼洏鏉$爜")
@@ -1119,7 +1181,7 @@
//鏉$爜鍓嶇紑 = 鐗╂枡鍐呯爜 + 骞� + 鏈� + 鏃�
sTMNumber = HNumber + sYear + sPeriod + sDay;
Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else
{
@@ -1184,6 +1246,40 @@
return objJsonResult;
}
HBarCodeList barcode = new HBarCodeList();
+
+ if (CampanyName == "娴疯瘹") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉�
+ {
+ string sHMTONo = ""; //璁″垝璺熻釜鍙�
+ string sHSourceBillNo = ""; //婧愬崟鍗曞彿
+ string sHSourceBillSEQ = ""; //婧愬崟琛屽彿
+ string sHSourceEntryID = ""; //婧愬崟瀛怚D
+ string sSupNumber = ""; //渚涘簲鍟嗕唬鐮�
+ string sHQty = ""; //鏁伴噺
+
+ sHMTONo = DBUtility.ClsPub.isStrNull(ordrlist[j].HMTONo);
+ sHSourceBillNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HBillNo);
+ sHSourceBillSEQ = DBUtility.ClsPub.isStrNull(ordrlist[j].HSourceBillSEQ);
+ sHSourceEntryID = DBUtility.ClsPub.isStrNull(ordrlist[j].HSubID);
+ sSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HSupNumber);
+ sHQty = DBUtility.ClsPub.isStrNull(HMinQty);
+
+ if (DBUtility.ClsPub.isStrNull(ordrlist[j].HBillType) == "1102") //婧愬崟锛氶噰璐鍗�
+ {
+ //鏉$爜瑙勫垯锛氶噰璐鍗曞崟鍙稝琛屽彿@鐗╂枡浠g爜@MTO@鏁伴噺@渚涘簲鍟嗕唬鐮�
+ TM = sHSourceBillNo + "@" + sHSourceBillSEQ + "@" + HMaterNumber + "@" + sHMTONo + "@" + sHQty + "@" + sSupNumber;
+ }
+ else if (DBUtility.ClsPub.isStrNull(ordrlist[j].HBillType) == "1103") //婧愬崟锛氭敹鏂欓�氱煡鍗�
+ {
+ //鏉$爜瑙勫垯锛氭敹鏂欓�氱煡鍗曞彿@鍗曟嵁瀛愬唴鐮丂鐗╂枡浠g爜@MTO@鏁伴噺@渚涘簲鍟嗕唬鐮�
+ TM = sHSourceBillNo + "@" + sHSourceEntryID + "@" + HMaterNumber + "@" + sHMTONo + "@" + sHQty + "@" + sSupNumber;
+ }
+ else
+ {
+ //鏉$爜瑙勫垯锛氱墿鏂欏唴鐮丂MTO@鎵规鍙稝鏁伴噺
+ TM = HNumber + "@" + sHMTONo.Replace(" ","") + "@" + HBatchNo.Replace(" ","") + "@" + sHQty;
+ }
+ }
+
barcode.HBarCode2 = TM;
barcode.HEntryID2 = ClsPub.isStrNull(j + 1);
barcode.HMaterID2 = ordrlist[j].HMaterID;
@@ -1584,9 +1680,11 @@
",@HFactory = N'" + HFactory + "'" +
",@HCoilNO = N'" + HCoilNO + "'" +
",@HFurnaceNO = N'" + HFurnaceNO + "'" +
- ",@HInnerBillNo = N'" + ordrlist[0].HSourceBillNo + "'"
+ ",@HInnerBillNo = N'" + ordrlist[0].HInnerBillNo + "'" +
+ ",@HSourceBillType = N'" + ordrlist[0].HBillType + "'" +
+ ",@HStockOrg = N'" + HOrgType + "'" +
+ ",@HInterID = N'" + ordrlist[0].HInterID + "'"
, "h_p_SC_BarCode_Transfer");
-
if((bool)ds1.Tables[0].Rows[0]["returntype"] == true)
{
objJsonResult.code = "1";
@@ -1608,6 +1706,285 @@
return objJsonResult;
}
return objJsonResult;
+ }
+ #endregion
+
+ #region 鏉$爜杞瓨鏉$爜涓绘。(鎵归噺)
+ /// <summary>
+ /// 鏉$爜杞瓨鏉$爜涓绘。(鎵归噺)
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Sc_BarCode/SaveBarCode_NoGenerate_Batch")]
+ [HttpPost]
+ public object SaveBarCode_NoGenerate_Batch([FromBody] JObject msg)
+ {
+ try
+ {
+ var _value = msg["msg"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.None);
+ string msg2 = sArray[0].ToString();
+ string HOrgType = sArray[1].ToString();
+ string HSourceBillTypeName = sArray[2].ToString();
+ string HSelectBarCodeType = sArray[3].ToString();
+ string CampanyName = sArray[4].ToString() == "xxx" ? "" : sArray[4].ToString();
+ string UserName = sArray[5].ToString();
+ string barCodeNoStrs = sArray[6].ToString(); // 杩欓噷鐨勬潯鐮佹槸涓庢彁浜ょ殑鍗曟嵁搴忓垪瀵瑰簲鐨勬潯鐮佹暟缁�
+ string HFactory = sArray[7].ToString();
+ string HCoilNO = sArray[8].ToString();
+ string HFurnaceNO = sArray[9].ToString();
+ ClsPub.CurUserName = UserName;
+
+ //鑾峰彇鍐呯爜
+ HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo);
+ DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View();
+ HOrgNumber = "";
+ if (oClsGy_ORGANIZATIONS_View.GetInfoByName(HOrgType))
+ {
+ HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID;
+ HOrgNumber = DBUtility.ClsPub.isStrNull(oClsGy_ORGANIZATIONS_View.omodel.HNumber);
+ }
+ if (HOrgID == -1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-2-055]閫夋嫨缁勭粐鏈夐敊璇�!";
+ return objJsonResult;
+ }
+ if (!Sub_AllowSave(msg2, HSelectBarCodeType))//鍗曟嵁瀹屾暣鎬у垽鏂�
+ {
+ return objJsonResult;
+ }
+ if (HSelectBarCodeType == "浠櫒鎴愬搧鏉$爜瑙勫垯")
+ {
+ //瀹㈡埛瀹氬埗
+ }
+ else
+ {
+ string HBarCodeType = ClsPub.isStrNull(HSelectBarCodeType);
+ // 鏉$爜杞瓨
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ List<HSouceOrderList> ordrlist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HSouceOrderList>>(msg2);
+ List<string> barcodeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(barCodeNoStrs);
+ // TODO 閫氳繃InterID 鍜� EntryID 浠庢潯鐮佹。妗堜腑鏌ヨ鏄惁鏈夊凡鐢熸垚鐨勫崟鎹� 閲嶆柊鍐欎竴涓瓨鍌ㄨ繃绋嬶紝褰撳凡瀛樺湪瀵瑰簲鐨勬潯鐮佸崟鎹椂锛岃繑鍥炴潯鐮佷富妗d腑鐨勬潯鐮佹。妗�
+ DataSet dsCache = oCN.RunProcReturn($@"select * from h_v_IF_BarCodeBillList a
+ Inner Join Gy_BarCodeBill b on a.HItemID = b.HItemID
+ where b.HSourceINterID = { ordrlist[0].HMainID } and b.HSourceEntryID = {ordrlist[0].HSubID}"
+ , "h_v_IF_BarCodeBillList");
+ if(dsCache.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "2";
+ objJsonResult.count = 1;
+ objJsonResult.data = dsCache.Tables[0];
+ objJsonResult.Message = "鏉$爜宸插瓨鍦�!";
+ return objJsonResult;
+ }
+ DataSet ds1 = new DataSet();
+ for(int i=0; i<ordrlist.Count; i++)
+ {
+
+ long HSourceInterID = string.IsNullOrEmpty(ordrlist[i].HMainID) == true ? 0 : ClsPub.isLong(ordrlist[0].HMainID);
+ long HSourceEntryID = string.IsNullOrEmpty(ordrlist[i].HSubID) == true ? 0 : ClsPub.isLong(ordrlist[0].HSubID);
+
+ ds1 = oCN.RunProcReturn("exec h_p_SC_BarCode_Transfer " +
+ "@HBarCodeNo = N'" + barcodeList[i] + "'" +
+ ",@HSubID = " + ordrlist[i].HSubID +
+ ",@HMaterID = " + ordrlist[i].HMaterID +
+ ",@HGiveAwayFlag = " + ordrlist[i].HGiveAwayFlag +
+ ",@HQty = " + ordrlist[i].HQty +
+ ",@HUnitID = " + ordrlist[i].HUnitID +
+ ",@HMinQty = " + ordrlist[i].HMinQty +
+ ",@HSupID = " + ordrlist[i].HSupID +
+ ",@HBatchNo = N'" + ordrlist[i].HBatchNo + "'" +
+ ",@HMTONO = N'" + ordrlist[i].HMTONo + "'" +
+ ",@HBarCodeDate = N'" + ordrlist[i].HDate + "'" +
+ ",@HEmpID = " + ordrlist[i].HEmpID +
+ ",@HSourceInterID = " + HSourceInterID +
+ ",@HSourceEntryID = " + HSourceEntryID +
+ ",@HBarCodeType = N'" + HBarCodeType + "'" +
+ ",@HSourceBillNo = N'" + ordrlist[i].HSourceBillNo + "'" +
+ ",@HMaker = N'" + ordrlist[i].HMaker + "'" +
+ ",@HFactory = N'" + HFactory + "'" +
+ ",@HCoilNO = N'" + HCoilNO + "'" +
+ ",@HFurnaceNO = N'" + HFurnaceNO + "'" +
+ ",@HInnerBillNo = N'" + ordrlist[i].HInnerBillNo + "'" +
+ ",@HSourceBillType = N'" + ordrlist[i].HBillType + "'" +
+ ",@HStockOrg = N'" + HOrgType + "'" +
+ ",@HInterID = " + ordrlist[i].HInterID
+ , "h_p_SC_BarCode_Transfer");
+ if ((bool)ds1.Tables[0].Rows[0]["returntype"] == false)
+ {
+ throw new Exception(ds1.Tables[0].Rows[0]["mesg"].ToString());
+ }
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = ds1.Tables[0].Rows[0]["mesg"].ToString();
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[3899-2-006]鏉$爜鐢熸垚澶辫触!" + e.Message;
+ return objJsonResult;
+ }
+ return objJsonResult;
+ }
+ #endregion
+
+ #region 鏇存柊鏉$爜瀵瑰簲鍑哄簱鐢宠鍗曞彿 鍏磋揪
+ public class BarCodeMeta
+ {
+ public string HBarCode { get; set; }
+ public string HBatchNo { get; set; }
+ public string HMaterModel { get; set; }
+ public string HMaterName { get; set; }
+ public float HQty { get; set; }
+ public string HSCSPName { get; set; }
+ public string HSCWHName { get; set; }
+ public string HSPName { get; set; }
+ public float HTMQty { get; set; }
+ public string HUnitName { get; set; }
+ public string HWHName { get; set; }
+ }
+
+ [Route("Sc_BarCode/Set_BarCodeBill")]
+ [HttpPost]
+ public object Set_BarCodeBill([FromBody] JObject msg)
+ {
+
+ var _value = msg["msg"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.None);
+ string msg2 = sArray[0].ToString();
+ string HBillType = sArray[1].ToString();
+ string HBillNo = sArray[2].ToString();
+ string HOrgName = sArray[3].ToString();
+
+ List<BarCodeMeta> BarCodeMetaList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<BarCodeMeta>>(msg2);
+ oCN.BeginTran();
+ try
+ {
+ for(int i = 0; i < BarCodeMetaList.Count; i++)
+ {
+ if (HBillType == "1205") // 閿�鍞嚭搴�
+ {
+
+ if (HOrgName.Contains("鍏磋揪") && !string.IsNullOrEmpty(HBillNo))
+ {
+ // 鍏磋揪 閿�鍞嚭搴撴洿鏂� 鍙戣揣閫氱煡鍗�
+ oCN.RunProcReturn("Update Gy_BarCodeBill set " +
+ "HSeOutStockBillNo='" + HBillNo + "' where HBarCode = '" + BarCodeMetaList[i].HBarCode + "'", "Gy_BarCodeBill");
+ }
+
+ }
+ }
+
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "";
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇敼澶辫触!" + e.Message;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region [鑾峰彇鏍囩鎵撳嵃鎸囦护 CPCL鎸囦护]
+ [Route("Sc_BarCode/Get_BarCodePrintCode_CPCL")]
+ [HttpGet]
+ public object Get_BarCodePrintCode_CPCL(string HOrginationName, string HBillSubType, int HInterID, int HItemID)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("exec h_p_getHBarCodePrintCode_CPCL N'" + HOrginationName + "'" +
+ ",N'" + HBillSubType + "'," + HInterID + "," + HItemID, "h_p_getHBarCodePrintCode_CPCL");
+ if((int)ds.Tables[0].Rows[0]["resultType"] == 1)
+ {
+ string resultMesg = ds.Tables[0].Rows[0]["payload"].ToString().Replace("\\r\\n", "\r\n");
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = resultMesg;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵撳嵃鎸囦护鑾峰彇澶辫触!" + ds.Tables[0].Rows[0]["payload"];
+ return objJsonResult;
+ }
+ }
+ catch(Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵撳嵃鎸囦护鑾峰彇澶辫触!" + e.Message;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region [APP 鑾峰彇鎵撳嵃妯℃澘]
+ public class PrintTemplate
+ {
+ public int Id { get; set; }
+ public string OrgShort { get; set; }
+ public string HBillSubtype { get; set; }
+ public string Format { get; set; }
+ public string Description { get; set; }
+ public string[] Placeholder { get; set; }
+ }
+
+ [Route("Sc_BarCode/Get_BarCodeGenTemplate")]
+ [HttpGet]
+ public object Get_BarCodeGenTemplate(string HOrginationName, string HBillSubType)
+ {
+ try
+ {
+
+ string filePath = HttpContext.Current.Server.MapPath("~/Template");
+ string fileFullPath = Path.Combine(filePath, "barCodeTemplateStorage.json");
+
+ if (!File.Exists(fileFullPath))
+ {
+
+ throw new Exception($"妯℃澘鏂囦欢涓嶅瓨鍦細{fileFullPath}");
+ }
+
+ string jsonContent = File.ReadAllText(fileFullPath);
+ PrintTemplate[] templates = JsonConvert.DeserializeObject<PrintTemplate[]>(jsonContent);
+ PrintTemplate targetTemplate = templates.FirstOrDefault<PrintTemplate>(t => HOrginationName.Contains(t.OrgShort) && string.Equals(t.HBillSubtype, HBillSubType));
+ if (targetTemplate != null)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.data = JsonConvert.SerializeObject(targetTemplate);
+ return objJsonResult;
+ }
+ else
+ {
+ throw new Exception($"娌℃湁鎵惧埌瀵瑰簲鐨勬ā鏉�");
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵撳嵃妯℃澘鑾峰彇澶辫触!" + e.Message;
+ return objJsonResult;
+ }
}
#endregion
@@ -2113,6 +2490,9 @@
//澧炲姞 鏉$爜瓒呰繃鏈敓鎴愬姛鑳芥帶鍒�
//
+ //鑷姩瑁呯
+ string sql_autoForBoxBill = "exec h_v_Gy_BarCode_AutoProductBarCodeBox " + HInterID.ToString();
+ oCN.RunProc(sql_autoForBoxBill);
oCN.Commit();
List<Object> listobj = ListRows.ConvertAll(s => (object)s);//List瀹炰綋绫昏浆鎹负object
@@ -2149,6 +2529,262 @@
}
}
#endregion
+
+ #region [app 鏉$爜鎷嗙爜鑾峰彇瀛愭潯鐮乚
+ [Route("Sc_BarCode/SplitBarCode_Sub")]
+ [HttpGet]
+ public object SplitBarCode_Sub(string HBarCodeNo)
+ {
+ try
+ {
+ if (string.IsNullOrWhiteSpace(HBarCodeNo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "璇疯緭鍏ユ潯鐮佺紪鍙�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ // 鍘荤┖鏍�
+ string cleanBarCode = HBarCodeNo.Trim();
+ string prefix = cleanBarCode + "-"; // 鐢ㄤ簬鏌ュ瓙鐮�
+
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+
+ // 1. 鍏堟煡鐩存帴瀛愮爜锛堜竴绾у瓙鐮侊細xxx-1, xxx-2, ...锛�
+ string sqlSub = @"SELECT * FROM h_v_Gy_SplitBarCode WITH(NOLOCK) WHERE HBarCode LIKE '" + prefix + @"%'
+ AND HBarCode NOT LIKE '" + prefix + @"%-%'
+ AND ISNUMERIC(RIGHT(HBarCode, LEN(HBarCode) - LEN('" + prefix + @"'))) = 1
+ AND TRY_CAST(RIGHT(HBarCode, LEN(HBarCode) - LEN('" + prefix + @"')) AS INT) IS NOT NULL";
+
+ DataSet ds = oCn.RunProcReturn(sqlSub, "Gy_BarCodeBill");
+
+ // 2. 濡傛灉鏈夊瓙鐮� 鈫� 杩斿洖瀛愮爜 + 涓嬩竴涓紪鍙�
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
+ {
+ int maxSuffix = 0;
+ foreach (DataRow row in ds.Tables[0].Rows)
+ {
+ string barCode = row["HBarCode"].ToString();
+ string suffix = barCode.Substring(prefix.Length);
+ if (int.TryParse(suffix, out int num) && num > maxSuffix)
+ maxSuffix = num;
+ }
+
+ string nextBarCode = $"{cleanBarCode}-{maxSuffix + 1}";
+
+ objJsonResult.code = "1";
+ objJsonResult.count = ds.Tables[0].Rows.Count;
+ objJsonResult.Message = "鏌ヨ鎴愬姛锛岃繑鍥炵洿鎺ュ瓙鐮�";
+ objJsonResult.data = new
+ {
+ SubBarCodes = ds.Tables[0],
+ NextBarCode = nextBarCode
+ };
+ }
+ else
+ {
+ // 3. 娌℃湁瀛愮爜 鈫� 鏌ヨ嚜宸�
+ string sqlSelf = @"SELECT * FROM h_v_Gy_SplitBarCode WITH(NOLOCK) WHERE HBarCode = '" + cleanBarCode.Replace("'", "''") + "'";
+
+ DataSet dsSelf = oCn.RunProcReturn(sqlSelf, "Gy_BarCodeBill");
+
+ if (dsSelf != null && dsSelf.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "璇ユ潯鐮佹棤瀛愮爜锛岃繑鍥炶嚜韬�";
+ objJsonResult.data = new
+ {
+ SubBarCodes = dsSelf.Tables[0],
+ NextBarCode = $"{cleanBarCode}-1" // 寤鸿浠� -1 寮�濮�
+ };
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏉$爜涓嶅瓨鍦紝璇锋鏌�";
+ objJsonResult.data = null;
+ }
+ }
+
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "寮傚父锛�" + ex.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region [app鏉$爜鎷嗙爜鐢熸垚]
+ [Route("Sc_BarCode/SplitBarCode_Save")]
+ [HttpPost]
+ public object SplitBarCode_Save([FromBody] JObject msg)
+ {
+ try
+ {
+ ListModels oListModels = new ListModels();
+ DAL.ClsGy_BarCodeBill_ChaiMa BillNew = new DAL.ClsGy_BarCodeBill_ChaiMa();
+ var _value = msg["msg"].ToString();
+ string msg1 = _value.ToString();
+
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string barcode = sArray[0].ToString(); //鏉$爜缂栧彿
+ Double splitnum = Convert.ToDouble(sArray[1]); //鎷嗙爜鏁伴噺
+ string data = sArray[2].ToString(); //琛ㄤ綋鏁版嵁
+ string user = sArray[3].ToString(); //鐢ㄦ埛鍚�
+
+ data = data.Replace("\\", "");
+ data = data.Replace("\n", ""); //\n
+
+ List<Model.ClsGy_BarCodeEdit_Model> lsmain = new List<Model.ClsGy_BarCodeEdit_Model>();
+ lsmain = oListModels.getObjectByJson_Gy_SplitBarCode(data);
+
+ oCN.BeginTran();
+
+ ds = oCN.RunProcReturn("select top 1 * from Gy_BarCodeBill where HBarCode='" + barcode + "'", "Gy_BarCodeBill");
+
+ if (ds != null || ds.Tables[0].Rows.Count > 0)
+ {
+
+ string sql = "insert into Gy_BarCodeBill (HInterID, HEntryID, HBarCode, HBarCodeType, HBarCodeSubType, HMaterID, HUnitID, HQty, HBatchNo, HSupID, HGroupID, HMaker, HMakeDate, " +
+ "HPrintQty, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType, HinitQty, HEndQty, HBarcodeQtys, HBarcodeNo, HDeptID, HWhID, HSPID, HRemark, " +
+ "HCusID, HCusType, HEndDate, HWorkLineName, HBarCodeDate, HSTOCKORGID, HOWNERID, HSeOrderBillNo, HGiveAwayFlag, HMaterName, HMaterModel, " +
+ "HPinfan, HAuxPropID, HMTONo, HInnerBillNo, HCoilNO, HFurnaceNO, HFactory, HAuxQty, HheatNO, HProduceDate, HExpiryDate, HEmpID, HCusModel, HCusMaterName, HCheckEmpName, HZZRQ" +
+ ") values (" +
+ "'" + ds.Tables[0].Rows[0]["HInterID"].ToString() + "', " +
+ "'" + (int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1).ToString() + "', " +
+ "'" + lsmain[0].HBarCode.ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HBarCodeType"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HBarCodeSubType"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HMaterID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HUnitID"].ToString() + "', " +
+ "'" + splitnum + "', " +
+ "'" + ds.Tables[0].Rows[0]["HBatchNo"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HSupID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HGroupID"].ToString() + "', " +
+ "'" + user + "', getdate(), " +
+ "'" + ds.Tables[0].Rows[0]["HPrintQty"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HSourceInterID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HSourceEntryID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HSourceBillNo"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HSourceBillType"].ToString() + "', " +
+ "'" + splitnum + "', " +
+ "'" + ds.Tables[0].Rows[0]["HEndQty"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HBarcodeQtys"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HBarcodeNo"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HDeptID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HWhID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HSPID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HRemark"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HCusID"].ToString() + "', " +
+ "'" + 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() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HSTOCKORGID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HOWNERID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HSeOrderBillNo"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HGiveAwayFlag"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HMaterName"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HMaterModel"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HPinfan"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HAuxPropID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HMTONo"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HInnerBillNo"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HCoilNO"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HFurnaceNO"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HFactory"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HAuxQty"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HheatNO"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HProduceDate"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HExpiryDate"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HEmpID"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HCusModel"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HCusMaterName"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HCheckEmpName"].ToString() + "', " +
+ "'" + ds.Tables[0].Rows[0]["HZZRQ"].ToString() + "'" +
+ ")";
+ //鎻掑叆鎷嗗垎鏉$爜
+ oCN.RunProc(sql);
+ //鏇存柊鑰佹潯鐮佺殑HQty鏁伴噺
+ oCN.RunProc("update Gy_BarCodeBill set HQty= HQty-'"+splitnum+"' where HItemID="+ ds.Tables[0].Rows[0]["HItemID"].ToString());
+
+
+
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+
+ }
+ else
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佹湭鏌ヨ鍒版潯鐮佷俊鎭�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region [鏉$爜鐢熸垚鎺ュ彛_灏忓崼闀洉鐮乚
+ [Route("Sc_BarCode/GetSNByICMO_XW")]
+ [HttpGet]
+ public object GetSNByICMO(String HBillNo,int HSeq)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("exec h_p_WMS_GetSNByICMO_XW '" + HBillNo + "', "+ HSeq, "h_p_WMS_GetSNByICMO_XW");
+
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "[0000-1-037]鏉$爜鐢熸垚鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-2-020]娌℃湁杩斿洖浠讳綍缁撴灉,鏉$爜鐢熸垚澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[3899-2-006]鏉$爜鐢熸垚澶辫触!" + e.Message;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.1