diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index d1a8136d..225e9892 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -1556,6 +1556,49 @@ namespace Myshipping.Application } } + + if (!string.IsNullOrEmpty(model.CtnDayNum)) + { + var gc = goodsconfig.Where(x => x.StatusName == "申请箱使" && x.CreatedUserId == user.Id).FirstOrDefault(); + if (gc != null) + { + + await _goodsStatus.InsertAsync(new BookingGoodsStatus + { + bookingId = entity.Id, + ConfigId = gc.Id, + FinishTime = DateTime.Now, + FinishUser = user.Name, + FinishUserId = user.Id, + Remark = "", + ExtData = model.CtnDayNum + }); + } + else + { + + var configid = await _goodsStatusConfig.InsertReturnSnowflakeIdAsync(new BookingGoodsStatusConfig + { + + StatusName = "申请箱使", + Sort = goodsconfig.Where(x => x.CreatedUserId == user.Id).Max(x => x.Sort) + 1, + CreatedTime = DateTime.Now, + CreatedUserId = user.Id, + CreatedUserName = user.Name, + IsDeleted = false + }); + await _goodsStatus.InsertAsync(new BookingGoodsStatus + { + bookingId = entity.Id, + ConfigId = configid, + FinishTime = DateTime.Now, + FinishUser = user.Name, + FinishUserId = user.Id, + Remark = "", + ExtData = model.CtnDayNum + }); + } + } #endregion } else @@ -1773,7 +1816,48 @@ namespace Myshipping.Application } } } + if (!string.IsNullOrEmpty(model.CtnDayNum)) + { + var gc = goodsconfig.Where(x => x.StatusName == "申请箱使" && x.CreatedUserId == user.Id).FirstOrDefault(); + if (gc != null) + { + + await _goodsStatus.InsertAsync(new BookingGoodsStatus + { + bookingId = entity.Id, + ConfigId = gc.Id, + FinishTime = DateTime.Now, + FinishUser = user.Name, + FinishUserId = user.Id, + Remark = "", + ExtData = model.CtnDayNum + }); + } + else + { + var configid = await _goodsStatusConfig.InsertReturnSnowflakeIdAsync(new BookingGoodsStatusConfig + { + + StatusName = "申请箱使", + Sort = goodsconfig.Where(x => x.CreatedUserId == user.Id).Max(x => x.Sort) + 1, + CreatedTime = DateTime.Now, + CreatedUserId = user.Id, + CreatedUserName = user.Name, + IsDeleted = false + }); + await _goodsStatus.InsertAsync(new BookingGoodsStatus + { + bookingId = entity.Id, + ConfigId = configid, + FinishTime = DateTime.Now, + FinishUser = user.Name, + FinishUserId = user.Id, + Remark = "", + ExtData = model.CtnDayNum + }); + } + } bool flag = true; long bid = 0; foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(entity)) @@ -2204,14 +2288,12 @@ namespace Myshipping.Application public async Task GetSyncVesselDate() { - var list = await _vesselinfo.AsQueryable().Where(x => x.ETD != null && x.ATD != null && x.TenantId == UserManager.TENANT_ID).Select(x => new DjyVesselDto + var list = await _vesselinfo.AsQueryable().Where(x => x.ETD != null && x.ATD != null && x.TenantId == UserManager.TENANT_ID&&(x.Voyno!=null&&x.Voyno!="")).Select(x => new { Vessel = x.Vessel, Voyno = x.Voyno, CARRIER = x.CARRIER, - CARRIERID = x.CARRIERID, - ETD = null, - ETA = null + CARRIERID = x.CARRIERID }).Distinct().ToListAsync(); return list; }