注塑看板
This commit is contained in:
@@ -14,6 +14,7 @@ using Tnb.BasicData.Entities;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
||||
using Tnb.Common.Redis;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -23,12 +24,15 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly RedisData2 _redisData;
|
||||
|
||||
public BiService(ISqlSugarRepository<Material> repository,
|
||||
RedisData2 redisData,
|
||||
IBillRullService billRuleService,
|
||||
IUserManager userManager)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_redisData = redisData;
|
||||
_db = repository.AsSugarClient();
|
||||
}
|
||||
|
||||
@@ -115,20 +119,29 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
output.equip_pie_list = await _db.Queryable<EqpEquipment>()
|
||||
.GroupBy(x => x.status)
|
||||
.OrderBy(x=>x.code)
|
||||
.Select(x => new EquipPieOutput
|
||||
{
|
||||
name = x.status,
|
||||
value = SqlFunc.AggregateCount(x.id)
|
||||
}).ToListAsync();
|
||||
})
|
||||
|
||||
.ToListAsync();
|
||||
|
||||
output.equip_info_list = await _db.Queryable<EqpEquipment>()
|
||||
.LeftJoin<EqpEquipType>((x,y)=>x.equip_type_id==y.id)
|
||||
.Where((x,y)=>y.code=="ZSJ")
|
||||
.OrderBy(x=>x.code)
|
||||
.Select(x => new EquipPieOutput
|
||||
{
|
||||
code = x.code,
|
||||
name = x.name,
|
||||
status = x.status
|
||||
}).ToListAsync();
|
||||
foreach (var item in output.equip_info_list)
|
||||
{
|
||||
item.status = _redisData.Get<string>($"{item.code}:ActstsMach");
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user