@ -1351,9 +1351,9 @@ namespace ibk.IPD.Controller.IPD_PS
RequestEntity result = new RequestEntity ( ) ; //声明返回参数实体类
StringBuilder strSql = new StringBuilder ( ) ; //声明拼接Sql语句变量
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(" AND IS_BING ='0' ");
@ -1384,7 +1384,7 @@ namespace ibk.IPD.Controller.IPD_PS
strSql . AppendLine ( " AND PLT = '" + QAGP . PLT + "'" ) ;
}
strSql . AppendLine ( " ORDER BY INS_DATE DESC ") ;
strSql . AppendLine ( " ORDER BY SMP_NO_M ,SMP_FLG DESC ") ;
try
@ -1501,7 +1501,7 @@ namespace ibk.IPD.Controller.IPD_PS
//strData.Append((pdi.PLATE_NO).PadRight(14));// 钢板号: VARCHAR2(14)
//strData.Append((pdi.SMP_NO).PadRight(14));// 试样号: 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);
@ -1520,7 +1520,7 @@ namespace ibk.IPD.Controller.IPD_PS
//strData.Append((pdi.PLATE_NO).PadRight(14));// 钢板号: VARCHAR2(14)
//strData.Append((pdi.SMP_NO).PadRight(14));// 试样号: 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 )
{
@ -1532,13 +1532,13 @@ namespace ibk.IPD.Controller.IPD_PS
b = false ;
}
//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 ( "AND PLATE_NO = '{0}' " , model . PLATE_NO ) ) ;
strSql . AppendLine ( string . Format ( "AND ORD_NO = '{0}' " , model . ORD_NO ) ) ;
strSql . AppendLine ( string . Format ( "AND ORD_ITEM = '{0}' " , model . ORD_ITEM ) ) ;
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 ( " WHERE 1 = 1 " ) ) ;
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 ( "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 ( " SELECT " ) ;
strSql . AppendLine ( " STANDARD_NO, " ) ;
strSql . AppendLine ( " TD_STANDARD_NO, " ) ;
strSql . AppendLine ( "INS_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 ( " FROM YCTD_WH_NO WHERE RATE IS NOT NULL " ) ;
strSql . AppendLine ( " ) WHERE rn = 1 " ) ;
strSql . AppendLine ( " UNION ALL " ) ;
strSql . AppendLine ( " SELECT * FROM YCTD_WH_NO_COPY WHERE RATE IS NOT NULL ) " ) ;
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 ) )
@ -1884,28 +1885,61 @@ namespace ibk.IPD.Controller.IPD_PS
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 " ) ;
try
{
//DataTable ltYctdWh =new DataTable();
//开启数据库连接查询数据
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
using ( IDbContext db 2 = ObjectContainer . GetObject < IDbContext > ( "db _sur ") )
{
//开启数据库连接查询数据
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
{
dtCheck = db . Query ( strSql . ToString ( ) ) ;
dtCheck = db . Query ( strSql . ToString ( ) ) ;
result . data = dtCheck ;
if ( dtCheck . Rows . Count > 0 )
{
result . msg = "操作成功!" ;
result . code = "1" ;
}
else
{
result . msg = "未找到查询所需数据!" ;
result . code = "1" ;
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 )
{
result . msg = "操作成功!" ;
result . code = "1" ;
}
else
{
result . msg = "未找到查询所需数据!" ;
result . code = "1" ;
}
}
}
}
catch ( Exception ex )
{
@ -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" +
",STEEL_GRD_DETAIL,STDSPEC_STLGRD,STD_FLG" +
",RATE,ORD_NO,ORD_ITEM,PLATE_NO,STLGRD" +
",YP_MIN,YP_MAX,YP_RST,TS_MIN,TS_MAX,TS_RST" +
") VALUES ( " ) ;
strSql . AppendLine ( string . Format ( " '{0}', " , model . 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 . PLATE_NO ) ) ;
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 ( " ) " ) ) ;
db . Execute ( strSql . ToString ( ) ) ;