|
|
@@ -1,5 +1,6 @@
|
|
|
using BizCom;
|
|
|
using Newtonsoft.Json;
|
|
|
+using Newtonsoft.Json.Linq;
|
|
|
using NHibernate.Type;
|
|
|
using SiteCore.taoObj;
|
|
|
using SQLData;
|
|
|
@@ -231,25 +232,39 @@ namespace SiteCore
|
|
|
public static string API_LogisticsOnlineSend(string orderid, string pCode, string comCode, string out_Sid, string ctid)
|
|
|
{
|
|
|
List<string> postLst = new List<string>();
|
|
|
+ DataTable dt_item = DbHelper.DbConn.ExecuteDataset(string.Format("SELECT oid, sku_id, num FROM [dbo].[CE_ErpTradeOrder] WHERE tid = '{0}'", orderid)).Tables[0];
|
|
|
var res_obj = new
|
|
|
{
|
|
|
refOid = orderid,
|
|
|
posCode = pCode,
|
|
|
packages = new[]
|
|
|
{
|
|
|
- new{ outSid=out_Sid,companyCode=comCode}
|
|
|
+ new{
|
|
|
+ outSid = out_Sid,
|
|
|
+ companyCode = comCode,
|
|
|
+ lines = dt_item.AsEnumerable().Select(row => new
|
|
|
+ {
|
|
|
+ refOlId = row["oid"],
|
|
|
+ refSkuId = row["sku_id"],
|
|
|
+ num = row["num"]
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
string ro_json = JsonConvert.SerializeObject(res_obj);
|
|
|
string sql = string.Format("SELECT tid FROM [dbo].[CE_ErpTradeCell] WHERE tid = '{0}' and OrderState > 6", orderid);
|
|
|
DataTable dt = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
string send_api = "ds.omni.erp.third.order.send";
|
|
|
- if (dt != null && dt.Rows.Count > 0 && !ctid.Contains("S_"))
|
|
|
+ if (dt != null && dt.Rows.Count > 0)
|
|
|
{
|
|
|
send_api = "ds.omni.erp.third.order.uploadExtraLogistics";//额外发货
|
|
|
XLog.SaveLog(0, "额外发货:" + orderid + "-" + comCode + "-" + out_Sid);
|
|
|
}
|
|
|
string res = Base_Request(ro_json, send_api);
|
|
|
+ if (res.Contains("上传额外运单信息成功"))
|
|
|
+ {
|
|
|
+ res = res.Replace("上传额外运单信息成功", "发货成功true");
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|