注塑看板
This commit is contained in:
@@ -33,6 +33,8 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
|
||||
public class EquipPieOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string code { get; set; }
|
||||
public string name { get; set; }
|
||||
public int value { get; set; }
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,42 +423,42 @@ namespace Tnb.QcMgr
|
||||
GetQuery(Query, entity);
|
||||
List<QcCheckPlanH> list = await Query.ToListAsync();
|
||||
List<string> removes = new();
|
||||
foreach (QcCheckPlanH data in list)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(entity.materialid))
|
||||
{
|
||||
if (_repository.AsSugarClient().Queryable<QcCheckPlanMaterial>().Where(p => p.planid == data.id).Any())
|
||||
{
|
||||
if (!_repository.AsSugarClient().Queryable<QcCheckPlanMaterial>().Where(p => p.planid == data.id && p.materialid == entity.materialid).Any())
|
||||
{
|
||||
removes.Add(data.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(entity.processid))
|
||||
{
|
||||
if (_repository.AsSugarClient().Queryable<QcCheckPlanProcess>().Where(p => p.planid == data.id).Any())
|
||||
{
|
||||
if (!_repository.AsSugarClient().Queryable<QcCheckPlanProcess>().Where(p => p.planid == data.id && p.processid == entity.processid).Any())
|
||||
{
|
||||
removes.Add(data.id);
|
||||
}
|
||||
// foreach (QcCheckPlanH data in list)
|
||||
// {
|
||||
// if (!string.IsNullOrEmpty(entity.materialid))
|
||||
// {
|
||||
// if (_repository.AsSugarClient().Queryable<QcCheckPlanMaterial>().Where(p => p.planid == data.id).Any())
|
||||
// {
|
||||
// if (!_repository.AsSugarClient().Queryable<QcCheckPlanMaterial>().Where(p => p.planid == data.id && p.materialid == entity.materialid).Any())
|
||||
// {
|
||||
// removes.Add(data.id);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (!string.IsNullOrEmpty(entity.processid))
|
||||
// {
|
||||
// if (_repository.AsSugarClient().Queryable<QcCheckPlanProcess>().Where(p => p.planid == data.id).Any())
|
||||
// {
|
||||
// if (!_repository.AsSugarClient().Queryable<QcCheckPlanProcess>().Where(p => p.planid == data.id && p.processid == entity.processid).Any())
|
||||
// {
|
||||
// removes.Add(data.id);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// if (!string.IsNullOrEmpty(entity.workid))
|
||||
// {
|
||||
// if (_repository.AsSugarClient().Queryable<QcCheckPlanWork>().Where(p => p.planid == data.id).Any())
|
||||
// {
|
||||
// if (!_repository.AsSugarClient().Queryable<QcCheckPlanWork>().Where(p => p.planid == data.id && p.workid == entity.workid).Any())
|
||||
// {
|
||||
// removes.Add(data.id);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(entity.workid))
|
||||
{
|
||||
if (_repository.AsSugarClient().Queryable<QcCheckPlanWork>().Where(p => p.planid == data.id).Any())
|
||||
{
|
||||
if (!_repository.AsSugarClient().Queryable<QcCheckPlanWork>().Where(p => p.planid == data.id && p.workid == entity.workid).Any())
|
||||
{
|
||||
removes.Add(data.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list = list.Where(p => !removes.Contains(p.id)).ToList();
|
||||
// list = list.Where(p => !removes.Contains(p.id)).ToList();
|
||||
// .WhereIF(!string.IsNullOrEmpty(entity.materialid), (a, b, c, d, e) => c.materialid == entity.materialid)
|
||||
// .WhereIF(!string.IsNullOrEmpty(entity.processid), (a, b, c, d, e) => d.processid == entity.processid)
|
||||
// .WhereIF(!string.IsNullOrEmpty(entity.workid), (a, b, c, d, e) => e.workid == entity.workid).ToListAsync();
|
||||
@@ -478,7 +478,7 @@ namespace Tnb.QcMgr
|
||||
RemarkAttribute remark = RemarkAttribute.GetRemark(enumTriggerEvent);
|
||||
string type = DictionaryData.Where(p => p.FullName == remark.CheckType).First().Id;
|
||||
TriggerEvent = _repository.AsSugarClient().Queryable<QcTriggerEvent>().Where(p => p.type == type && p.name == remark.CheckContent).First();
|
||||
Query = Query.Where((a, b, c, d, e) => b.triggertype == "3" && b.content!.Contains(TriggerEvent.id));
|
||||
Query = Query.Where((a, b, c, d, e) => b.triggertype == "3" && b.content!.Contains(TriggerEvent.id) && c.materialid==entity.materialid);
|
||||
}
|
||||
private void Filter(List<QcCheckPlanH> QcCheckPlanHs, TriggerPlanEntity entity)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user