jianghaiqing 1 year ago
commit 0a13b7df58

@ -715,7 +715,7 @@ namespace Myshipping.Application
{ {
var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync(); var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync();
if (!(mlist.OPID == UserManager.UserId.ToString() || mlist.DOCID == UserManager.UserId.ToString() || mlist.CUSTSERVICEID == UserManager.UserId.ToString() || mlist.ROUTEID == UserManager.UserId.ToString() || mlist.CreatedUserId.ToString() == UserManager.UserId.ToString())) if (!(mlist.OPID == UserManager.UserId.ToString() || mlist.DOCID == UserManager.UserId.ToString() || mlist.CUSTSERVICEID == UserManager.UserId.ToString() || mlist.ROUTEID == UserManager.UserId.ToString() || mlist.CreatedUserId.ToString() == UserManager.UserId.ToString()||UserManager.DjyUserId== "d85fd590-d9f6-4410-93a1-f6fac77b606e"))
{ {
throw Oops.Bah("您没有当前单据的操作权限!"); throw Oops.Bah("您没有当前单据的操作权限!");
@ -7829,11 +7829,11 @@ namespace Myshipping.Application
item.CtnDayNum = CtnDayNumlist.Where(x => x.StatusName == "申请箱使").Select(x => x.ExtData).FirstOrDefault(); item.CtnDayNum = CtnDayNumlist.Where(x => x.StatusName == "申请箱使").Select(x => x.ExtData).FirstOrDefault();
} }
if (!string.IsNullOrEmpty(item.ISSUETYPE)) //if (!string.IsNullOrEmpty(item.ISSUETYPE))
{ //{
var ISSUETYPE = _cache.GetAllMappingIssueType().Result.Where(x => x.Module == "HeChuan" && x.Code == item.ISSUETYPE).Select(x => x.MapName).FirstOrDefault(); // var ISSUETYPE = _cache.GetAllMappingIssueType().Result.Where(x => x.Module == "HeChuan" && x.Code == item.ISSUETYPE).Select(x => x.MapName).FirstOrDefault();
item.ISSUETYPE = ISSUETYPE; // item.ISSUETYPE = ISSUETYPE;
} //}
var ctn = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == item.Id && x.IsDeleted == false).ToListAsync(); var ctn = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == item.Id && x.IsDeleted == false).ToListAsync();
item.ctnInputs = ctn.Adapt<List<BookingCtnDto>>(); item.ctnInputs = ctn.Adapt<List<BookingCtnDto>>();

@ -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 });
}
}
}
}
} }
} }

Loading…
Cancel
Save