|
|
@ -1243,7 +1243,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
#region 插入货运动态
|
|
|
|
#region 插入货运动态
|
|
|
|
//配置中所有的货物状态
|
|
|
|
//配置中所有的货物状态
|
|
|
|
var config = _goodsStatusConfig.AsQueryable().Filter(null, true).Where(config => config.CreatedUserId == UserManager.UserId).ToList().DistinctBy(x => x.StatusName).Select(config => new GoodsStatusQuery
|
|
|
|
var config = _goodsStatusConfig.AsQueryable().Filter(null, true).Where(config => config.CreatedUserId == entity.CreatedUserId).ToList().DistinctBy(x => x.StatusName).Select(config => new GoodsStatusQuery
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
ConfigId = config.Id,
|
|
|
|
ConfigId = config.Id,
|
|
|
@ -1257,9 +1257,10 @@ namespace Myshipping.Application
|
|
|
|
Remark = null,
|
|
|
|
Remark = null,
|
|
|
|
Sort = config.Sort
|
|
|
|
Sort = config.Sort
|
|
|
|
}).ToList();
|
|
|
|
}).ToList();
|
|
|
|
if (config==null) {
|
|
|
|
if (config == null)
|
|
|
|
_GoodsConfig.InitGoodsStatusConfig(UserManager.UserId, UserManager.Name);
|
|
|
|
{
|
|
|
|
config = _goodsStatusConfig.AsQueryable().Filter(null, true).Where(config => config.CreatedUserId == UserManager.UserId).ToList().DistinctBy(x => x.StatusName).Select(config => new GoodsStatusQuery
|
|
|
|
_GoodsConfig.InitGoodsStatusConfig((long)entity.CreatedUserId, entity.CreatedUserName);
|
|
|
|
|
|
|
|
config = _goodsStatusConfig.AsQueryable().Filter(null, true).Where(config => config.CreatedUserId == entity.CreatedUserId).ToList().DistinctBy(x => x.StatusName).Select(config => new GoodsStatusQuery
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
ConfigId = config.Id,
|
|
|
|
ConfigId = config.Id,
|
|
|
@ -1273,47 +1274,89 @@ namespace Myshipping.Application
|
|
|
|
Remark = null,
|
|
|
|
Remark = null,
|
|
|
|
Sort = config.Sort
|
|
|
|
Sort = config.Sort
|
|
|
|
}).ToList();
|
|
|
|
}).ToList();
|
|
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(entity.MBLNO))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.MBLNO))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var ConfigId = config.Where(x => x.SystemCode == "YSDBC").Select(x => x.ConfigId).First();
|
|
|
|
|
|
|
|
var Status = _goodsStatus.FirstOrDefault(x => x.bookingId == Id && x.ConfigId == ConfigId);
|
|
|
|
|
|
|
|
if (Status == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var ConfigId = config.Where(x => x.SystemCode == "YSDBC").Select(x => x.ConfigId).First();
|
|
|
|
await _goodsStatus.InsertAsync(new BookingGoodsStatus
|
|
|
|
var Status = _goodsStatus.FirstOrDefault(x => x.bookingId == Id && x.ConfigId == ConfigId);
|
|
|
|
|
|
|
|
if (Status == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bookingId = Id,
|
|
|
|
|
|
|
|
ConfigId = ConfigId,
|
|
|
|
await _goodsStatus.InsertAsync(new BookingGoodsStatus
|
|
|
|
FinishTime = DateTime.Now,
|
|
|
|
{
|
|
|
|
FinishUser = UserManager.Name,
|
|
|
|
bookingId = Id,
|
|
|
|
FinishUserId = UserManager.UserId,
|
|
|
|
ConfigId = ConfigId,
|
|
|
|
IsPublic = false
|
|
|
|
FinishTime = DateTime.Now,
|
|
|
|
});
|
|
|
|
FinishUser = UserManager.Name,
|
|
|
|
|
|
|
|
FinishUserId = UserManager.UserId,
|
|
|
|
|
|
|
|
IsPublic = false
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.CUSTNO))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var ConfigId = config.Where(x => x.SystemCode == "YDC").Select(x => x.ConfigId).First();
|
|
|
|
|
|
|
|
var Status = _goodsStatus.FirstOrDefault(x => x.bookingId == Id && x.ConfigId == ConfigId);
|
|
|
|
|
|
|
|
if (Status == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await _goodsStatus.InsertAsync(new BookingGoodsStatus
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bookingId = Id,
|
|
|
|
|
|
|
|
ConfigId = ConfigId,
|
|
|
|
|
|
|
|
FinishTime = DateTime.Now,
|
|
|
|
|
|
|
|
FinishUser = UserManager.Name,
|
|
|
|
|
|
|
|
FinishUserId = UserManager.UserId,
|
|
|
|
|
|
|
|
IsPublic = false
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(entity.CUSTNO))
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var ConfigId = config.Where(x => x.SystemCode == "YDC").Select(x => x.ConfigId).First();
|
|
|
|
if (!string.IsNullOrEmpty(entity.MBLNO))
|
|
|
|
var Status = _goodsStatus.FirstOrDefault(x => x.bookingId == Id && x.ConfigId == ConfigId);
|
|
|
|
|
|
|
|
if (Status == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var ConfigId = config.Where(x => x.SystemCode == "YSDBC").Select(x => x.ConfigId).First();
|
|
|
|
await _goodsStatus.InsertAsync(new BookingGoodsStatus
|
|
|
|
var Status = _goodsStatus.FirstOrDefault(x => x.bookingId == Id && x.ConfigId == ConfigId);
|
|
|
|
|
|
|
|
if (Status == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bookingId = Id,
|
|
|
|
|
|
|
|
ConfigId = ConfigId,
|
|
|
|
await _goodsStatus.InsertAsync(new BookingGoodsStatus
|
|
|
|
FinishTime = DateTime.Now,
|
|
|
|
{
|
|
|
|
FinishUser = UserManager.Name,
|
|
|
|
bookingId = Id,
|
|
|
|
FinishUserId = UserManager.UserId,
|
|
|
|
ConfigId = ConfigId,
|
|
|
|
IsPublic = false
|
|
|
|
FinishTime = DateTime.Now,
|
|
|
|
});
|
|
|
|
FinishUser = UserManager.Name,
|
|
|
|
|
|
|
|
FinishUserId = UserManager.UserId,
|
|
|
|
|
|
|
|
IsPublic = false
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.CUSTNO))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var ConfigId = config.Where(x => x.SystemCode == "YDC").Select(x => x.ConfigId).First();
|
|
|
|
|
|
|
|
var Status = _goodsStatus.FirstOrDefault(x => x.bookingId == Id && x.ConfigId == ConfigId);
|
|
|
|
|
|
|
|
if (Status == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await _goodsStatus.InsertAsync(new BookingGoodsStatus
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bookingId = Id,
|
|
|
|
|
|
|
|
ConfigId = ConfigId,
|
|
|
|
|
|
|
|
FinishTime = DateTime.Now,
|
|
|
|
|
|
|
|
FinishUser = UserManager.Name,
|
|
|
|
|
|
|
|
FinishUserId = UserManager.UserId,
|
|
|
|
|
|
|
|
IsPublic = false
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|