|
|
|
@ -258,6 +258,16 @@ namespace Myshipping.Application
|
|
|
|
|
var arr = Ids.Split(",");
|
|
|
|
|
if (arr.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
List<CustEDIDto> custEDIDtos = new List<CustEDIDto>();
|
|
|
|
|
var key = _webAccountConfig.GetAccountConfig("DjyCangDan", UserManager.UserId).Result;
|
|
|
|
|
if (key == null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
throw Oops.Bah("当前用户未配置key,请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
var dicUrl = _cache.GetAllDictData().Result.First(x => x.TypeCode == "url_set" && x.Code == "request_emf");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var ar in arr)
|
|
|
|
|
{
|
|
|
|
|
long Id = Convert.ToInt64(ar);
|
|
|
|
@ -273,15 +283,8 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK127);
|
|
|
|
|
}
|
|
|
|
|
var dicUrl = _cache.GetAllDictData().Result.First(x => x.TypeCode == "url_set" && x.Code == "request_emf");
|
|
|
|
|
var key = _webAccountConfig.GetAccountConfig("DjyCangDan", UserManager.UserId).Result;
|
|
|
|
|
if (key == null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
throw Oops.Bah("当前用户未配置key,请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<CustEDIDto> custEDIDtos = new List<CustEDIDto>();
|
|
|
|
|
MDATA mDATA = new MDATA();
|
|
|
|
|
List<CTNDATAItem> CTNDATA = new List<CTNDATAItem>();
|
|
|
|
|
mDATA = order.Adapt<MDATA>();
|
|
|
|
@ -317,27 +320,34 @@ namespace Myshipping.Application
|
|
|
|
|
CTNDATA = CTNDATA
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
string strPostObj = custEDIDtos.ToJsonString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var sendObj = new
|
|
|
|
|
{
|
|
|
|
|
ac = "emf",
|
|
|
|
|
uid = UserManager.DjyUserId,
|
|
|
|
|
skey = key.Password,
|
|
|
|
|
optype = type,
|
|
|
|
|
data = strPostObj
|
|
|
|
|
};
|
|
|
|
|
_logger.LogInformation($"调用舱单接口 {dicUrl.Value} 传递数据:{strPostObj}");
|
|
|
|
|
var strResp = await dicUrl.Value.SetContentType("multipart/form-data").SetBody(sendObj).PostAsStringAsync();
|
|
|
|
|
_logger.LogInformation($"调用舱单接口返回:{strResp}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var jobjResp = JObject.Parse(strResp);
|
|
|
|
|
bool respCode = jobjResp.GetBooleanValue("Success");
|
|
|
|
|
if (respCode == false)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(jobjResp.GetStringValue("Message").Replace("<br />", "\r\n").Replace("<br/>", ""));
|
|
|
|
|
}
|
|
|
|
|
string strPostObj = custEDIDtos.ToJsonString();
|
|
|
|
|
|
|
|
|
|
var sendObj = new
|
|
|
|
|
{
|
|
|
|
|
ac = "emf",
|
|
|
|
|
uid = UserManager.DjyUserId,
|
|
|
|
|
skey = key.Password,
|
|
|
|
|
optype = type,
|
|
|
|
|
data = strPostObj
|
|
|
|
|
};
|
|
|
|
|
_logger.LogInformation($"调用舱单接口 {dicUrl.Value} 传递数据:{strPostObj}");
|
|
|
|
|
var strResp = await dicUrl.Value.SetContentType("multipart/form-data").SetBody(sendObj).PostAsStringAsync();
|
|
|
|
|
_logger.LogInformation($"调用舱单接口返回:{strResp}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var jobjResp = JObject.Parse(strResp);
|
|
|
|
|
bool respCode = jobjResp.GetBooleanValue("Success");
|
|
|
|
|
if (respCode == false)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(jobjResp.GetStringValue("Message").Replace("<br />", "\r\n").Replace("<br/>", ""));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var ar in arr)
|
|
|
|
|
{
|
|
|
|
|
long Id = Convert.ToInt64(ar);
|
|
|
|
|
var order = await _seaeedi.AsQueryable().Filter(null, true).Where(x => x.Id == Id).FirstAsync();
|
|
|
|
|
//货运动态
|
|
|
|
|
var bsl = new BookingStatusLog();
|
|
|
|
|
bsl.BookingId = order.BookingId;
|
|
|
|
@ -372,8 +382,12 @@ namespace Myshipping.Application
|
|
|
|
|
if (type == "0" || type == "1")
|
|
|
|
|
{
|
|
|
|
|
await _seaeedi.UpdateAsync(x => x.Id == Id, x => new BookingOrderSeaeEdi { State = "已直发", SENDREMARK = SENDREMARK });
|
|
|
|
|
await _rep.SetGoodsStatus("YFCD", Id);
|
|
|
|
|
await _rep.SendBookingOrder(new long[] { Id });
|
|
|
|
|
if (string.IsNullOrEmpty(order.HBLNO)) {
|
|
|
|
|
|
|
|
|
|
await _rep.SetGoodsStatus("YFCD", order.BookingId);
|
|
|
|
|
await _rep.SendBookingOrder(new long[] { order.BookingId });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (type == "2")
|
|
|
|
|
{
|
|
|
|
@ -382,17 +396,15 @@ namespace Myshipping.Application
|
|
|
|
|
if (type == "4")
|
|
|
|
|
{
|
|
|
|
|
await _seaeedi.UpdateAsync(x => x.Id == Id, x => new BookingOrderSeaeEdi { State = "已作废", SENDREMARK = SENDREMARK });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|