This commit is contained in:
qianjiawei
2023-10-31 14:53:58 +08:00
parent ab1635cbe5
commit 2c37098bc2

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Aspose.Cells.Drawing;
@@ -14,6 +15,7 @@ using JNPF.VisualDev;
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using NPOI.SS.Formula.Functions;
using SqlSugar;
using Tnb.BasicData.Entities;
using Tnb.QcMgr.Entities;
@@ -95,7 +97,7 @@ namespace Tnb.QcMgr
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("ok", "合格");
dic.Add("no", "不合格");
dic.Add("barelyok", "让步合格");
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>();
@@ -106,6 +108,15 @@ namespace Tnb.QcMgr
.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>()
.LeftJoin<BasMaterial>((a, b) => a.materialid == b.id)
.LeftJoin<BasProcess>((a, b, c) => a.processid == c.id)
@@ -129,7 +140,8 @@ namespace Tnb.QcMgr
tasktime = a.tasktime == null ? "" : a.tasktime,
exectime = a.exectime == null ? "" : a.exectime,
execuser = e.RealName == null ? "" : e.RealName,
}).OrderByDescending(a => DateTime.Parse(a.exectime)).ToPagedListAsync(input.currentPage, input.pageSize);
}).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize);
foreach (var item in result.list)
{
item.checktype = list.Select(p => p.Id).Contains(item.checktype) ? list.Where(p => p.Id == item.checktype).First().FullName : "";