@ -90,7 +90,7 @@ namespace SlabHandle
strSql . AppendLine ( "WHERE 1 = 1 " ) ;
strSql . AppendLine ( "WHERE 1 = 1 " ) ;
////TODO:测试数据
////TODO:测试数据
strSql . AppendLine ( " AND A.SLAB_NO = '2 310768931 '") ;
strSql . AppendLine ( " AND A.SLAB_NO = '2 430408334 '") ;
//if (strWHere != string.Empty)
//if (strWHere != string.Empty)
//{
//{
@ -194,38 +194,39 @@ namespace SlabHandle
strSql . AppendLine ( " SELECT* FROM(SELECT QQM.*," ) ;
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 ( " 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 ( " 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 ( " 'OMK24040013-005' " ) ;
strSql . AppendLine ( " where(QQM.ORD_NO, QQM.ORD_ITEM) IN( " ) ;
//strSql.AppendLine(" 'OMK24050015-009' ");
//OMK24010042-002
//OMK24010042-002
//strSql.AppendLine( " SELECT ");
strSql . AppendLine ( " SELECT " ) ;
//strSql.AppendLine( " TO_CHAR(BOI.ORD_NO), TO_CHAR(BOI.ORD_ITEM) ");
strSql . AppendLine ( " TO_CHAR(BOI.ORD_NO), TO_CHAR(BOI.ORD_ITEM) " ) ;
//strSql.AppendLine( "FROM NISCO.cp_prc CPP ");
strSql . AppendLine ( "FROM NISCO.cp_prc CPP " ) ;
//strSql.AppendLine( "INNER JOIN ");
strSql . AppendLine ( "INNER JOIN " ) ;
//strSql.AppendLine( "NISCO.BP_ORDER_ITEM boi ");
strSql . AppendLine ( "NISCO.BP_ORDER_ITEM boi " ) ;
//strSql.AppendLine( "ON BOI.ORD_NO = CPP.ORD_NO ");
strSql . AppendLine ( "ON BOI.ORD_NO = CPP.ORD_NO " ) ;
//strSql.AppendLine( "AND BOI.ORD_ITEM = CPP.ORD_ITEM ");
strSql . AppendLine ( "AND BOI.ORD_ITEM = CPP.ORD_ITEM " ) ;
//strSql.AppendLine( "AND BOI.ORD_WID<> 0 ");
strSql . AppendLine ( "AND BOI.ORD_WID<> 0 " ) ;
//strSql.AppendLine( "AND BOI.ORD_LEN<> 0 ");
strSql . AppendLine ( "AND BOI.ORD_LEN<> 0 " ) ;
//strSql.AppendLine( "AND BOI.ORD_THK<> 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 ( "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 ( " AND " ) ;
//strSql.AppendLine(" (SELECT COUNT(A.REQ_SEQ_NO) ") ;
strSql . AppendLine ( " (SELECT COUNT(A.REQ_SEQ_NO) " ) ;
//strSql.AppendLine( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B");
strSql . AppendLine ( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B" ) ;
//strSql.AppendLine( " WHERE ");
strSql . AppendLine ( " WHERE " ) ;
//strSql.AppendLine( " 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM");
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.BLOCK_SEQ >= '01' " ) ;
//strSql.AppendLine( " AND A.SEQ >= '01' ");
strSql . AppendLine ( " AND A.SEQ >= '01' " ) ;
//strSql.AppendLine( " And B.REQ_SEQ_NO = A.REQ_SEQ_NO ");
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 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.PROD_CD = 'PP' " ) ;
//strSql.AppendLine(" AND boi.REC_STS = '2' ") ;
strSql . AppendLine ( " AND boi.REC_STS = '2' " ) ;
//strSql.AppendLine(" and boi.ORD_STS IN('E') ") ;
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.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.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.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((BOI.CUST_DEL_TO_DATE > TO_CHAR(SYSDATE - 183, 'YYYYMMdd')) OR(boi.ORD_NO LIKE 'OMA%'))" ) ;
strSql . AppendLine ( " )" ) ;
strSql . AppendLine ( " )" ) ;
strSql . AppendLine ( ") T WHERE T.RK = 1" ) ;
strSql . AppendLine ( ") T WHERE T.RK = 1" ) ;
try
try
@ -355,24 +356,25 @@ namespace SlabHandle
strSql . AppendLine ( "WHERE 1 = 1 " ) ;
strSql . AppendLine ( "WHERE 1 = 1 " ) ;
strSql . AppendLine ( " AND BOI.ORD_NO || '-' || BOI.ORD_ITEM IN ('OMK24040013-005')" ) ;
//strSql.AppendLine(" AND BOI.ORD_NO || '-' || BOI.ORD_ITEM IN ('OMK24050015-009')"); //OMK24050015 009
//strSql.AppendLine(" AND ");
//strSql.AppendLine(" (SELECT COUNT(A.REQ_SEQ_NO) ");
strSql . AppendLine ( " AND " ) ;
//strSql.AppendLine(" FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B");
strSql . AppendLine ( " (SELECT COUNT(A.REQ_SEQ_NO) " ) ;
//strSql.AppendLine(" WHERE ");
strSql . AppendLine ( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B" ) ;
//strSql.AppendLine(" 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM");
strSql . AppendLine ( " WHERE " ) ;
//strSql.AppendLine(" AND A.BLOCK_SEQ >= '01' ");
strSql . AppendLine ( " 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM" ) ;
//strSql.AppendLine(" AND A.SEQ >= '01' ");
strSql . AppendLine ( " AND A.BLOCK_SEQ >= '01' " ) ;
//strSql.AppendLine(" And B.REQ_SEQ_NO = A.REQ_SEQ_NO ");
strSql . AppendLine ( " AND A.SEQ >= '01' " ) ;
//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 B.REQ_SEQ_NO = A.REQ_SEQ_NO " ) ;
//strSql.AppendLine(" AND boi.PROD_CD = 'PP' ");
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.REC_STS = '2' ");
strSql . AppendLine ( " AND boi.PROD_CD = 'PP' " ) ;
//strSql.AppendLine("and boi.ORD_STS IN('E') ");
strSql . AppendLine ( "AND boi.REC_STS = '2' " ) ;
//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.ORD_STS IN('E') " ) ;
//strSql.AppendLine("AND boi.CFM_MILL_PLT='C3' ");
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.ORD_NO NOT LIKE 'OMZ%' OR (boi.ORD_NO LIKE 'OMZ%' AND boi.STDSPEC LIKE '%KRZN-A%'))");
strSql . AppendLine ( "AND boi.CFM_MILL_PLT='C3' " ) ;
//strSql.AppendLine("AND((BOI.CUST_DEL_TO_DATE > TO_CHAR(SYSDATE - 183, 'YYYYMMdd')) OR(boi.ORD_NO LIKE 'OMA%'))");
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
try
{
{
@ -406,34 +408,34 @@ namespace SlabHandle
IList < QP_QLTY_CHEM > orderChemistrys = new List < QP_QLTY_CHEM > ( ) ;
IList < QP_QLTY_CHEM > orderChemistrys = new List < QP_QLTY_CHEM > ( ) ;
strSql . AppendLine ( "SELECT T.*FROM(" ) ;
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 ( "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 ( " 'OMK24040013-005'" ) ;
//strSql.AppendLine(" 'OMK24050015-009'") ;
//strSql.AppendLine("SELECT") ;
strSql . AppendLine ( "SELECT" ) ;
//strSql.AppendLine( "TO_CHAR(BOI.ORD_NO), TO_CHAR(BOI.ORD_ITEM)");
strSql . AppendLine ( "TO_CHAR(BOI.ORD_NO), TO_CHAR(BOI.ORD_ITEM)" ) ;
//strSql.AppendLine( "FROM NISCO.cp_prc CPP ");
strSql . AppendLine ( "FROM NISCO.cp_prc CPP " ) ;
//strSql.AppendLine( "INNER JOIN ");
strSql . AppendLine ( "INNER JOIN " ) ;
//strSql.AppendLine( "NISCO.BP_ORDER_ITEM boi ");
strSql . AppendLine ( "NISCO.BP_ORDER_ITEM boi " ) ;
//strSql.AppendLine( "ON BOI.ORD_NO = CPP.ORD_NO ");
strSql . AppendLine ( "ON BOI.ORD_NO = CPP.ORD_NO " ) ;
//strSql.AppendLine( "AND BOI.ORD_ITEM = CPP.ORD_ITEM ");
strSql . AppendLine ( "AND BOI.ORD_ITEM = CPP.ORD_ITEM " ) ;
//strSql.AppendLine( "AND BOI.ORD_WID <> 0 ");
strSql . AppendLine ( "AND BOI.ORD_WID <> 0 " ) ;
//strSql.AppendLine( "AND BOI.ORD_LEN <> 0 ");
strSql . AppendLine ( "AND BOI.ORD_LEN <> 0 " ) ;
//strSql.AppendLine( "AND BOI.ORD_THK <> 0 ");
strSql . AppendLine ( "AND BOI.ORD_THK <> 0 " ) ;
//strSql.AppendLine( " WHERE 1=1 AND ");
strSql . AppendLine ( " WHERE 1=1 AND " ) ;
//strSql.AppendLine(" (SELECT COUNT(A.REQ_SEQ_NO) ") ;
strSql . AppendLine ( " (SELECT COUNT(A.REQ_SEQ_NO) " ) ;
//strSql.AppendLine( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B");
strSql . AppendLine ( " FROM NISCO.EP_REQ_SLAB_D A, NISCO.EP_REQ_SLAB B" ) ;
//strSql.AppendLine( " WHERE ");
strSql . AppendLine ( " WHERE " ) ;
//strSql.AppendLine( " 1 = 1 AND A.ORD_NO = BOI.ORD_NO AND A.ORD_ITEM = BOI.ORD_ITEM");
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.BLOCK_SEQ >= '01' " ) ;
//strSql.AppendLine( " AND A.SEQ >= '01' ");
strSql . AppendLine ( " AND A.SEQ >= '01' " ) ;
//strSql.AppendLine( " And B.REQ_SEQ_NO = A.REQ_SEQ_NO ");
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 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.PROD_CD = 'PP'" ) ;
//strSql.AppendLine("AND boi.REC_STS = '2' ") ;
strSql . AppendLine ( "AND boi.REC_STS = '2' " ) ;
//strSql.AppendLine("and boi.ORD_STS IN('E') ") ;
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.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.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.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((BOI.CUST_DEL_TO_DATE > TO_CHAR(SYSDATE - 183, 'YYYYMMdd')) OR(boi.ORD_NO LIKE 'OMA%'))" ) ;
strSql . AppendLine ( ") " ) ;
strSql . AppendLine ( ") " ) ;
strSql . AppendLine ( " AND QQC.KND IN ('1','2') ) T WHERE T.rk = 1 " ) ;
strSql . AppendLine ( " AND QQC.KND IN ('1','2') ) T WHERE T.rk = 1 " ) ;
@ -1285,7 +1287,7 @@ namespace SlabHandle
strSql . AppendLine ( "LEFT JOIN NISCO.QP_NISCO_CHMC QNC ON QNC.STLGRD = A.STLGRD" ) ;
strSql . AppendLine ( "LEFT JOIN NISCO.QP_NISCO_CHMC QNC ON QNC.STLGRD = A.STLGRD" ) ;
strSql . AppendLine ( "WHERE 1 = 1 " ) ;
strSql . AppendLine ( "WHERE 1 = 1 " ) ;
strSql . AppendLine ( " AND A.SLAB_NO = '2 310768931 '") ;
strSql . AppendLine ( " AND A.SLAB_NO = '2 430408334 '") ;
//strSql.AppendLine(" AND (A.CUR_INV IN('ZB','ZZ','HB','B1','52','C7','HC') " +
//strSql.AppendLine(" AND (A.CUR_INV IN('ZB','ZZ','HB','B1','52','C7','HC') " +
@ -1360,7 +1362,7 @@ namespace SlabHandle
strSql . AppendLine ( " FROM NISCO.FP_SLAB fs " ) ;
strSql . AppendLine ( " FROM NISCO.FP_SLAB fs " ) ;
strSql . AppendLine ( " START WITH fs.SLAB_NO " ) ;
strSql . AppendLine ( " START WITH fs.SLAB_NO " ) ;
strSql . AppendLine ( " IN " ) ;
strSql . AppendLine ( " IN " ) ;
strSql . AppendLine ( " ( '2 310768931 ' ") ;
strSql . AppendLine ( " ( '2 430408334 ' ") ;
//strSql.AppendLine(" SELECT DISTINCT A.SLAB_NO ");
//strSql.AppendLine(" SELECT DISTINCT A.SLAB_NO ");
@ -1485,7 +1487,7 @@ namespace SlabHandle
strSql . AppendLine ( " FROM NISCO.FP_SLAB fs " ) ;
strSql . AppendLine ( " FROM NISCO.FP_SLAB fs " ) ;
strSql . AppendLine ( " START WITH fs.SLAB_NO " ) ;
strSql . AppendLine ( " START WITH fs.SLAB_NO " ) ;
strSql . AppendLine ( " IN " ) ;
strSql . AppendLine ( " IN " ) ;
strSql . AppendLine ( " ( '2 310768931 ' ") ;
strSql . AppendLine ( " ( '2 430408334 ' ") ;
//strSql.AppendLine(" SELECT DISTINCT A.SLAB_NO ");
//strSql.AppendLine(" SELECT DISTINCT A.SLAB_NO ");