一坯多标准,添加分组条件

main
sunhao 6 months ago
parent 3b16bb3d7b
commit 25d0b3b9f7

@ -61,6 +61,30 @@ MES
BKDMES000 BKDMES000
BKDMES005 BKDMES005
2022.10.17新增 2022.10.17新增
取样 并样 非船板
北科大
MES
BKDMES000
BKDMESMP
2024.05.18
取样 并号 船板
北科大
MES
BKDMES000
BKDMESMP01
2024.05.18
取样 并号关系 船板
北科大
MES
BKDMES000
BKDMESMP02
2024.05.18
取样 反馈
MES
北科大
MESBKD000
MESBKDMP01
2024.05.18
余材替代处理结果 余材替代处理结果
MES MES
北科大 北科大
@ -86,6 +110,47 @@ MESBKD010
MESBKD011 MESBKD011
取样接口
并样接口 非船板 (北科大-->MES接收)
电文定义DATA 前10位记录FORMID
主要内容:
FORMID10位 BKDMESMP 固定
业务ID号 NUMBER(12) 流水号,需要在应答中带回
钢板号VARCHAR2(14)
试样号:VARCHAR2(14)
并样接口 船板 (北科大-->MES接收)
电文定义DATA 前10位记录FORMID
主要内容:
FORMID10位 BKDMESMP01 固定
业务ID号 NUMBER(12) 流水号,需要在应答中带回
钢板号VARCHAR2(14)
产品代码:VARCHAR2(2)
实际标记:VARCHAR2(1)
位置:VARCHAR2(1)
长度:VARCHAR2(10)
试样号:VARCHAR2(14) 注倒数第二位13位是9
并样 船板 关系 (北科大-->MES接收)
电文定义DATA 前10位记录FORMID
主要内容:
FORMID10位 BKDMESMP01 固定
业务ID号 NUMBER(12) 流水号,需要在应答中带回
钢板号VARCHAR2(14)
产品代码:VARCHAR2(2)
实际标记:VARCHAR2(1)
位置:VARCHAR2(1)
长度:VARCHAR2(10)
试样号:VARCHAR2(14)
并样 反馈 (MES-->北科大接收)
电文定义DATA 前10位记录FORMID
主要内容:
FORMIDVARCHAR2(10)MESBKD011 固定
业务ID号 NUMBER(12) 流水号,需要在应答中带回
式样号: VARCHAR2(14)
处理结果标识VARCHAR2(1)S-成功F-失败)
处理说明VARCHAR2(200)
余材替代请求XAC直接替代或退判替代(北科大-->ERP接收) 余材替代请求XAC直接替代或退判替代(北科大-->ERP接收)
替代请求替代系统直接发给ERP系统 替代请求替代系统直接发给ERP系统
替代结果ERP通过内部接口发MESXAA替代结果或退判结果,MES根据情况进行炼钢缓冲区退料、余材替代等处理。 替代结果ERP通过内部接口发MESXAA替代结果或退判结果,MES根据情况进行炼钢缓冲区退料、余材替代等处理。

@ -79,6 +79,8 @@ namespace SlabHandle
[Persistent("ZZ_PLT_DESP"), DisplayName("轧制工厂简称")] [Persistent("ZZ_PLT_DESP"), DisplayName("轧制工厂简称")]
public string ZZ_PLT_DESP { get; set; } public string ZZ_PLT_DESP { get; set; }
//分类
[Persistent("CLASS_FL"), DisplayName("分类")]
public string CLASS_FL { get; set; }
} }
} }

@ -7166,11 +7166,18 @@ namespace SlabHandle
&& p.THK_MIN <= TPF.Order.ORD_THK && p.THK_MIN <= TPF.Order.ORD_THK
&& p.THK_MAX >= TPF.Order.ORD_THK).Count() > 0) && p.THK_MAX >= TPF.Order.ORD_THK).Count() > 0)
{ {
//同一个分组
int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD
&& p.STDSPEC == TPF.Order.STDSPEC && p.STDSPEC == TPF.Order.STDSPEC
&& p.ZZ_PLT == "C3" && p.ZZ_PLT == "C3"
&& p.THK_MIN <= TPF.Order.ORD_THK && p.THK_MIN <= TPF.Order.ORD_THK
&& p.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().STL_SEQ; && p.THK_MAX >= TPF.Order.ORD_THK
&& p.CLASS_FL.Contains(glCpNiscoChmcSl.Where(e => e.STLGRD == TSCopy.STLGRD
&& e.STDSPEC == TPF.Order.STDSPEC
&& e.ZZ_PLT == "C3"
&& e.THK_MIN <= TPF.Order.ORD_THK
&& e.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().CLASS_FL)
).FirstOrDefault().STL_SEQ;
TSS.SORT = intSort; TSS.SORT = intSort;
//替代工艺 //替代工艺
if (ChkDiffStdl(TSCopy, TPF.Order)) if (ChkDiffStdl(TSCopy, TPF.Order))
@ -8748,11 +8755,25 @@ namespace SlabHandle
&& p.THK_MIN <= TPF.Order.ORD_THK && p.THK_MIN <= TPF.Order.ORD_THK
&& p.THK_MAX >= TPF.Order.ORD_THK).Count() > 0) && p.THK_MAX >= TPF.Order.ORD_THK).Count() > 0)
{ {
//int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD
// && p.STDSPEC == TPF.Order.STDSPEC
// && p.ZZ_PLT == "C3"
// && p.THK_MIN <= TPF.Order.ORD_THK
// && p.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().STL_SEQ;
//同一个分组
int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD
&& p.STDSPEC == TPF.Order.STDSPEC && p.STDSPEC == TPF.Order.STDSPEC
&& p.ZZ_PLT == "C3" && p.ZZ_PLT == "C3"
&& p.THK_MIN <= TPF.Order.ORD_THK && p.THK_MIN <= TPF.Order.ORD_THK
&& p.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().STL_SEQ; && p.THK_MAX >= TPF.Order.ORD_THK
&& p.CLASS_FL.Contains(glCpNiscoChmcSl.Where(e => e.STLGRD == TSCopy.STLGRD
&& e.STDSPEC == TPF.Order.STDSPEC
&& e.ZZ_PLT == "C3"
&& e.THK_MIN <= TPF.Order.ORD_THK
&& e.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().CLASS_FL)
).FirstOrDefault().STL_SEQ;
TSS.SORT = intSort; TSS.SORT = intSort;
//替代工艺 //替代工艺
if (ChkDiffStdl(TSCopy, TPF.Order)) if (ChkDiffStdl(TSCopy, TPF.Order))
@ -9835,11 +9856,23 @@ namespace SlabHandle
&& p.THK_MIN <= TPF.Order.ORD_THK && p.THK_MIN <= TPF.Order.ORD_THK
&& p.THK_MAX >= TPF.Order.ORD_THK).Count() > 0) && p.THK_MAX >= TPF.Order.ORD_THK).Count() > 0)
{ {
//int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD
// && p.STDSPEC == TPF.Order.STDSPEC
// && p.ZZ_PLT == "C3"
// && p.THK_MIN <= TPF.Order.ORD_THK
// && p.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().STL_SEQ;
//同一个分组
int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD
&& p.STDSPEC == TPF.Order.STDSPEC && p.STDSPEC == TPF.Order.STDSPEC
&& p.ZZ_PLT == "C3" && p.ZZ_PLT == "C3"
&& p.THK_MIN <= TPF.Order.ORD_THK && p.THK_MIN <= TPF.Order.ORD_THK
&& p.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().STL_SEQ; && p.THK_MAX >= TPF.Order.ORD_THK
&& p.CLASS_FL.Contains(glCpNiscoChmcSl.Where(e => e.STLGRD == TSCopy.STLGRD
&& e.STDSPEC == TPF.Order.STDSPEC
&& e.ZZ_PLT == "C3"
&& e.THK_MIN <= TPF.Order.ORD_THK
&& e.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().CLASS_FL)
).FirstOrDefault().STL_SEQ;
TSS.SORT = intSort; TSS.SORT = intSort;
//替代工艺 //替代工艺
if (ChkDiffStdl(TSCopy, TPF.Order)) if (ChkDiffStdl(TSCopy, TPF.Order))
@ -11019,11 +11052,23 @@ namespace SlabHandle
&& p.THK_MIN <= TPF.Order.ORD_THK && p.THK_MIN <= TPF.Order.ORD_THK
&& p.THK_MAX >= TPF.Order.ORD_THK).Count() > 0) && p.THK_MAX >= TPF.Order.ORD_THK).Count() > 0)
{ {
//int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD
// && p.STDSPEC == TPF.Order.STDSPEC
// && p.ZZ_PLT == "C3"
// && p.THK_MIN <= TPF.Order.ORD_THK
// && p.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().STL_SEQ;
//同一个分组
int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD int intSort = glCpNiscoChmcSl.Where(p => p.STLGRD == TSCopy.STLGRD
&& p.STDSPEC == TPF.Order.STDSPEC && p.STDSPEC == TPF.Order.STDSPEC
&& p.ZZ_PLT == "C3" && p.ZZ_PLT == "C3"
&& p.THK_MIN <= TPF.Order.ORD_THK && p.THK_MIN <= TPF.Order.ORD_THK
&& p.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().STL_SEQ; && p.THK_MAX >= TPF.Order.ORD_THK
&& p.CLASS_FL.Contains(glCpNiscoChmcSl.Where(e => e.STLGRD == TSCopy.STLGRD
&& e.STDSPEC == TPF.Order.STDSPEC
&& e.ZZ_PLT == "C3"
&& e.THK_MIN <= TPF.Order.ORD_THK
&& e.THK_MAX >= TPF.Order.ORD_THK).FirstOrDefault().CLASS_FL)
).FirstOrDefault().STL_SEQ;
TSS.SORT = intSort; TSS.SORT = intSort;
//替代工艺 //替代工艺
if (ChkDiffStdl(TSCopy, TPF.Order)) if (ChkDiffStdl(TSCopy, TPF.Order))
@ -14955,6 +15000,25 @@ namespace SlabHandle
return false; return false;
} }
//获取分类
string strClass = glCpNiscoChmcSl.Where(p => p.STLGRD == tSlab.STLGRD
&& p.STDSPEC == strSTD1
&& p.ZZ_PLT == "C3"
&& p.THK_MIN <= decThk
&& p.THK_MAX >= decThk).FirstOrDefault().CLASS_FL;
//一坯多标准要在同一个分类中
if (glCpNiscoChmcSl.Where(p => p.STLGRD == tSlab.STLGRD
&& p.STDSPEC == strSTD2
&& p.ZZ_PLT == "C3"
&& p.THK_MIN <= decThk
&& p.THK_MAX >= decThk
&& p.CLASS_FL.Contains(strClass)).Count()<0)
{
return false;
}
return true; return true;
} }

@ -1048,7 +1048,7 @@ namespace SlabHandle
DataTable dtCheck = new DataTable(); DataTable dtCheck = new DataTable();
IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>(); IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>();
strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL"); strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL CNCS WHERE NVL( CNCS.CLASS_FL , ' ')<>' '");
try try
{ {

@ -1067,7 +1067,7 @@ namespace SlabHandle
DataTable dtCheck = new DataTable(); DataTable dtCheck = new DataTable();
IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>(); IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>();
strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL"); strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL CNCS WHERE NVL( CNCS.CLASS_FL , ' ')<>' '");
try try
{ {

@ -79,6 +79,8 @@ namespace SlabHandle
[Persistent("ZZ_PLT_DESP"), DisplayName("轧制工厂简称")] [Persistent("ZZ_PLT_DESP"), DisplayName("轧制工厂简称")]
public string ZZ_PLT_DESP { get; set; } public string ZZ_PLT_DESP { get; set; }
//分类
[Persistent("CLASS_FL"), DisplayName("分类")]
public string CLASS_FL { get; set; }
} }
} }

@ -4330,18 +4330,24 @@ namespace SlabHandle
{ {
flag = true; flag = true;
} }
if (tpg.CRU_PIEs.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC).Count() > 0) //获取分类
string strCLASS_FL = string.Empty;
if (cP_NISCOs.Where(q => q.STDSPEC == glt.STDSPEC).Count() > 0)
{ {
int ints = cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC).FirstOrDefault().STL_SEQ; strCLASS_FL = cP_NISCOs.Where(q => q.STDSPEC == glt.STDSPEC).FirstOrDefault().CLASS_FL;
}
if (tpg.CRU_PIEs.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC && q.CLASS_FL == strCLASS_FL ).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC && q.CLASS_FL== strCLASS_FL).Count() > 0)
{
int ints = cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
foreach (TB_PLATE_FIC tpf in tpg.CRU_PIEs) foreach (TB_PLATE_FIC tpf in tpg.CRU_PIEs)
{ {
ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ; ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
} }
if (ints == cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC).FirstOrDefault().STL_SEQ && lt.ChkDiffStdl == "1") if (ints == cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ && lt.ChkDiffStdl == "1")
{ {
flag = true; flag = true;
} }
if (tpg.CRU_PIEs.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.Order)).Count() > 0) if (tpg.CRU_PIEs.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.Order)).Count() > 0)
{ {
flag = true; flag = true;
} }
@ -4528,6 +4534,13 @@ namespace SlabHandle
&& glt.THK + ConverDataToDecimal(0.6) >= lt.THK && glt.THK + ConverDataToDecimal(0.6) >= lt.THK
&& tpf2.ORD_LEN >= tpf1.ORD_LEN - 2000&& tpf2.ORD_LEN<=tpf1.ORD_LEN) && tpf2.ORD_LEN >= tpf1.ORD_LEN - 2000&& tpf2.ORD_LEN<=tpf1.ORD_LEN)
{ {
//获取分类
//获取分类
string strCLASS_FL = string.Empty;
if (cP_NISCOs.Where(q => q.STDSPEC == glt.STDSPEC).Count() > 0)
{
strCLASS_FL = cP_NISCOs.Where(q => q.STDSPEC == glt.STDSPEC).FirstOrDefault().CLASS_FL;
}
bool flag = false; bool flag = false;
if ( if (
@ -4536,20 +4549,20 @@ namespace SlabHandle
{ {
flag = true; flag = true;
} }
if (tpg.CRU_PIEs.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC).Count() > 0) if (tpg.CRU_PIEs.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC && q.CLASS_FL == strCLASS_FL).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC && q.CLASS_FL == strCLASS_FL).Count() > 0)
{ {
int ints = cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC).FirstOrDefault().STL_SEQ; int ints = cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
foreach (TB_PLATE_FIC tpf in tpg.CRU_PIEs) foreach (TB_PLATE_FIC tpf in tpg.CRU_PIEs)
{ {
ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ; ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
} }
if (ints == cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC).FirstOrDefault().STL_SEQ && lt.ChkDiffStdl == "1") if (ints == cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ && lt.ChkDiffStdl == "1")
{ {
flag = true; flag = true;
} }
if (tpg.CRU_PIEs.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.Order)).Count() > 0) if (tpg.CRU_PIEs.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.Order)).Count() > 0)
{ {
flag = true; flag = true;
} }
@ -4682,6 +4695,13 @@ namespace SlabHandle
glt.THK - ConverDataToDecimal(0.6) <= lt.THK glt.THK - ConverDataToDecimal(0.6) <= lt.THK
&& glt.THK + ConverDataToDecimal(0.6) >= lt.THK) && glt.THK + ConverDataToDecimal(0.6) >= lt.THK)
{ {
//获取分类
//获取分类
string strCLASS_FL = string.Empty;
if (cP_NISCOs.Where(q => q.STDSPEC == glt.STDSPEC).Count() > 0)
{
strCLASS_FL = cP_NISCOs.Where(q => q.STDSPEC == glt.STDSPEC).FirstOrDefault().CLASS_FL;
}
bool flag = false; bool flag = false;
if ((tpg.CRU_PIEs.Where(p => p.STLGRD != tSlab.STLGRD).Count() == 0 && lt.STLGRD == tSlab.STLGRD) || if ((tpg.CRU_PIEs.Where(p => p.STLGRD != tSlab.STLGRD).Count() == 0 && lt.STLGRD == tSlab.STLGRD) ||
@ -4689,18 +4709,18 @@ namespace SlabHandle
{ {
flag = true; flag = true;
} }
if (tpg.CRU_PIEs.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC).Count() > 0) if (tpg.CRU_PIEs.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC && q.CLASS_FL == strCLASS_FL).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC && q.CLASS_FL == strCLASS_FL).Count() > 0)
{ {
int ints = cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC).FirstOrDefault().STL_SEQ; int ints = cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
foreach (TB_PLATE_FIC tpf in tpg.CRU_PIEs) foreach (TB_PLATE_FIC tpf in tpg.CRU_PIEs)
{ {
ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ; ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
} }
if (ints == cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC).FirstOrDefault().STL_SEQ && lt.ChkDiffStdl == "1") if (ints == cP_NISCOs.Where(q => q.STDSPEC == lt.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ && lt.ChkDiffStdl == "1")
{ {
flag = true; flag = true;
} }
if (tpg.CRU_PIEs.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.Order)).Count() > 0) if (tpg.CRU_PIEs.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.Order)).Count() > 0)
{ {
flag = true; flag = true;
} }
@ -6234,48 +6254,44 @@ namespace SlabHandle
//if (tpg.GRP_ID >= 10000) //if (tpg.GRP_ID >= 10000)
//{ //{
// if (tpg.CRU_PIEs_ACT.GroupBy(p => p.Order.STLGRD).Count() == 1 && tpg.CRU_PIEs_ACT.FirstOrDefault().STLGRD == iSlab.STLGRD) // if (tpg.CRU_PIEs_ACT.GroupBy(p => p.Order.STLGRD).Count() == 1 && tpg.CRU_PIEs_ACT.FirstOrDefault().STLGRD == iSlab.STLGRD)
//{ //{
// tpg.ChkDiffStdl = "1"; // tpg.ChkDiffStdl = "1";
// } // }
//else //else
//{ //{
if (tpg.CRU_PIEs_ACT.GroupBy(p => p.Order.STDSPEC).Count() == 1 && ChkDiffStdl(iSlab, tpg.CRU_PIEs_ACT[0].Order)) if (tpg.CRU_PIEs_ACT.GroupBy(p => p.Order.STDSPEC).Count() == 1 && ChkDiffStdl(iSlab, tpg.CRU_PIEs_ACT[0].Order))
{
tpg.ChkDiffStdl = "1";
}
else
{
IList<CP_NISCO_CHMC_SL> cP_NISCOs = glCpNiscoChmcSl.Where(p => p.ZZ_PLT == "C2"
&& p.STLGRD == iSlab.STLGRD
&& p.THK_MIN < tpg.THK
&& p.THK_MAX >= tpg.THK).ToList();
if (tpg.CRU_PIEs_ACT.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).Count() == 0).Count() > 0)
{
tpg.ChkDiffStdl = "0";
}
else
{
TB_PLATE_FIC tpf = tpg.CRU_PIEs_ACT.OrderBy(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).FirstOrDefault().STL_SEQ).FirstOrDefault();
int STL_SEQ = cP_NISCOs.Where(q => q.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ;
if (tpg.CRU_PIEs_ACT.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).FirstOrDefault().STL_SEQ == STL_SEQ && ChkDiffStdl(iSlab, p.Order)).Count() > 0)
{ {
tpg.ChkDiffStdl = "1"; tpg.ChkDiffStdl = "1";
} }
else else
{ {
IList<CP_NISCO_CHMC_SL> cP_NISCOs = glCpNiscoChmcSl.Where(p => p.ZZ_PLT == "C2" tpg.ChkDiffStdl = "0";
&& p.STLGRD == iSlab.STLGRD
&& p.THK_MIN < tpg.THK
&& p.THK_MAX >= tpg.THK).ToList();
if (tpg.CRU_PIEs_ACT.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).Count() == 0).Count() > 0)
{
tpg.ChkDiffStdl = "0";
}
else
{
TB_PLATE_FIC tpf = tpg.CRU_PIEs_ACT.OrderBy(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).FirstOrDefault().STL_SEQ).FirstOrDefault();
int STL_SEQ = cP_NISCOs.Where(q => q.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ;
if (tpg.CRU_PIEs_ACT.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).FirstOrDefault().STL_SEQ == STL_SEQ && ChkDiffStdl(iSlab, p.Order)).Count() > 0)
{
tpg.ChkDiffStdl = "1";
}
else
{
tpg.ChkDiffStdl = "0";
}
}
} }
// } }
}
// }
//} //}
decimal YIELD_WGT = 0; decimal YIELD_WGT = 0;
if (glYIElD_CONTROL.Where(p => p.STLGRD == tpg.STLGRD && p.PLT == "C2").Count() > 0) if (glYIElD_CONTROL.Where(p => p.STLGRD == tpg.STLGRD && p.PLT == "C2").Count() > 0)
{ {

@ -966,7 +966,7 @@ namespace SlabHandle
DataTable dtCheck = new DataTable(); DataTable dtCheck = new DataTable();
IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>(); IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>();
strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL"); strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL CNCS WHERE NVL( CNCS.CLASS_FL , ' ')<>' '");
try try
{ {

@ -999,7 +999,7 @@ namespace SlabHandle
DataTable dtCheck = new DataTable(); DataTable dtCheck = new DataTable();
IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>(); IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>();
strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL"); strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL CNCS WHERE NVL( CNCS.CLASS_FL , ' ')<>' '");
try try
{ {

@ -80,5 +80,8 @@ namespace SlabHandle
public string ZZ_PLT_DESP { get; set; } public string ZZ_PLT_DESP { get; set; }
//分类
[Persistent("CLASS_FL"), DisplayName("分类")]
public string CLASS_FL { get; set; }
} }
} }

@ -1713,18 +1713,24 @@ namespace SlabHandle
{ {
flag = true; flag = true;
} }
if (tpg.CRU_PIEs.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC).Count() > 0) //获取分类
string strCLASS_FL = string.Empty;
if (cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp.STDSPEC).Count() > 0)
{ {
int ints = cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC).FirstOrDefault().STL_SEQ; strCLASS_FL = cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp.STDSPEC).FirstOrDefault().CLASS_FL;
}
if (tpg.CRU_PIEs.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC && q.CLASS_FL == strCLASS_FL).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC && q.CLASS_FL == strCLASS_FL).Count() > 0)
{
int ints = cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
foreach (TB_PLATE_FIC tpf in tpg.CRU_PIEs) foreach (TB_PLATE_FIC tpf in tpg.CRU_PIEs)
{ {
ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC).FirstOrDefault().STL_SEQ; ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.Order.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
} }
if (ints == cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC).FirstOrDefault().STL_SEQ && iTbPlateGrp_S.ChkDiffStdl == "1") if (ints == cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ && iTbPlateGrp_S.ChkDiffStdl == "1")
{ {
flag = true; flag = true;
} }
if (tpg.CRU_PIEs.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.Order)).Count() > 0) if (tpg.CRU_PIEs.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.Order.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.Order)).Count() > 0)
{ {
flag = true; flag = true;
} }
@ -1866,18 +1872,24 @@ namespace SlabHandle
{ {
flag = true; flag = true;
} }
if (tB_PLATE_GRP_THKGRP.THK_GRP.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.STDSPEC).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC).Count() > 0) //获取分类
string strCLASS_FL = string.Empty;
if (cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp.STDSPEC).Count() > 0)
{
strCLASS_FL = cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp.STDSPEC).FirstOrDefault().CLASS_FL;
}
if (tB_PLATE_GRP_THKGRP.THK_GRP.All(p => cP_NISCOs.Where(q => q.STDSPEC == p.STDSPEC && q.CLASS_FL == strCLASS_FL).Count() > 0) && cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC && q.CLASS_FL == strCLASS_FL).Count() > 0)
{ {
int ints = cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC).FirstOrDefault().STL_SEQ; int ints = cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
foreach (TB_PLATE_GRP tpf in tB_PLATE_GRP_THKGRP.THK_GRP) foreach (TB_PLATE_GRP tpf in tB_PLATE_GRP_THKGRP.THK_GRP)
{ {
ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.STDSPEC).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.STDSPEC).FirstOrDefault().STL_SEQ; ints = cP_NISCOs.Where(p => p.STDSPEC == tpf.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ > ints ? ints : cP_NISCOs.Where(p => p.STDSPEC == tpf.STDSPEC && p.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ;
} }
if (ints == cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC).FirstOrDefault().STL_SEQ && iTbPlateGrp_S.ChkDiffStdl == "1") if (ints == cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_S.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ && iTbPlateGrp_S.ChkDiffStdl == "1")
{ {
flag = true; flag = true;
} }
if (tB_PLATE_GRP_THKGRP.THK_GRP.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.STDSPEC).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.CRU_PIEs.FirstOrDefault().Order)).Count() > 0) if (tB_PLATE_GRP_THKGRP.THK_GRP.Where(p => cP_NISCOs.Where(q => q.STDSPEC == p.STDSPEC && q.CLASS_FL == strCLASS_FL).FirstOrDefault().STL_SEQ == ints && ChkDiffStdl(tSlab, p.CRU_PIEs.FirstOrDefault().Order)).Count() > 0)
{ {
flag = true; flag = true;
} }
@ -4567,7 +4579,14 @@ namespace SlabHandle
{ {
continue; continue;
} }
if (iTbPlateGrp_F.STDSPEC != iTbPlateGrp_S.STDSPEC && cP_NISCOs.Where(p => p.STDSPEC == iTbPlateGrp_S.STDSPEC || p.STDSPEC == iTbPlateGrp_F.STDSPEC).Count() < 2) //获取分类
string strCLASS_FL = string.Empty;
if (cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_F.STDSPEC).Count() > 0)
{
strCLASS_FL = cP_NISCOs.Where(q => q.STDSPEC == iTbPlateGrp_F.STDSPEC).FirstOrDefault().CLASS_FL;
}
if (iTbPlateGrp_F.STDSPEC != iTbPlateGrp_S.STDSPEC && cP_NISCOs.Where(p => p.STDSPEC == iTbPlateGrp_S.STDSPEC || p.STDSPEC == iTbPlateGrp_F.STDSPEC && (p.CLASS_FL==strCLASS_FL)).Count() < 2)
{ {
continue; continue;
} }

@ -944,7 +944,7 @@ namespace SlabHandle
DataTable dtCheck = new DataTable(); DataTable dtCheck = new DataTable();
IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>(); IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>();
strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL"); strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL CNCS WHERE NVL( CNCS.CLASS_FL , ' ')<>' '");
try try
{ {

@ -961,7 +961,7 @@ namespace SlabHandle
DataTable dtCheck = new DataTable(); DataTable dtCheck = new DataTable();
IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>(); IList<CP_NISCO_CHMC_SL> ltCP_NISCO_CHMC_SL = new List<CP_NISCO_CHMC_SL>();
strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL"); strSql.AppendLine("SELECT * FROM NISCO.CP_NISCO_CHMC_SL CNCS WHERE NVL( CNCS.CLASS_FL , ' ')<>' '");
try try
{ {

Loading…
Cancel
Save