质检方案
This commit is contained in:
@@ -3,10 +3,18 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NPOI.SS.Formula.PTG;
|
||||
|
||||
namespace Tnb.QcMgr.Entities.Dto
|
||||
{
|
||||
public class Trigger
|
||||
public class TriggerPlan
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string code { get; set; }
|
||||
public string type { get; set; }
|
||||
public string cycle { get; set; }
|
||||
public string[] trievent { get; set; }
|
||||
public string[] trieventid { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,5 +23,13 @@ namespace Tnb.QcMgr.Interfaces
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Task<dynamic> GetCheckItems(string id);
|
||||
|
||||
/// <summary>
|
||||
/// 获取触发计划清单
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Task<dynamic> GetTriggerPlans();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ArrayExtensions;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -108,6 +109,33 @@ namespace Tnb.QcMgr
|
||||
return CheckPlansOut;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取触发计划清单
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetTriggerPlans()
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
var QcTriggerPlans = await db.Queryable<QcTriggerPlan>().ToListAsync();
|
||||
var QcTriggerEvents = await db.Queryable<QcTriggerEvent>().ToListAsync();
|
||||
List<TriggerPlan> TriggerPlans = new List<TriggerPlan>();
|
||||
foreach (var triggerPlan in QcTriggerPlans)
|
||||
{
|
||||
TriggerPlan TriggerPlan = new TriggerPlan();
|
||||
TriggerPlan.id = triggerPlan.id;
|
||||
TriggerPlan.name = triggerPlan.name!;
|
||||
TriggerPlan.code = triggerPlan.code!;
|
||||
TriggerPlan.type = triggerPlan.type!;
|
||||
TriggerPlan.cycle = triggerPlan.cycle!;
|
||||
TriggerPlan.trieventid = triggerPlan.trievent!.Replace("[", "").Replace("]", "").Replace("\r\n", "").Replace("\"", "").Replace(" ","").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||
TriggerPlan.trievent = QcTriggerEvents.Where(p => TriggerPlan.trieventid.Contains(p.id)).Select(p => p.name!).ToArray();
|
||||
TriggerPlans.Add(TriggerPlan);
|
||||
}
|
||||
return TriggerPlans;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存质检方案质检项和附加信息
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user