@ -1353,7 +1353,7 @@ namespace ibk.IPD.Controller.IPD_PS
DataTable dtCheck = new DataTable ( ) ;
DataTable dtCheck = new DataTable ( ) ;
DataTable dtPlate = new DataTable ( ) ;
DataTable dtPlate = new DataTable ( ) ;
strSql . AppendLine ( " SELECT * FROM CONFIRMSMPNO ") ;
strSql . AppendLine ( " SELECT * FROM CONFIRMSMPNO _M ") ;
strSql . AppendLine ( " where 1=1 " ) ;
strSql . AppendLine ( " where 1=1 " ) ;
//strSql.AppendLine(" AND IS_BING ='0' ");
//strSql.AppendLine(" AND IS_BING ='0' ");
@ -1384,7 +1384,7 @@ namespace ibk.IPD.Controller.IPD_PS
strSql . AppendLine ( " AND PLT = '" + QAGP . PLT + "'" ) ;
strSql . AppendLine ( " AND PLT = '" + QAGP . PLT + "'" ) ;
}
}
strSql . AppendLine ( " ORDER BY INS_DATE DESC ") ;
strSql . AppendLine ( " ORDER BY SMP_NO_M ,SMP_FLG DESC ") ;
try
try
@ -1501,7 +1501,7 @@ namespace ibk.IPD.Controller.IPD_PS
//strData.Append((pdi.PLATE_NO).PadRight(14));// 钢板号: VARCHAR2(14)
//strData.Append((pdi.PLATE_NO).PadRight(14));// 钢板号: VARCHAR2(14)
//strData.Append((pdi.SMP_NO).PadRight(14));// 试样号: VARCHAR2(14)
//strData.Append((pdi.SMP_NO).PadRight(14));// 试样号: VARCHAR2(14)
//strData.Append((pdi.SYNOPSIS.ToString()).PadRight(1));// 标记: VARCHAR2(14)
//strData.Append((pdi.SYNOPSIS.ToString()).PadRight(1));// 标记: VARCHAR2(14)
Result1 . DATA = model . DATA . Split ( new char [ ] { ' ' } , StringSplitOptions . RemoveEmptyEntries ) . ToList ( ) . First ( ) ;
Result1 . DATA = model . DATA . Split ( new char [ ] { ' $ ' } , StringSplitOptions . RemoveEmptyEntries ) . ToList ( ) . First ( ) ;
//TBDIPDO InsertPDO2 = GetPDO(model);
//TBDIPDO InsertPDO2 = GetPDO(model);
@ -1520,7 +1520,7 @@ namespace ibk.IPD.Controller.IPD_PS
//strData.Append((pdi.PLATE_NO).PadRight(14));// 钢板号: VARCHAR2(14)
//strData.Append((pdi.PLATE_NO).PadRight(14));// 钢板号: VARCHAR2(14)
//strData.Append((pdi.SMP_NO).PadRight(14));// 试样号: VARCHAR2(14)
//strData.Append((pdi.SMP_NO).PadRight(14));// 试样号: VARCHAR2(14)
//strData.Append((pdi.SYNOPSIS.ToString()).PadRight(1));// 标记: VARCHAR2(14)
//strData.Append((pdi.SYNOPSIS.ToString()).PadRight(1));// 标记: VARCHAR2(14)
Result2 . DATA = model . DATA . Split ( new char [ ] { ' ' } , StringSplitOptions . RemoveEmptyEntries ) . ToList ( ) . Last ( ) ;
Result2 . DATA = model . DATA . Split ( new char [ ] { ' $ ' } , StringSplitOptions . RemoveEmptyEntries ) . ToList ( ) . Last ( ) ;
if ( Result1 ! = null )
if ( Result1 ! = null )
{
{
@ -1532,13 +1532,13 @@ namespace ibk.IPD.Controller.IPD_PS
b = false ;
b = false ;
}
}
//strSql.AppendLine("DELETE FROM CONFIRMSMPNO WHERE 1=1 ");
//strSql.AppendLine("DELETE FROM CONFIRMSMPNO WHERE 1=1 ");
strSql . AppendLine ( " UPDATE CONFIRMSMPNO SET IS_BING = '1' ") ;
strSql . AppendLine ( " UPDATE CONFIRMSMPNO _M SET IS_BING = '1' ") ;
strSql . AppendLine ( string . Format ( " WHERE 1 = 1 " ) ) ;
strSql . AppendLine ( string . Format ( " WHERE 1 = 1 " ) ) ;
strSql . AppendLine ( string . Format ( "AND PLATE_NO = '{0}' " , model . PLATE_NO ) ) ;
strSql . AppendLine ( string . Format ( "AND PLATE_NO = '{0}' " , model . PLATE_NO ) ) ;
strSql . AppendLine ( string . Format ( "AND ORD_NO = '{0}' " , model . ORD_NO ) ) ;
strSql . AppendLine ( string . Format ( "AND ORD_NO = '{0}' " , model . ORD_NO ) ) ;
strSql . AppendLine ( string . Format ( "AND ORD_ITEM = '{0}' " , model . ORD_ITEM ) ) ;
strSql . AppendLine ( string . Format ( "AND ORD_ITEM = '{0}' " , model . ORD_ITEM ) ) ;
db . Execute ( strSql . ToString ( ) ) ; // 执行删除数据操作
db . Execute ( strSql . ToString ( ) ) ; // 执行删除数据操作
strSql2 . AppendLine ( " UPDATE PDI_SMP_NO SET IS_STATE = '1', ") ;
strSql2 . AppendLine ( " UPDATE PDI_SMP_NO _M SET IS_STATE = '1', ") ;
strSql2 . AppendLine ( string . Format ( " INS_DATE='{0}' " , DateTime . Now . ToString ( "yyyyMMddHHmmss" ) ) ) ;
strSql2 . AppendLine ( string . Format ( " INS_DATE='{0}' " , DateTime . Now . ToString ( "yyyyMMddHHmmss" ) ) ) ;
strSql2 . AppendLine ( string . Format ( " WHERE 1 = 1 " ) ) ;
strSql2 . AppendLine ( string . Format ( " WHERE 1 = 1 " ) ) ;
strSql2 . AppendLine ( string . Format ( "AND PLATE_NO = '{0}' " , model . PLATE_NO ) ) ;
strSql2 . AppendLine ( string . Format ( "AND PLATE_NO = '{0}' " , model . PLATE_NO ) ) ;
@ -1843,21 +1843,22 @@ namespace ibk.IPD.Controller.IPD_PS
//strSql.AppendLine(" ) WHERE rn = 1 ");
//strSql.AppendLine(" ) WHERE rn = 1 ");
strSql . AppendLine ( "SELECT * FROM( " ) ;
strSql . AppendLine ( "SELECT * FROM( " ) ;
strSql . AppendLine ( " SELECT STANDARD_NO, TD_STANDARD_NO, INS_DATE, UPD_DATE, TD_FL,THK_TOL_MIN,THK_TOL_MAX,REMARK ,STEEL_GRD_DETAIL,STDSPEC_STLGRD,STD_FLG,RATE,ORD_NO,ORD_ITEM,PLATE_NO,STLGRD ") ;
strSql . AppendLine ( " SELECT STANDARD_NO, TD_STANDARD_NO, INS_DATE, UPD_DATE, TD_FL,THK_TOL_MIN,THK_TOL_MAX,REMARK ,STEEL_GRD_DETAIL,STDSPEC_STLGRD,STD_FLG,RATE,ORD_NO,ORD_ITEM,PLATE_NO,STLGRD , YP_RST ,YP_MIN,YP_MAX, TS_RST,TS_MIN,TS_MAX ") ;
strSql . AppendLine ( "FROM ( " ) ;
strSql . AppendLine ( "FROM ( " ) ;
strSql . AppendLine ( " SELECT " ) ;
strSql . AppendLine ( " SELECT " ) ;
strSql . AppendLine ( " STANDARD_NO, " ) ;
strSql . AppendLine ( " STANDARD_NO, " ) ;
strSql . AppendLine ( " TD_STANDARD_NO, " ) ;
strSql . AppendLine ( " TD_STANDARD_NO, " ) ;
strSql . AppendLine ( "INS_DATE, " ) ;
strSql . AppendLine ( "INS_DATE, " ) ;
strSql . AppendLine ( "UPD_DATE, " ) ;
strSql . AppendLine ( "UPD_DATE, " ) ;
strSql . AppendLine ( "TD_FL, THK_TOL_MIN,THK_TOL_MAX ,REMARK, STEEL_GRD_DETAIL,STDSPEC_STLGRD,STD_FLG,RATE,ORD_NO,ORD_ITEM,PLATE_NO,STLGRD ") ;
strSql . AppendLine ( "TD_FL, THK_TOL_MIN,THK_TOL_MAX ,REMARK, STEEL_GRD_DETAIL,STDSPEC_STLGRD,STD_FLG,RATE,ORD_NO,ORD_ITEM,PLATE_NO,STLGRD ,YP_RST-YP_MIN YP_RST ,YP_MIN,YP_MAX,TS_RST-TS_MIN TS_RST,TS_MIN,TS_MAX ") ;
strSql . AppendLine ( " ,ROW_NUMBER() OVER(PARTITION BY STANDARD_NO, TD_STANDARD_NO ORDER BY INS_DATE DESC) AS rn " ) ;
strSql . AppendLine ( " ,ROW_NUMBER() OVER(PARTITION BY STANDARD_NO, TD_STANDARD_NO ORDER BY INS_DATE DESC) AS rn " ) ;
strSql . AppendLine ( " FROM YCTD_WH_NO WHERE RATE IS NOT NULL " ) ;
strSql . AppendLine ( " FROM YCTD_WH_NO WHERE RATE IS NOT NULL " ) ;
strSql . AppendLine ( " ) WHERE rn = 1 " ) ;
strSql . AppendLine ( " ) WHERE rn = 1 " ) ;
strSql . AppendLine ( " UNION ALL " ) ;
strSql . AppendLine ( " UNION ALL " ) ;
strSql . AppendLine ( " SELECT * FROM YCTD_WH_NO_COPY WHERE RATE IS NOT NULL ) " ) ;
strSql . AppendLine ( " SELECT * FROM YCTD_WH_NO_COPY WHERE RATE IS NOT NULL ) " ) ;
strSql . AppendLine ( " WHERE 1 = 1 " ) ;
strSql . AppendLine ( " WHERE 1 = 1 " ) ;
//只取当前日期的数据
strSql . AppendLine ( "AND TO_CHAR(TO_DATE(INS_DATE,'YYYYMMDDHH24MISS'), 'YYYYMMDD') = TO_CHAR(SYSDATE, 'YYYYMMDD') " ) ;
//标准号
//标准号
if ( ! string . IsNullOrWhiteSpace ( QAGP . STANDARD_NO ) )
if ( ! string . IsNullOrWhiteSpace ( QAGP . STANDARD_NO ) )
@ -1884,17 +1885,47 @@ namespace ibk.IPD.Controller.IPD_PS
strSql . AppendLine ( " AND THK_TOL_MAX >= '" + QAGP . THK_TOL_MAX + "'" ) ;
strSql . AppendLine ( " AND THK_TOL_MAX >= '" + QAGP . THK_TOL_MAX + "'" ) ;
}
}
//屈服
if ( ! string . IsNullOrWhiteSpace ( QAGP . YP_RST ) )
{
strSql . AppendLine ( " AND YP_RST >= '" + QAGP . YP_RST + "'" ) ;
}
//抗拉
if ( ! string . IsNullOrWhiteSpace ( QAGP . TS_RST ) )
{
strSql . AppendLine ( " AND TS_RST >= '" + QAGP . TS_RST + "'" ) ;
}
strSql . AppendLine ( " ORDER BY INS_DATE DESC " ) ;
strSql . AppendLine ( " ORDER BY INS_DATE DESC " ) ;
try
try
{
{
//DataTable ltYctdWh =new DataTable();
//开启数据库连接查询数据
using ( IDbContext db2 = ObjectContainer . GetObject < IDbContext > ( "db_sur" ) )
{
//开启数据库连接查询数据
//开启数据库连接查询数据
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
{
{
dtCheck = db . Query ( strSql . ToString ( ) ) ;
dtCheck = db . Query ( strSql . ToString ( ) ) ;
result . data = dtCheck ;
DataTable dtResult = dtCheck . Clone ( ) ;
// 查找不在第二个DataTable中的行并添加到结果DataTable
foreach ( DataRow row in dtCheck . Rows )
{
DataTable ltYctdWh = db2 . Query ( "SELECT * FROM NISCO.YCTD_WH WHERE STANDARD_NO='" + row . Field < string > ( "STANDARD_NO" ) + "' AND TD_STANDARD_NO='" + row . Field < string > ( "TD_STANDARD_NO" ) + "'" ) ;
if ( ltYctdWh . Rows . Count = = 0 )
{
dtResult . ImportRow ( row ) ;
}
}
result . data = dtResult ;
if ( dtCheck . Rows . Count > 0 )
if ( dtCheck . Rows . Count > 0 )
{
{
result . msg = "操作成功!" ;
result . msg = "操作成功!" ;
@ -1907,6 +1938,9 @@ namespace ibk.IPD.Controller.IPD_PS
}
}
}
}
}
}
}
catch ( Exception ex )
catch ( Exception ex )
{
{
result . msg = "数据库错误!" ;
result . msg = "数据库错误!" ;
@ -1937,6 +1971,7 @@ namespace ibk.IPD.Controller.IPD_PS
strSql . AppendLine ( " INSERT INTO YCTD_WH_NO_COPY (STANDARD_NO, TD_STANDARD_NO, INS_DATE, UPD_DATE, TD_FL,THK_TOL_MIN,THK_TOL_MAX,REMARK" +
strSql . AppendLine ( " INSERT INTO YCTD_WH_NO_COPY (STANDARD_NO, TD_STANDARD_NO, INS_DATE, UPD_DATE, TD_FL,THK_TOL_MIN,THK_TOL_MAX,REMARK" +
",STEEL_GRD_DETAIL,STDSPEC_STLGRD,STD_FLG" +
",STEEL_GRD_DETAIL,STDSPEC_STLGRD,STD_FLG" +
",RATE,ORD_NO,ORD_ITEM,PLATE_NO,STLGRD" +
",RATE,ORD_NO,ORD_ITEM,PLATE_NO,STLGRD" +
",YP_MIN,YP_MAX,YP_RST,TS_MIN,TS_MAX,TS_RST" +
") VALUES ( " ) ;
") VALUES ( " ) ;
strSql . AppendLine ( string . Format ( " '{0}', " , model . STANDARD_NO ) ) ;
strSql . AppendLine ( string . Format ( " '{0}', " , model . STANDARD_NO ) ) ;
strSql . AppendLine ( string . Format ( " '{0}', " , model . TD_STANDARD_NO ) ) ;
strSql . AppendLine ( string . Format ( " '{0}', " , model . TD_STANDARD_NO ) ) ;
@ -1954,6 +1989,14 @@ namespace ibk.IPD.Controller.IPD_PS
strSql . AppendLine ( string . Format ( " '{0}', " , model . ORD_ITEM ) ) ;
strSql . AppendLine ( string . Format ( " '{0}', " , model . ORD_ITEM ) ) ;
strSql . AppendLine ( string . Format ( " '{0}', " , model . PLATE_NO ) ) ;
strSql . AppendLine ( string . Format ( " '{0}', " , model . PLATE_NO ) ) ;
strSql . AppendLine ( string . Format ( " '{0}'" , model . STLGRD ) ) ;
strSql . AppendLine ( string . Format ( " '{0}'" , model . STLGRD ) ) ;
strSql . AppendLine ( string . Format ( " '{0}'" , model . YP_MIN ) ) ;
strSql . AppendLine ( string . Format ( " '{0}'" , model . YP_MAX ) ) ;
strSql . AppendLine ( string . Format ( " '{0}'" , model . YP_RST ) ) ;
strSql . AppendLine ( string . Format ( " '{0}'" , model . TS_MIN ) ) ;
strSql . AppendLine ( string . Format ( " '{0}'" , model . TS_MAX ) ) ;
strSql . AppendLine ( string . Format ( " '{0}'" , model . TS_RST ) ) ;
strSql . AppendLine ( string . Format ( " ) " ) ) ;
strSql . AppendLine ( string . Format ( " ) " ) ) ;
db . Execute ( strSql . ToString ( ) ) ;
db . Execute ( strSql . ToString ( ) ) ;