|
|
|
@ -1243,7 +1243,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
#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,
|
|
|
|
@ -1257,9 +1257,10 @@ namespace Myshipping.Application
|
|
|
|
|
Remark = null,
|
|
|
|
|
Sort = config.Sort
|
|
|
|
|
}).ToList();
|
|
|
|
|
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
|
|
|
|
|
if (config == null)
|
|
|
|
|
{
|
|
|
|
|
_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,
|
|
|
|
@ -1273,47 +1274,89 @@ namespace Myshipping.Application
|
|
|
|
|
Remark = null,
|
|
|
|
|
Sort = config.Sort
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.MBLNO))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
await _goodsStatus.InsertAsync(new BookingGoodsStatus
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
bookingId = Id,
|
|
|
|
|
ConfigId = ConfigId,
|
|
|
|
|
FinishTime = DateTime.Now,
|
|
|
|
|
FinishUser = UserManager.Name,
|
|
|
|
|
FinishUserId = UserManager.UserId,
|
|
|
|
|
IsPublic = false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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))
|
|
|
|
|
{
|
|
|
|
|
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();
|
|
|
|
|
var Status = _goodsStatus.FirstOrDefault(x => x.bookingId == Id && x.ConfigId == ConfigId);
|
|
|
|
|
if (Status == null)
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.MBLNO))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
await _goodsStatus.InsertAsync(new BookingGoodsStatus
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
bookingId = Id,
|
|
|
|
|
ConfigId = ConfigId,
|
|
|
|
|
FinishTime = DateTime.Now,
|
|
|
|
|
FinishUser = UserManager.Name,
|
|
|
|
|
FinishUserId = UserManager.UserId,
|
|
|
|
|
IsPublic = false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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))
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|