|
|
@ -258,6 +258,16 @@ namespace Myshipping.Application
|
|
|
|
var arr = Ids.Split(",");
|
|
|
|
var arr = Ids.Split(",");
|
|
|
|
if (arr.Count() > 0)
|
|
|
|
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)
|
|
|
|
foreach (var ar in arr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
long Id = Convert.ToInt64(ar);
|
|
|
|
long Id = Convert.ToInt64(ar);
|
|
|
@ -273,15 +283,8 @@ namespace Myshipping.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK127);
|
|
|
|
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();
|
|
|
|
MDATA mDATA = new MDATA();
|
|
|
|
List<CTNDATAItem> CTNDATA = new List<CTNDATAItem>();
|
|
|
|
List<CTNDATAItem> CTNDATA = new List<CTNDATAItem>();
|
|
|
|
mDATA = order.Adapt<MDATA>();
|
|
|
|
mDATA = order.Adapt<MDATA>();
|
|
|
@ -317,27 +320,34 @@ namespace Myshipping.Application
|
|
|
|
CTNDATA = CTNDATA
|
|
|
|
CTNDATA = CTNDATA
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
string strPostObj = custEDIDtos.ToJsonString();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var sendObj = new
|
|
|
|
string strPostObj = custEDIDtos.ToJsonString();
|
|
|
|
{
|
|
|
|
|
|
|
|
ac = "emf",
|
|
|
|
var sendObj = new
|
|
|
|
uid = UserManager.DjyUserId,
|
|
|
|
{
|
|
|
|
skey = key.Password,
|
|
|
|
ac = "emf",
|
|
|
|
optype = type,
|
|
|
|
uid = UserManager.DjyUserId,
|
|
|
|
data = strPostObj
|
|
|
|
skey = key.Password,
|
|
|
|
};
|
|
|
|
optype = type,
|
|
|
|
_logger.LogInformation($"调用舱单接口 {dicUrl.Value} 传递数据:{strPostObj}");
|
|
|
|
data = strPostObj
|
|
|
|
var strResp = await dicUrl.Value.SetContentType("multipart/form-data").SetBody(sendObj).PostAsStringAsync();
|
|
|
|
};
|
|
|
|
_logger.LogInformation($"调用舱单接口返回:{strResp}");
|
|
|
|
_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)
|
|
|
|
var jobjResp = JObject.Parse(strResp);
|
|
|
|
{
|
|
|
|
bool respCode = jobjResp.GetBooleanValue("Success");
|
|
|
|
throw Oops.Bah(jobjResp.GetStringValue("Message").Replace("<br />", "\r\n").Replace("<br/>", ""));
|
|
|
|
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();
|
|
|
|
var bsl = new BookingStatusLog();
|
|
|
|
bsl.BookingId = order.BookingId;
|
|
|
|
bsl.BookingId = order.BookingId;
|
|
|
@ -372,8 +382,12 @@ namespace Myshipping.Application
|
|
|
|
if (type == "0" || type == "1")
|
|
|
|
if (type == "0" || type == "1")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await _seaeedi.UpdateAsync(x => x.Id == Id, x => new BookingOrderSeaeEdi { State = "已直发", SENDREMARK = SENDREMARK });
|
|
|
|
await _seaeedi.UpdateAsync(x => x.Id == Id, x => new BookingOrderSeaeEdi { State = "已直发", SENDREMARK = SENDREMARK });
|
|
|
|
await _rep.SetGoodsStatus("YFCD", Id);
|
|
|
|
if (string.IsNullOrEmpty(order.HBLNO)) {
|
|
|
|
await _rep.SendBookingOrder(new long[] { Id });
|
|
|
|
|
|
|
|
|
|
|
|
await _rep.SetGoodsStatus("YFCD", order.BookingId);
|
|
|
|
|
|
|
|
await _rep.SendBookingOrder(new long[] { order.BookingId });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (type == "2")
|
|
|
|
if (type == "2")
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -382,17 +396,15 @@ namespace Myshipping.Application
|
|
|
|
if (type == "4")
|
|
|
|
if (type == "4")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await _seaeedi.UpdateAsync(x => x.Id == Id, x => new BookingOrderSeaeEdi { State = "已作废", SENDREMARK = SENDREMARK });
|
|
|
|
await _seaeedi.UpdateAsync(x => x.Id == Id, x => new BookingOrderSeaeEdi { State = "已作废", SENDREMARK = SENDREMARK });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|