|
|
@ -271,6 +271,7 @@ namespace ICSSoft.DataProject |
|
|
|
sql = string.Format(sql, Identification); |
|
|
|
DataTable dt = DBHelper.SQlReturnData(sql, cmd); |
|
|
|
if (dt.Rows.Count > 1) |
|
|
|
|
|
|
|
{ |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo202"));//单次提交单据数量卡控(只允许一张单据)
|
|
|
|
} |
|
|
@ -492,28 +493,29 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="TransType"></param>
|
|
|
|
/// <param name="Identification"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void SalesReturnBackInERP(string TransType, string Identification, SqlCommand cmd, Dictionary<string, string> language, string BusinessCode) |
|
|
|
public static void SalesReturnBackInERP(string TransCode, string Identification, SqlCommand cmd, Dictionary<string, string> language, string workPoint) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
#region SAP(三层结构)
|
|
|
|
string IsSuccess = ""; |
|
|
|
string ErrorMessage = ""; |
|
|
|
string sql = @" select Distinct A.SDNCode,A.WorkPoint from ICSSDN A
|
|
|
|
LEFT JOIN ICSWareHouseLotInfoLog B ON B.TransCode=A.SDNCode AND B.WorkPoint=A.WorkPoint |
|
|
|
where B.Identification='{0}' AND BusinessCode='20'";
|
|
|
|
sql = string.Format(sql, Identification); |
|
|
|
DataTable dt = DBHelper.SQlReturnData(sql, cmd); |
|
|
|
if (dt.Rows.Count > 1) |
|
|
|
{ |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo202"));//单次提交单据数量卡控(只允许一张单据)
|
|
|
|
} |
|
|
|
for (int i = 0; i < dt.Rows.Count; i++) |
|
|
|
{ |
|
|
|
string sql = ""; |
|
|
|
//string sql = @" select Distinct A.SDNCode,A.WorkPoint from ICSSDN A
|
|
|
|
// LEFT JOIN ICSWareHouseLotInfoLog B ON B.TransCode=A.SDNCode AND B.WorkPoint=A.WorkPoint
|
|
|
|
// where B.Identification='{0}' AND BusinessCode='44'";
|
|
|
|
//sql = string.Format(sql, Identification);
|
|
|
|
//DataTable dt = DBHelper.SQlReturnData(sql, cmd);
|
|
|
|
//if (dt.Rows.Count > 1)
|
|
|
|
//{
|
|
|
|
// throw new Exception(language.GetNameByCode("WMSAPIInfo202"));//单次提交单据数量卡控(只允许一张单据)
|
|
|
|
//}
|
|
|
|
//for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
|
//{
|
|
|
|
string chksql = @"select SUM(Quantity) AS Quantity,SUM(SDNQuantity) AS SDNQuantity from ICSSDN
|
|
|
|
where SDNCode='{0}' and WorkPoint='{1}' |
|
|
|
GROUP BY SDNCode,WorkPoint";
|
|
|
|
chksql = string.Format(chksql, dt.Rows[i]["SDNCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
chksql = string.Format(chksql, TransCode, workPoint); |
|
|
|
DataTable chkdt = DBHelper.SQlReturnData(chksql, cmd); |
|
|
|
if (Convert.ToDecimal(chkdt.Rows[0]["Quantity"]) == Convert.ToDecimal(chkdt.Rows[0]["SDNQuantity"])) |
|
|
|
{ |
|
|
@ -521,7 +523,7 @@ namespace ICSSoft.DataProject |
|
|
|
SAPCallBackDispatchVPN.ZWMS_SK_DO_GZ1 Info = new SAPCallBackDispatchVPN.ZWMS_SK_DO_GZ1(); |
|
|
|
List<SAPCallBackDispatchVPN.ZWMS_DO_HEAD> headlist = new List<SAPCallBackDispatchVPN.ZWMS_DO_HEAD>(); |
|
|
|
SAPCallBackDispatchVPN.ZWMS_DO_HEAD head = new SAPCallBackDispatchVPN.ZWMS_DO_HEAD(); |
|
|
|
head.VBELN = dt.Rows[i]["SDNCode"].ToString(); |
|
|
|
head.VBELN = TransCode; |
|
|
|
headlist.Add(head); |
|
|
|
Info.T_HEAD = headlist.ToArray(); |
|
|
|
List<SAPCallBackDispatchVPN.ZWMS_DO_ITEM> ItemList = new List<SAPCallBackDispatchVPN.ZWMS_DO_ITEM>(); |
|
|
@ -531,7 +533,7 @@ namespace ICSSoft.DataProject |
|
|
|
,ISNULL(B.BatchCode,'') AS BatchCode from ICSSDN A |
|
|
|
LEFT JOIN ICSExtension B ON B.ID=A.ExtensionID AND B.WorkPoint=A.WorkPoint |
|
|
|
WHERE SDNCode='{0}' AND A.WorkPoint='{1}'";
|
|
|
|
sql = string.Format(sql, dt.Rows[i]["SDNCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); |
|
|
|
sql = string.Format(sql, TransCode, workPoint); |
|
|
|
DataTable Sapdt = DBHelper.SQlReturnData(sql, cmd); |
|
|
|
foreach (DataRow dr in Sapdt.Rows) |
|
|
|
{ |
|
|
@ -575,7 +577,7 @@ namespace ICSSoft.DataProject |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//}
|
|
|
|
if (IsSuccess == "N") |
|
|
|
{ |
|
|
|
throw new Exception(ErrorMessage); |
|
|
|