optimize
wet 2 years ago
parent 70576883f0
commit 0807086592

@ -52,7 +52,7 @@ namespace Myshipping.Application
public async Task<dynamic> Page([FromQuery] QueryBookingGoodsStatusConfigInput input)
{
//初次使用没有数据,进行初始化
InitGoodsStatusConfig(UserManager.UserId);
InitGoodsStatusConfig(UserManager.UserId,UserManager.Name);
var entities = await _rep.AsQueryable()
.Where(m => m.CreatedUserId == UserManager.UserId)
@ -127,7 +127,7 @@ namespace Myshipping.Application
/// 初始化当前用户的货物状态配置
/// </summary>
[NonAction]
public async void InitGoodsStatusConfig(long userid)
public async void InitGoodsStatusConfig(long userid,string username)
{
if (_rep.AsQueryable().Count(x => x.CreatedUserId == userid) == 0)
{
@ -139,7 +139,11 @@ namespace Myshipping.Application
{
StatusName = itm.Value,
Sort = itm.Sort,
SystemCode = itm.Code
SystemCode = itm.Code,
CreatedUserId=userid,
TenantId=UserManager.TENANT_ID,
CreatedUserName= username,
CreatedTime=DateTime.Now
});
});
}

@ -11,6 +11,6 @@ namespace Myshipping.Application
Task<long> Save(SaveBookingGoodsStatusConfigInput input);
Task Delete(long id);
Task<BookingGoodsStatusConfig> Get(long id);
void InitGoodsStatusConfig( long userid);
void InitGoodsStatusConfig( long userid,string username);
}
}

@ -5181,10 +5181,12 @@ namespace Myshipping.Application
allData.log = list;
var userid = _rep.Where(x => x.Id == bookingId).Select(x => x.CreatedUserId).First();
var order = _rep.Where(x => x.Id == bookingId).First();
var userid = order.CreatedUserId;
var username = order.CreatedUserName;
if (userid != null)
{
_GoodsConfig.InitGoodsStatusConfig( Convert.ToInt64(userid));
_GoodsConfig.InitGoodsStatusConfig( Convert.ToInt64(userid),username);
var GoodsStatus = await _goodsStatus.AsQueryable().LeftJoin(_goodsStatusConfig.AsQueryable(),

Loading…
Cancel
Save