@ -90,7 +90,7 @@ namespace SlabHandle
strSql . AppendLine ( "WHERE 1 = 1 " ) ;
////TODO:测试数据
strSql . AppendLine ( " AND A.SLAB_NO = '24 3040833 4'") ;
strSql . AppendLine ( " AND A.SLAB_NO = '24 2045944 4'") ;
//if (strWHere != string.Empty)
//{
@ -194,39 +194,38 @@ namespace SlabHandle
strSql . AppendLine ( " SELECT* FROM(SELECT QQM.*," ) ;
strSql . AppendLine ( " rank() over(partition by QQM.ord_no, QQM.ord_item order by knd desc) rk" ) ;
strSql . AppendLine ( " from NISCO.QP_QLTY_MATR QQM " ) ;
//strSql.AppendLine(" where(QQM.ORD_NO || '-' || QQM.ORD_ITEM) IN( ");
strSql . AppendLine ( " where(QQM.ORD_NO, QQM.ORD_ITEM) IN( " ) ;
//strSql.AppendLine(" 'OMK24050015-009' ");
strSql . AppendLine ( " where(QQM.ORD_NO || '-' || QQM.ORD_ITEM) IN( " ) ;
strSql . AppendLine ( " 'OM624050010-004','OMG24060013-001' " ) ;
//OMK24010042-002
strSql . AppendLine ( " SELECT " ) ;
strSql . AppendLine ( " TO_CHAR(BOI.ORD_NO), TO_CHAR(BOI.ORD_ITEM) " ) ;
strSql . AppendLine ( "FROM NISCO.cp_prc CPP " ) ;
strSql . AppendLine ( "INNER JOIN " ) ;
strSql . AppendLine ( "NISCO.BP_ORDER_ITEM boi " ) ;
strSql . AppendLine ( "ON BOI.ORD_NO = CPP.ORD_NO " ) ;
strSql . AppendLine ( "AND BOI.ORD_ITEM = CPP.ORD_ITEM " ) ;
strSql . AppendLine ( "AND BOI.ORD_WID<> 0 " ) ;
strSql . AppendLine ( "AND BOI.ORD_LEN<> 0 " ) ;
strSql . AppendLine ( "AND BOI.ORD_THK<> 0 " ) ;
strSql . AppendLine ( "WHERE 1=1 " ) ; // ROUND(CPP.ORD_REM_WGT / (((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85)) >= 1");
strSql . AppendLine ( " AND " ) ;
strSql . AppendLine ( " (SELECT COUNT(A.REQ_SEQ_NO) " ) ;
strSql . AppendLine ( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B" ) ;
strSql . AppendLine ( " WHERE " ) ;
strSql . AppendLine ( " 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM" ) ;
strSql . AppendLine ( " AND A.BLOCK_SEQ >= '01' " ) ;
strSql . AppendLine ( " AND A.SEQ >= '01' " ) ;
strSql . AppendLine ( " And B.REQ_SEQ_NO = A.REQ_SEQ_NO " ) ;
strSql . AppendLine ( " AND B.REC_STS = '1') + GREATEST(0, (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) / (((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85) )>= 0.95" ) ;
strSql . AppendLine ( " AND boi.PROD_CD = 'PP' " ) ;
strSql . AppendLine ( " AND boi.REC_STS = '2' " ) ;
strSql . AppendLine ( " and boi.ORD_STS IN('E') " ) ;
strSql . AppendLine ( " AND (boi.ord_knd ='A' OR (boi.ord_knd ='T' AND (SELECT COUNT(*) FROM NISCO.BP_ODER_XY BOXY WHERE BOXY.ORDER_NO=BOI.ORD_NO AND BOXY.ORDER_ITEM=BOI.ORD_ITEM )>0)) " ) ;
strSql . AppendLine ( "AND boi.CFM_MILL_PLT='C3' " ) ;
strSql . AppendLine ( "AND (boi.ORD_NO NOT LIKE 'OMZ%' OR (boi.ORD_NO LIKE 'OMZ%' AND boi.STDSPEC LIKE '%KRZN-A%'))" ) ;
strSql . AppendLine ( "AND((BOI.CUST_DEL_TO_DATE > TO_CHAR(SYSDATE - 183, 'YYYYMMdd')) OR(boi.ORD_NO LIKE 'OMA%'))" ) ;
//strSql.AppendLine( " SELECT ");
//strSql.AppendLine( " TO_CHAR(BOI.ORD_NO), TO_CHAR(BOI.ORD_ITEM) ");
//strSql.AppendLine( "FROM NISCO.cp_prc CPP ");
//strSql.AppendLine( "INNER JOIN ");
//strSql.AppendLine( "NISCO.BP_ORDER_ITEM boi ");
//strSql.AppendLine( "ON BOI.ORD_NO = CPP.ORD_NO ");
//strSql.AppendLine( "AND BOI.ORD_ITEM = CPP.ORD_ITEM ");
//strSql.AppendLine( "AND BOI.ORD_WID<> 0 ");
//strSql.AppendLine( "AND BOI.ORD_LEN<> 0 ");
//strSql.AppendLine( "AND BOI.ORD_THK<> 0 ");
//strSql.AppendLine("WHERE 1=1 "); // ROUND(CPP.ORD_REM_WGT / (((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85)) >= 1");
//strSql.AppendLine(" AND ") ;
//strSql.AppendLine(" (SELECT COUNT(A.REQ_SEQ_NO) ") ;
//strSql.AppendLine( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B");
//strSql.AppendLine( " WHERE ");
//strSql.AppendLine( " 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM");
//strSql.AppendLine( " AND A.BLOCK_SEQ >= '01' ");
//strSql.AppendLine( " AND A.SEQ >= '01' ");
//strSql.AppendLine( " And B.REQ_SEQ_NO = A.REQ_SEQ_NO ");
//strSql.AppendLine( " AND B.REC_STS = '1') + GREATEST(0, (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) / (((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85) )>= 0.95");
//strSql.AppendLine(" AND boi.PROD_CD = 'PP' ") ;
//strSql.AppendLine(" AND boi.REC_STS = '2' ") ;
//strSql.AppendLine(" and boi.ORD_STS IN('E') ") ;
//strSql.AppendLine( " AND (boi.ord_knd ='A' OR (boi.ord_knd ='T' AND (SELECT COUNT(*) FROM NISCO.BP_ODER_XY BOXY WHERE BOXY.ORDER_NO=BOI.ORD_NO AND BOXY.ORDER_ITEM=BOI.ORD_ITEM )>0)) ");
//strSql.AppendLine("AND boi.CFM_MILL_PLT='C3' ") ;
//strSql.AppendLine( "AND (boi.ORD_NO NOT LIKE 'OMZ%' OR (boi.ORD_NO LIKE 'OMZ%' AND boi.STDSPEC LIKE '%KRZN-A%'))");
//strSql.AppendLine( "AND((BOI.CUST_DEL_TO_DATE > TO_CHAR(SYSDATE - 183, 'YYYYMMdd')) OR(boi.ORD_NO LIKE 'OMA%'))");
strSql . AppendLine ( " )" ) ;
strSql . AppendLine ( ") T WHERE T.RK = 1" ) ;
try
@ -356,25 +355,24 @@ namespace SlabHandle
strSql . AppendLine ( "WHERE 1 = 1 " ) ;
//strSql.AppendLine(" AND BOI.ORD_NO || '-' || BOI.ORD_ITEM IN ('OMK24050015-009')"); //OMK24050015 009
strSql . AppendLine ( " AND BOI.ORD_NO || '-' || BOI.ORD_ITEM IN ('OM624050010-004','OMG24060013-001')" ) ;
strSql . AppendLine ( " AND " ) ;
strSql . AppendLine ( " (SELECT COUNT(A.REQ_SEQ_NO) " ) ;
strSql . AppendLine ( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B" ) ;
strSql . AppendLine ( " WHERE " ) ;
strSql . AppendLine ( " 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM" ) ;
strSql . AppendLine ( " AND A.BLOCK_SEQ >= '01' " ) ;
strSql . AppendLine ( " AND A.SEQ >= '01' " ) ;
strSql . AppendLine ( " And B.REQ_SEQ_NO = A.REQ_SEQ_NO " ) ;
strSql . AppendLine ( " AND B.REC_STS = '1') + GREATEST(0, (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) / (((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85)) >= 0.95" ) ;
strSql . AppendLine ( " AND boi.PROD_CD = 'PP' " ) ;
strSql . AppendLine ( "AND boi.REC_STS = '2' " ) ;
strSql . AppendLine ( "and boi.ORD_STS IN('E') " ) ;
strSql . AppendLine ( "AND (boi.ord_knd ='A' OR (boi.ord_knd ='T' AND (SELECT COUNT(*) FROM NISCO.BP_ODER_XY BOXY WHERE BOXY.ORDER_NO=BOI.ORD_NO AND BOXY.ORDER_ITEM=BOI.ORD_ITEM )>0)) " ) ;
strSql . AppendLine ( "AND boi.CFM_MILL_PLT='C3' " ) ;
strSql . AppendLine ( "AND (boi.ORD_NO NOT LIKE 'OMZ%' OR (boi.ORD_NO LIKE 'OMZ%' AND boi.STDSPEC LIKE '%KRZN-A%'))" ) ;
strSql . AppendLine ( "AND((BOI.CUST_DEL_TO_DATE > TO_CHAR(SYSDATE - 183, 'YYYYMMdd')) OR(boi.ORD_NO LIKE 'OMA%'))" ) ;
//strSql.AppendLine(" AND ");
//strSql.AppendLine(" (SELECT COUNT(A.REQ_SEQ_NO) ");
//strSql.AppendLine(" FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B");
//strSql.AppendLine(" WHERE ");
//strSql.AppendLine(" 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM");
//strSql.AppendLine(" AND A.BLOCK_SEQ >= '01' ");
//strSql.AppendLine(" AND A.SEQ >= '01' ");
//strSql.AppendLine(" And B.REQ_SEQ_NO = A.REQ_SEQ_NO ");
//strSql.AppendLine(" AND B.REC_STS = '1') + GREATEST(0, (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) / (((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85)) >= 0.95");
//strSql.AppendLine(" AND boi.PROD_CD = 'PP' ");
//strSql.AppendLine("AND boi.REC_STS = '2' ");
//strSql.AppendLine("and boi.ORD_STS IN('E') ");
//strSql.AppendLine("AND (boi.ord_knd ='A' OR (boi.ord_knd ='T' AND (SELECT COUNT(*) FROM NISCO.BP_ODER_XY BOXY WHERE BOXY.ORDER_NO=BOI.ORD_NO AND BOXY.ORDER_ITEM=BOI.ORD_ITEM )>0)) ");
//strSql.AppendLine("AND boi.CFM_MILL_PLT='C3' ");
//strSql.AppendLine("AND (boi.ORD_NO NOT LIKE 'OMZ%' OR (boi.ORD_NO LIKE 'OMZ%' AND boi.STDSPEC LIKE '%KRZN-A%'))");
//strSql.AppendLine("AND((BOI.CUST_DEL_TO_DATE > TO_CHAR(SYSDATE - 183, 'YYYYMMdd')) OR(boi.ORD_NO LIKE 'OMA%'))");
try
{
@ -408,34 +406,34 @@ namespace SlabHandle
IList < QP_QLTY_CHEM > orderChemistrys = new List < QP_QLTY_CHEM > ( ) ;
strSql . AppendLine ( "SELECT T.*FROM(" ) ;
strSql . AppendLine ( "SELECT QQC.*, rank() over(partition by QQC.ord_no, QQC.ord_item order by knd desc) rk from NISCO.QP_QLTY_CHEM QQC where (QQC.ORD_NO , QQC.ORD_ITEM) IN(") ;
//strSql.AppendLine(" 'OMK24050015-009'") ;
strSql . AppendLine ( "SELECT" ) ;
strSql . AppendLine ( "TO_CHAR(BOI.ORD_NO), TO_CHAR(BOI.ORD_ITEM)" ) ;
strSql . AppendLine ( "FROM NISCO.cp_prc CPP " ) ;
strSql . AppendLine ( "INNER JOIN " ) ;
strSql . AppendLine ( "NISCO.BP_ORDER_ITEM boi " ) ;
strSql . AppendLine ( "ON BOI.ORD_NO = CPP.ORD_NO " ) ;
strSql . AppendLine ( "AND BOI.ORD_ITEM = CPP.ORD_ITEM " ) ;
strSql . AppendLine ( "AND BOI.ORD_WID <> 0 " ) ;
strSql . AppendLine ( "AND BOI.ORD_LEN <> 0 " ) ;
strSql . AppendLine ( "AND BOI.ORD_THK <> 0 " ) ;
strSql . AppendLine ( " WHERE 1=1 AND " ) ;
strSql . AppendLine ( " (SELECT COUNT(A.REQ_SEQ_NO) " ) ;
strSql . AppendLine ( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B" ) ;
strSql . AppendLine ( " WHERE " ) ;
strSql . AppendLine ( " 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM" ) ;
strSql . AppendLine ( " AND A.BLOCK_SEQ >= '01' " ) ;
strSql . AppendLine ( " AND A.SEQ >= '01' " ) ;
strSql . AppendLine ( " And B.REQ_SEQ_NO = A.REQ_SEQ_NO " ) ;
strSql . AppendLine ( " AND B.REC_STS = '1') + GREATEST(0, (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) / (((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85)) >= 0.95" ) ;
strSql . AppendLine ( "AND boi.PROD_CD = 'PP'" ) ;
strSql . AppendLine ( "AND boi.REC_STS = '2' " ) ;
strSql . AppendLine ( "and boi.ORD_STS IN('E') " ) ;
strSql . AppendLine ( "AND (boi.ord_knd ='A' OR (boi.ord_knd ='T' AND (SELECT COUNT(*) FROM NISCO.BP_ODER_XY BOXY WHERE BOXY.ORDER_NO=BOI.ORD_NO AND BOXY.ORDER_ITEM=BOI.ORD_ITEM )>0)) " ) ;
strSql . AppendLine ( "AND boi.CFM_MILL_PLT='C3' " ) ;
strSql . AppendLine ( "AND (boi.ORD_NO NOT LIKE 'OMZ%' OR (boi.ORD_NO LIKE 'OMZ%' AND boi.STDSPEC LIKE '%KRZN-A%'))" ) ;
strSql . AppendLine ( "AND((BOI.CUST_DEL_TO_DATE > TO_CHAR(SYSDATE - 183, 'YYYYMMdd')) OR(boi.ORD_NO LIKE 'OMA%'))" ) ;
strSql . AppendLine ( "SELECT QQC.*, rank() over(partition by QQC.ord_no, QQC.ord_item order by knd desc) rk from NISCO.QP_QLTY_CHEM QQC where (QQC.ORD_NO || '-' || QQC.ORD_ITEM) IN(") ;
strSql . AppendLine ( " 'OM624050010-004','OMG24060013-001'" ) ;
//strSql.AppendLine("SELECT") ;
//strSql.AppendLine( "TO_CHAR(BOI.ORD_NO), TO_CHAR(BOI.ORD_ITEM)");
//strSql.AppendLine( "FROM NISCO.cp_prc CPP ");
//strSql.AppendLine( "INNER JOIN ");
//strSql.AppendLine( "NISCO.BP_ORDER_ITEM boi ");
//strSql.AppendLine( "ON BOI.ORD_NO = CPP.ORD_NO ");
//strSql.AppendLine( "AND BOI.ORD_ITEM = CPP.ORD_ITEM ");
//strSql.AppendLine( "AND BOI.ORD_WID <> 0 ");
//strSql.AppendLine( "AND BOI.ORD_LEN <> 0 ");
//strSql.AppendLine( "AND BOI.ORD_THK <> 0 ");
//strSql.AppendLine( " WHERE 1=1 AND ");
//strSql.AppendLine(" (SELECT COUNT(A.REQ_SEQ_NO) ") ;
//strSql.AppendLine( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B");
//strSql.AppendLine( " WHERE ");
//strSql.AppendLine( " 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM");
//strSql.AppendLine( " AND A.BLOCK_SEQ >= '01' ");
//strSql.AppendLine( " AND A.SEQ >= '01' ");
//strSql.AppendLine( " And B.REQ_SEQ_NO = A.REQ_SEQ_NO ");
//strSql.AppendLine( " AND B.REC_STS = '1') + GREATEST(0, (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) / (((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85)) >= 0.95");
//strSql.AppendLine("AND boi.PROD_CD = 'PP'") ;
//strSql.AppendLine("AND boi.REC_STS = '2' ") ;
//strSql.AppendLine("and boi.ORD_STS IN('E') ") ;
//strSql.AppendLine( "AND (boi.ord_knd ='A' OR (boi.ord_knd ='T' AND (SELECT COUNT(*) FROM NISCO.BP_ODER_XY BOXY WHERE BOXY.ORDER_NO=BOI.ORD_NO AND BOXY.ORDER_ITEM=BOI.ORD_ITEM )>0)) ");
//strSql.AppendLine("AND boi.CFM_MILL_PLT='C3' ") ;
//strSql.AppendLine( "AND (boi.ORD_NO NOT LIKE 'OMZ%' OR (boi.ORD_NO LIKE 'OMZ%' AND boi.STDSPEC LIKE '%KRZN-A%'))");
//strSql.AppendLine( "AND((BOI.CUST_DEL_TO_DATE > TO_CHAR(SYSDATE - 183, 'YYYYMMdd')) OR(boi.ORD_NO LIKE 'OMA%'))");
strSql . AppendLine ( ") " ) ;
strSql . AppendLine ( " AND QQC.KND IN ('1','2') ) T WHERE T.rk = 1 " ) ;
@ -1287,7 +1285,7 @@ namespace SlabHandle
strSql . AppendLine ( "LEFT JOIN NISCO.QP_NISCO_CHMC QNC ON QNC.STLGRD = A.STLGRD" ) ;
strSql . AppendLine ( "WHERE 1 = 1 " ) ;
strSql . AppendLine ( " AND A.SLAB_NO = '24 3040833 4 '") ;
strSql . AppendLine ( " AND A.SLAB_NO = '24 2045944 4 '") ;
//strSql.AppendLine(" AND (A.CUR_INV IN('ZB','ZZ','HB','B1','52','C7','HC') " +
@ -1362,7 +1360,7 @@ namespace SlabHandle
strSql . AppendLine ( " FROM NISCO.FP_SLAB fs " ) ;
strSql . AppendLine ( " START WITH fs.SLAB_NO " ) ;
strSql . AppendLine ( " IN " ) ;
strSql . AppendLine ( " ( '24 30408334 ' ") ;
strSql . AppendLine ( " ( '24 20459444 ' ") ;
//strSql.AppendLine(" SELECT DISTINCT A.SLAB_NO ");
@ -1487,7 +1485,7 @@ namespace SlabHandle
strSql . AppendLine ( " FROM NISCO.FP_SLAB fs " ) ;
strSql . AppendLine ( " START WITH fs.SLAB_NO " ) ;
strSql . AppendLine ( " IN " ) ;
strSql . AppendLine ( " ( '24 30408334 ' ") ;
strSql . AppendLine ( " ( '24 20459444 ' ") ;
//strSql.AppendLine(" SELECT DISTINCT A.SLAB_NO ");