jianghaiqing 1 year ago
commit bf3c54aa40

@ -15,7 +15,6 @@ namespace Myshipping.Application
Task<BookingOrderOutput> Get(long Id); Task<BookingOrderOutput> Get(long Id);
Task<dynamic> Page([FromQuery] BookingOrderInput input);
Task<List<BookingLogDto>> GetLog(long Id); Task<List<BookingLogDto>> GetLog(long Id);
Task<IActionResult> Download(long id); Task<IActionResult> Download(long id);
@ -70,5 +69,7 @@ namespace Myshipping.Application
/// <param name="bookingId"></param> /// <param name="bookingId"></param>
/// <returns></returns> /// <returns></returns>
Task SetGoodsStatus(string code, long bookingId); Task SetGoodsStatus(string code, long bookingId);
} }
} }

@ -135,30 +135,33 @@ namespace Myshipping.Application
var list = entities.Adapt<SqlSugarPagedList<BookingOrderSFDto>>(); var list = entities.Adapt<SqlSugarPagedList<BookingOrderSFDto>>();
foreach (var item in list.Items) { foreach (var item in list.Items) {
item.Business = await _business.AsQueryable().Filter(null, true).Where(x => x.PId == item.Id).ToListAsync();
item.detail= await _detail.AsQueryable().Filter(null, true).Where(x => x.PId == item.Id).ToListAsync();
} }
return list; return list;
} }
/// <summary>
/// 保存并返回数据
/// </summary>
/// <returns></returns>
[HttpGet("/BookingOrderSF/Save")]
public async Task<dynamic> Save(BookingOrderSFDto input)
{
if (input.Id == 0)
{
}
else {
/// <summary>
/// Test }
/// </summary> return null;
/// <returns></returns>
[HttpGet("/BookingOrderSF/Test")]
public async Task<dynamic> Test()
{
return "1";
} }
} }

@ -122,7 +122,8 @@ namespace Myshipping.Application
{ {
entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.EdiCode).FirstOrDefault(); entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.EdiCode).FirstOrDefault();
} }
if (entity.CARGOID!="D") { if (entity.CARGOID != "D")
{
entity.DCLASS = string.Empty; entity.DCLASS = string.Empty;
entity.DUNNO = string.Empty; entity.DUNNO = string.Empty;
@ -160,6 +161,7 @@ namespace Myshipping.Application
{ {
entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.EdiCode).FirstOrDefault(); entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.EdiCode).FirstOrDefault();
} }
if (entity.CARGOID != "D") if (entity.CARGOID != "D")
{ {
@ -334,7 +336,7 @@ namespace Myshipping.Application
bool respCode = jobjResp.GetBooleanValue("Success"); bool respCode = jobjResp.GetBooleanValue("Success");
if (respCode == false) if (respCode == false)
{ {
throw Oops.Bah(jobjResp.GetStringValue("Message").Replace("<br />", "\r\n").Replace("<br/>","")); throw Oops.Bah(jobjResp.GetStringValue("Message").Replace("<br />", "\r\n").Replace("<br/>", ""));
} }
//货运动态 //货运动态
var bsl = new BookingStatusLog(); var bsl = new BookingStatusLog();
@ -367,13 +369,11 @@ namespace Myshipping.Application
{ {
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 });
} }
if (type == "0") if (type == "0" || type == "1")
{
await _seaeedi.UpdateAsync(x => x.Id == Id, x => new BookingOrderSeaeEdi { State = "已直发", SENDREMARK = SENDREMARK });
}
if (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);
await _rep.SendBookingOrder(new long[] { Id });
} }
if (type == "2") if (type == "2")
{ {
@ -387,52 +387,9 @@ namespace Myshipping.Application
} }
if (type == "3"|| type == "0"||type == "1") {
#region 插入货运动态
//配置中所有的货物状态
var config = _goodsStatusConfig.AsQueryable().Where(config => config.CreatedUserId == order.CreatedUserId).ToList().DistinctBy(x => x.StatusName).Select(config => new GoodsStatusQuery
{
ConfigId = config.Id,
SystemCode = config.SystemCode,
StatusName = config.StatusName,
FinishTime = null,
FinishUser = null,
FinishUserId = null,
IsPublic = false,
ExtData = null,
Remark = null,
Sort = config.Sort
}).ToList();
var ConfigId = config.Where(x => x.SystemCode == "YFCD").Select(x => x.ConfigId).First();
await _goodsStatus.InsertAsync(new BookingGoodsStatus
{
bookingId= Id,
ConfigId= ConfigId,
FinishTime=DateTime.Now,
FinishUser= order.CreatedUserName,
FinishUserId = order.CreatedUserId,
IsPublic=false
});
List<long> tslist = new List<long>();
tslist.Add((long)Id);
var itemcode = _cache.GetAllTenantParam().Result.Where(x => x.ParaCode == "BOOKING_DATA_PUSH" && x.TenantId == UserManager.TENANT_ID).Select(x => x.ItemCode).FirstOrDefault();
if (!string.IsNullOrEmpty(itemcode))
{
if (itemcode == "true")
await _rep.SendBookingOrder(tslist.ToArray());
_logger.LogInformation(Id + "自动订舱货物状态推送成功!");
}
}
#endregion
} }

@ -848,7 +848,7 @@ namespace Myshipping.Application
//派车后填写货物状态 //派车后填写货物状态
await _bookingOrderService.SetGoodsStatus("YPC", model.Id); await _bookingOrderService.SetGoodsStatus("YPC", model.Id);
await _bookingOrderService.SendBookingOrder(new long[] { model.Id });
//更新派车订单为已提交 //更新派车订单为已提交
model.Status = BookingTruckStatus.SUBMITED.ToString(); model.Status = BookingTruckStatus.SUBMITED.ToString();
model.UpdatedTime = DateTime.Now; model.UpdatedTime = DateTime.Now;

@ -1746,7 +1746,7 @@ namespace Myshipping.Application
}); });
it.YgtETD = item.ETD; it.YgtETD = item.ETD;
} }
if (it.ATD != item.ATD&& it.ATD==null) if (it.ATD != item.ATD && it.ATD == null)
{ {
flag = true; flag = true;
////添加booking日志 ////添加booking日志
@ -1800,21 +1800,7 @@ namespace Myshipping.Application
} }
if (issend) if (issend)
{ {
await _bookingorderservice.SendBookingOrder(order.Where(x => x.ParentId == 0).Select(x => x.Id).ToArray());
var itemcode = _cache.GetAllTenantParam().Result.Where(x => x.ParaCode == "BOOKING_DATA_PUSH" && x.TenantId == UserManager.TENANT_ID).Select(x => x.ItemCode).FirstOrDefault();
if (!string.IsNullOrEmpty(itemcode))
{
if (itemcode == "true")
{
List<long> list = new List<long>();
list = order.Where(x => x.ParentId == 0).Select(x => x.Id).ToList();
if (list != null && list.Count > 0)
{
await _bookingorderservice.SendBookingOrder(list.ToArray());
}
}
}
} }
} }
} }
@ -1993,13 +1979,8 @@ namespace Myshipping.Application
} }
if (issend) if (issend)
{ {
var itemcode = _cache.GetAllTenantParam().Result.Where(x => x.ParaCode == "BOOKING_DATA_PUSH" && x.TenantId == UserManager.TENANT_ID).Select(x => x.ItemCode).FirstOrDefault();
if (!string.IsNullOrEmpty(itemcode))
{
if (itemcode == "true")
await _bookingorderservice.SendBookingOrder(order.Where(x => x.ParentId == 0).Select(x => x.Id).ToArray()); await _bookingorderservice.SendBookingOrder(order.Where(x => x.ParentId == 0).Select(x => x.Id).ToArray());
}
} }
} }

Loading…
Cancel
Save