检验批委托速度优化

This commit is contained in:
2024-07-18 14:51:16 +08:00
parent d985c413b3
commit 98012f9450
38 changed files with 941 additions and 145 deletions
@@ -8,6 +8,7 @@ using BLL;
using System.Windows.Forms;
using Newtonsoft.Json.Linq;
using AspNet = System.Web.UI.WebControls;
using FineUIPro.Web.common.BaseInfo;
namespace FineUIPro.Web.HJGL.WeldingManage
{
@@ -41,6 +42,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
#endregion
public static List<Model.HJGL_View_CH_TrustItem> trustItemList;
public static List<Model.HJGLPointManageCheckIsOk> hotPass_JOT_ID_List;
public static List<Model.HJGLPointManageCheckIsOk> hardPassList;
public static List<Model.HJGLPointManageCheckIsOk> HotProessTrustItemList;
public static List<Model.HJGLPointManageCheckIsOk> hotHardList;
#region
/// <summary>
/// 加载页面
@@ -108,6 +115,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
//cbVI.HeaderText = "<i class=\"ui-icon f-grid-checkbox myheadercheckbox\"></i>&nbsp;外观检验";
//显示列
trustItemList = HJGL_TrustManageEditService.GetView_CH_TrustItemByProjectId(this.drpProjectId.SelectedValue);
hotPass_JOT_ID_List = (from x in Funs.DB.HJGL_View_CH_HotProessResult where x.ProjectId == drpProjectId.SelectedValue select new Model.HJGLPointManageCheckIsOk { Id = x.JOT_ID, IsOK = x.IsOK }).ToList();
hardPassList = (from x in Funs.DB.HJGL_View_CH_HardTestResult where x.ProjectId == drpProjectId.SelectedValue select new Model.HJGLPointManageCheckIsOk { Id = x.JOT_ID, IsOK = x.IsOK }).ToList();
HotProessTrustItemList = (from x in Funs.DB.HJGL_View_CH_HotProessTrustItem where x.ProjectId == drpProjectId.SelectedValue && x.TrustDate != null select new Model.HJGLPointManageCheckIsOk { Id = x.JOT_ID, IsOK = x.IsOK }).ToList();
hotHardList = (from x in Funs.DB.HJGL_CH_HardTestReportItem select new Model.HJGLPointManageCheckIsOk { Id = x.JOT_ID }).ToList();
Model.Sys_UserShowColumns c = BLL.Sys_UserShowColumnsService.GetColumnsByUserId(this.CurrUser.UserId, "P");
if (c != null)
{
@@ -1239,7 +1255,18 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (!string.IsNullOrEmpty(batchDetail.JOT_ID))
{
//委托日期
var trustItem = BLL.HJGL_TrustManageEditService.GetView_CH_TrustItemByJotID(batchDetail.JOT_ID, batch.ProjectId);
//var trustItem = BLL.HJGL_TrustManageEditService.GetView_CH_TrustItemByJotID(batchDetail.JOT_ID, batch.ProjectId);
//if (trustItem != null)
//{
// var trust = BLL.HJGL_TrustManageEditService.GetCH_TrustByID(trustItem.CH_TrustID);
// if (trust != null)
// {
// if (trust.CH_TrustDate != null)
// {
// lblTrustDate.Text = string.Format("{0:yyyy-MM-dd}", trust.CH_TrustDate);
// }
// }
var trustItem = trustItemList.FirstOrDefault(x => x.JOT_ID == batchDetail.JOT_ID);
if (trustItem != null)
{
var trust = BLL.HJGL_TrustManageEditService.GetCH_TrustByID(trustItem.CH_TrustID);
@@ -1247,13 +1274,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (trust.CH_TrustDate != null)
{
lblTrustDate.Text = string.Format("{0:yyyy-MM-dd}", trust.CH_TrustDate);
lblTrustDate.Text = string.Format("{0:yyyy-MM-dd}", trust.CH_TrustDate);
}
}
}
//热处理合格
var hotPass = Funs.DB.HJGL_View_CH_HotProessResult.FirstOrDefault(x => x.JOT_ID == batchDetail.JOT_ID && x.ProjectId == batch.ProjectId);
var hotPass = hotPass_JOT_ID_List.FirstOrDefault(x => x .Id== batchDetail.JOT_ID);
if (hotPass != null)
{
if (hotPass.IsOK == true)
@@ -1262,7 +1289,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
//硬度合格
var hardPass = Funs.DB.HJGL_View_CH_HardTestResult.FirstOrDefault(x => x.JOT_ID == batchDetail.JOT_ID && x.ProjectId == batch.ProjectId);
var hardPass = hardPassList.FirstOrDefault(x => x.Id == batchDetail.JOT_ID );
if (hardPass != null)
{
if (hardPass.IsOK == true)
@@ -1271,13 +1298,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
//是否热处理
var hotProessTrustItem = Funs.DB.HJGL_View_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == batchDetail.JOT_ID && x.ProjectId == batch.ProjectId && x.TrustDate != null);
var hotProessTrustItem = HotProessTrustItemList.FirstOrDefault(x => x.Id == batchDetail.JOT_ID );
if (hotProessTrustItem != null)
{
cbHotTrust.Checked = true;
}
//硬度委托
var hotHard = Funs.DB.HJGL_CH_HardTestReportItem.FirstOrDefault(x => x.JOT_ID == batchDetail.JOT_ID);
var hotHard = hotHardList.FirstOrDefault(x => x.Id == batchDetail.JOT_ID);
if (hotHard != null)
{
cbHotHard.Checked = true;