执行代码清理,修复warning
This commit is contained in:
@@ -34,22 +34,24 @@ namespace Tnb.QcMgr
|
||||
}
|
||||
private async Task<dynamic> GetListAsync(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||
dic.Add("ok", "合格");
|
||||
dic.Add("no", "不合格");
|
||||
dic.Add("barelyok", "让步合格");
|
||||
dic.Add("await", "待检");
|
||||
dic.Add("temporarily", "暂控");
|
||||
Dictionary<string, string> queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson) : new Dictionary<string, string>();
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> dic = new()
|
||||
{
|
||||
{ "ok", "合格" },
|
||||
{ "no", "不合格" },
|
||||
{ "barelyok", "让步合格" },
|
||||
{ "await", "待检" },
|
||||
{ "temporarily", "暂控" }
|
||||
};
|
||||
Dictionary<string, string>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson) : new Dictionary<string, string>();
|
||||
string materialid = queryJson.ContainsKey("materialid") ? queryJson["materialid"].ToString() : "";
|
||||
string checktype = queryJson.ContainsKey("checktype") ? queryJson["checktype"].ToString() : "";
|
||||
string status = queryJson.ContainsKey("status") ? queryJson["status"].ToString() : "";
|
||||
var list = await db.Queryable<DictionaryDataEntity>()
|
||||
List<DictionaryDataEntity> list = await db.Queryable<DictionaryDataEntity>()
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b) => a.DictionaryTypeId == b.Id)
|
||||
.Where((a, b) => b.FullName == "质检状态" || b.FullName == "质检类型选择").ToListAsync();
|
||||
var BasLocations = await db.Queryable<BasLocation>().ToListAsync();
|
||||
var result = await db.Queryable<QcCheckExecH>()
|
||||
List<BasLocation> BasLocations = await db.Queryable<BasLocation>().ToListAsync();
|
||||
SqlSugarPagedList<QcCheckExecHOut> result = await db.Queryable<QcCheckExecH>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.materialid == b.id)
|
||||
.LeftJoin<BasProcess>((a, b, c) => a.processid == c.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workid == d.Id)
|
||||
@@ -69,11 +71,11 @@ namespace Tnb.QcMgr
|
||||
checknum = a.checknum,
|
||||
status = a.status,
|
||||
result = a.result,
|
||||
tasktime = a.tasktime == null ? "" : a.tasktime,
|
||||
exectime = a.exectime == null ? "" : a.exectime,
|
||||
execuser = e.RealName == null ? "" : e.RealName,
|
||||
tasktime = a.tasktime ?? "",
|
||||
exectime = a.exectime ?? "",
|
||||
execuser = e.RealName ?? "",
|
||||
}).OrderByDescending(a => DateTime.Parse(a.exectime)).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
foreach (var item in result.list)
|
||||
foreach (QcCheckExecHOut? item in result.list)
|
||||
{
|
||||
item.checktype = list.Select(p => p.Id).Contains(item.checktype) ? list.Where(p => p.Id == item.checktype).First().FullName : "";
|
||||
item.status = list.Select(p => p.Id).Contains(item.status) ? list.Where(p => p.Id == item.status).First().FullName : "";
|
||||
@@ -86,31 +88,27 @@ namespace Tnb.QcMgr
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetCheckTask(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||
dic.Add("ok", "合格");
|
||||
dic.Add("no", "不合格");
|
||||
dic.Add("barelyOk", "让步合格");
|
||||
dic.Add("await", "待检");
|
||||
dic.Add("temporarily", "暂控");
|
||||
Dictionary<string, string> queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson) : new Dictionary<string, string>();
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> dic = new()
|
||||
{
|
||||
{ "ok", "合格" },
|
||||
{ "no", "不合格" },
|
||||
{ "barelyOk", "让步合格" },
|
||||
{ "await", "待检" },
|
||||
{ "temporarily", "暂控" }
|
||||
};
|
||||
Dictionary<string, string>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson) : new Dictionary<string, string>();
|
||||
string materialid = queryJson.ContainsKey("materialid") ? queryJson["materialid"].ToString() : "";
|
||||
string checktype = queryJson.ContainsKey("checktype") ? queryJson["checktype"].ToString() : "";
|
||||
string status = queryJson.ContainsKey("status") ? queryJson["status"].ToString() : "";
|
||||
var list = await db.Queryable<DictionaryDataEntity>()
|
||||
List<DictionaryDataEntity> list = await db.Queryable<DictionaryDataEntity>()
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b) => a.DictionaryTypeId == b.Id)
|
||||
.Where((a, b) => b.FullName == "质检状态" || b.FullName == "质检类型选择").ToListAsync();
|
||||
var BasLocations = await db.Queryable<BasLocation>().ToListAsync();
|
||||
Expression<Func<QcCheckExecHOut, object>> expression;
|
||||
if (list.Where(p => p.FullName == "待执行").First().Id == status)
|
||||
{
|
||||
expression = a => DateTime.Parse(a.tasktime!);
|
||||
}
|
||||
else
|
||||
{
|
||||
expression = a => DateTime.Parse(a.exectime!);
|
||||
}
|
||||
var result = await db.Queryable<QcCheckExecH>()
|
||||
List<BasLocation> BasLocations = await db.Queryable<BasLocation>().ToListAsync();
|
||||
Expression<Func<QcCheckExecHOut, object>> expression = list.Where(p => p.FullName == "待执行").First().Id == status
|
||||
? (a => DateTime.Parse(a.tasktime!))
|
||||
: (a => DateTime.Parse(a.exectime!));
|
||||
SqlSugarPagedList<QcCheckExecHOut> result = await db.Queryable<QcCheckExecH>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.materialid == b.id)
|
||||
.LeftJoin<BasProcess>((a, b, c) => a.processid == c.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workid == d.Id)
|
||||
@@ -130,12 +128,12 @@ namespace Tnb.QcMgr
|
||||
checknum = a.checknum,
|
||||
status = a.status,
|
||||
result = a.result,
|
||||
tasktime = a.tasktime == null ? "" : a.tasktime,
|
||||
exectime = a.exectime == null ? "" : a.exectime,
|
||||
execuser = e.RealName == null ? "" : e.RealName,
|
||||
tasktime = a.tasktime ?? "",
|
||||
exectime = a.exectime ?? "",
|
||||
execuser = e.RealName ?? "",
|
||||
}).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
foreach (var item in result.list)
|
||||
foreach (QcCheckExecHOut? item in result.list)
|
||||
{
|
||||
item.checktype = list.Select(p => p.Id).Contains(item.checktype) ? list.Where(p => p.Id == item.checktype).First().FullName : "";
|
||||
item.status = list.Select(p => p.Id).Contains(item.status) ? list.Where(p => p.Id == item.status).First().FullName : "";
|
||||
|
||||
Reference in New Issue
Block a user