optimize
wet 2 years ago
parent f9a3dce792
commit 1d58041cdb

@ -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 #endregion
} }
else 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; bool flag = true;
long bid = 0; long bid = 0;
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(entity)) foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(entity))
@ -2204,14 +2288,12 @@ namespace Myshipping.Application
public async Task<dynamic> GetSyncVesselDate() public async Task<dynamic> 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, Vessel = x.Vessel,
Voyno = x.Voyno, Voyno = x.Voyno,
CARRIER = x.CARRIER, CARRIER = x.CARRIER,
CARRIERID = x.CARRIERID, CARRIERID = x.CARRIERID
ETD = null,
ETA = null
}).Distinct().ToListAsync(); }).Distinct().ToListAsync();
return list; return list;
} }

Loading…
Cancel
Save