|
|
@ -30,7 +30,7 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="Quantity"></param>
|
|
|
|
/// <param name="WorkPoint"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void OneStepTransferDocIn(string TransCode,string TransSequence, string WorkPoint,string Quantity, SqlCommand cmd, Dictionary<string, string> language) |
|
|
|
public static void OneStepTransferDocIn(string TransCode, string TransSequence, string WorkPoint, string Quantity, SqlCommand cmd, Dictionary<string, string> language) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
@ -99,11 +99,11 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void OneStepTransferDocInERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language,string BusinessCode) |
|
|
|
public static void OneStepTransferDocInERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
#region SAP
|
|
|
|
#region SAP(三层结构)
|
|
|
|
string IsSuccess = ""; |
|
|
|
string ErrorMessage = ""; |
|
|
|
string sql = @" select Distinct A.TransferNO,A.WorkPoint from ICSTransfer A
|
|
|
@ -122,46 +122,58 @@ namespace ICSSoft.DataProject |
|
|
|
GROUP BY TransferNO,WorkPoint";
|
|
|
|
chksql = string.Format(chksql, dt.Rows[i]["TransferNO"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
DataTable chkdt = DBHelper.SQlReturnData(chksql, cmd); |
|
|
|
if (Convert.ToDecimal(chkdt.Rows[0]["Quantity"]) != Convert.ToDecimal(chkdt.Rows[0]["TransferQuantity"])) |
|
|
|
if (Convert.ToDecimal(chkdt.Rows[0]["Quantity"]) == Convert.ToDecimal(chkdt.Rows[0]["TransferQuantity"])) |
|
|
|
{ |
|
|
|
throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo203"), chkdt.Rows[0]["Quantity"].ToString(), chkdt.Rows[0]["TransferQuantity"].ToString()));//单次提交数量卡控(必须整单提交)
|
|
|
|
} |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ Client = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ(); |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ1 Info = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ1(); |
|
|
|
Info.NEWID = Identification; |
|
|
|
Info.DANJU = dt.Rows[i]["TransferNO"].ToString(); |
|
|
|
Info.STATE = "0"; |
|
|
|
List<SAPCallBackDocVPN.ZWMS_PZ> ItemList = new List<SAPCallBackDocVPN.ZWMS_PZ>(); |
|
|
|
Info.Z_GERNR = new SAPCallBackDocVPN.ZWEBS_GERNR[1]; |
|
|
|
Info.Z_FLAG = new SAPCallBackDocVPN.ZWEB_RETURN[1]; |
|
|
|
sql = @" select A.TransferNO,A.Sequence,A.Quantity,A.TransferQuantity,B.BatchCode from ICSTransfer A
|
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ Client = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ(); |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ1 Info = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ1(); |
|
|
|
Info.NEWID = Identification; |
|
|
|
Info.DANJU = dt.Rows[i]["TransferNO"].ToString(); |
|
|
|
Info.STATE = "0"; |
|
|
|
List<SAPCallBackDocVPN.ZWMS_PZ> ItemList = new List<SAPCallBackDocVPN.ZWMS_PZ>(); |
|
|
|
List<SAPCallBackDocVPN.ZWEBS_GERNR> ItemLineList = new List<SAPCallBackDocVPN.ZWEBS_GERNR>(); |
|
|
|
Info.Z_FLAG = new SAPCallBackDocVPN.ZWEB_RETURN[1]; |
|
|
|
sql = @" select A.TransferNO,A.SAPSequence,A.InvCode,A.Sequence,A.Quantity,A.TransferQuantity
|
|
|
|
,ISNULL(B.BatchCode,'') AS BatchCode from ICSTransfer A |
|
|
|
LEFT JOIN ICSExtension B ON B.ID=A.ExtensionID AND B.WorkPoint=A.WorkPoint |
|
|
|
WHERE TransferNO='{0}' AND A.WorkPoint='{1}'";
|
|
|
|
sql = string.Format(sql, dt.Rows[i]["TransferNO"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
DataTable Sapdt = DBHelper.SQlReturnData(sql, cmd); |
|
|
|
foreach (DataRow dr in Sapdt.Rows) |
|
|
|
{ |
|
|
|
if (Convert.ToDecimal(dr["Quantity"].ToString()) == Convert.ToDecimal(dr["TransferQuantity"].ToString())) |
|
|
|
sql = string.Format(sql, dt.Rows[i]["TransferNO"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
DataTable Sapdt = DBHelper.SQlReturnData(sql, cmd); |
|
|
|
foreach (DataRow dr in Sapdt.Rows) |
|
|
|
{ |
|
|
|
SAPCallBackDocVPN.ZWMS_PZ Item = new SAPCallBackDocVPN.ZWMS_PZ(); |
|
|
|
Item.DANJU = dr["TransferNO"].ToString(); |
|
|
|
Item.POSNR = dr["Sequence"].ToString(); |
|
|
|
Item.LINGYSL = System.Decimal.Round(Convert.ToDecimal(dr["Quantity"].ToString()), 3); |
|
|
|
Item.SERNP = dr["BatchCode"].ToString(); |
|
|
|
ItemList.Add(Item); |
|
|
|
if (Convert.ToDecimal(dr["Quantity"].ToString()) == Convert.ToDecimal(dr["TransferQuantity"].ToString())) |
|
|
|
{ |
|
|
|
SAPCallBackDocVPN.ZWMS_PZ Item = new SAPCallBackDocVPN.ZWMS_PZ(); |
|
|
|
SAPCallBackDocVPN.ZWEBS_GERNR ItemLine = new SAPCallBackDocVPN.ZWEBS_GERNR(); |
|
|
|
Item.DANJU = dr["TransferNO"].ToString(); |
|
|
|
Item.POSNR = dr["SAPSequence"].ToString(); |
|
|
|
Item.LINGYSL = System.Decimal.Round(Convert.ToDecimal(dr["Quantity"].ToString()), 3); |
|
|
|
ItemList.Add(Item); |
|
|
|
if (dr["BatchCode"].ToString() != "") |
|
|
|
{ |
|
|
|
ItemLine.DANJU = dr["TransferNO"].ToString(); |
|
|
|
ItemLine.POSNR = dr["SAPSequence"].ToString(); |
|
|
|
ItemLine.MATNR = dr["InvCode"].ToString(); |
|
|
|
ItemLine.GERNR = dr["BatchCode"].ToString(); |
|
|
|
ItemLineList.Add(ItemLine); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (ItemList.Count > 0) |
|
|
|
{ |
|
|
|
Info.Z_ITEM = ItemList.ToArray(); |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse result = new SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse(); |
|
|
|
result = Client.CallZWMS_SK_WS_PZ(Info); |
|
|
|
if (result.Z_NULL == "N") |
|
|
|
if (ItemList.Count > 0) |
|
|
|
{ |
|
|
|
foreach (SAPCallBackDocVPN.ZWEB_RETURN resultItem in result.Z_FLAG) |
|
|
|
Info.Z_ITEM = ItemList.ToArray(); |
|
|
|
if (ItemLineList.Count > 0) |
|
|
|
{ |
|
|
|
Info.Z_GERNR = ItemLineList.ToArray(); |
|
|
|
} |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse result = new SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse(); |
|
|
|
result = Client.CallZWMS_SK_WS_PZ(Info); |
|
|
|
if (result.Z_NULL == "N") |
|
|
|
{ |
|
|
|
IsSuccess = "N"; |
|
|
|
ErrorMessage += resultItem.L_MESSAGE + "/r/n"; |
|
|
|
foreach (SAPCallBackDocVPN.ZWEB_RETURN resultItem in result.Z_FLAG) |
|
|
|
{ |
|
|
|
IsSuccess = "N"; |
|
|
|
ErrorMessage += resultItem.L_MESSAGE + "/r/n"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -180,14 +192,14 @@ namespace ICSSoft.DataProject |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 调拨
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 调拨接口
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void StepTransferDocInERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language,string BusinessCode) |
|
|
|
public static void StepTransferDocInERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
@ -238,7 +250,7 @@ namespace ICSSoft.DataProject |
|
|
|
JObject det = (JObject)detail; |
|
|
|
string allcol = jo["cWhCode"].ToString() + det["ProjectCode"].ToString() + det["cBatch"].ToString() + det["version"].ToString() + det["brand"].ToString() + det["cFree1"].ToString() + det["cFree2"].ToString() + det["cFree3"].ToString() + det["cFree4"].ToString() + det["cFree5"].ToString() |
|
|
|
+ det["cFree6"].ToString() + det["cFree7"].ToString() + det["cFree8"].ToString() + det["cFree9"].ToString() + det["cFree10"].ToString(); |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["DNDetailID"].ToString(), Identification, jo["ID"].ToString(), det["DetailID"].ToString(), jo["RCVTCode"].ToString(), det["Sequence"].ToString(),allcol, cmd, language, BusinessCode); |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["DNDetailID"].ToString(), Identification, jo["ID"].ToString(), det["DetailID"].ToString(), jo["RCVTCode"].ToString(), det["Sequence"].ToString(), allcol, cmd, language, BusinessCode); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -406,7 +418,7 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void TwoStepTransferDocOutERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language,string BusinessCode) |
|
|
|
public static void TwoStepTransferDocOutERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
@ -451,7 +463,7 @@ namespace ICSSoft.DataProject |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo080")+result.Message); |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo080") + result.Message); |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
} |
|
|
@ -510,7 +522,7 @@ namespace ICSSoft.DataProject |
|
|
|
BEGIN |
|
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo149") + @"',16,1); |
|
|
|
END";
|
|
|
|
sql = string.Format(sql, LotNo, WorkPoint,TransCode,TransSequence, Quantity); |
|
|
|
sql = string.Format(sql, LotNo, WorkPoint, TransCode, TransSequence, Quantity); |
|
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd)) |
|
|
|
{ |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo150"));//"两步调入单更新失败!");
|
|
|
@ -528,7 +540,7 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void TwoStepTransferDocInERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language,string BusinessCode) |
|
|
|
public static void TwoStepTransferDocInERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
@ -562,7 +574,7 @@ namespace ICSSoft.DataProject |
|
|
|
{ |
|
|
|
foreach (DataRow dr in dt.Rows) |
|
|
|
{ |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "","", cmd, language, BusinessCode); |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "", "", cmd, language, BusinessCode); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
@ -573,7 +585,7 @@ namespace ICSSoft.DataProject |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo080")+result.Message); |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo080") + result.Message); |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
} |
|
|
@ -641,11 +653,11 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void OtherOutDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language,string BusinessCode) |
|
|
|
public static void OtherOutDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
#region SAP
|
|
|
|
#region SAP(三层结构)
|
|
|
|
string IsSuccess = ""; |
|
|
|
string ErrorMessage = ""; |
|
|
|
string sql = @" select Distinct A.OutCode,A.WorkPoint from ICSOtherOut A
|
|
|
@ -664,46 +676,58 @@ namespace ICSSoft.DataProject |
|
|
|
GROUP BY OutCode,WorkPoint";
|
|
|
|
chksql = string.Format(chksql, dt.Rows[i]["OutCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
DataTable chkdt = DBHelper.SQlReturnData(chksql, cmd); |
|
|
|
if (Convert.ToDecimal(chkdt.Rows[0]["Quantity"]) != Convert.ToDecimal(chkdt.Rows[0]["OutQuantity"])) |
|
|
|
if (Convert.ToDecimal(chkdt.Rows[0]["Quantity"]) == Convert.ToDecimal(chkdt.Rows[0]["OutQuantity"])) |
|
|
|
{ |
|
|
|
throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo203"), chkdt.Rows[0]["Quantity"].ToString(), chkdt.Rows[0]["OutQuantity"].ToString()));//单次提交数量卡控(必须整单提交)
|
|
|
|
} |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ Client = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ(); |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ1 Info = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ1(); |
|
|
|
Info.NEWID = Identification; |
|
|
|
Info.DANJU = dt.Rows[i]["OutCode"].ToString(); |
|
|
|
Info.STATE = "0"; |
|
|
|
List<SAPCallBackDocVPN.ZWMS_PZ> ItemList = new List<SAPCallBackDocVPN.ZWMS_PZ>(); |
|
|
|
Info.Z_GERNR = new SAPCallBackDocVPN.ZWEBS_GERNR[1]; |
|
|
|
Info.Z_FLAG = new SAPCallBackDocVPN.ZWEB_RETURN[1]; |
|
|
|
sql = @"select A.OutCode,A.Sequence,A.Quantity,A.OutQuantity,B.BatchCode from ICSOtherOut A
|
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ Client = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ(); |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ1 Info = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ1(); |
|
|
|
Info.NEWID = Identification; |
|
|
|
Info.DANJU = dt.Rows[i]["OutCode"].ToString(); |
|
|
|
Info.STATE = "0"; |
|
|
|
List<SAPCallBackDocVPN.ZWMS_PZ> ItemList = new List<SAPCallBackDocVPN.ZWMS_PZ>(); |
|
|
|
List<SAPCallBackDocVPN.ZWEBS_GERNR> ItemLineList = new List<SAPCallBackDocVPN.ZWEBS_GERNR>(); |
|
|
|
Info.Z_FLAG = new SAPCallBackDocVPN.ZWEB_RETURN[1]; |
|
|
|
sql = @"select A.OutCode,A.SAPSequence,A.InvCode,A.Sequence,A.Quantity,A.OutQuantity
|
|
|
|
,ISNULL(B.BatchCode,'') AS BatchCode from ICSOtherOut A |
|
|
|
LEFT JOIN ICSExtension B ON B.ID=A.ExtensionID AND B.WorkPoint=A.WorkPoint |
|
|
|
WHERE OutCode='{0}' AND A.WorkPoint='{1}'";
|
|
|
|
sql = string.Format(sql, dt.Rows[i]["OutCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
DataTable Sapdt = DBHelper.SQlReturnData(sql, cmd); |
|
|
|
foreach (DataRow dr in Sapdt.Rows) |
|
|
|
{ |
|
|
|
if (Convert.ToDecimal(dr["Quantity"].ToString()) == Convert.ToDecimal(dr["OutQuantity"].ToString())) |
|
|
|
sql = string.Format(sql, dt.Rows[i]["OutCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
DataTable Sapdt = DBHelper.SQlReturnData(sql, cmd); |
|
|
|
foreach (DataRow dr in Sapdt.Rows) |
|
|
|
{ |
|
|
|
SAPCallBackDocVPN.ZWMS_PZ Item = new SAPCallBackDocVPN.ZWMS_PZ(); |
|
|
|
Item.DANJU = dr["OutCode"].ToString(); |
|
|
|
Item.POSNR = dr["Sequence"].ToString(); |
|
|
|
Item.LINGYSL = System.Decimal.Round(Convert.ToDecimal(dr["Quantity"].ToString()), 3); |
|
|
|
Item.SERNP = dr["BatchCode"].ToString(); |
|
|
|
ItemList.Add(Item); |
|
|
|
if (Convert.ToDecimal(dr["Quantity"].ToString()) == Convert.ToDecimal(dr["OutQuantity"].ToString())) |
|
|
|
{ |
|
|
|
SAPCallBackDocVPN.ZWMS_PZ Item = new SAPCallBackDocVPN.ZWMS_PZ(); |
|
|
|
SAPCallBackDocVPN.ZWEBS_GERNR ItemLine = new SAPCallBackDocVPN.ZWEBS_GERNR(); |
|
|
|
Item.DANJU = dr["OutCode"].ToString(); |
|
|
|
Item.POSNR = dr["SAPSequence"].ToString(); |
|
|
|
Item.LINGYSL = System.Decimal.Round(Convert.ToDecimal(dr["Quantity"].ToString()), 3); |
|
|
|
ItemList.Add(Item); |
|
|
|
if (dr["BatchCode"].ToString() != "") |
|
|
|
{ |
|
|
|
ItemLine.DANJU = dr["OutCode"].ToString(); |
|
|
|
ItemLine.POSNR = dr["SAPSequence"].ToString(); |
|
|
|
ItemLine.MATNR = dr["InvCode"].ToString(); |
|
|
|
ItemLine.GERNR = dr["BatchCode"].ToString(); |
|
|
|
ItemLineList.Add(ItemLine); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (ItemList.Count > 0) |
|
|
|
{ |
|
|
|
Info.Z_ITEM = ItemList.ToArray(); |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse result = new SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse(); |
|
|
|
result = Client.CallZWMS_SK_WS_PZ(Info); |
|
|
|
if (result.Z_NULL == "N") |
|
|
|
if (ItemList.Count > 0) |
|
|
|
{ |
|
|
|
foreach (SAPCallBackDocVPN.ZWEB_RETURN resultItem in result.Z_FLAG) |
|
|
|
Info.Z_ITEM = ItemList.ToArray(); |
|
|
|
if (ItemLineList.Count > 0) |
|
|
|
{ |
|
|
|
Info.Z_GERNR = ItemLineList.ToArray(); |
|
|
|
} |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse result = new SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse(); |
|
|
|
result = Client.CallZWMS_SK_WS_PZ(Info); |
|
|
|
if (result.Z_NULL == "N") |
|
|
|
{ |
|
|
|
IsSuccess = "N"; |
|
|
|
ErrorMessage += resultItem.L_MESSAGE + "/r/n"; |
|
|
|
foreach (SAPCallBackDocVPN.ZWEB_RETURN resultItem in result.Z_FLAG) |
|
|
|
{ |
|
|
|
IsSuccess = "N"; |
|
|
|
ErrorMessage += resultItem.L_MESSAGE + "/r/n"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -780,11 +804,11 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void OtherInDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language,string BusinessCode) |
|
|
|
public static void OtherInDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
#region SAP
|
|
|
|
#region SAP(三层结构)
|
|
|
|
string IsSuccess = ""; |
|
|
|
string ErrorMessage = ""; |
|
|
|
string sql = @" select Distinct A.InCode,A.WorkPoint from ICSOtherIn A
|
|
|
@ -803,46 +827,58 @@ namespace ICSSoft.DataProject |
|
|
|
GROUP BY InCode,WorkPoint";
|
|
|
|
chksql = string.Format(chksql, dt.Rows[i]["InCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
DataTable chkdt = DBHelper.SQlReturnData(chksql, cmd); |
|
|
|
if (Convert.ToDecimal(chkdt.Rows[0]["Quantity"]) != Convert.ToDecimal(chkdt.Rows[0]["InQuantity"])) |
|
|
|
if (Convert.ToDecimal(chkdt.Rows[0]["Quantity"]) == Convert.ToDecimal(chkdt.Rows[0]["InQuantity"])) |
|
|
|
{ |
|
|
|
throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo203"), chkdt.Rows[0]["Quantity"].ToString(), chkdt.Rows[0]["InQuantity"].ToString()));//单次提交数量卡控(必须整单提交)
|
|
|
|
} |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ Client = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ(); |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ1 Info = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ1(); |
|
|
|
Info.NEWID = Identification; |
|
|
|
Info.DANJU = dt.Rows[i]["InCode"].ToString(); |
|
|
|
Info.STATE = "0"; |
|
|
|
List<SAPCallBackDocVPN.ZWMS_PZ> ItemList = new List<SAPCallBackDocVPN.ZWMS_PZ>(); |
|
|
|
Info.Z_GERNR = new SAPCallBackDocVPN.ZWEBS_GERNR[1]; |
|
|
|
Info.Z_FLAG = new SAPCallBackDocVPN.ZWEB_RETURN[1]; |
|
|
|
sql = @"select A.InCode,A.Sequence,A.Quantity,A.InQuantity,B.BatchCode from ICSOtherIn A
|
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ Client = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ(); |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZ1 Info = new SAPCallBackDocVPN.ZWMS_SK_WS_PZ1(); |
|
|
|
Info.NEWID = Identification; |
|
|
|
Info.DANJU = dt.Rows[i]["InCode"].ToString(); |
|
|
|
Info.STATE = "0"; |
|
|
|
List<SAPCallBackDocVPN.ZWMS_PZ> ItemList = new List<SAPCallBackDocVPN.ZWMS_PZ>(); |
|
|
|
List<SAPCallBackDocVPN.ZWEBS_GERNR> ItemLineList = new List<SAPCallBackDocVPN.ZWEBS_GERNR>(); |
|
|
|
Info.Z_FLAG = new SAPCallBackDocVPN.ZWEB_RETURN[1]; |
|
|
|
sql = @"select A.InCode,A.SAPSequence,A.InvCode,A.Sequence,A.Quantity,A.InQuantity
|
|
|
|
,ISNULL(B.BatchCode,'') AS BatchCode from ICSOtherIn A |
|
|
|
LEFT JOIN ICSExtension B ON B.ID=A.ExtensionID AND B.WorkPoint=A.WorkPoint |
|
|
|
WHERE InCode='{0}' AND A.WorkPoint='{1}'";
|
|
|
|
sql = string.Format(sql, dt.Rows[i]["InCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
DataTable Sapdt = DBHelper.SQlReturnData(sql, cmd); |
|
|
|
foreach (DataRow dr in Sapdt.Rows) |
|
|
|
{ |
|
|
|
if (Convert.ToDecimal(dr["Quantity"].ToString()) == Convert.ToDecimal(dr["InQuantity"].ToString())) |
|
|
|
sql = string.Format(sql, dt.Rows[i]["InCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
DataTable Sapdt = DBHelper.SQlReturnData(sql, cmd); |
|
|
|
foreach (DataRow dr in Sapdt.Rows) |
|
|
|
{ |
|
|
|
SAPCallBackDocVPN.ZWMS_PZ Item = new SAPCallBackDocVPN.ZWMS_PZ(); |
|
|
|
Item.DANJU = dr["InCode"].ToString(); |
|
|
|
Item.POSNR = dr["Sequence"].ToString(); |
|
|
|
Item.LINGYSL = System.Decimal.Round(Convert.ToDecimal(dr["Quantity"].ToString()), 3); |
|
|
|
Item.SERNP = dr["BatchCode"].ToString(); |
|
|
|
ItemList.Add(Item); |
|
|
|
if (Convert.ToDecimal(dr["Quantity"].ToString()) == Convert.ToDecimal(dr["InQuantity"].ToString())) |
|
|
|
{ |
|
|
|
SAPCallBackDocVPN.ZWMS_PZ Item = new SAPCallBackDocVPN.ZWMS_PZ(); |
|
|
|
SAPCallBackDocVPN.ZWEBS_GERNR ItemLine = new SAPCallBackDocVPN.ZWEBS_GERNR(); |
|
|
|
Item.DANJU = dr["InCode"].ToString(); |
|
|
|
Item.POSNR = dr["SAPSequence"].ToString(); |
|
|
|
Item.LINGYSL = System.Decimal.Round(Convert.ToDecimal(dr["Quantity"].ToString()), 3); |
|
|
|
ItemList.Add(Item); |
|
|
|
if (dr["BatchCode"].ToString() != "") |
|
|
|
{ |
|
|
|
ItemLine.DANJU = dr["InCode"].ToString(); |
|
|
|
ItemLine.POSNR = dr["SAPSequence"].ToString(); |
|
|
|
ItemLine.MATNR = dr["InvCode"].ToString(); |
|
|
|
ItemLine.GERNR = dr["BatchCode"].ToString(); |
|
|
|
ItemLineList.Add(ItemLine); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (ItemList.Count > 0) |
|
|
|
{ |
|
|
|
Info.Z_ITEM = ItemList.ToArray(); |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse result = new SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse(); |
|
|
|
result = Client.CallZWMS_SK_WS_PZ(Info); |
|
|
|
if (result.Z_NULL == "N") |
|
|
|
if (ItemList.Count > 0) |
|
|
|
{ |
|
|
|
foreach (SAPCallBackDocVPN.ZWEB_RETURN resultItem in result.Z_FLAG) |
|
|
|
Info.Z_ITEM = ItemList.ToArray(); |
|
|
|
if (ItemLineList.Count > 0) |
|
|
|
{ |
|
|
|
Info.Z_GERNR = ItemLineList.ToArray(); |
|
|
|
} |
|
|
|
SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse result = new SAPCallBackDocVPN.ZWMS_SK_WS_PZResponse(); |
|
|
|
result = Client.CallZWMS_SK_WS_PZ(Info); |
|
|
|
if (result.Z_NULL == "N") |
|
|
|
{ |
|
|
|
IsSuccess = "N"; |
|
|
|
ErrorMessage += resultItem.L_MESSAGE + "/r/n"; |
|
|
|
foreach (SAPCallBackDocVPN.ZWEB_RETURN resultItem in result.Z_FLAG) |
|
|
|
{ |
|
|
|
IsSuccess = "N"; |
|
|
|
ErrorMessage += resultItem.L_MESSAGE + "/r/n"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -959,7 +995,7 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void DisassemblyDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language,string BusinessCode) |
|
|
|
public static void DisassemblyDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
@ -991,7 +1027,7 @@ namespace ICSSoft.DataProject |
|
|
|
{ |
|
|
|
foreach (DataRow dr in dt.Rows) |
|
|
|
{ |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "","", cmd, language, BusinessCode); |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, dr["ID"].ToString(), Identification, "", "", "", "", "", cmd, language, BusinessCode); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
@ -1002,7 +1038,7 @@ namespace ICSSoft.DataProject |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo080")+result.Message); |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo080") + result.Message); |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
} |
|
|
@ -1070,7 +1106,7 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void BrrowDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language,string BusinessCode) |
|
|
|
public static void BrrowDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
@ -1115,9 +1151,9 @@ namespace ICSSoft.DataProject |
|
|
|
foreach (var detail in resdetail) |
|
|
|
{ |
|
|
|
JObject det = (JObject)detail; |
|
|
|
string allcol = jo["cWhCode"].ToString() + det["ProjectCode"].ToString() + det["cBatch"].ToString() + det["version"].ToString() + det["brand"].ToString() + det["cFree1"].ToString() + det["cFree2"].ToString() + det["cFree3"].ToString() + det["cFree4"].ToString() + det["cFree5"].ToString() |
|
|
|
string allcol = jo["cWhCode"].ToString() + det["ProjectCode"].ToString() + det["cBatch"].ToString() + det["version"].ToString() + det["brand"].ToString() + det["cFree1"].ToString() + det["cFree2"].ToString() + det["cFree3"].ToString() + det["cFree4"].ToString() + det["cFree5"].ToString() |
|
|
|
+ det["cFree6"].ToString() + det["cFree7"].ToString() + det["cFree8"].ToString() + det["cFree9"].ToString() + det["cFree10"].ToString(); |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["SourceDetailID"].ToString(), Identification, jo["ID"].ToString(), |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["SourceDetailID"].ToString(), Identification, jo["ID"].ToString(), |
|
|
|
det["DetailID"].ToString(), jo["OtherOutCode"].ToString(), det["Sequence"].ToString(), allcol, cmd, language, BusinessCode); |
|
|
|
} |
|
|
|
} |
|
|
@ -1200,7 +1236,7 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void ReturnDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language,string BusinessCode) |
|
|
|
public static void ReturnDocERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
@ -1226,7 +1262,7 @@ namespace ICSSoft.DataProject |
|
|
|
SELECT Costre,Sequence,InvCode,Quantity,Amount,ReturnDetailID AS SourceDetailID,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10 FROM #TempERP |
|
|
|
|
|
|
|
DROP TABLE #TempERP";
|
|
|
|
sql = string.Format(sql, Identification,BusinessCode); |
|
|
|
sql = string.Format(sql, Identification, BusinessCode); |
|
|
|
DataSet ds = DBHelper.SQlReturnDataSet(sql, cmd); |
|
|
|
|
|
|
|
string Inputstr = DataToJsonHelper.DataSetToJson(ds, "details", "Costre"); |
|
|
@ -1247,8 +1283,8 @@ namespace ICSSoft.DataProject |
|
|
|
JObject det = (JObject)detail; |
|
|
|
string allcol = jo["cWhCode"].ToString() + det["ProjectCode"].ToString() + det["cBatch"].ToString() + det["version"].ToString() + det["brand"].ToString() + det["cFree1"].ToString() + det["cFree2"].ToString() + det["cFree3"].ToString() + det["cFree4"].ToString() + det["cFree5"].ToString() |
|
|
|
+ det["cFree6"].ToString() + det["cFree7"].ToString() + det["cFree8"].ToString() + det["cFree9"].ToString() + det["cFree10"].ToString(); |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["SourceDetailID"].ToString(), Identification, jo["ID"].ToString(), |
|
|
|
det["DetailID"].ToString(), jo["OtherInCode"].ToString(), det["Sequence"].ToString(),"", cmd,language, BusinessCode); |
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoLogUpdate(TransType, det["SourceDetailID"].ToString(), Identification, jo["ID"].ToString(), |
|
|
|
det["DetailID"].ToString(), jo["OtherInCode"].ToString(), det["Sequence"].ToString(), "", cmd, language, BusinessCode); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
xxxxxxxxxx