任务单排班 质量bug

This commit is contained in:
2024-08-23 13:40:20 +08:00
parent a9a64ca88e
commit fea4b31b09
8 changed files with 135 additions and 58 deletions

View File

@@ -423,45 +423,46 @@ 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);
// }
//
// }
// }
// 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);
// }
// }
// }
// }
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);
}
}
}
}
// 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();
Filter(list, entity);
if (list.Count > 0)
{
@@ -478,7 +479,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) && c.materialid==entity.materialid);
Query = Query.Where((a, b, c, d, e) => b.triggertype == "3" && b.content!.Contains(TriggerEvent.id));
}
private void Filter(List<QcCheckPlanH> QcCheckPlanHs, TriggerPlanEntity entity)
{

View File

@@ -10,6 +10,7 @@ using JNPF.Systems.Entitys.Permission;
using JNPF.Systems.Entitys.System;
using JNPF.VisualDev;
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SqlSugar;
@@ -367,7 +368,7 @@ namespace Tnb.QcMgr
pqty = pqty,
rqty = rqty,
check_result = ((EnumCheckConclusion)dic[CheckTaskInput.result]).ToString(),
});
},db);
}
}
await db.Ado.CommitTranAsync();