You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4210 lines
239 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using ibk.IPD.Entity;
using ibk.IPD.Entity.IPD_MR.HotRoll;
using ibk.IPD.Entity.IPD_PS;
using ibk.IPD.Entity.IpdPs;
using log4net;
using SinglePlateHandle.Enity;
using SOA.Objects;
using SOA.Persistent;
using System;
using System.Collections.Generic;
using System.Data;
using System.Reflection;
using System.Text;
using QP_STD_HEAD = ibk.IPD.Entity.IPD_PS.QP_STD_HEAD;
namespace ibk.IPD.Service.IPD_PS
{
public class SurMatSubService
{
private static readonly ILog logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
#region 获取存储数据
/// <summary>
/// 获取所有未确认数据
/// </summary>
/// <returns></returns>
public IList<SUPERSEDE> GetUnConSUPERSEDE()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<SUPERSEDE> gSUPERSEDE = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM SUPERSEDE");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gSUPERSEDE = db.Query<SUPERSEDE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetUnConSUPERSEDE 报错", ex);
}
return gSUPERSEDE;
}
public IList<SUPERSEDE_HISTORY> GetUnConSUPERSEDEHIS()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<SUPERSEDE_HISTORY> gSUPERSEDE = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM SUPERSEDE_HISTORY where 1=1");
strSql.AppendLine(" and HAN_RSL <> 'S'");
strSql.AppendLine(" and to_date(SUB_DATE,'yyyy-mm-dd hh24:mi:ss') < to_date('" + DateTime.Now.AddDays(-1) + "','yyyy-mm-dd hh24:mi:ss')");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gSUPERSEDE = db.Query<SUPERSEDE_HISTORY>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetUnConSUPERSEDE 报错", ex);
}
return gSUPERSEDE;
}
public IList<ONWAY_PLA_FUNGIBLE_SPECI> GetONWAY_PLA_FUNGIBLE_SPECI()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<ONWAY_PLA_FUNGIBLE_SPECI> gSUPERSEDE = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM ONWAY_PLA_FUNGIBLE_SPECI where 1=1");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gSUPERSEDE = db.Query<ONWAY_PLA_FUNGIBLE_SPECI>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetUnConSUPERSEDE 报错", ex);
}
return gSUPERSEDE;
}
public IList<TB_STDSPEC> GetSTDSPEC_Only_One()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<TB_STDSPEC> gSTDSPEC = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine(" select STDSPEC from NISCO.BP_ORDER_ITEM boi where boi.CUST_DEL_TO_DATE > TO_CHAR(SYSdate + '-90' ,'yyyyMMdd') GROUP BY STDSPEC HAVING count(STDSPEC) =1");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gSTDSPEC = db.Query<TB_STDSPEC>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetSTDSPEC_Only_One 报错", ex);
}
return gSTDSPEC;
}
///// <summary>
///// 可用订单选择
///// 订单欠量字段 ORD_REM_CNT
///// </summary>
///// <returns>所有符合条件的订单 集合</returns>
//public IList<BP_ORDER_ITEM> GetOrder(string strWHereOrd, string strSpecialOrd)
//{
// StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
// StringBuilder strRemSql = new StringBuilder(); //声明订单欠量sql
// IList<BP_ORDER_ITEM> gpPlates = null;
// //查询可用订单以及常用字段
// strSql.AppendLine(" SELECT ");
// strSql.AppendLine(" BOI.ORD_NO, BOI.ORD_ITEM, QQD.THK_TOL_MIN ,QQD.THK_TOL_MAX ,BOI.REC_STS, BOI.PLN_ORD, BOI.PLN_ORD_ITEM, BOI.ORD_STS, BOI.HOLD_FL, BOI.HOLD_DATE, BOI.HOLD_TIME, BOI.HOLD_EMP_ID ");
// strSql.AppendLine(", BOI.CURRENCY, BOI.EXTRA_FL, BOI.DISCON_PRC, BOI.TOT_PRC, BOI.TRANS_PRC, BOI.EMP_ID, BOI.PROD_PRC, BOI.REG_DATE, BOI.REG_TIME, BOI.CONF_DATE ");
// strSql.AppendLine(", BOI.CONF_TIME, BOI.CONF_EMP_ID, BOI.CUST_CD, BOI.ORD_CUST_CD, BOI.PROD_DGR, BOI.SALE_WAY, BOI.DEPT_CD, BOI.DEST_CD, BOI.DEST_DETAIL ");
// strSql.AppendLine(", BOI.ENDUSE_CD, BOI.STLGRD, BOI.PAYMENT_COND, BOI.DEL_COND, BOI.DEL_TOL_UNIT, BOI.DEL_TOL_MAX, BOI.DEL_TOL_MIN, BOI.WGT_UNIT, BOI.WGT_GRP ");
// strSql.AppendLine(", BOI.PROD_WGT, BOI.PROD_WGT_MIN, BOI.PROD_WGT_MAX, BOI.TOT_WGT, BOI.STDSPEC, BOI.STDSPEC_YY, BOI.ORD_SIZE, BOI.ORD_WID, BOI.ORD_LEN, BOI.ORD_THK ");
// strSql.AppendLine(", BOI.INDIA, BOI.OUTDIA, BOI.CAN_FL, BOI.CAN_DATE, BOI.CAN_TIME, BOI.CAN_EMP_ID, BOI.MOD_FL, BOI.MOD_DATE, BOI.MOD_TIME, BOI.DEL_FR_DATE, BOI.DEL_TO_DATE ");
// strSql.AppendLine(", BOI.CUST_DEL_FR_DATE, BOI.CUST_DEL_TO_DATE, BOI.ORD_PROD_END_DATE, BOI.ORD_PROD_END_TIME, BOI.ORD_SHIP_END_DATE, BOI.ORD_SHIP_END_TIME, BOI.ORD_ACCP_DATE ");
// strSql.AppendLine(", BOI.ORD_ACCP_TIME, BOI.CUST_REQ_PLANT, BOI.TENT_REQ_PLANT, BOI.CONF_PLANT, BOI.CUST_SPEC_NO, BOI.MARKING_WAY, BOI.STAMP, BOI.TRANSP_WAY, BOI.ORD_KND ");
// strSql.AppendLine(", BOI.TRIM_FL, BOI.URGNT_FL, BOI.UST_FL, BOI.PAYMENT_FL, BOI.PAYMENT_DATE, BOI.PAYMENT_TIME, BOI.PAYMENT_EMP_ID, BOI.PACK_WAY, BOI.PACK_WGT_MAX ");
// strSql.AppendLine(", BOI.PACK_WGT_MIN, BOI.NUM_PROD, BOI.SALE_EMP_ID, BOI.END_CUST_CD, BOI.INSP_CD, BOI.DOME_FL, BOI.PROD_CD, BOI.PROD_THK_TGT, BOI.SIZE_KND, BOI.ORD_LEN_MIN ");
// strSql.AppendLine(", BOI.ORD_LEN_MAX, BOI.MATR_FL, BOI.CONT_END_DATE, BOI.CONT_END_TIME, BOI.CONT_END_EMP_ID, BOI.VESSEL_NO, BOI.CUST_REQ_NO, BOI.COLOR_STROKE, BOI.RELEASE_DATE ");
// strSql.AppendLine(", BOI.RELEASE_TIME, BOI.RELEASE_EMP_ID, BOI.PLN_SMS_PLT, BOI.PLN_MILL_PLT, BOI.CFM_SMS_PLT, BOI.CFM_MILL_PLT, BOI.HTM_SHOT_BLAST ");
// strSql.AppendLine(", BOI.INS_DATE, BOI.INS_TIME, BOI.INS_EMPID, BOI.INS_PGMID, BOI.UPD_DATE, BOI.UPD_TIME, BOI.UPD_EMPID, BOI.UPD_PGMID, BOI.SEALMEMO ");
// strSql.AppendLine(", BOI.INSPUNITCODEA, BOI.INSPUNITCODEB, BOI.INSPUNITCODEC, BOI.PRODSPECNOA, BOI.PRODSPECNOB, BOI.PRODSPECNOC, BOI.PAINTNUM, BOI.LP_HD_THK, BOI.LP_MD_THK, BOI.LP_TL_THK ");
// strSql.AppendLine(", BOI.LP_LEN1, BOI.LP_LEN2, BOI.LP_LEN3, BOI.LP_LEN4, BOI.LP_LEN5, BOI.IMP_CONT, BOI.INSPECT_ORGAN, BOI.CONTRACT_NO, BOI.TRIAL_PRODUCT, BOI.TRIAL_NUM, BOI.TRIAL_STR ");
// strSql.AppendLine(", BOI.TRIAL_END, BOI.SIDEMARK, BOI.JIT_STRINGA, BOI.JIT_STRINGB, BOI.JIT_STRINGC, BOI.JITID, BOI.JIT_FLAG, BOI.QO_FL, BOI.SAMPLE_MEMO, BOI.SIZE_MEMO, BOI.PACK_MEMO ");
// strSql.AppendLine(", BOI.FLUSH_FL, BOI.APPOINT_PLT, BOI.MORD_DESIGN_WGT, BOI.MORD_FL, BOI.APPOINT_PLT_REASON, BOI.SURFACE_REQUESTS, BOI.STAMP_FL, BOI.UST_INSP_FL, BOI.SPRAY_FL ");
// strSql.AppendLine(", BOI.BUFPOOL_CD, BOI.MULTI_INSP_FL, BOI.CONTRACT_DATE, BOI.DELIVERY_STATUS, BOI.CUST_CLASS, BOI.CUST_LEVEL, BOI.SPECIAL_OPR_REQ, BOI.WITNESS_CONTENT, BOI.COGGING_FLAG ");
// strSql.AppendLine(", BOI.STD_DET_CLASS_CD, BOI.STD_DET_CLASS_LVL, BOI.CERT_NOTE, BOI.INSPECT_FLAG, BOI.E2E_CUST, BOI.CUST_PURCHASE, BOI.GUID, BOI.NEW_CLASS_STATE, BOI.FACEPAINT ");
// strSql.AppendLine(", BOI.IS_JC, BOI.UST_JC, BOI.LEVEL_JM, BOI.ORDER_NOFH, BOI.ITEM_NOFH, BOI.ORDER_THK_JC, BOI.ORDER_THK_FC, BOI.TYPEFH, BOI.PRODTYPENO, BOI.STEEL_SPRAY ");
// strSql.AppendLine(", BOI.STEEL_PACK, BOI.STEEL_SHOTBLAST, BOI.STEEL_SLOTEPROCESS, BOI.ORDERQTY, BOI.ORDER_CNT, BOI.DELIVERY_STATUS1, BOI.DELIVERY_STATUS2, BOI.DELIVERY_STATUS3 ");
// strSql.AppendLine(", BOI.SPECNOA, BOI.SPECNOB, BOI.SPECNOC, BOI.SPECNOA_YY, BOI.SPECNOB_YY, BOI.SPECNOC_YY, BOI.INSPUNITCODE, BOI.SUBCUSTNO, BOI.ISSHIPORDER, BOI.SAILINGDATE ");
// strSql.AppendLine(", BOI.MARINEBOARD, BOI.ORDERNOYPK, BOI.ORDERITEMYPK, BOI.SORTINGMARK, BOI.UST_FL_PRINT, BOI.PRINTUTLEVEL, BOI.RULLBOARDCUT, BOI.PAINTUPT, BOI.ORDERPRICEB ");
// strSql.AppendLine(", BOI.ADJUSTPRICE, BOI.HOTUT, BOI.HOTUTRATE, BOI.SPECIALSIGN, BOI.UST_MODE, BOI.INSP_CD1, BOI.INSP_CD2, BOI.QKL_CUSTNO ");
// strSql.AppendLine(", CPP.ORD_WGT ");
// //TODO:TEST_DATA
// strSql.AppendLine(",FLOOR( (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100)/ TRUNC(((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85,3)) AS SUB_LACK_NUM ");
// //strSql.AppendLine(",1 AS SUB_LACK_NUM ");
// strSql.AppendLine(",(NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) AS SUB_LACK_WGT ");
// strSql.AppendLine(",QQT.HTM_METH1 ");
// strSql.AppendLine(",QQT.HTM_METH2 ");
// strSql.AppendLine(",QQT.HTM_METH3 ");
// strSql.AppendLine(",count(EP_SLAB_B.REQ_SEQ_NO) SLAB_LACK_NUM , count(EP_SLAB_B.REQ_SEQ_NO) + FLOOR( (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100)/ TRUNC(((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85,3)) AS LACK_NUM ");
// 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("LEFT JOIN NISCO.QP_QLTY_TECH QQT ");
// strSql.AppendLine("ON BOI.ORD_NO = QQT.ORD_NO ");
// strSql.AppendLine("AND BOI.ORD_ITEM = QQT.ORD_ITEM ");
// strSql.AppendLine("LEFT JOIN NISCO.QP_QLTY_DELV QQD");
// strSql.AppendLine("ON BOI.ORD_NO = QQD.ORD_NO");
// strSql.AppendLine("AND BOI.ORD_ITEM = QQD.ORD_ITEM");
// strSql.AppendLine("LEFT JOIN NISCO.EP_REQ_SLAB EP_SLAB ");
// strSql.AppendLine("ON EP_SLAB.ORD_NO = QQD.ORD_NO ");
// strSql.AppendLine("AND EP_SLAB.ORD_ITEM = QQD.ORD_ITEM ");
// strSql.AppendLine("LEFT JOIN NISCO.EP_REQ_SLAB_D EP_SLAB");
// strSql.AppendLine("ON EP_SLAB.ORD_NO = QQD.ORD_NO ");
// strSql.AppendLine("AND EP_SLAB.ORD_ITEM = QQD.ORD_ITEM ");
// strSql.AppendLine("AND EP_SLAB.BLOCK_SEQ >= '01'");
// strSql.AppendLine("AND EP_SLAB.SEQ >= '01'");
// strSql.AppendLine("LEFT JOIN NISCO.EP_REQ_SLAB EP_SLAB_B");
// strSql.AppendLine("ON EP_SLAB.REQ_SEQ_NO = EP_SLAB_B.REQ_SEQ_NO");
// strSql.AppendLine("AND EP_SLAB_B.REC_STS = '1'");
// //TODO:TEST_DATA
// strSql.AppendLine("WHERE 1=1 ");
// strSql.AppendLine(" AND ((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') + 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', 'D') ");
// strSql.AppendLine("AND boi.ord_knd IN('A') ");
// strSql.AppendLine("AND boi.ORD_NO NOT LIKE 'OMZ%'");
// strSql.AppendLine(strWHereOrd);
// strSql.AppendLine(strSpecialOrd);
// //strSql.AppendLine(" or boi.ORD_NO ='OMC22100055'");
// //strSql.AppendLine(" AND boi.ORD_ITEM ='106'");
// strSql.AppendLine("GROUP BY BOI.ORD_NO, BOI.ORD_ITEM, QQD.THK_TOL_MIN ,QQD.THK_TOL_MAX ,BOI.REC_STS, BOI.PLN_ORD, BOI.PLN_ORD_ITEM, BOI.ORD_STS, BOI.HOLD_FL, BOI.HOLD_DATE, BOI.HOLD_TIME, BOI.HOLD_EMP_ID ");
// strSql.AppendLine(", BOI.CURRENCY, BOI.EXTRA_FL, BOI.DISCON_PRC, BOI.TOT_PRC, BOI.TRANS_PRC, BOI.EMP_ID, BOI.PROD_PRC, BOI.REG_DATE, BOI.REG_TIME, BOI.CONF_DATE ");
// strSql.AppendLine(", BOI.CONF_TIME, BOI.CONF_EMP_ID, BOI.CUST_CD, BOI.ORD_CUST_CD, BOI.PROD_DGR, BOI.SALE_WAY, BOI.DEPT_CD, BOI.DEST_CD, BOI.DEST_DETAIL ");
// strSql.AppendLine(", BOI.ENDUSE_CD, BOI.STLGRD, BOI.PAYMENT_COND, BOI.DEL_COND, BOI.DEL_TOL_UNIT, BOI.DEL_TOL_MAX, BOI.DEL_TOL_MIN, BOI.WGT_UNIT, BOI.WGT_GRP ");
// strSql.AppendLine(", BOI.PROD_WGT, BOI.PROD_WGT_MIN, BOI.PROD_WGT_MAX, BOI.TOT_WGT, BOI.STDSPEC, BOI.STDSPEC_YY, BOI.ORD_SIZE, BOI.ORD_WID, BOI.ORD_LEN, BOI.ORD_THK ");
// strSql.AppendLine(", BOI.INDIA, BOI.OUTDIA, BOI.CAN_FL, BOI.CAN_DATE, BOI.CAN_TIME, BOI.CAN_EMP_ID, BOI.MOD_FL, BOI.MOD_DATE, BOI.MOD_TIME, BOI.DEL_FR_DATE, BOI.DEL_TO_DATE ");
// strSql.AppendLine(", BOI.CUST_DEL_FR_DATE, BOI.CUST_DEL_TO_DATE, BOI.ORD_PROD_END_DATE, BOI.ORD_PROD_END_TIME, BOI.ORD_SHIP_END_DATE, BOI.ORD_SHIP_END_TIME, BOI.ORD_ACCP_DATE ");
// strSql.AppendLine(", BOI.ORD_ACCP_TIME, BOI.CUST_REQ_PLANT, BOI.TENT_REQ_PLANT, BOI.CONF_PLANT, BOI.CUST_SPEC_NO, BOI.MARKING_WAY, BOI.STAMP, BOI.TRANSP_WAY, BOI.ORD_KND ");
// strSql.AppendLine(", BOI.TRIM_FL, BOI.URGNT_FL, BOI.UST_FL, BOI.PAYMENT_FL, BOI.PAYMENT_DATE, BOI.PAYMENT_TIME, BOI.PAYMENT_EMP_ID, BOI.PACK_WAY, BOI.PACK_WGT_MAX ");
// strSql.AppendLine(", BOI.PACK_WGT_MIN, BOI.NUM_PROD, BOI.SALE_EMP_ID, BOI.END_CUST_CD, BOI.INSP_CD, BOI.DOME_FL, BOI.PROD_CD, BOI.PROD_THK_TGT, BOI.SIZE_KND, BOI.ORD_LEN_MIN ");
// strSql.AppendLine(", BOI.ORD_LEN_MAX, BOI.MATR_FL, BOI.CONT_END_DATE, BOI.CONT_END_TIME, BOI.CONT_END_EMP_ID, BOI.VESSEL_NO, BOI.CUST_REQ_NO, BOI.COLOR_STROKE, BOI.RELEASE_DATE ");
// strSql.AppendLine(", BOI.RELEASE_TIME, BOI.RELEASE_EMP_ID, BOI.PLN_SMS_PLT, BOI.PLN_MILL_PLT, BOI.CFM_SMS_PLT, BOI.CFM_MILL_PLT, BOI.HTM_SHOT_BLAST ");
// strSql.AppendLine(", BOI.INS_DATE, BOI.INS_TIME, BOI.INS_EMPID, BOI.INS_PGMID, BOI.UPD_DATE, BOI.UPD_TIME, BOI.UPD_EMPID, BOI.UPD_PGMID, BOI.SEALMEMO ");
// strSql.AppendLine(", BOI.INSPUNITCODEA, BOI.INSPUNITCODEB, BOI.INSPUNITCODEC, BOI.PRODSPECNOA, BOI.PRODSPECNOB, BOI.PRODSPECNOC, BOI.PAINTNUM, BOI.LP_HD_THK, BOI.LP_MD_THK, BOI.LP_TL_THK ");
// strSql.AppendLine(", BOI.LP_LEN1, BOI.LP_LEN2, BOI.LP_LEN3, BOI.LP_LEN4, BOI.LP_LEN5, BOI.IMP_CONT, BOI.INSPECT_ORGAN, BOI.CONTRACT_NO, BOI.TRIAL_PRODUCT, BOI.TRIAL_NUM, BOI.TRIAL_STR ");
// strSql.AppendLine(", BOI.TRIAL_END, BOI.SIDEMARK, BOI.JIT_STRINGA, BOI.JIT_STRINGB, BOI.JIT_STRINGC, BOI.JITID, BOI.JIT_FLAG, BOI.QO_FL, BOI.SAMPLE_MEMO, BOI.SIZE_MEMO, BOI.PACK_MEMO ");
// strSql.AppendLine(", BOI.FLUSH_FL, BOI.APPOINT_PLT, BOI.MORD_DESIGN_WGT, BOI.MORD_FL, BOI.APPOINT_PLT_REASON, BOI.SURFACE_REQUESTS, BOI.STAMP_FL, BOI.UST_INSP_FL, BOI.SPRAY_FL ");
// strSql.AppendLine(", BOI.BUFPOOL_CD, BOI.MULTI_INSP_FL, BOI.CONTRACT_DATE, BOI.DELIVERY_STATUS, BOI.CUST_CLASS, BOI.CUST_LEVEL, BOI.SPECIAL_OPR_REQ, BOI.WITNESS_CONTENT, BOI.COGGING_FLAG ");
// strSql.AppendLine(", BOI.STD_DET_CLASS_CD, BOI.STD_DET_CLASS_LVL, BOI.CERT_NOTE, BOI.INSPECT_FLAG, BOI.E2E_CUST, BOI.CUST_PURCHASE, BOI.GUID, BOI.NEW_CLASS_STATE, BOI.FACEPAINT ");
// strSql.AppendLine(", BOI.IS_JC, BOI.UST_JC, BOI.LEVEL_JM, BOI.ORDER_NOFH, BOI.ITEM_NOFH, BOI.ORDER_THK_JC, BOI.ORDER_THK_FC, BOI.TYPEFH, BOI.PRODTYPENO, BOI.STEEL_SPRAY ");
// strSql.AppendLine(", BOI.STEEL_PACK, BOI.STEEL_SHOTBLAST, BOI.STEEL_SLOTEPROCESS, BOI.ORDERQTY, BOI.ORDER_CNT, BOI.DELIVERY_STATUS1, BOI.DELIVERY_STATUS2, BOI.DELIVERY_STATUS3 ");
// strSql.AppendLine(", BOI.SPECNOA, BOI.SPECNOB, BOI.SPECNOC, BOI.SPECNOA_YY, BOI.SPECNOB_YY, BOI.SPECNOC_YY, BOI.INSPUNITCODE, BOI.SUBCUSTNO, BOI.ISSHIPORDER, BOI.SAILINGDATE ");
// strSql.AppendLine(", BOI.MARINEBOARD, BOI.ORDERNOYPK, BOI.ORDERITEMYPK, BOI.SORTINGMARK, BOI.UST_FL_PRINT, BOI.PRINTUTLEVEL, BOI.RULLBOARDCUT, BOI.PAINTUPT, BOI.ORDERPRICEB ");
// strSql.AppendLine(", BOI.ADJUSTPRICE, BOI.HOTUT, BOI.HOTUTRATE, BOI.SPECIALSIGN, BOI.UST_MODE, BOI.INSP_CD1, BOI.INSP_CD2, BOI.QKL_CUSTNO ");
// strSql.AppendLine(", CPP.ORD_WGT ,FLOOR( (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)) ,(NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) ");
// strSql.AppendLine(", QQT.HTM_METH1 ");
// strSql.AppendLine(", QQT.HTM_METH2 ");
// strSql.AppendLine(", QQT.HTM_METH3 ");
// try
// {
// //开启数据库连接查询数据
// using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
// {
// gpPlates = db.Query<BP_ORDER_ITEM>(strSql.ToString());
// // logger.Info(gpPlates.Count.ToString());
// //gpPlates = CommonUtils.DataTableToList<BP_ORDER_ITEM>(a);
// // logger.Info("gpPlates :" + a.Rows.Count);
// }
// }
// catch (Exception ex)
// {
// logger.Error("GetOrder 报错", ex);
// }
// return gpPlates;
//}
/// <summary>
/// 可用订单选择
/// 订单欠量字段 ORD_REM_CNT
/// </summary>
/// <returns>所有符合条件的订单 集合</returns>
public IList<BP_ORDER_ITEM> GetOrder(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
StringBuilder strRemSql = new StringBuilder(); //声明订单欠量sql
IList<BP_ORDER_ITEM> gpPlates = null;
//查询可用订单以及常用字段
strSql.AppendLine(" SELECT ");
strSql.AppendLine(" BOI.ORD_NO, BOI.ORD_ITEM, QQD.THK_TOL_MIN ,QQD.THK_TOL_MAX ,BOI.REC_STS, BOI.PLN_ORD, BOI.PLN_ORD_ITEM, BOI.ORD_STS, BOI.HOLD_FL, BOI.HOLD_DATE, BOI.HOLD_TIME, BOI.HOLD_EMP_ID ");
strSql.AppendLine(", BOI.CURRENCY, BOI.EXTRA_FL, BOI.DISCON_PRC, BOI.TOT_PRC, BOI.TRANS_PRC, BOI.EMP_ID, BOI.PROD_PRC, BOI.REG_DATE, BOI.REG_TIME, BOI.CONF_DATE ");
strSql.AppendLine(", BOI.CONF_TIME, BOI.CONF_EMP_ID, BOI.CUST_CD, BOI.ORD_CUST_CD, BOI.PROD_DGR, BOI.SALE_WAY, BOI.DEPT_CD, BOI.DEST_CD, BOI.DEST_DETAIL ");
strSql.AppendLine(", BOI.ENDUSE_CD, BOI.STLGRD, BOI.PAYMENT_COND, BOI.DEL_COND, BOI.DEL_TOL_UNIT, BOI.DEL_TOL_MAX, BOI.DEL_TOL_MIN, BOI.WGT_UNIT, BOI.WGT_GRP ");
strSql.AppendLine(", BOI.PROD_WGT, BOI.PROD_WGT_MIN, BOI.PROD_WGT_MAX, BOI.TOT_WGT, BOI.STDSPEC, BOI.STDSPEC_YY, BOI.ORD_SIZE, BOI.ORD_WID, BOI.ORD_LEN, BOI.ORD_THK ");
strSql.AppendLine(", BOI.INDIA, BOI.OUTDIA, BOI.CAN_FL, BOI.CAN_DATE, BOI.CAN_TIME, BOI.CAN_EMP_ID, BOI.MOD_FL, BOI.MOD_DATE, BOI.MOD_TIME, BOI.DEL_FR_DATE, BOI.DEL_TO_DATE ");
strSql.AppendLine(", BOI.CUST_DEL_FR_DATE, BOI.CUST_DEL_TO_DATE, BOI.ORD_PROD_END_DATE, BOI.ORD_PROD_END_TIME, BOI.ORD_SHIP_END_DATE, BOI.ORD_SHIP_END_TIME, BOI.ORD_ACCP_DATE ");
strSql.AppendLine(", BOI.ORD_ACCP_TIME, BOI.CUST_REQ_PLANT, BOI.TENT_REQ_PLANT, BOI.CONF_PLANT, BOI.CUST_SPEC_NO, BOI.MARKING_WAY, BOI.STAMP, BOI.TRANSP_WAY, BOI.ORD_KND ");
strSql.AppendLine(", BOI.TRIM_FL, BOI.URGNT_FL, BOI.UST_FL, BOI.PAYMENT_FL, BOI.PAYMENT_DATE, BOI.PAYMENT_TIME, BOI.PAYMENT_EMP_ID, BOI.PACK_WAY, BOI.PACK_WGT_MAX ");
strSql.AppendLine(", BOI.PACK_WGT_MIN, BOI.NUM_PROD, BOI.SALE_EMP_ID, BOI.END_CUST_CD, BOI.INSP_CD, BOI.DOME_FL, BOI.PROD_CD, BOI.PROD_THK_TGT, BOI.SIZE_KND, BOI.ORD_LEN_MIN ");
strSql.AppendLine(", BOI.ORD_LEN_MAX, BOI.MATR_FL, BOI.CONT_END_DATE, BOI.CONT_END_TIME, BOI.CONT_END_EMP_ID, BOI.VESSEL_NO, BOI.CUST_REQ_NO, BOI.COLOR_STROKE, BOI.RELEASE_DATE ");
strSql.AppendLine(", BOI.RELEASE_TIME, BOI.RELEASE_EMP_ID, BOI.PLN_SMS_PLT, BOI.PLN_MILL_PLT, BOI.CFM_SMS_PLT, BOI.CFM_MILL_PLT, BOI.HTM_SHOT_BLAST ");
strSql.AppendLine(", BOI.INS_DATE, BOI.INS_TIME, BOI.INS_EMPID, BOI.INS_PGMID, BOI.UPD_DATE, BOI.UPD_TIME, BOI.UPD_EMPID, BOI.UPD_PGMID, BOI.SEALMEMO ");
strSql.AppendLine(", BOI.INSPUNITCODEA, BOI.INSPUNITCODEB, BOI.INSPUNITCODEC, BOI.PRODSPECNOA, BOI.PRODSPECNOB, BOI.PRODSPECNOC, BOI.PAINTNUM, BOI.LP_HD_THK, BOI.LP_MD_THK, BOI.LP_TL_THK ");
strSql.AppendLine(", BOI.LP_LEN1, BOI.LP_LEN2, BOI.LP_LEN3, BOI.LP_LEN4, BOI.LP_LEN5, BOI.IMP_CONT, BOI.INSPECT_ORGAN, BOI.CONTRACT_NO, BOI.TRIAL_PRODUCT, BOI.TRIAL_NUM, BOI.TRIAL_STR ");
strSql.AppendLine(", BOI.TRIAL_END, BOI.SIDEMARK, BOI.JIT_STRINGA, BOI.JIT_STRINGB, BOI.JIT_STRINGC, BOI.JITID, BOI.JIT_FLAG, BOI.QO_FL, BOI.SAMPLE_MEMO, BOI.SIZE_MEMO, BOI.PACK_MEMO ");
strSql.AppendLine(", BOI.FLUSH_FL, BOI.APPOINT_PLT, BOI.MORD_DESIGN_WGT, BOI.MORD_FL, BOI.APPOINT_PLT_REASON, BOI.SURFACE_REQUESTS, BOI.STAMP_FL, BOI.UST_INSP_FL, BOI.SPRAY_FL ");
strSql.AppendLine(", BOI.BUFPOOL_CD, BOI.MULTI_INSP_FL, BOI.CONTRACT_DATE, BOI.DELIVERY_STATUS, BOI.CUST_CLASS, BOI.CUST_LEVEL, BOI.SPECIAL_OPR_REQ, BOI.WITNESS_CONTENT, BOI.COGGING_FLAG ");
strSql.AppendLine(", BOI.STD_DET_CLASS_CD, BOI.STD_DET_CLASS_LVL, BOI.CERT_NOTE, BOI.INSPECT_FLAG, BOI.E2E_CUST, BOI.CUST_PURCHASE, BOI.GUID, BOI.NEW_CLASS_STATE, BOI.FACEPAINT ");
strSql.AppendLine(", BOI.IS_JC, BOI.UST_JC, BOI.LEVEL_JM, BOI.ORDER_NOFH, BOI.ITEM_NOFH, BOI.ORDER_THK_JC, BOI.ORDER_THK_FC, BOI.TYPEFH, BOI.PRODTYPENO, BOI.STEEL_SPRAY ");
strSql.AppendLine(", BOI.STEEL_PACK, BOI.STEEL_SHOTBLAST, BOI.STEEL_SLOTEPROCESS, BOI.ORDERQTY, BOI.ORDER_CNT, BOI.DELIVERY_STATUS1, BOI.DELIVERY_STATUS2, BOI.DELIVERY_STATUS3 ");
strSql.AppendLine(", BOI.SPECNOA, BOI.SPECNOB, BOI.SPECNOC, BOI.SPECNOA_YY, BOI.SPECNOB_YY, BOI.SPECNOC_YY, BOI.INSPUNITCODE, BOI.SUBCUSTNO, BOI.ISSHIPORDER, BOI.SAILINGDATE ");
strSql.AppendLine(", BOI.MARINEBOARD, BOI.ORDERNOYPK, BOI.ORDERITEMYPK, BOI.SORTINGMARK, BOI.UST_FL_PRINT, BOI.PRINTUTLEVEL, BOI.RULLBOARDCUT, BOI.PAINTUPT, BOI.ORDERPRICEB ");
strSql.AppendLine(", BOI.ADJUSTPRICE, BOI.HOTUT, BOI.HOTUTRATE, BOI.SPECIALSIGN, BOI.UST_MODE, BOI.INSP_CD1, BOI.INSP_CD2, BOI.QKL_CUSTNO ");
strSql.AppendLine(", CPP.ORD_WGT ");
//TODO:TEST_DATA
strSql.AppendLine(",FLOOR( (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100)/ TRUNC(((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85,3)) AS SUB_LACK_NUM ");
//strSql.AppendLine(",1 AS SUB_LACK_NUM ");
strSql.AppendLine(",(NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) AS SUB_LACK_WGT ");
strSql.AppendLine(",QQT.HTM_METH1 ");
strSql.AppendLine(",QQT.HTM_METH2 ");
strSql.AppendLine(",QQT.HTM_METH3 ");
strSql.AppendLine(",count(EP_SLAB_D.REQ_SEQ_NO) SLAB_LACK_NUM , count(EP_SLAB_D.REQ_SEQ_NO) + FLOOR( (NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100)/ TRUNC(((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85,3)) AS LACK_NUM ");
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("LEFT JOIN NISCO.QP_QLTY_TECH QQT ");
strSql.AppendLine("ON BOI.ORD_NO = QQT.ORD_NO ");
strSql.AppendLine("AND BOI.ORD_ITEM = QQT.ORD_ITEM ");
strSql.AppendLine("LEFT JOIN NISCO.QP_QLTY_DELV QQD");
strSql.AppendLine("ON BOI.ORD_NO = QQD.ORD_NO");
strSql.AppendLine("AND BOI.ORD_ITEM = QQD.ORD_ITEM");
strSql.AppendLine("LEFT JOIN NISCO.EP_REQ_SLAB EP_SLAB_B ");
strSql.AppendLine("ON EP_SLAB_B.ORD_NO = QQD.ORD_NO ");
strSql.AppendLine("AND EP_SLAB_B.ORD_ITEM = QQD.ORD_ITEM ");
strSql.AppendLine("AND EP_SLAB_B.REC_STS = '1'");
//strSql.AppendLine("LEFT JOIN NISCO.EP_REQ_SLAB EP_SLAB_B");
//strSql.AppendLine("ON EP_SLAB.REQ_SEQ_NO = EP_SLAB_B.REQ_SEQ_NO");
strSql.AppendLine("LEFT JOIN NISCO.EP_REQ_SLAB_D EP_SLAB_D");
strSql.AppendLine("ON EP_SLAB_D.ORD_NO = QQD.ORD_NO ");
strSql.AppendLine("AND EP_SLAB_D.REQ_SEQ_NO= EP_SLAB_D.REQ_SEQ_NO");
strSql.AppendLine("AND EP_SLAB_D.ORD_ITEM = QQD.ORD_ITEM ");
strSql.AppendLine("AND EP_SLAB_D.BLOCK_SEQ >= '01'");
strSql.AppendLine("AND EP_SLAB_D.SEQ >= '01'");
strSql.AppendLine("AND EP_SLAB_B.REC_STS = '1'");
//TODO:TEST_DATA
strSql.AppendLine("WHERE 1=1 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine("AND boi.ord_knd IN('A') ");
//strSql.AppendLine("AND boi.ORD_NO NOT LIKE 'OMZ%'");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
//strSql.AppendLine(" or boi.ORD_NO ='OMD22110005'");
//strSql.AppendLine(" AND boi.ORD_ITEM ='100'");
strSql.AppendLine("GROUP BY BOI.ORD_NO, BOI.ORD_ITEM, QQD.THK_TOL_MIN ,QQD.THK_TOL_MAX ,BOI.REC_STS, BOI.PLN_ORD, BOI.PLN_ORD_ITEM, BOI.ORD_STS, BOI.HOLD_FL, BOI.HOLD_DATE, BOI.HOLD_TIME, BOI.HOLD_EMP_ID ");
strSql.AppendLine(", BOI.CURRENCY, BOI.EXTRA_FL, BOI.DISCON_PRC, BOI.TOT_PRC, BOI.TRANS_PRC, BOI.EMP_ID, BOI.PROD_PRC, BOI.REG_DATE, BOI.REG_TIME, BOI.CONF_DATE ");
strSql.AppendLine(", BOI.CONF_TIME, BOI.CONF_EMP_ID, BOI.CUST_CD, BOI.ORD_CUST_CD, BOI.PROD_DGR, BOI.SALE_WAY, BOI.DEPT_CD, BOI.DEST_CD, BOI.DEST_DETAIL ");
strSql.AppendLine(", BOI.ENDUSE_CD, BOI.STLGRD, BOI.PAYMENT_COND, BOI.DEL_COND, BOI.DEL_TOL_UNIT, BOI.DEL_TOL_MAX, BOI.DEL_TOL_MIN, BOI.WGT_UNIT, BOI.WGT_GRP ");
strSql.AppendLine(", BOI.PROD_WGT, BOI.PROD_WGT_MIN, BOI.PROD_WGT_MAX, BOI.TOT_WGT, BOI.STDSPEC, BOI.STDSPEC_YY, BOI.ORD_SIZE, BOI.ORD_WID, BOI.ORD_LEN, BOI.ORD_THK ");
strSql.AppendLine(", BOI.INDIA, BOI.OUTDIA, BOI.CAN_FL, BOI.CAN_DATE, BOI.CAN_TIME, BOI.CAN_EMP_ID, BOI.MOD_FL, BOI.MOD_DATE, BOI.MOD_TIME, BOI.DEL_FR_DATE, BOI.DEL_TO_DATE ");
strSql.AppendLine(", BOI.CUST_DEL_FR_DATE, BOI.CUST_DEL_TO_DATE, BOI.ORD_PROD_END_DATE, BOI.ORD_PROD_END_TIME, BOI.ORD_SHIP_END_DATE, BOI.ORD_SHIP_END_TIME, BOI.ORD_ACCP_DATE ");
strSql.AppendLine(", BOI.ORD_ACCP_TIME, BOI.CUST_REQ_PLANT, BOI.TENT_REQ_PLANT, BOI.CONF_PLANT, BOI.CUST_SPEC_NO, BOI.MARKING_WAY, BOI.STAMP, BOI.TRANSP_WAY, BOI.ORD_KND ");
strSql.AppendLine(", BOI.TRIM_FL, BOI.URGNT_FL, BOI.UST_FL, BOI.PAYMENT_FL, BOI.PAYMENT_DATE, BOI.PAYMENT_TIME, BOI.PAYMENT_EMP_ID, BOI.PACK_WAY, BOI.PACK_WGT_MAX ");
strSql.AppendLine(", BOI.PACK_WGT_MIN, BOI.NUM_PROD, BOI.SALE_EMP_ID, BOI.END_CUST_CD, BOI.INSP_CD, BOI.DOME_FL, BOI.PROD_CD, BOI.PROD_THK_TGT, BOI.SIZE_KND, BOI.ORD_LEN_MIN ");
strSql.AppendLine(", BOI.ORD_LEN_MAX, BOI.MATR_FL, BOI.CONT_END_DATE, BOI.CONT_END_TIME, BOI.CONT_END_EMP_ID, BOI.VESSEL_NO, BOI.CUST_REQ_NO, BOI.COLOR_STROKE, BOI.RELEASE_DATE ");
strSql.AppendLine(", BOI.RELEASE_TIME, BOI.RELEASE_EMP_ID, BOI.PLN_SMS_PLT, BOI.PLN_MILL_PLT, BOI.CFM_SMS_PLT, BOI.CFM_MILL_PLT, BOI.HTM_SHOT_BLAST ");
strSql.AppendLine(", BOI.INS_DATE, BOI.INS_TIME, BOI.INS_EMPID, BOI.INS_PGMID, BOI.UPD_DATE, BOI.UPD_TIME, BOI.UPD_EMPID, BOI.UPD_PGMID, BOI.SEALMEMO ");
strSql.AppendLine(", BOI.INSPUNITCODEA, BOI.INSPUNITCODEB, BOI.INSPUNITCODEC, BOI.PRODSPECNOA, BOI.PRODSPECNOB, BOI.PRODSPECNOC, BOI.PAINTNUM, BOI.LP_HD_THK, BOI.LP_MD_THK, BOI.LP_TL_THK ");
strSql.AppendLine(", BOI.LP_LEN1, BOI.LP_LEN2, BOI.LP_LEN3, BOI.LP_LEN4, BOI.LP_LEN5, BOI.IMP_CONT, BOI.INSPECT_ORGAN, BOI.CONTRACT_NO, BOI.TRIAL_PRODUCT, BOI.TRIAL_NUM, BOI.TRIAL_STR ");
strSql.AppendLine(", BOI.TRIAL_END, BOI.SIDEMARK, BOI.JIT_STRINGA, BOI.JIT_STRINGB, BOI.JIT_STRINGC, BOI.JITID, BOI.JIT_FLAG, BOI.QO_FL, BOI.SAMPLE_MEMO, BOI.SIZE_MEMO, BOI.PACK_MEMO ");
strSql.AppendLine(", BOI.FLUSH_FL, BOI.APPOINT_PLT, BOI.MORD_DESIGN_WGT, BOI.MORD_FL, BOI.APPOINT_PLT_REASON, BOI.SURFACE_REQUESTS, BOI.STAMP_FL, BOI.UST_INSP_FL, BOI.SPRAY_FL ");
strSql.AppendLine(", BOI.BUFPOOL_CD, BOI.MULTI_INSP_FL, BOI.CONTRACT_DATE, BOI.DELIVERY_STATUS, BOI.CUST_CLASS, BOI.CUST_LEVEL, BOI.SPECIAL_OPR_REQ, BOI.WITNESS_CONTENT, BOI.COGGING_FLAG ");
strSql.AppendLine(", BOI.STD_DET_CLASS_CD, BOI.STD_DET_CLASS_LVL, BOI.CERT_NOTE, BOI.INSPECT_FLAG, BOI.E2E_CUST, BOI.CUST_PURCHASE, BOI.GUID, BOI.NEW_CLASS_STATE, BOI.FACEPAINT ");
strSql.AppendLine(", BOI.IS_JC, BOI.UST_JC, BOI.LEVEL_JM, BOI.ORDER_NOFH, BOI.ITEM_NOFH, BOI.ORDER_THK_JC, BOI.ORDER_THK_FC, BOI.TYPEFH, BOI.PRODTYPENO, BOI.STEEL_SPRAY ");
strSql.AppendLine(", BOI.STEEL_PACK, BOI.STEEL_SHOTBLAST, BOI.STEEL_SLOTEPROCESS, BOI.ORDERQTY, BOI.ORDER_CNT, BOI.DELIVERY_STATUS1, BOI.DELIVERY_STATUS2, BOI.DELIVERY_STATUS3 ");
strSql.AppendLine(", BOI.SPECNOA, BOI.SPECNOB, BOI.SPECNOC, BOI.SPECNOA_YY, BOI.SPECNOB_YY, BOI.SPECNOC_YY, BOI.INSPUNITCODE, BOI.SUBCUSTNO, BOI.ISSHIPORDER, BOI.SAILINGDATE ");
strSql.AppendLine(", BOI.MARINEBOARD, BOI.ORDERNOYPK, BOI.ORDERITEMYPK, BOI.SORTINGMARK, BOI.UST_FL_PRINT, BOI.PRINTUTLEVEL, BOI.RULLBOARDCUT, BOI.PAINTUPT, BOI.ORDERPRICEB ");
strSql.AppendLine(", BOI.ADJUSTPRICE, BOI.HOTUT, BOI.HOTUTRATE, BOI.SPECIALSIGN, BOI.UST_MODE, BOI.INSP_CD1, BOI.INSP_CD2, BOI.QKL_CUSTNO ");
strSql.AppendLine(", CPP.ORD_WGT ,FLOOR( (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)) ,(NVL(CPP.ORD_REM_WGT, 0) - CPP.ORD_WGT * (CPP.DEL_TOL_MAX + ABS(CPP.DEL_TOL_MIN)) / 100) ");
strSql.AppendLine(", QQT.HTM_METH1 ");
strSql.AppendLine(", QQT.HTM_METH2 ");
strSql.AppendLine(", QQT.HTM_METH3 ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gpPlates = db.Query<BP_ORDER_ITEM>(strSql.ToString());
// logger.Info(gpPlates.Count.ToString());
//gpPlates = CommonUtils.DataTableToList<BP_ORDER_ITEM>(a);
// logger.Info("gpPlates :" + a.Rows.Count);
}
}
catch (Exception ex)
{
logger.Error("GetOrder 报错", ex);
}
return gpPlates;
}
/// <summary>
///查询所有余材的信息
/// </summary>
/// <returns>所有符合条件的XACDZBDZEQAB 状态余材 集合</returns>
public IList<GP_SMP_NO> GetGP_SMP_NO(string strWHerePlate, string strNotinPlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<GP_SMP_NO> gpPlates = new List<GP_SMP_NO>();
//查询语句日期时间拼接起来格式化成yyyy-mm-dd hh24:mi:ss PROD_WGT
strSql.AppendLine("SELECT");
strSql.AppendLine(" distinct GP.PLATE_NO ,GP.SMP_NO ");
strSql.AppendLine("FROM NISCO.GP_PLATE GP where smp_no is not null ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(strNotinPlate);
strSql.AppendLine("ORDER BY GP.PLATE_NO");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gpPlates = db.Query<GP_SMP_NO>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetGP_SMP_NO 报错", ex);
}
return gpPlates;
}
/// <summary>
///查询降级到余材
/// </summary>
/// <returns>所有符合条件的XACDZBDZEQAB 状态余材 集合</returns>
public IList<CP_REP_HIS> GetREP_TYP()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<CP_REP_HIS> gpPlates = new List<CP_REP_HIS>();
//查询语句日期时间拼接起来格式化成yyyy-mm-dd hh24:mi:ss PROD_WGT
strSql.AppendLine("SELECT");
strSql.AppendLine(" * FROM NISCO.CP_REP_HIS ");
strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(" AND REP_TYP = '1' ");
strSql.AppendLine(" AND INS_EMP = '0007299' ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gpPlates = db.Query<CP_REP_HIS>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetREP_TYP 报错", ex);
}
return gpPlates;
}
/// <summary>
///查询所有余材的信息
/// </summary>
/// <returns>所有符合条件的XACDZBDZEQAB 状态余材 集合</returns>
public IList<GP_PLATE> GetAllMat(string strWHerePlate, string strNotinPlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<GP_PLATE> gpPlates = new List<GP_PLATE>();
//查询语句日期时间拼接起来格式化成yyyy-mm-dd hh24:mi:ss PROD_WGT
strSql.AppendLine("SELECT");
strSql.AppendLine(" GP.PLATE_NO ");
strSql.AppendLine(",GI.INSP_B_DEP_FLAW2 ");
strSql.AppendLine(",(SELECT COUNT(*) ");
strSql.AppendLine(" FROM NISCO.GP_USTRESULT GU ");
strSql.AppendLine(" WHERE GU.PLATE_NO = TRIM(GP.PLATE_NO) ");
strSql.AppendLine(" AND GU.UST_DEC = 'Y') GU_CNT ");
strSql.AppendLine(", QQD.THK_TOL_MIN ,QQD.THK_TOL_MAX , GP.OCCR_CD, GP.PLT, GP.PRC_LINE, GP.REC_STS, GP.PROC_CD, GP.BEF_PROC_CD, GP.PROD_CD, GP.STLGRD");
strSql.AppendLine(", CASE WHEN gpr.THK > 0 and gp.PROC_CD <> 'XAC' THEN gpr.THK ELSE gp.THK END THK");
strSql.AppendLine(", CASE WHEN gpr.WID > 0 and gp.PROC_CD <> 'XAC' THEN gpr.WID ELSE gp.WID END WID");
strSql.AppendLine(", CASE WHEN gpr.LEN > 0 and gp.PROC_CD <> 'XAC' THEN gpr.LEN ELSE gp.LEN END LEN");
strSql.AppendLine(", GP.WGT, GP.CAL_WGT, GP.THK_GRP, GP.WID_GRP, GP.OVER_FL, GP.ORD_FL, GP.WOO_RSN ");
strSql.AppendLine(", GP.ORD_NO, GP.ORD_ITEM, GP.ORG_ORD_NO, GP.ORG_ORD_ITEM, GP.ENDUSE_CD, GP.DEL_TO_DATE, GP.PROD_DATE ");
strSql.AppendLine(", GP.PROD_TIME, GP.SHIFT, GP.GROUP_CD, GP.LOC, GP.BED_PILE_DATE, GP.SMP_FL, GP.SMP_LOC, GP.SMP_LEN ");
strSql.AppendLine(", GP.SMP_NO, GP.INSP_EMP, GP.DSC_DATE, GP.DSC_TIME, GP.PROD_GRD, GP.SURF_GRD, GP.QUALITY_GRD ");
strSql.AppendLine(", GP.QUALITY_UPD_GRD, GP.APLY_STDSPEC, GP.APLY_ENDUSE_CD, GP.IN_PLT_CD, GP.IN_PLT, GP.IN_PLT_DATE ");
strSql.AppendLine(", GP.IN_PLT_TIME, GP.IN_CAR_NO, GP.SLAB_NO, GP.IN_PLT_CO, GP.OUT_PLT_CD, GP.OUT_PLT, GP.OUT_PLT_DATE ");
strSql.AppendLine(", GP.OUT_PLT_TIME, GP.OUT_CAR_NO, GP.OUT_SHEET_NO, GP.HOUSING_DATE, GP.HOUSING_TIME, GP.SHP_IST_NO ");
strSql.AppendLine(", GP.SHP_IST_DATE, GP.SHP_IST_TIME, GP.SHP_DATE, GP.SHP_TIME, GP.TRNS_NO, GP.CAR_NO, GP.TRNS_CMPY_CD ");
strSql.AppendLine(", GP.SHP_EMP, GP.TRAIN_LINE_NAME, GP.DEST_DETAIL, GP.CERT_RPT_FL, GP.CERT_RPT_DATE, GP.CERT_RPT_TIME ");
strSql.AppendLine(", GP.SHP_IST_CAN_DATE, GP.SHP_IST_CAN_TIME, GP.SHP_IST_CAN_FL, GP.INS_DATE, GP.INS_EMP_CD, GP.INS_PGMID ");
strSql.AppendLine(", GP.UPD_DATE, GP.UPD_EMP_CD, GP.UPD_PGM, GP.PLATE_SEC, GP.CR_CD, GP.PILE_NO, GP.PRC, GP.SF_ORNOT, GP.UST_FL ");
strSql.AppendLine(", GP.TRIM_FL, GP.END_RES, GP.ORG_PLATE, GP.ORD_THK, GP.ORD_WID, GP.ORD_LEN, GP.ORD_WGT, GP.NEXT_PROC ");
strSql.AppendLine(", GP.ACT_SMP_FL, GP.ACT_SMP_LEN, GP.CUST_CD, GP.CUR_INV, GP.BEF_APLY_STDSPEC, GP.STDSPEC_UPD_FL ");
strSql.AppendLine(", GP.SIZE_KND, GP.BAOXIN_IF_DATE, GP.SLAB_WGT, GP.CUST_SPEC_NO, GP.LOAD_WGT, GP.PRICE_GRD ");
strSql.AppendLine(", GP.PRICE_GRD_DATE, GP.PRICE_GRD_TIME, GP.PRICE_GRD_EMP_CD, GP.CHG_GRD_RES, GP.MARKING_FL ");
strSql.AppendLine(", GP.MAT_OWNER_FL, GP.MAT_OWNER_CUST_CD, GP.RSLT_PROC_CD, GP.UST_RLT_CD, GP.UST_STATUS ");
strSql.AppendLine(", GP.HTM_SHOT_BLAST, GP.HTM_SHOT_BLAST_RLT, GP.HTM_RSLT_FL, GP.HTM_METH1, GP.HTM_COND1 ");
strSql.AppendLine(", GP.HTM_RLT_METH1, GP.HTM_METH2, GP.HTM_COND2, GP.HTM_RLT_METH2, GP.HTM_METH3, GP.HTM_COND3 ");
strSql.AppendLine(", GP.HTM_RLT_METH3, GP.HTM_METH4, GP.HTM_COND4, GP.HTM_RLT_METH4, GP.HTM_METH5, GP.HTM_COND5 ");
strSql.AppendLine(", GP.HTM_RLT_METH5, GP.GRID_FL, GP.GRID_RSLT, GP.CL_FL, GP.CL_RSLT, GP.GAS_FL, GP.GAS_RSLT, GP.UST_CNT ");
strSql.AppendLine(", GP.CUT_CNT, GP.HTM_CNT, GP.CL_CNT, GP.SB_CNT, GP.GRD_CNT, GP.CLAIM_RES, GP.CLAIM_DATE, GP.CLAIM_THK ");
strSql.AppendLine(", GP.CLAIM_WID, GP.CLAIM_LEN, GP.CLAIM_WGT, GP.ERP_IF_DATE, GP.NEXT_PLAN_HTM, GP.NEXT_PLAN_HTM_COND ");
strSql.AppendLine(", GP.PLAN_CUT_CNT, GP.SMP_SET_FL, GP.FP_FL, GP.FP_RSLT, GP.FP_CNT, GP.ACT_SMP_FL_R, GP.ACT_SMP_LEN_R ");
strSql.AppendLine(", GP.SMP_NO_R, GP.ERP_MPLATE_CHK, GP.ERP_PLATE_IN ");
strSql.AppendLine(", '' SUB_PRO_STA, '' SUB_CON_STA, '' SUB_CUT_POS_1,'' SUB_FULL,'' SUB_LACK_CON ");
strSql.AppendLine(", '' SUB_CUT_POS_2, '' SUB_ORD_NO, '' SUB_ORD_ITEM, '' SUB_ORD_REM, '' SUB_SUR_LEN_1, '' SUB_SUR_WID_1 ");
strSql.AppendLine(", '' SUB_SUR_LEN_2, '' SUB_SUR_WID_2, '' SUB_SUR_STA_1, '' SUB_SUR_STA_2, '' SUB_LOS_WGT, '' SUB_DATE ");
strSql.AppendLine(", '' SUB_NUM, '' SUB_DIR, '' SUB_US_WID, '' SUB_US_LEN, '' SUB_CUT_X, '' SUB_CUT_Y, '' SUB_USER ");
strSql.AppendLine(",bob.ORD_NO BOB_ORD_NO --//--替代前订单订单号 ");
strSql.AppendLine(",bob.ORD_ITEM BOB_ORD_ITEM --//--替代前订单序列 ");
strSql.AppendLine(",bob.STDSPEC BOB_STDSPEC --//--替代前订单订单标准 ");
strSql.AppendLine(",bob.ORD_THK BOB_ORD_THK --//--替代前订单厚度 ");
strSql.AppendLine(",bob.ORD_WID BOB_ORD_WID --//--替代前订单宽度 ");
strSql.AppendLine(",bob.ORD_LEN BOB_ORD_LEN --//--替代前订单长度 ");
strSql.AppendLine(",bob.PROD_WGT BOB_WGT_UNIT --//--替代前订单重量 ");
strSql.AppendLine(",bob.CUST_CD BOB_CUST_CD --//--替代前订单客户名称 ");
strSql.AppendLine(",bob.ENDUSE_CD BOB_ENDUSE_CD --//--替代前订单订单用途 ");
strSql.AppendLine(",bob.ORD_KND BOB_ORD_KND --//--替代前订单订单种类 ");
strSql.AppendLine(",boo.ORD_NO BOO_ORD_NO --//--原始订单订单号 ");
strSql.AppendLine(",boo.ORD_ITEM BOO_ORD_ITEM --//--原始订单序列 ");
strSql.AppendLine(",boo.STDSPEC BOO_STDSPEC --//--原始订单订单标准 ");
strSql.AppendLine(",boo.ORD_THK BOO_ORD_THK --//--原始订单厚度 ");
strSql.AppendLine(",boo.ORD_WID BOO_ORD_WID --//--原始订单宽度 ");
strSql.AppendLine(",boo.ORD_LEN BOO_ORD_LEN --//--原始订单长度 ");
strSql.AppendLine(",boo.PROD_WGT BOO_WGT_UNIT --//--原始订单重量 ");
strSql.AppendLine(",boo.CUST_CD BOO_CUST_CD --//--原始订单客户名称 ");
strSql.AppendLine(", CASE WHEN gpr.THK > 0 and gpr.WID > 0 and gpr.LEN >0 and gp.PROC_CD <> 'XAC' THEN 1 ELSE 0 END IS_CP_MOVE ");
strSql.AppendLine(", CASE WHEN UST.UST_DEC = 'N' and UST.UST_DEC_FP_1 = 'Y' THEN 1 ELSE 0 END IS_UST ");
strSql.AppendLine("FROM NISCO.GP_PLATE GP ");
strSql.AppendLine("LEFT JOIN NISCO.BP_ORDER_ITEM bob ON gp.ORD_NO = bob.ORD_NO AND gp.ORD_ITEM = bob.ORD_ITEM--// ");
strSql.AppendLine("LEFT JOIN NISCO.BP_ORDER_ITEM boo ON gp.ORG_ORD_NO = boo.ORD_NO AND gp.ORG_ORD_ITEM = boo.ORD_ITEM--// ");
strSql.AppendLine("LEFT JOIN NISCO.QP_QLTY_DELV QQD ON gp.ORG_ORD_NO = QQD.ORD_NO AND gp.ORG_ORD_ITEM = QQD.ORD_ITEM--// ");
strSql.AppendLine("LEFT JOIN NISCO.GP_PLATE_REPLACE gpr ON gpr.PLATE_NO = gp.PLATE_NO ");
strSql.AppendLine("LEFT JOIN NISCO.GP_INSPPLATE GI ON GI.MAT_NO = GP.PLATE_NO ");
strSql.AppendLine("LEFT JOIN NISCO.GP_USTRESULT UST ON UST.PLATE_NO = GP.PLATE_NO ");
strSql.AppendLine("WHERE 1=1 ");
strSql.AppendLine("AND GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN UST.UST_DEC = 'N' and UST.UST_DEC_FP_1 = 'Y' AND (GP.SURF_GRD = '1' OR GP.SURF_GRD = '2' OR GP.SURF_GRD = '3' OR GP.SURF_GRD = '4') THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PRICE_GRD = '2' AND trunc(months_between(sysdate,to_date(PROD_DATE,'yyyymmdd'))) <'3' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd <> 'XAC' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'XAC' AND GP.PRICE_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'XAC' AND GP.PRICE_GRD is null THEN 1 ");
strSql.AppendLine("WHEN UST.UST_DEC = 'N' and UST.UST_DEC_FP_1 = 'Y' AND (GP.SURF_GRD = '1' OR GP.SURF_GRD = '2' OR GP.SURF_GRD = '3' OR GP.SURF_GRD = '4') THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine("AND GP.APLY_STDSPEC NOT LIKE '%NG-XY%'");
strSql.AppendLine("AND GP.Len <50000 "); //钢板长度上限50米
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(strNotinPlate);
strSql.AppendLine("ORDER BY GP.PLATE_NO");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gpPlates = db.Query<GP_PLATE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetAllMat 报错", ex);
}
return gpPlates;
}
/// <summary>
///查询所有余材的信息
/// </summary>
/// <returns>所有符合条件的XACDZBDZEQAB 状态余材 集合</returns>
public IList<GP_PLATE> GetAllCGB(string strWHerePlate, string strNotinPlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<GP_PLATE> gpPlates = new List<GP_PLATE>();
//查询语句日期时间拼接起来格式化成yyyy-mm-dd hh24:mi:ss PROD_WGT
strSql.AppendLine("SELECT");
strSql.AppendLine(" GP.PLATE_NO ");
strSql.AppendLine(",GI.INSP_B_DEP_FLAW2 ");
strSql.AppendLine(",(SELECT COUNT(*) ");
strSql.AppendLine(" FROM NISCO.GP_USTRESULT GU ");
strSql.AppendLine(" WHERE GU.PLATE_NO = TRIM(GP.PLATE_NO) ");
strSql.AppendLine(" AND GU.UST_DEC = 'Y') GU_CNT ");
strSql.AppendLine(", QQD.THK_TOL_MIN ,QQD.THK_TOL_MAX , GP.OCCR_CD, GP.PLT, GP.PRC_LINE, GP.REC_STS, GP.PROC_CD, GP.BEF_PROC_CD, GP.PROD_CD, GP.STLGRD");
strSql.AppendLine(", CASE WHEN gpr.THK > 0 and gp.PROC_CD <> 'XAC' THEN gpr.THK ELSE gp.THK END THK");
strSql.AppendLine(", CASE WHEN gpr.WID > 0 and gp.PROC_CD <> 'XAC' THEN gpr.WID ELSE gp.WID END WID");
strSql.AppendLine(", CASE WHEN gpr.LEN > 0 and gp.PROC_CD <> 'XAC' THEN gpr.LEN ELSE gp.LEN END LEN");
strSql.AppendLine(", GP.WGT, GP.CAL_WGT, GP.THK_GRP, GP.WID_GRP, GP.OVER_FL, GP.ORD_FL, GP.WOO_RSN ");
strSql.AppendLine(", GP.ORD_NO, GP.ORD_ITEM, GP.ORG_ORD_NO, GP.ORG_ORD_ITEM, GP.ENDUSE_CD, GP.DEL_TO_DATE, GP.PROD_DATE ");
strSql.AppendLine(", GP.PROD_TIME, GP.SHIFT, GP.GROUP_CD, GP.LOC, GP.BED_PILE_DATE, GP.SMP_FL, GP.SMP_LOC, GP.SMP_LEN ");
strSql.AppendLine(", GP.SMP_NO, GP.INSP_EMP, GP.DSC_DATE, GP.DSC_TIME, GP.PROD_GRD, GP.SURF_GRD, GP.QUALITY_GRD ");
strSql.AppendLine(", GP.QUALITY_UPD_GRD, GP.APLY_STDSPEC, GP.APLY_ENDUSE_CD, GP.IN_PLT_CD, GP.IN_PLT, GP.IN_PLT_DATE ");
strSql.AppendLine(", GP.IN_PLT_TIME, GP.IN_CAR_NO, GP.SLAB_NO, GP.IN_PLT_CO, GP.OUT_PLT_CD, GP.OUT_PLT, GP.OUT_PLT_DATE ");
strSql.AppendLine(", GP.OUT_PLT_TIME, GP.OUT_CAR_NO, GP.OUT_SHEET_NO, GP.HOUSING_DATE, GP.HOUSING_TIME, GP.SHP_IST_NO ");
strSql.AppendLine(", GP.SHP_IST_DATE, GP.SHP_IST_TIME, GP.SHP_DATE, GP.SHP_TIME, GP.TRNS_NO, GP.CAR_NO, GP.TRNS_CMPY_CD ");
strSql.AppendLine(", GP.SHP_EMP, GP.TRAIN_LINE_NAME, GP.DEST_DETAIL, GP.CERT_RPT_FL, GP.CERT_RPT_DATE, GP.CERT_RPT_TIME ");
strSql.AppendLine(", GP.SHP_IST_CAN_DATE, GP.SHP_IST_CAN_TIME, GP.SHP_IST_CAN_FL, GP.INS_DATE, GP.INS_EMP_CD, GP.INS_PGMID ");
strSql.AppendLine(", GP.UPD_DATE, GP.UPD_EMP_CD, GP.UPD_PGM, GP.PLATE_SEC, GP.CR_CD, GP.PILE_NO, GP.PRC, GP.SF_ORNOT, GP.UST_FL ");
strSql.AppendLine(", GP.TRIM_FL, GP.END_RES, GP.ORG_PLATE, GP.ORD_THK, GP.ORD_WID, GP.ORD_LEN, GP.ORD_WGT, GP.NEXT_PROC ");
strSql.AppendLine(", GP.ACT_SMP_FL, GP.ACT_SMP_LEN, GP.CUST_CD, GP.CUR_INV, GP.BEF_APLY_STDSPEC, GP.STDSPEC_UPD_FL ");
strSql.AppendLine(", GP.SIZE_KND, GP.BAOXIN_IF_DATE, GP.SLAB_WGT, GP.CUST_SPEC_NO, GP.LOAD_WGT, GP.PRICE_GRD ");
strSql.AppendLine(", GP.PRICE_GRD_DATE, GP.PRICE_GRD_TIME, GP.PRICE_GRD_EMP_CD, GP.CHG_GRD_RES, GP.MARKING_FL ");
strSql.AppendLine(", GP.MAT_OWNER_FL, GP.MAT_OWNER_CUST_CD, GP.RSLT_PROC_CD, GP.UST_RLT_CD, GP.UST_STATUS ");
strSql.AppendLine(", GP.HTM_SHOT_BLAST, GP.HTM_SHOT_BLAST_RLT, GP.HTM_RSLT_FL, GP.HTM_METH1, GP.HTM_COND1 ");
strSql.AppendLine(", GP.HTM_RLT_METH1, GP.HTM_METH2, GP.HTM_COND2, GP.HTM_RLT_METH2, GP.HTM_METH3, GP.HTM_COND3 ");
strSql.AppendLine(", GP.HTM_RLT_METH3, GP.HTM_METH4, GP.HTM_COND4, GP.HTM_RLT_METH4, GP.HTM_METH5, GP.HTM_COND5 ");
strSql.AppendLine(", GP.HTM_RLT_METH5, GP.GRID_FL, GP.GRID_RSLT, GP.CL_FL, GP.CL_RSLT, GP.GAS_FL, GP.GAS_RSLT, GP.UST_CNT ");
strSql.AppendLine(", GP.CUT_CNT, GP.HTM_CNT, GP.CL_CNT, GP.SB_CNT, GP.GRD_CNT, GP.CLAIM_RES, GP.CLAIM_DATE, GP.CLAIM_THK ");
strSql.AppendLine(", GP.CLAIM_WID, GP.CLAIM_LEN, GP.CLAIM_WGT, GP.ERP_IF_DATE, GP.NEXT_PLAN_HTM, GP.NEXT_PLAN_HTM_COND ");
strSql.AppendLine(", GP.PLAN_CUT_CNT, GP.SMP_SET_FL, GP.FP_FL, GP.FP_RSLT, GP.FP_CNT, GP.ACT_SMP_FL_R, GP.ACT_SMP_LEN_R ");
strSql.AppendLine(", GP.SMP_NO_R, GP.ERP_MPLATE_CHK, GP.ERP_PLATE_IN ");
strSql.AppendLine(", '' SUB_PRO_STA, '' SUB_CON_STA, '' SUB_CUT_POS_1,'' SUB_FULL,'' SUB_LACK_CON ");
strSql.AppendLine(", '' SUB_CUT_POS_2, '' SUB_ORD_NO, '' SUB_ORD_ITEM, '' SUB_ORD_REM, '' SUB_SUR_LEN_1, '' SUB_SUR_WID_1 ");
strSql.AppendLine(", '' SUB_SUR_LEN_2, '' SUB_SUR_WID_2, '' SUB_SUR_STA_1, '' SUB_SUR_STA_2, '' SUB_LOS_WGT, '' SUB_DATE ");
strSql.AppendLine(", '' SUB_NUM, '' SUB_DIR, '' SUB_US_WID, '' SUB_US_LEN, '' SUB_CUT_X, '' SUB_CUT_Y, '' SUB_USER ");
strSql.AppendLine(",bob.ORD_NO BOB_ORD_NO --//--替代前订单订单号 ");
strSql.AppendLine(",bob.ORD_ITEM BOB_ORD_ITEM --//--替代前订单序列 ");
strSql.AppendLine(",bob.STDSPEC BOB_STDSPEC --//--替代前订单订单标准 ");
strSql.AppendLine(",bob.ORD_THK BOB_ORD_THK --//--替代前订单厚度 ");
strSql.AppendLine(",bob.ORD_WID BOB_ORD_WID --//--替代前订单宽度 ");
strSql.AppendLine(",bob.ORD_LEN BOB_ORD_LEN --//--替代前订单长度 ");
strSql.AppendLine(",bob.PROD_WGT BOB_WGT_UNIT --//--替代前订单重量 ");
strSql.AppendLine(",bob.CUST_CD BOB_CUST_CD --//--替代前订单客户名称 ");
strSql.AppendLine(",bob.ENDUSE_CD BOB_ENDUSE_CD --//--替代前订单订单用途 ");
strSql.AppendLine(",bob.ORD_KND BOB_ORD_KND --//--替代前订单订单种类 ");
strSql.AppendLine(",boo.ORD_NO BOO_ORD_NO --//--原始订单订单号 ");
strSql.AppendLine(",boo.ORD_ITEM BOO_ORD_ITEM --//--原始订单序列 ");
strSql.AppendLine(",boo.STDSPEC BOO_STDSPEC --//--原始订单订单标准 ");
strSql.AppendLine(",boo.ORD_THK BOO_ORD_THK --//--原始订单厚度 ");
strSql.AppendLine(",boo.ORD_WID BOO_ORD_WID --//--原始订单宽度 ");
strSql.AppendLine(",boo.ORD_LEN BOO_ORD_LEN --//--原始订单长度 ");
strSql.AppendLine(",boo.PROD_WGT BOO_WGT_UNIT --//--原始订单重量 ");
strSql.AppendLine(",boo.CUST_CD BOO_CUST_CD --//--原始订单客户名称 ");
strSql.AppendLine(", CASE WHEN gpr.THK > 0 and gpr.WID > 0 and gpr.LEN >0 and gp.PROC_CD <> 'XAC' THEN 1 ELSE 0 END IS_CP_MOVE ");
strSql.AppendLine(", CASE WHEN UST.UST_DEC = 'N' and UST.UST_DEC_FP_1 = 'Y' THEN 1 ELSE 0 END IS_UST ");
strSql.AppendLine("FROM NISCO.GP_PLATE GP ");
strSql.AppendLine("LEFT JOIN NISCO.BP_ORDER_ITEM bob ON gp.ORD_NO = bob.ORD_NO AND gp.ORD_ITEM = bob.ORD_ITEM--// ");
strSql.AppendLine("LEFT JOIN NISCO.BP_ORDER_ITEM boo ON gp.ORG_ORD_NO = boo.ORD_NO AND gp.ORG_ORD_ITEM = boo.ORD_ITEM--// ");
strSql.AppendLine("LEFT JOIN NISCO.QP_QLTY_DELV QQD ON gp.ORG_ORD_NO = QQD.ORD_NO AND gp.ORG_ORD_ITEM = QQD.ORD_ITEM--// ");
strSql.AppendLine("LEFT JOIN NISCO.GP_PLATE_REPLACE gpr ON gpr.PLATE_NO = gp.PLATE_NO ");
strSql.AppendLine("LEFT JOIN NISCO.GP_INSPPLATE GI ON GI.MAT_NO = GP.PLATE_NO ");
strSql.AppendLine("LEFT JOIN NISCO.GP_USTRESULT UST ON UST.PLATE_NO = GP.PLATE_NO ");
strSql.AppendLine("WHERE 1=1 ");
strSql.AppendLine("AND GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN UST.UST_DEC = 'N' and UST.UST_DEC_FP_1 = 'Y' AND (GP.SURF_GRD = '1' OR GP.SURF_GRD = '2' OR GP.SURF_GRD = '3' OR GP.SURF_GRD = '4') THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PRICE_GRD = '2' AND trunc(months_between(sysdate,to_date(PROD_DATE,'yyyymmdd'))) <'3' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd <> 'XAC' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'XAC' AND GP.PRICE_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'XAC' AND GP.PRICE_GRD is null THEN 1 ");
strSql.AppendLine("WHEN UST.UST_DEC = 'N' and UST.UST_DEC_FP_1 = 'Y' AND (GP.SURF_GRD = '1' OR GP.SURF_GRD = '2' OR GP.SURF_GRD = '3' OR GP.SURF_GRD = '4') THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine("AND GP.APLY_STDSPEC NOT LIKE '%NG-XY%'");
//strSql.AppendLine("AND GP.Len <50000 "); //钢板长度上限50米
strSql.AppendLine("AND length(GP.PLATE_NO) =12"); //钢板长度上限50米
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(strNotinPlate);
strSql.AppendLine("ORDER BY GP.PLATE_NO");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gpPlates = db.Query<GP_PLATE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetAllCGB 报错", ex);
}
return gpPlates;
}
/// <summary>
/// 获取标准集合
/// </summary>
/// <returns>所有标准的集合</returns>
public IList<CP_NISCO_CHMC_SL> GetStandGroup()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<CP_NISCO_CHMC_SL> gpPlates = new List<CP_NISCO_CHMC_SL>();
strSql.AppendLine("SELECT ");
strSql.AppendLine(" STLGRD ");
strSql.AppendLine(" , STEEL_GRD_DETAIL ");
strSql.AppendLine(" , STL_SEQ ");
strSql.AppendLine(" , STDSPEC ");
strSql.AppendLine(" , THK_MIN ");
strSql.AppendLine(" , THK_MAX ");
strSql.AppendLine(" , INS_DATE ");
strSql.AppendLine(" , INS_TIME ");
strSql.AppendLine(" , INS_EMP ");
strSql.AppendLine(" , UPD_DATE ");
strSql.AppendLine(" , UPD_TIME ");
strSql.AppendLine(" , UPD_EMP ");
strSql.AppendLine(" , STLGRD_FL ");
strSql.AppendLine(" , ZZ_PLT ");
strSql.AppendLine(" , ZZ_PLT_DESP ");
strSql.AppendLine("FROM NISCO.CP_NISCO_CHMC_SL ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gpPlates = db.Query<CP_NISCO_CHMC_SL>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetStandGroup 报错", ex);
}
return gpPlates;
}
/// <summary>
/// 根据订单号找到对应的订单要求化学成分
/// </summary>
/// <returns>对应的化学成分集合</returns>
/// 方法如果被static修饰, 则在接口中无法被发现(原因不详)
public IList<QP_QLTY_CHEM> GetOrderChemistry(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
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("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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine("AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(") ");
strSql.AppendLine(" AND QQC.KND IN ('1','2') ) T WHERE T.rk = 1 ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
orderChemistrys = db.Query<QP_QLTY_CHEM>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetSurplusMaterial 报错 : ", ex);
}
return orderChemistrys;
}
/// <summary>
/// 获取订单化学属性QP_QLTY_CHEM_FP
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_CHEM_FP> GetQP_QLTY_CHEM_FP(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_CHEM_FP> ltQP_QLTY_MATR_MAIN = new List<QP_QLTY_CHEM_FP>();
//strSql.AppendLine(" select t.ord_no,t.ord_item,t.knd,t.CHEM_COMP_CD,t.FOMULA_CD,t.CHEM_COMP_MIN, t.CHEM_COMP_MAX,t.CHEM_DIFF_MIN,t.CHEM_DIFF_MAX,t.SMP_CNT,t.GC_NO,t.CHEM_DIGIT,SMP_GC_TYPE from (select t.ord_no,t.ord_item,t.knd,t.CHEM_COMP_CD,t.FOMULA_CD,t.CHEM_COMP_MIN, t.CHEM_COMP_MAX,t.CHEM_DIFF_MIN,t.CHEM_DIFF_MAX,t.SMP_CNT,t.GC_NO,t.CHEM_DIGIT,t.SMP_GC_TYPE, ");
strSql.AppendLine(" select ORD_NO,ORD_ITEM,KND,CHEM_COMP_CD,FOMULA_CD,CHEM_COMP_MIN,CHEM_COMP_MAX,INS_DATE,INS_TIME,UPD_DATE,UPD_TIME,UPD_EMP,CHEM_DIFF_MIN,CHEM_DIFF_MAX,SMP_CNT,GC_NO,CHEM_DIGIT,SMP_GC_TYPE from (select t.*, ");
strSql.AppendLine(" rank() over(partition by t.ord_no,t.ord_item order by knd desc) rk from nisco.QP_QLTY_CHEM_FP t ");
strSql.AppendLine(" where t.knd in ('4','5') and (ord_no,ord_item) in(select BOI.ORD_NO,BOI.ORD_ITEM from NISCO.BP_ORDER_ITEM boi ");
//strSql.AppendLine(" where 1=1 and (ord_no,ord_item) in(select BOI.ORD_NO,BOI.ORD_ITEM from NISCO.BP_ORDER_ITEM boi ");
strSql.AppendLine(" INNER JOIN NISCO.cp_prc CPP ");
strSql.AppendLine(" ON BOI.ORD_NO = CPP.ORD_NO ");
strSql.AppendLine(" AND BOI.ORD_ITEM = CPP.ORD_ITEM ");
strSql.AppendLine(" where BOI.ORD_WID > 0 ");
strSql.AppendLine(" AND BOI.ORD_LEN > 0 ");
strSql.AppendLine(" AND BOI.ORD_THK > 0 ");
strSql.AppendLine(" and boi.PROD_CD = 'PP' ");
strSql.AppendLine(" AND boi.REC_STS = '2' ");
strSql.AppendLine(" and boi.ORD_STS IN('E', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(" AND ((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') + 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(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
//strSql.AppendLine(" AND t.KND IN ('1','2') ) t where rk = 1 ");
strSql.AppendLine(" ) t where rk = 1 ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_MAIN = db.Query<QP_QLTY_CHEM_FP>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_CHEM_FP 报错 : ", ex);
}
return ltQP_QLTY_MATR_MAIN;
}
/// <summary>
/// 根据钢板板坯号找到对应炉号,根据炉号找到对应化学成分
/// </summary>
/// <returns>对应的化学成分集合</returns>
public IList<QP_CHEM_RSLT> GetChemistry(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_CHEM_RSLT> chemistrys = new List<QP_CHEM_RSLT>();
strSql.AppendLine("SELECT* FROM NISCO.QP_CHEM_RSLT WHERE HEAT_NO IN ");
strSql.AppendLine("(SELECT DISTINCT HEAT_NO FROM NISCO.FP_SLAB WHERE SLAB_NO IN ");
strSql.AppendLine("(SELECT DISTINCT GP.SLAB_NO FROM NISCO.GP_PLATE GP ");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
chemistrys = db.Query<QP_CHEM_RSLT>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetChemistry 报错 : ", ex);
}
return chemistrys;
}
/// <summary>
/// 根据钢板板坯号找到对应炉号,根据炉号找到对应化学成分
/// </summary>
/// <returns>对应的化学成分集合</returns>
public IList<QP_CHEM_RSLT_FP> GetQP_CHEM_RSLT_FP(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_CHEM_RSLT_FP> chemistrys = new List<QP_CHEM_RSLT_FP>();
strSql.AppendLine(" SELECT* FROM NISCO.QP_CHEM_RSLT_FP WHERE substr(SMP_NO,1,8) IN "); //版批号前8位是炉号
strSql.AppendLine("(SELECT DISTINCT HEAT_NO FROM NISCO.FP_SLAB WHERE SLAB_NO IN ");
strSql.AppendLine("(SELECT DISTINCT GP.SLAB_NO FROM NISCO.GP_PLATE GP ");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
chemistrys = db.Query<QP_CHEM_RSLT_FP>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_CHEM_RSLT_FP 报错 : ", ex);
}
return chemistrys;
}
/// <summary>
/// 获取钢板的炉号
/// </summary>
/// <param name="plate"></param>
/// <returns></returns>
public IList<FP_SLAB> GetHeat(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<FP_SLAB> chemistrys = new List<FP_SLAB>();
strSql.AppendLine("SELECT* FROM NISCO.FP_SLAB WHERE SLAB_NO IN ");
strSql.AppendLine("(SELECT DISTINCT GP.SLAB_NO FROM NISCO.GP_PLATE GP ");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
chemistrys = db.Query<FP_SLAB>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetChemistry 报错 : ", ex);
}
return chemistrys;
}
/// <summary>
/// 获取钢板信息
/// </summary>
/// <param name="strWHerePlate"></param>
/// <returns></returns>
public GP_PLATE GetPlate(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
GP_PLATE rePlate = new GP_PLATE();
strSql.AppendFormat("SELECT * FROM NISCO.GP_PLATE WHERE PLATE_NO ='{0}'", strWHerePlate);
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
rePlate = db.QuerySingle<GP_PLATE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetPlate 报错 : ", ex);
}
return rePlate;
}
/// <summary>
/// 获取订单物理属性
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR> GetQP_QLTY_MATR()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR> ltQP_QLTY_MATR = new List<QP_QLTY_MATR>();
strSql.AppendLine("SELECT* from QP_QLTY_MATR where(ORD_NO || '-' || ORD_ITEM) IN(");
strSql.AppendLine("SELECT");
strSql.AppendLine("TO_CHAR(BOI.ORD_NO) || '-' || TO_CHAR(BOI.ORD_ITEM)");
strSql.AppendLine("FROM cp_prc CPP ");
strSql.AppendLine("INNER JOIN ");
strSql.AppendLine("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 CPP.ORD_REM_WGT / (((BOI.ORD_WID / 1000) * (BOI.ORD_LEN / 1000) * (BOI.ORD_THK / 1000)) * 7.85) > 1");
strSql.AppendLine("AND boi.PROD_CD = 'PP' ");
strSql.AppendLine("AND boi.REC_STS = '2' ");
strSql.AppendLine("and boi.ORD_STS IN('E', 'D') ");
strSql.AppendLine("AND boi.ord_knd IN('A') ");
strSql.AppendLine("OR (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') > 0 ");
strSql.AppendLine(")");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR = db.Query<QP_QLTY_MATR>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetChemistry 报错 : ", ex);
}
return ltQP_QLTY_MATR;
}
/// <summary>
/// 获取钢板物理特性
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT> GetQP_TEST_RSLT()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT> ltQP_TEST_RSLT = new List<QP_TEST_RSLT>();
//strSql.AppendLine(string.Format("SELECT * FROM QP_CHEM_RSLT WHERE HEAT_NO = (SELECT HEAT_NO FROM FP_SLAB WHERE SLAB_NO = '{0}')", plate.SLAB_NO));
strSql.AppendLine("SELECT * FROM QP_TEST_RSLT WHERE SMP_NO IN ");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM GP_PLATE GP ");
strSql.AppendLine("WHERE proc_cd IN('DZB','DZE','QAB','XAC') AND PROD_CD = 'PP' AND REC_STS = '2' ");
strSql.AppendLine("AND(CASE WHEN proc_cd = 'XAC' AND PROD_GRD = '1' AND SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN proc_cd = 'QAB' AND PROD_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT = db.Query<QP_TEST_RSLT>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetChemistry 报错 : ", ex);
}
return ltQP_TEST_RSLT;
}
/// <summary>
/// 获取钢板物理特性
/// </summary>
/// <returns></returns>
public IList<ZP_CD> GetZP_CD()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<ZP_CD> ltZP_CD = new List<ZP_CD>();
//strSql.AppendLine(string.Format("SELECT * FROM QP_CHEM_RSLT WHERE HEAT_NO = (SELECT HEAT_NO FROM FP_SLAB WHERE SLAB_NO = '{0}')", plate.SLAB_NO));
strSql.AppendLine("select * from ZP_CD where cd_mana_no='G0099' ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
ltZP_CD = db.Query<ZP_CD>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetZP_CD 报错 : ", ex);
}
return ltZP_CD;
}
/// <summary>
/// 获取DZB处理仓库
/// </summary>
/// <returns></returns>
public IList<ZP_CD> GetDZBWar()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<ZP_CD> ltZP_CD = new List<ZP_CD>();
strSql.AppendLine("select * from ZP_CD where cd_mana_no='WLCK' ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
ltZP_CD = db.Query<ZP_CD>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetZP_CD 报错 : ", ex);
}
return ltZP_CD;
}
/// <summary>
/// 获取DZB处理仓库
/// </summary>
/// <returns></returns>
public IList<ZP_CD> GetRCLLW()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<ZP_CD> ltZP_CD = new List<ZP_CD>();
strSql.AppendLine("select * from ZP_CD where cd_mana_no='RCLLW' ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
ltZP_CD = db.Query<ZP_CD>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetRCLLW 报错 : ", ex);
}
return ltZP_CD;
}
/// <summary>
/// 获取厚度公差配置
/// </summary>
/// <returns></returns>
public IList<THK_TOLER_INTER> GetGCJJ()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<THK_TOLER_INTER> ltZP_CD = new List<THK_TOLER_INTER>();
strSql.AppendLine(" SELECT * from THK_TOLER_INTER ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
ltZP_CD = db.Query<THK_TOLER_INTER>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetGCJJ 报错 : ", ex);
}
return ltZP_CD;
}
// <summary>
/// 获取历史信息
/// </summary>
/// <param name="strHAN_RSL"></param>
/// <returns></returns>
public IList<SUPERSEDE_HISTORY> GetHistory()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<SUPERSEDE_HISTORY> ltHISTORY = new List<SUPERSEDE_HISTORY>();
strSql.AppendLine("SELECT * FROM SUPERSEDE_HISTORY WHERE 1=1 ");
strSql.AppendLine(" and to_date(SUB_DATE ,'yyyy-mm-dd hh24:mi:ss') > to_date('" + DateTime.Now.AddDays(-2) + "','yyyy-mm-dd hh24:mi:ss')");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
ltHISTORY = db.Query<SUPERSEDE_HISTORY>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetPlate 报错 : ", ex);
}
return ltHISTORY;
}
/// <summary>
/// 替代确认数据
/// </summary>
/// <param name="ltSup">替代确认数据 实体类集合</param>
public void UpdateManual(IList<TB_PLATE_MANUAL> ltManual)
{
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
try
{
string upd_date = DateTime.Now.ToString("yyyyMMdd");
string upd_time = DateTime.Now.ToString("HHmmss");
//开启事务
db.BeginTransaction();
bool b = true;
#region 自动确认
foreach (TB_PLATE_MANUAL model in ltManual)
{
string strSql = string.Format("Update TB_PLATE_MANUAL Set RETURN_RESULTS = '{0}' WHERE PLATE_NO = '{1}' AND ORD_NO = '{2}' AND ORD_ITEM = '{3}'", model.RETURN_RESULTS, model.PLATE_NO, model.ORD_NO, model.ORD_ITEM);
if (db.Execute(strSql) == 0)
{
b = false;
break;
}
}
#endregion
if (b)
{
//数据操作成功则保存数据
db.Commit();
}
else
{
//操作失败回滚数据到初始状态
db.Rollback();
}
}
catch (Exception ex)
{
//数据如果发生错误则回滚
db.Rollback();
logger.Error("UpdateManual 报错", ex);
}
}
}
/// <summary>
/// 替代确认数据
/// </summary>
/// <param name="ltSup">替代确认数据 实体类集合</param>
public void SaveSupersede(IList<SUPERSEDE> ltSup, IList<SUPERSEDE_ORDER> ltsupOrd)
{
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
try
{
//因为是同时操作两个表, 所以开启事务
db.BeginTransaction();
db.Insert<SUPERSEDE>(ltSup);
db.Insert<SUPERSEDE_ORDER>(ltsupOrd);
bool b = true;
#region 自动确认
foreach (SUPERSEDE delAddModel in ltSup)
{
string strSql = string.Format("DELETE FROM SUPERSEDE WHERE PLATE_NO = '{0}' AND APLY_STDSPEC = '{1}' AND ORD_NO = '{2}' AND ORD_ITEM = '{3}'", delAddModel.PLATE_NO, delAddModel.APLY_STDSPEC, delAddModel.ORD_NO, delAddModel.ORD_ITEM);
//将匹配表的记录信息复制给历史记录表
SUPERSEDE_CONFIRAM sc = new SUPERSEDE_CONFIRAM
{
PLATE_NO = delAddModel.PLATE_NO,
PROC_CD = delAddModel.PROC_CD,
ORD_NO = delAddModel.ORD_NO,
ORD_ITEM = delAddModel.ORD_ITEM,
INS_DATE = DateTime.Now.ToString("yyyyMMdd"),
INS_TIME = DateTime.Now.ToString("HHmmss"),
//替代状态
STATE = "1"
};
SUPERSEDE supData = new SUPERSEDE();
string strSqlSup = "SELECT * FROM SUPERSEDE WHERE PLATE_NO ='" + delAddModel.PLATE_NO + "'";
//获取替代信息
supData = db.QuerySingle<SUPERSEDE>(strSqlSup);
//替代履历
SUPERSEDE_HISTORY supHis = GetSupHis(supData);
//PDO
TBDIPDO InsertPDO = GetTBDIBKDPDO(supData);
db.Insert<TBDIPDO>(InsertPDO);
//db.Insert<SUPERSEDE_HISTORY>(supHis);
if (db.Execute(strSql) == 0)
{
b = false;
break;
}
if (db.Insert<SUPERSEDE_HISTORY>(supHis) == 0)
{
b = false;
break;
}
}
#endregion
if (b)
{
//数据操作成功则保存数据
db.Commit();
}
else
{
//操作失败回滚数据到初始状态
db.Rollback();
}
}
catch (Exception ex)
{
//数据如果发生错误则回滚
db.Rollback();
logger.Error("DelSupAddSupersedeConfiram 报错", ex);
}
}
}
/// <summary>
/// 删除不可替代钢板
/// </summary>
/// <param name="ltSup">替代确认数据 实体类集合</param>
public void deleteTBPLATESPE(List<TB_PLATE_SPE> delModel)
{
//RequestEntity result = new RequestEntity();
StringBuilder strSql = new StringBuilder();
try
{
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
foreach (var model in delModel)
{
try
{
//PLATE_NO
strSql.AppendLine("DELETE FROM TB_PLATE_SPE WHERE 1=1 ");
strSql.AppendLine(string.Format("AND PLATE_NO like '%{0}%' ", model.PLATE_NO));
db.Execute(strSql.ToString()); // 执行删除数据操作
//执行完操作之后清空strSql 准备下次 appendLine
strSql.Length = 0;
}
catch
{
logger.Error("该条记录删除失败: " + delModel.ToString());
}
}
}
}
catch (Exception ex)
{
logger.Error("DelTbPlateSpe 报错", ex);
}
//return result;
}
// <summary>
/// 替代数据
/// </summary>
/// <param name="data">替代数据 实体类集合</param>
public void SaveProcessData(TB_PROCESS_DATA data)
{
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
try
{
db.Insert<TB_PROCESS_DATA>(data);
}
catch (Exception ex)
{
logger.Info("替代确认错误信息:" + ex.ToString());
}
}
}
public void SaveSupersedetest(IList<GP_PLATE_TEST> ltSup, IList<BP_ORDER_ITEM_TEST> ltsupOrd)
{
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
try
{
//因为是同时操作两个表, 所以开启事务
db.BeginTransaction();
if(ltSup.Count>0)
{
db.Insert<GP_PLATE_TEST>(ltSup);
}
if (ltsupOrd.Count>0)
{
db.Insert<BP_ORDER_ITEM_TEST>(ltsupOrd);
}
bool b = true;
//if (db.Execute(strSql) == 0)
//{
// b = false;
// //break;
//}
//if (db.Insert<SUPERSEDE_HISTORY>(supHis) == 0)
//{
// b = false;
// //break;
//}
if (b)
{
//数据操作成功则保存数据
db.Commit();
}
else
{
//操作失败回滚数据到初始状态
db.Rollback();
}
}
catch (Exception ex)
{
//数据如果发生错误则回滚
db.Rollback();
logger.Error("DelSupAddSupersedeConfiram 报错", ex);
}
}
}
/// <summary>
/// 获取时间戳
/// </summary>
/// <returns></returns>
public static string GetTimeStamp()
{
TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 8, 0, 0, 0);
return Convert.ToInt64(ts.TotalMilliseconds).ToString();
}
/// <summary>
/// 整理 PDO 实体类数据
/// </summary>
/// <param name="prP_PLATE">钢板数据</param>
/// <param name="prorder">订单数据库</param>
/// <returns></returns>
public static TBDIPDO GetTBDIBKDPDO(SUPERSEDE prsup)
{
TBDIPDO Result = new TBDIPDO();
//Data字段数值型、字符型都是后补空格
Result.TIMESTAMP = GetTimeStamp(); //TIMESTAMP: 1970.1.1 8:00:00 至当前时间的毫秒数
Result.SERIALNO = "0";//Serialno 默认0对于TIMESTAMP: 重复时的区分号
Result.QUEUEID = "BKDMES000";//主键BKDYC0001 有时序先后顺序的必须用同一个QUEUEID
Result.HEADER = "";// 未使用
//Result.DATA = "";// 前10位记录FORMID(例如BKD001 / BKD002)
Result.STATUS = "N";// 发送方写入N读取成功后变0异常变1
Result.PROCESSTIME = DateTime.Now.ToString("yyyyMMddHHmmss");//:读取时间
Result.DESCRIPTION = "";//:读取异常备注
StringBuilder strData = new StringBuilder();
if (prsup.PROC_CD == "XAC")
{
strData.Append(("BKDERP001").PadRight(10));//FORMID10位 BKDERP001 固定
strData.Append(prsup.ID.PadRight(12)); // 业务ID号 NUMBER(12) 流水号,需要再应答中带回
strData.Append(prsup.SUB_FULL); // 替代类型VARCHAR2(1), C - 完全替代P - 退判替代
strData.Append((prsup.PLATE_NO).PadRight(14));// 钢板号: VARCHAR2(14)
strData.Append((prsup.ORD_NO).PadRight(11));// 订单号: VARCHAR2(11)
strData.Append((prsup.ORD_ITEM).PadRight(4)); // 订单项次号: VARCHAR2(4)
strData.Append(GetSlabNo(prsup).PadRight(14)); // 板坯号: VARCHAR2(14)
if (prsup.SUB_FULL != "C")
{
if (!string.IsNullOrEmpty(prsup.SUB_LACK_CON))
{
if (prsup.SUB_LACK_CON.Contains("取样"))
{
strData.Append("1"); // 取样: VARCHAR2(1)
}
else
{
strData.Append("0"); // 不取样: VARCHAR2(1)
}
}
else
{
strData.Append("0"); // 不取样: VARCHAR2(1)
}
}
else
{
strData.Append("0"); // 不取样: VARCHAR2(1)
}
//是否终结
if (prsup.IS_END == "是")
{
strData.Append("1"); // 终结订单: VARCHAR2(1)
}
else
{
strData.Append("0"); // 非终结订单: VARCHAR2(1)
}
if (prsup.SPLITTING == "1")
{
decimal len = Convert.ToDecimal(prsup.GP_LEN);
string SPLITTING = "B";
strData.Append((SPLITTING).PadRight(20)); //分板备注: VARCHAR2(20)
strData.Append((len.ToString()).PadRight(5)); //单定尺 订单长度 : VARCHAR2(5)
}
if (prsup.SPLITTING == "2")
{
string SPLITTING = "A";
strData.Append((SPLITTING).PadRight(20)); //分板备注: VARCHAR2(20)
strData.Append((prsup.CUTTING_LEN).PadRight(5)); //单定尺 订单长度 : VARCHAR2(5)
}
if (string.IsNullOrEmpty(prsup.SPLITTING))
{
string SPLITTING = "";
string dec = "";
strData.Append((SPLITTING).PadRight(20)); //分板备注: VARCHAR2(20)
strData.Append((prsup.GP_LEN).PadRight(5)); //单定尺 订单长度 : VARCHAR2(5)
}
Result.QUEUEID = "BKDERP000";
}
else
{
strData.Append(("BKDMES002").PadRight(10));// FORMID10位 BKDMES002 固定
strData.Append(prsup.ID.PadRight(12));// 业务ID号 NUMBER(12) 流水号,需要再应答中带回
strData.Append(prsup.SUB_FULL); // 替代类型VARCHAR2(1), C - 完全替代P - 退判替代
strData.Append((prsup.PLATE_NO).PadRight(14)); // 钢板号: VARCHAR2(14)
strData.Append((prsup.ORD_NO).PadRight(11));// 订单号: VARCHAR2(11)
strData.Append((prsup.ORD_ITEM).PadRight(4)); // 订单项次号: VARCHAR2(4)
strData.Append(GetSlabNo(prsup).PadRight(14)); // 板坯号: VARCHAR2(14)
if (prsup.SUB_FULL != "C")
{
if (!string.IsNullOrEmpty(prsup.SUB_LACK_CON))
{
if (prsup.SUB_LACK_CON.Contains("取样"))
{
strData.Append("1"); // 取样: VARCHAR2(1)
}
else
{
strData.Append("0"); // 不取样: VARCHAR2(1)
}
}
else
{
strData.Append("0"); // 不取样: VARCHAR2(1)
}
}
else
{
strData.Append("0"); // 不取样: VARCHAR2(1)
}
//是否终结
if (prsup.IS_END == "是")
{
strData.Append("1"); // 终结订单: VARCHAR2(1)
}
else
{
strData.Append("0"); // 非终结订单: VARCHAR2(1)
}
if (prsup.SPLITTING == "1")
{
decimal len = Convert.ToDecimal(prsup.GP_LEN);
string SPLITTING = "B";// 分板:长度倍尺分板
strData.Append((SPLITTING).PadRight(20)); //分板备注: VARCHAR2(20)
strData.Append((len.ToString()).PadRight(5)); //单定尺 订单长度 : VARCHAR2(5)
}
if (prsup.SPLITTING == "2")
{
string SPLITTING = "A";//A 分板: 一块正品一块余材;
strData.Append((SPLITTING).PadRight(20)); //分板备注: VARCHAR2(20)
strData.Append((prsup.CUTTING_LEN).PadRight(5)); //单定尺 订单长度 : VARCHAR2(5)
}
if (string.IsNullOrEmpty(prsup.SPLITTING))
{
string SPLITTING = "";
string dec = "";
strData.Append((SPLITTING).PadRight(20)); //分板备注: VARCHAR2(20)
strData.Append((prsup.GP_LEN).PadRight(5)); //单定尺 订单长度 : VARCHAR2(5)
}
Result.QUEUEID = "BKDMES000";
}
//化学成分N
if (prsup.SUB_LACK_CON == null)
{
strData.Append("0");
}
else
{
if (prsup.SUB_LACK_CON.Contains("化学成分N"))
{
strData.Append("1");
}
else
{
strData.Append("0");
}
}
Result.DATA = strData.ToString();
return Result;
}
/// <summary>
/// 获取缓冲区板坯号
/// </summary>
/// <param name="prsup">变量数据</param>
/// <returns></returns>
public static string GetSlabNo(SUPERSEDE prsup)
{
string strSlabNo = string.Empty;
DataTable dtReturn = new DataTable();
StringBuilder strSql = new StringBuilder();
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
//strSql.AppendLine(" SELECT ");
//strSql.AppendLine(" R.SLAB_NO ");
//strSql.AppendLine(" ,R.REQ_SEQ_NO ");
//strSql.AppendLine(" , R.ORD_NO ");
//strSql.AppendLine(" , R.ORD_ITEM ");
//strSql.AppendLine(" FROM NISCO.EP_REQ_SLAB R ");
//strSql.AppendLine(" WHERE R.SUPLY_SMS_PLT = 'B1' ");
//strSql.AppendLine(" AND R.REQ_SEQ_NO NOT IN(SELECT REQ_SEQ_NO ");
//strSql.AppendLine(" FROM NISCO.EP_SLAB_EDT ");
//strSql.AppendLine(" WHERE REQ_SEQ_NO IS NOT NULL) ");
//strSql.AppendLine(" AND NVL(R.CNF_FL,' ') = 'F' ");
//strSql.AppendLine(" AND NVL(R.REC_STS,' ') = '1' ");
strSql.AppendLine(" SELECT 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 ");
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' ");
strSql.AppendFormat(" AND A.ORD_NO = '{0}' ", prsup.ORD_NO);
strSql.AppendFormat(" AND A.ORD_ITEM = '{0}' ", prsup.ORD_ITEM);
dtReturn = db.Query(strSql.ToString());
if (dtReturn.Rows.Count > 0)
{
strSlabNo = dtReturn.Rows[0]["REQ_SEQ_NO"].ToString();
}
}
}
catch (Exception)
{
}
//if (prsup.SLAB_LACK_FLG=="1")//欠量不用炼钢缓存区的量
//{
// strSlabNo = String.Empty;
//}
return strSlabNo;
}
public static SUPERSEDE_HISTORY GetSupHis(SUPERSEDE prsup)
{
SUPERSEDE_HISTORY Result = new SUPERSEDE_HISTORY();
Result.APLY_STDSPEC = prsup.APLY_STDSPEC;
Result.ID = prsup.ID;
Result.PLATE_NO = prsup.PLATE_NO;
Result.APLY_STDSPEC = prsup.APLY_STDSPEC;
Result.PROC_CD = prsup.PROC_CD;
Result.THK = prsup.THK;
Result.WID = prsup.WID;
Result.LEN = prsup.LEN;
Result.WGT = prsup.WGT;
Result.REDO_HOT = prsup.REDO_HOT;
Result.SIZE_KND = prsup.SIZE_KND;
Result.TRIMMING = prsup.TRIMMING;
Result.ORD_NO = prsup.ORD_NO;
Result.SUB_RATE = prsup.SUB_RATE;
Result.ORD_ITEM = prsup.ORD_ITEM;
Result.STLGRD = prsup.STLGRD;
Result.TRIMMING_WID = prsup.TRIMMING_WID;
Result.TRIMMING_LEN = prsup.TRIMMING_LEN;
Result.SURPLUS_WID = prsup.SURPLUS_WID;
Result.SURPLUS_LEN = prsup.SURPLUS_LEN;
Result.PLATE_SIZE = prsup.PLATE_SIZE;
Result.SUB_DATE = prsup.SUB_DATE;
Result.GP_THK = prsup.GP_THK;
Result.GP_WID = prsup.GP_WID;
Result.GP_LEN = prsup.GP_LEN;
Result.GP_WGT = prsup.GP_WGT;
Result.GP_APLY_STDSPEC = prsup.GP_APLY_STDSPEC;
Result.GP_ORD_FL = prsup.GP_ORD_FL;
Result.GP_SURF_GRD = prsup.GP_SURF_GRD;
Result.BOI_ORD_NO = prsup.BOI_ORD_NO;
Result.BOI_ORD_ITEM = prsup.BOI_ORD_ITEM;
Result.BOI_STDSPEC = prsup.BOI_STDSPEC;
Result.BOI_ORD_THK = prsup.BOI_ORD_THK;
Result.BOI_ORD_WID = prsup.BOI_ORD_WID;
Result.BOI_ORD_LEN = prsup.BOI_ORD_LEN;
Result.BOI_WGT_UNIT = prsup.BOI_WGT_UNIT;
Result.BOI_CUST_CD = prsup.BOI_CUST_CD;
Result.BOI_ENDUSE_CD = prsup.BOI_ENDUSE_CD;
Result.BOI_ORD_KND = prsup.BOI_ORD_KND;
Result.BOB_ORD_NO = prsup.BOB_ORD_NO;
Result.BOB_ORD_ITEM = prsup.BOB_ORD_ITEM;
Result.BOB_STDSPEC = prsup.BOB_STDSPEC;
Result.BOB_ORD_THK = prsup.BOB_ORD_THK;
Result.BOB_ORD_WID = prsup.BOB_ORD_WID;
Result.BOB_ORD_LEN = prsup.BOB_ORD_LEN;
Result.BOB_WGT_UNIT = prsup.BOB_WGT_UNIT;
Result.BOB_CUST_CD = prsup.BOB_CUST_CD;
Result.BOB_ENDUSE_CD = prsup.BOB_ENDUSE_CD;
Result.BOB_ORD_KND = prsup.BOB_ORD_KND;
Result.BOO_ORD_NO = prsup.BOO_ORD_NO;
Result.BOO_ORD_ITEM = prsup.BOO_ORD_ITEM;
Result.BOO_STDSPEC = prsup.BOO_STDSPEC;
Result.BOO_ORD_THK = prsup.BOO_ORD_THK;
Result.BOO_ORD_WID = prsup.BOO_ORD_WID;
Result.BOO_ORD_LEN = prsup.BOO_ORD_LEN;
Result.BOO_WGT_UNIT = prsup.BOO_WGT_UNIT;
Result.BOO_CUST_CD = prsup.BOO_CUST_CD;
Result.SUB_USER = prsup.SUB_USER;
Result.SUR_PRO_REM = prsup.SUR_PRO_REM;
Result.GP_PLT = prsup.GP_PLT;
Result.GP_PROD_TIME = prsup.GP_PROD_TIME;
Result.SUR_FIR_TIM = prsup.SUR_FIR_TIM;
Result.GP_WOO_RSN = prsup.GP_WOO_RSN;
Result.SUR_COM = prsup.SUR_COM;
Result.SUB_NUM = prsup.SUB_NUM;
Result.SUB_DIR = prsup.SUB_DIR;
Result.SUB_US_WID = prsup.SUB_US_WID;
Result.SUB_US_LEN = prsup.SUB_US_LEN;
Result.SUB_CUT_X = prsup.SUB_CUT_X;
Result.SUB_CUT_Y = prsup.SUB_CUT_Y;
Result.SUB_LOS_WGT = prsup.SUB_LOS_WGT;
Result.SUB_FOR = prsup.SUB_FOR;
Result.SUB_REM = prsup.SUB_REM;
Result.GP_CUR_INV = prsup.GP_CUR_INV;
Result.GP_TRIM_FL = prsup.GP_TRIM_FL;
Result.GP_SIZE_KND = prsup.GP_SIZE_KND;
Result.ORD_REM = prsup.ORD_REM;
Result.GP_UST_RLT_CD = prsup.GP_UST_RLT_CD;
Result.GP_GAS_FL = prsup.GP_GAS_FL;
Result.GP_CL_FL = prsup.GP_CL_FL;
Result.GP_HTM_CNT = prsup.GP_HTM_CNT;
Result.GP_STLGRD = prsup.GP_STLGRD;
Result.BOI_SURFACE_REQUESTS = prsup.BOI_SURFACE_REQUESTS;
Result.BOI_VESSEL_NO = prsup.BOI_VESSEL_NO;
Result.BOI_SIDEMARK = prsup.BOI_SIDEMARK;
Result.BOI_FACEPAINT = prsup.BOI_FACEPAINT;
Result.BOI_SEALMEMO = prsup.BOI_SEALMEMO;
Result.BOI_ORD_PROD_END_TIME = prsup.BOI_ORD_PROD_END_TIME;
Result.BOI_PROD_CD = prsup.BOI_PROD_CD;
Result.BOI_DOME_FL = prsup.BOI_DOME_FL;
Result.BOI_DEL_FR_DATE = prsup.BOI_DEL_TO_DATE;
Result.SUB_FULL = prsup.SUB_FULL;
Result.SUB_LACK_CON = prsup.SUB_LACK_CON;
//TODO:履历信息
Result.CON_DATE = DateTime.Now.ToString();
Result.CON_USER = "Auto";
Result.CON_RSL = "1";
Result.PROD_GRD = prsup.PROD_GRD;
Result.CUR_INV = prsup.CUR_INV;
Result.LOC = prsup.LOC;
Result.EFF_RATE = prsup.EFF_RATE;
Result.PRICE_GRD = prsup.PRICE_GRD;
Result.STATE = "1";
Result.SUB_LACK_NUM = prsup.SUB_LACK_NUM;
Result.ORD_WGT = prsup.ORD_WGT;
Result.SUB_LACK_WGT = prsup.SUB_LACK_WGT;
Result.SLAB_LACK_NUM = prsup.SLAB_LACK_NUM;
Result.LACK_NUM = prsup.LACK_NUM;
Result.SLAB_LACK_FLG = prsup.SLAB_LACK_FLG;
Result.Cutting_WGT = prsup.Cutting_WGT;
Result.STEEL_SCRAP_WGT = prsup.STEEL_SCRAP_WGT;
Result.SUB_PLATE_WGT = prsup.SUB_PLATE_WGT;
Result.CUTTING_LEN = prsup.CUTTING_LEN;
Result.CUTTING_WID = prsup.CUTTING_WID;
Result.CUTTING_THK = prsup.CUTTING_THK;
Result.IS_END = prsup.IS_END;
Result.SPLITTING = prsup.SPLITTING;
return Result;
}
/// <summary>
/// 获取配置参数
/// </summary>
/// <returns></returns>
public IList<TB_PS_CONFIG> GetTBPSRules()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<TB_PS_CONFIG> gTBSubRules = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM TB_PS_CONFIG");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gTBSubRules = db.Query<TB_PS_CONFIG>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetTBSubRules 报错", ex);
}
return gTBSubRules;
}
/// <summary>
/// GetTB_NEW_PLATEAND GP.REC_STS = '2' and GP.ord_fl = '2'
/// </summary>
/// <returns></returns>
public IList<TB_NEW_PLATE> GetTB_NEW_PLATE()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<TB_NEW_PLATE> ltTB_NEW_PLATE = new List<TB_NEW_PLATE>();
strSql.AppendLine("SELECT * FROM TB_NEW_PLATE ");
strSql.AppendLine(" WHERE STATUS ='N'");
strSql.AppendLine(" and to_date(INS_DATE || INS_TIME,'yyyy-mm-dd hh24:mi:ss') > to_date('" + DateTime.Now.AddHours(-1) + "','yyyy-mm-dd hh24:mi:ss')");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
ltTB_NEW_PLATE = db.Query<TB_NEW_PLATE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetTB_NEW_PLATE 报错 : ", ex);
}
return ltTB_NEW_PLATE;
}
/// <summary>
/// GetTB_NEW_PLATEAND GP.REC_STS = '2' and GP.ord_fl = '2'
/// </summary>
/// <returns></returns>
public IList<SUB_TYPE_MGT> GetSUB_TYPE_MGT()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<SUB_TYPE_MGT> ltSUB_TYPE_MGT = new List<SUB_TYPE_MGT>();
strSql.AppendLine("SELECT * FROM SUB_TYPE_MGT ");
strSql.AppendLine(" WHERE IS_RUN ='是'");
//strSql.AppendLine(" and to_date(INS_DATE || INS_TIME,'yyyy-mm-dd hh24:mi:ss') > to_date('" + DateTime.Now.AddHours(-1) + "','yyyy-mm-dd hh24:mi:ss')");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
ltSUB_TYPE_MGT = db.Query<SUB_TYPE_MGT>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetTB_NEW_PLATE 报错 : ", ex);
}
return ltSUB_TYPE_MGT;
}
/// <summary>
/// 在途的仓库
/// </summary>
/// <returns></returns>
public IList<CP_MOVE_SLT> GetCPMOVESLT(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<CP_MOVE_SLT> ltCP_MOVE_SLT = new List<CP_MOVE_SLT>();
strSql.AppendLine("SELECT * FROM( ");
strSql.AppendLine("SELECT ");
strSql.AppendLine("rank() over(partition BY CMS.MAT_NO order by CMS.SND_TIME desc) rk ,CMS.* ");
strSql.AppendLine("FROM NISCO.CP_MOVE_SLT CMS ");
strSql.AppendLine(" WHERE CMS.MAT_NO IN ");
strSql.AppendLine("(SELECT DISTINCT GP.PLATE_NO FROM NISCO.GP_PLATE GP ");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl = '2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ) ");
strSql.AppendLine("WHERE rk = 1 ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltCP_MOVE_SLT = db.Query<CP_MOVE_SLT>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetChemistry 报错 : ", ex);
}
return ltCP_MOVE_SLT;
}
public IList<REMA_PLA_SUBSI_WAREH_MANAGE> GetWarDiffDays()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<REMA_PLA_SUBSI_WAREH_MANAGE> gTBSubRules = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM REMA_PLA_SUBSI_WAREH_MANAGE");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gTBSubRules = db.Query<REMA_PLA_SUBSI_WAREH_MANAGE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetWarDiffDays 报错", ex);
}
return gTBSubRules;
}
public IList<TB_PLATE_MANUAL> GetTB_PLATE_MANUAL(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<TB_PLATE_MANUAL> gTBSubRules = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM TB_PLATE_MANUAL where 1=1 ");
if(!string.IsNullOrEmpty(strWHerePlate))
{
strSql.AppendLine(" AND PLATE_NO IN ("+ strWHerePlate+")");
}
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gTBSubRules = db.Query<TB_PLATE_MANUAL>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetWarDiffDays 报错", ex);
}
return gTBSubRules;
}
public IList<REMA_PLA_SUBSI_LOC_MANAGE> GetLOCMSNAGE()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<REMA_PLA_SUBSI_LOC_MANAGE> gTBSubRules = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM REMA_PLA_SUBSI_LOC_MANAGE");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gTBSubRules = db.Query<REMA_PLA_SUBSI_LOC_MANAGE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetWarDiffDays 报错", ex);
}
return gTBSubRules;
}
public IList<GP_PLATE> GetGP_PLATE(string strNotinPlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<GP_PLATE> gGP_PLATE = null;
//查询可用订单以及常用字段
strSql.AppendLine("SELECT");
strSql.AppendLine(" GP.PLATE_NO ");
strSql.AppendLine(",GI.INSP_B_DEP_FLAW2 ");
strSql.AppendLine(",(SELECT COUNT(*) ");
strSql.AppendLine(" FROM NISCO.GP_USTRESULT GU ");
strSql.AppendLine(" WHERE GU.PLATE_NO = TRIM(GP.PLATE_NO) ");
strSql.AppendLine(" AND GU.UST_DEC = 'Y') GU_CNT ");
strSql.AppendLine(", QQD.THK_TOL_MIN ,QQD.THK_TOL_MAX , GP.OCCR_CD, GP.PLT, GP.PRC_LINE, GP.REC_STS, GP.PROC_CD, GP.BEF_PROC_CD, GP.PROD_CD, GP.STLGRD");
strSql.AppendLine(", CASE WHEN gpr.THK > 0 and gp.PROC_CD <> 'XAC' THEN gpr.THK ELSE gp.THK END THK");
strSql.AppendLine(", CASE WHEN gpr.WID > 0 and gp.PROC_CD <> 'XAC' THEN gpr.WID ELSE gp.WID END WID");
strSql.AppendLine(", CASE WHEN gpr.LEN > 0 and gp.PROC_CD <> 'XAC' THEN gpr.LEN ELSE gp.LEN END LEN");
//strSql.AppendLine(",GP.THK");
//strSql.AppendLine(",GP.WID");
//strSql.AppendLine(",GP.LEN");
strSql.AppendLine(", GP.WGT, GP.CAL_WGT, GP.THK_GRP, GP.WID_GRP, GP.OVER_FL, GP.ORD_FL, GP.WOO_RSN ");
strSql.AppendLine(", GP.ORD_NO, GP.ORD_ITEM, GP.ORG_ORD_NO, GP.ORG_ORD_ITEM, GP.ENDUSE_CD, GP.DEL_TO_DATE, GP.PROD_DATE ");
strSql.AppendLine(", GP.PROD_TIME, GP.SHIFT, GP.GROUP_CD, GP.LOC, GP.BED_PILE_DATE, GP.SMP_FL, GP.SMP_LOC, GP.SMP_LEN ");
strSql.AppendLine(", GP.SMP_NO, GP.INSP_EMP, GP.DSC_DATE, GP.DSC_TIME, GP.PROD_GRD, GP.SURF_GRD, GP.QUALITY_GRD ");
strSql.AppendLine(", GP.QUALITY_UPD_GRD, GP.APLY_STDSPEC, GP.APLY_ENDUSE_CD, GP.IN_PLT_CD, GP.IN_PLT, GP.IN_PLT_DATE ");
strSql.AppendLine(", GP.IN_PLT_TIME, GP.IN_CAR_NO, GP.SLAB_NO, GP.IN_PLT_CO, GP.OUT_PLT_CD, GP.OUT_PLT, GP.OUT_PLT_DATE ");
strSql.AppendLine(", GP.OUT_PLT_TIME, GP.OUT_CAR_NO, GP.OUT_SHEET_NO, GP.HOUSING_DATE, GP.HOUSING_TIME, GP.SHP_IST_NO ");
strSql.AppendLine(", GP.SHP_IST_DATE, GP.SHP_IST_TIME, GP.SHP_DATE, GP.SHP_TIME, GP.TRNS_NO, GP.CAR_NO, GP.TRNS_CMPY_CD ");
strSql.AppendLine(", GP.SHP_EMP, GP.TRAIN_LINE_NAME, GP.DEST_DETAIL, GP.CERT_RPT_FL, GP.CERT_RPT_DATE, GP.CERT_RPT_TIME ");
strSql.AppendLine(", GP.SHP_IST_CAN_DATE, GP.SHP_IST_CAN_TIME, GP.SHP_IST_CAN_FL, GP.INS_DATE, GP.INS_EMP_CD, GP.INS_PGMID ");
strSql.AppendLine(", GP.UPD_DATE, GP.UPD_EMP_CD, GP.UPD_PGM, GP.PLATE_SEC, GP.CR_CD, GP.PILE_NO, GP.PRC, GP.SF_ORNOT, GP.UST_FL ");
strSql.AppendLine(", GP.TRIM_FL, GP.END_RES, GP.ORG_PLATE, GP.ORD_THK, GP.ORD_WID, GP.ORD_LEN, GP.ORD_WGT, GP.NEXT_PROC ");
strSql.AppendLine(", GP.ACT_SMP_FL, GP.ACT_SMP_LEN, GP.CUST_CD, GP.CUR_INV, GP.BEF_APLY_STDSPEC, GP.STDSPEC_UPD_FL ");
strSql.AppendLine(", GP.SIZE_KND, GP.BAOXIN_IF_DATE, GP.SLAB_WGT, GP.CUST_SPEC_NO, GP.LOAD_WGT, GP.PRICE_GRD ");
strSql.AppendLine(", GP.PRICE_GRD_DATE, GP.PRICE_GRD_TIME, GP.PRICE_GRD_EMP_CD, GP.CHG_GRD_RES, GP.MARKING_FL ");
strSql.AppendLine(", GP.MAT_OWNER_FL, GP.MAT_OWNER_CUST_CD, GP.RSLT_PROC_CD, GP.UST_RLT_CD, GP.UST_STATUS ");
strSql.AppendLine(", GP.HTM_SHOT_BLAST, GP.HTM_SHOT_BLAST_RLT, GP.HTM_RSLT_FL, GP.HTM_METH1, GP.HTM_COND1 ");
strSql.AppendLine(", GP.HTM_RLT_METH1, GP.HTM_METH2, GP.HTM_COND2, GP.HTM_RLT_METH2, GP.HTM_METH3, GP.HTM_COND3 ");
strSql.AppendLine(", GP.HTM_RLT_METH3, GP.HTM_METH4, GP.HTM_COND4, GP.HTM_RLT_METH4, GP.HTM_METH5, GP.HTM_COND5 ");
strSql.AppendLine(", GP.HTM_RLT_METH5, GP.GRID_FL, GP.GRID_RSLT, GP.CL_FL, GP.CL_RSLT, GP.GAS_FL, GP.GAS_RSLT, GP.UST_CNT ");
strSql.AppendLine(", GP.CUT_CNT, GP.HTM_CNT, GP.CL_CNT, GP.SB_CNT, GP.GRD_CNT, GP.CLAIM_RES, GP.CLAIM_DATE, GP.CLAIM_THK ");
strSql.AppendLine(", GP.CLAIM_WID, GP.CLAIM_LEN, GP.CLAIM_WGT, GP.ERP_IF_DATE, GP.NEXT_PLAN_HTM, GP.NEXT_PLAN_HTM_COND ");
strSql.AppendLine(", GP.PLAN_CUT_CNT, GP.SMP_SET_FL, GP.FP_FL, GP.FP_RSLT, GP.FP_CNT, GP.ACT_SMP_FL_R, GP.ACT_SMP_LEN_R ");
strSql.AppendLine(", GP.SMP_NO_R, GP.ERP_MPLATE_CHK, GP.ERP_PLATE_IN ");
strSql.AppendLine(", '' SUB_PRO_STA, '' SUB_CON_STA, '' SUB_CUT_POS_1,'' SUB_FULL,'' SUB_LACK_CON ");
strSql.AppendLine(", '' SUB_CUT_POS_2, '' SUB_ORD_NO, '' SUB_ORD_ITEM, '' SUB_ORD_REM, '' SUB_SUR_LEN_1, '' SUB_SUR_WID_1 ");
strSql.AppendLine(", '' SUB_SUR_LEN_2, '' SUB_SUR_WID_2, '' SUB_SUR_STA_1, '' SUB_SUR_STA_2, '' SUB_LOS_WGT, '' SUB_DATE ");
strSql.AppendLine(", '' SUB_NUM, '' SUB_DIR, '' SUB_US_WID, '' SUB_US_LEN, '' SUB_CUT_X, '' SUB_CUT_Y, '' SUB_USER ");
strSql.AppendLine(",bob.ORD_NO BOB_ORD_NO --//--替代前订单订单号 ");
strSql.AppendLine(",bob.ORD_ITEM BOB_ORD_ITEM --//--替代前订单序列 ");
strSql.AppendLine(",bob.STDSPEC BOB_STDSPEC --//--替代前订单订单标准 ");
strSql.AppendLine(",bob.ORD_THK BOB_ORD_THK --//--替代前订单厚度 ");
strSql.AppendLine(",bob.ORD_WID BOB_ORD_WID --//--替代前订单宽度 ");
strSql.AppendLine(",bob.ORD_LEN BOB_ORD_LEN --//--替代前订单长度 ");
strSql.AppendLine(",bob.PROD_WGT BOB_WGT_UNIT --//--替代前订单重量 ");
strSql.AppendLine(",bob.CUST_CD BOB_CUST_CD --//--替代前订单客户名称 ");
strSql.AppendLine(",bob.ENDUSE_CD BOB_ENDUSE_CD --//--替代前订单订单用途 ");
strSql.AppendLine(",bob.ORD_KND BOB_ORD_KND --//--替代前订单订单种类 ");
strSql.AppendLine(",boo.ORD_NO BOO_ORD_NO --//--原始订单订单号 ");
strSql.AppendLine(",boo.ORD_ITEM BOO_ORD_ITEM --//--原始订单序列 ");
strSql.AppendLine(",boo.STDSPEC BOO_STDSPEC --//--原始订单订单标准 ");
strSql.AppendLine(",boo.ORD_THK BOO_ORD_THK --//--原始订单厚度 ");
strSql.AppendLine(",boo.ORD_WID BOO_ORD_WID --//--原始订单宽度 ");
strSql.AppendLine(",boo.ORD_LEN BOO_ORD_LEN --//--原始订单长度 ");
strSql.AppendLine(",boo.PROD_WGT BOO_WGT_UNIT --//--原始订单重量 ");
strSql.AppendLine(",boo.CUST_CD BOO_CUST_CD --//--原始订单客户名称 ");
strSql.AppendLine("FROM NISCO.GP_PLATE GP ");
strSql.AppendLine("LEFT JOIN NISCO.BP_ORDER_ITEM bob ON gp.ORD_NO = bob.ORD_NO AND gp.ORD_ITEM = bob.ORD_ITEM--// ");
strSql.AppendLine("LEFT JOIN NISCO.BP_ORDER_ITEM boo ON gp.ORG_ORD_NO = boo.ORD_NO AND gp.ORG_ORD_ITEM = boo.ORD_ITEM--// ");
strSql.AppendLine("LEFT JOIN NISCO.QP_QLTY_DELV QQD ON gp.ORG_ORD_NO = QQD.ORD_NO AND gp.ORG_ORD_ITEM = QQD.ORD_ITEM--// ");
strSql.AppendLine("LEFT JOIN NISCO.GP_PLATE_REPLACE gpr ON gpr.PLATE_NO = gp.PLATE_NO ");
strSql.AppendLine("LEFT JOIN NISCO.GP_INSPPLATE GI ON GI.MAT_NO = GP.PLATE_NO ");
strSql.AppendLine("WHERE 1=1 ");
strSql.AppendLine("AND GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
strSql.AppendLine("AND GP.APLY_STDSPEC NOT LIKE '%NG-XY%'");
strSql.AppendLine("AND GP.Len <50000 "); //钢板长度上限50米
strSql.AppendLine(strNotinPlate);
strSql.AppendLine("ORDER BY GP.PLATE_NO");
//开启数据库连接查询数据
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gGP_PLATE = db.Query<GP_PLATE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetGP_PLATE 报错", ex);
}
return gGP_PLATE;
}
/// <summary>
/// 更新配置参数
/// </summary>
public void UpdateTbPSConf(TB_PS_CONFIG prTBSubRules)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
//查询可用订单以及常用字段
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
StringBuilder strsql = new StringBuilder();
if (prTBSubRules.ID != string.Empty)
{
strsql.AppendLine("UPDATE TB_PS_CONFIG SET ID='" + prTBSubRules.ID + "'");
if (!string.IsNullOrEmpty(prTBSubRules.LOOP_CYC))
{
strsql.AppendLine(", LOOP_CYC='" + prTBSubRules.LOOP_CYC + "'");
}
if (!string.IsNullOrEmpty(prTBSubRules.EFF_LEN))
{
strsql.AppendLine(", EFF_LEN='" + prTBSubRules.EFF_LEN + "'");
}
if (!string.IsNullOrEmpty(prTBSubRules.EFF_WID))
{
strsql.AppendLine(", EFF_WID='" + prTBSubRules.EFF_WID + "'");
}
if (!string.IsNullOrEmpty(prTBSubRules.ORD_DAYS_DIFF))
{
strsql.AppendLine(", ORD_DAYS_DIFF='" + prTBSubRules.ORD_DAYS_DIFF + "'");
}
if (!string.IsNullOrEmpty(prTBSubRules.PLATE_DAYS_DIFF))
{
strsql.AppendLine(", PLATE_DAYS_DIFF='" + prTBSubRules.PLATE_DAYS_DIFF + "'");
}
if (!string.IsNullOrEmpty(prTBSubRules.SUB_RATE))
{
strsql.AppendLine(", SUB_RATE='" + prTBSubRules.SUB_RATE + "'");
}
if (!string.IsNullOrEmpty(prTBSubRules.SUB_REM))
{
strsql.AppendLine(", SUB_REM='" + prTBSubRules.SUB_REM + "'");
}
if (!string.IsNullOrEmpty(prTBSubRules.SPLITTING_LEN))
{
strsql.AppendLine(", SPLITTING_LEN='" + prTBSubRules.SPLITTING_LEN + "'");
}
strsql.AppendLine("WHERE ID='" + prTBSubRules.ID + "'");
}
db.Execute(strsql.ToString());
}
}
catch (Exception ex)
{
logger.Error("UpdateParaConf 报错", ex);
}
}
public IList<QP_STD_HEAD> GetQPSTDHEAD()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<QP_STD_HEAD> gQPSTDHEAD = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM NISCO.QP_STD_HEAD");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gQPSTDHEAD = db.Query<QP_STD_HEAD>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQPSTDHEAD 报错", ex);
}
return gQPSTDHEAD;
}
public IList<GP_THK_ADD> GetGPTHKADD()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<GP_THK_ADD> gGPTHKADD = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM NISCO.GP_THK_ADD");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gGPTHKADD = db.Query<GP_THK_ADD>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetGPTHKADD 报错", ex);
}
return gGPTHKADD;
}
public IList<TB_PLATE_SPE> GetTBPlateSpe()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<TB_PLATE_SPE> gTBPlateSpe = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM TB_PLATE_SPE");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gTBPlateSpe = db.Query<TB_PLATE_SPE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetTBPlateSpe 报错", ex);
}
return gTBPlateSpe;
}
public IList<TB_PLATE_SPE> GetTB_PLATE_SPE()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<TB_PLATE_SPE> gTB_PLATE_SPE = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM TB_PLATE_SPE WHERE 1 = 1");
//strSql.AppendLine(" and to_date(INS_DATE || INS_TIME ,'yyyy-mm-dd hh24:mi:ss') < to_date('" + DateTime.Now.AddDays(-1) + "','yyyy-mm-dd hh24:mi:ss')");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gTB_PLATE_SPE = db.Query<TB_PLATE_SPE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetTB_PLATE_SPE 报错", ex);
}
return gTB_PLATE_SPE;
}
public IList<TB_ORD_SPE> GetTBOrdSpe()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<TB_ORD_SPE> gTBOrdSpe = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM TB_ORD_SPE");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gTBOrdSpe = db.Query<TB_ORD_SPE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetTBOrdSpe 报错", ex);
}
return gTBOrdSpe;
}
public IList<TB_SPECIAL_ORD> GetTbSpecialOrd(string ORD_FLG)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<TB_SPECIAL_ORD> gTBOrdSpe = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM TB_SPECIAL_ORD where 1=1 ");
//if (!string.IsNullOrWhiteSpace(ORD_FLG)) strSql.AppendLine(" AND ORD_FLG = '" + ORD_FLG + "'");
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
gTBOrdSpe = db.Query<TB_SPECIAL_ORD>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetTBOrdSpe 报错", ex);
}
return gTBOrdSpe;
}
/// <summary>
/// 是否可替代记录
/// </summary>
/// <returns></returns>
public IList<GP_PLATE_REPLACE> GetGpPlateReplace(string PLATE_NO = null)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<GP_PLATE_REPLACE> gGpPlateReplace = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM NISCO.GP_PLATE_REPLACE GP where 1=1 ");
if (!string.IsNullOrEmpty(PLATE_NO))
{
strSql.AppendLine(PLATE_NO);
}
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gGpPlateReplace = db.Query<GP_PLATE_REPLACE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetGpPlateReplace 报错", ex);
}
return gGpPlateReplace;
}
/// <summary>
/// 获取保留的余材
/// </summary>
/// <returns></returns>
public IList<GP_ZZP_YJ> GetGP_ZZP_YJ()
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<GP_ZZP_YJ> ltGetGP_ZZP_YJ = new List<GP_ZZP_YJ>();
strSql.AppendLine("select * from NISCO.GP_ZZP_YJ ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltGetGP_ZZP_YJ = db.Query<GP_ZZP_YJ>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetGP_ZZP_YJ 报错 : ", ex);
}
return ltGetGP_ZZP_YJ;
}
public IList<YCTD_WH> GetYCTDWH(string strWhereSTD)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
IList<YCTD_WH> gYCTDWH = null;
//查询可用订单以及常用字段
try
{
strSql.AppendLine("SELECT * FROM NISCO.YCTD_WH");
strSql.AppendLine("WHERE 1=1 ");
strSql.AppendLine(strWhereSTD);
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
gYCTDWH = db.Query<YCTD_WH>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetYCTDWH 报错", ex);
}
return gYCTDWH;
}
#endregion 获取存储数据
#region 订单物理特性
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_MAIN
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_MAIN> GetQP_QLTY_MATR_MAIN(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_MAIN> ltQP_QLTY_MATR_MAIN = new List<QP_QLTY_MATR_MAIN>();
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_MAIN QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_MAIN = db.Query<QP_QLTY_MATR_MAIN>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("QP_QLTY_MATR_MAIN 报错 : ", ex);
}
return ltQP_QLTY_MATR_MAIN;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HA
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HA> GetQP_QLTY_MATR_HA(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HA> ltQP_QLTY_MATR_HA = new List<QP_QLTY_MATR_HA>();
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_HA QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HA = db.Query<QP_QLTY_MATR_HA>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HA 报错 : ", ex);
}
return ltQP_QLTY_MATR_HA;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HB
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HB> GetQP_QLTY_MATR_HB(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HB> ltQP_QLTY_MATR_HB = new List<QP_QLTY_MATR_HB>();
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_HB QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HB = db.Query<QP_QLTY_MATR_HB>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HB 报错 : ", ex);
}
return ltQP_QLTY_MATR_HB;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HC
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HC> GetQP_QLTY_MATR_HC(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HC> ltQP_QLTY_MATR_HC = new List<QP_QLTY_MATR_HC>();
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_HC QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HC = db.Query<QP_QLTY_MATR_HC>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HC 报错 : ", ex);
}
return ltQP_QLTY_MATR_HC;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HD
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HD> GetQP_QLTY_MATR_HD(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HD> ltQP_QLTY_MATR_HD = new List<QP_QLTY_MATR_HD>();
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_HD QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HD = db.Query<QP_QLTY_MATR_HD>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HD 报错 : ", ex);
}
return ltQP_QLTY_MATR_HD;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HE
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HE> GetQP_QLTY_MATR_HE(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HE> ltQP_QLTY_MATR_HE = new List<QP_QLTY_MATR_HE>();
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_HE QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HE = db.Query<QP_QLTY_MATR_HE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HE 报错 : ", ex);
}
return ltQP_QLTY_MATR_HE;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HF
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HF> GetQP_QLTY_MATR_HF(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HF> ltQP_QLTY_MATR_HF = new List<QP_QLTY_MATR_HF>();
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_HF QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HF = db.Query<QP_QLTY_MATR_HF>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HF 报错 : ", ex);
}
return ltQP_QLTY_MATR_HF;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HJ
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HJ> GetQP_QLTY_MATR_HJ(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HJ> ltQP_QLTY_MATR_HJ = new List<QP_QLTY_MATR_HJ>();
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_HJ QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HJ = db.Query<QP_QLTY_MATR_HJ>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HJ 报错 : ", ex);
}
return ltQP_QLTY_MATR_HJ;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HK
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HK> GetQP_QLTY_MATR_HK(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HK> ltQP_QLTY_MATR_HK = new List<QP_QLTY_MATR_HK>();
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_HK QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HK = db.Query<QP_QLTY_MATR_HK>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HK 报错 : ", ex);
}
return ltQP_QLTY_MATR_HK;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HM
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HM> GetQP_QLTY_MATR_HM(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HM> ltQP_QLTY_MATR_HM = new List<QP_QLTY_MATR_HM>();
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_HM QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HM = db.Query<QP_QLTY_MATR_HM>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HM 报错 : ", ex);
}
return ltQP_QLTY_MATR_HM;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HN
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HN> GetQP_QLTY_MATR_HN(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HN> ltQP_QLTY_MATR_HN = new List<QP_QLTY_MATR_HN>();
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_HN QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HN = db.Query<QP_QLTY_MATR_HN>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HN 报错 : ", ex);
}
return ltQP_QLTY_MATR_HN;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HR
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HR> GetQP_QLTY_MATR_HR(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HR> ltQP_QLTY_MATR_HR = new List<QP_QLTY_MATR_HR>();
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_HR QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HR = db.Query<QP_QLTY_MATR_HR>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HR 报错 : ", ex);
}
return ltQP_QLTY_MATR_HR;
}
/// <summary>
/// 获取订单物理属性QP_QLTY_MATR_HZ
/// </summary>
/// <returns></returns>
public IList<QP_QLTY_MATR_HZ> GetQP_QLTY_MATR_HZ(string strWHereOrd, string strSpecialOrd)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_QLTY_MATR_HZ> ltQP_QLTY_MATR_HZ = new List<QP_QLTY_MATR_HZ>();
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_HZ QQM ");
strSql.AppendLine(" where(QQM.ORD_NO, QQM.ORD_ITEM) IN( ");
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 ");
strSql.AppendLine(" AND ((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') + 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', 'D') ");
strSql.AppendLine(" AND boi.ord_knd IN('A') ");
strSql.AppendLine(strWHereOrd);
strSql.AppendLine(strSpecialOrd);
strSql.AppendLine(" )");
strSql.AppendLine(") T WHERE T.RK = 1");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_QLTY_MATR_HZ = db.Query<QP_QLTY_MATR_HZ>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_QLTY_MATR_HZ 报错 : ", ex);
}
return ltQP_QLTY_MATR_HZ;
}
#endregion 订单物理特性
#region 钢板物理特性
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HA
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HA> GetQP_TEST_RSLT_HA(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HA> ltQP_TEST_RSLT_HA = new List<QP_TEST_RSLT_HA>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HA ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HA = db.Query<QP_TEST_RSLT_HA>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HA 报错 : ", ex);
}
return ltQP_TEST_RSLT_HA;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HB
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HB> GetQP_TEST_RSLT_HB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HB> ltQP_TEST_RSLT_HB = new List<QP_TEST_RSLT_HB>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HB ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HB = db.Query<QP_TEST_RSLT_HB>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HB;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HC
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HC> GetQP_TEST_RSLT_HC(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HC> ltQP_TEST_RSLT_HC = new List<QP_TEST_RSLT_HC>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HC ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HC = db.Query<QP_TEST_RSLT_HC>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HC 报错 : ", ex);
}
return ltQP_TEST_RSLT_HC;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HD
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HD> GetQP_TEST_RSLT_HD(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HD> ltQP_TEST_RSLT_HD = new List<QP_TEST_RSLT_HD>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HD ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HD = db.Query<QP_TEST_RSLT_HD>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HD 报错 : ", ex);
}
return ltQP_TEST_RSLT_HD;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HE
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HE> GetQP_TEST_RSLT_HE(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HE> ltQP_TEST_RSLT_HE = new List<QP_TEST_RSLT_HE>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HE ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HE = db.Query<QP_TEST_RSLT_HE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HE 报错 : ", ex);
}
return ltQP_TEST_RSLT_HE;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HF
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HF> GetQP_TEST_RSLT_HF(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HF> ltQP_TEST_RSLT_HF = new List<QP_TEST_RSLT_HF>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HF ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HF = db.Query<QP_TEST_RSLT_HF>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HF 报错 : ", ex);
}
return ltQP_TEST_RSLT_HF;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HJ
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HJ> GetQP_TEST_RSLT_HJ(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HJ> ltQP_TEST_RSLT_HJ = new List<QP_TEST_RSLT_HJ>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HJ ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HJ = db.Query<QP_TEST_RSLT_HJ>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HJ 报错 : ", ex);
}
return ltQP_TEST_RSLT_HJ;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HK
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HK> GetQP_TEST_RSLT_HK(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HK> ltQP_TEST_RSLT_HK = new List<QP_TEST_RSLT_HK>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HK ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HK = db.Query<QP_TEST_RSLT_HK>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HK 报错 : ", ex);
}
return ltQP_TEST_RSLT_HK;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HM
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HM> GetQP_TEST_RSLT_HM(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HM> ltQP_TEST_RSLT_HM = new List<QP_TEST_RSLT_HM>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HM ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HM = db.Query<QP_TEST_RSLT_HM>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HM 报错 : ", ex);
}
return ltQP_TEST_RSLT_HM;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HN
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HN> GetQP_TEST_RSLT_HN(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HN> ltQP_TEST_RSLT_HN = new List<QP_TEST_RSLT_HN>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HN ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HN = db.Query<QP_TEST_RSLT_HN>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HN 报错 : ", ex);
}
return ltQP_TEST_RSLT_HN;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HR
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HR> GetQP_TEST_RSLT_HR(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HR> ltQP_TEST_RSLT_HR = new List<QP_TEST_RSLT_HR>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HR ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HR = db.Query<QP_TEST_RSLT_HR>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HR 报错 : ", ex);
}
return ltQP_TEST_RSLT_HR;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HZ
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HZ> GetQP_TEST_RSLT_HZ(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HZ> ltQP_TEST_RSLT_HZ = new List<QP_TEST_RSLT_HZ>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HZ ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
strSql.AppendLine(" WHERE GP.proc_cd IN('DZB','DZE','QAB','XAC') AND GP.PROD_CD = 'PP' AND GP.REC_STS = '2' and GP.ord_fl='2' ");
strSql.AppendLine("AND(CASE WHEN GP.proc_cd = 'XAC' AND GP.PROD_GRD = '1' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'QAB' AND GP.SURF_GRD = '1' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZB' AND GP.SURF_GRD = '4' THEN 1 ");
strSql.AppendLine("WHEN GP.proc_cd = 'DZE' AND GP.SURF_GRD = '4' THEN 1 ELSE 0 END) = 1 ");
//strSql.AppendLine(" WHERE 1=1 ");
strSql.AppendLine(strWHerePlate);
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HZ = db.Query<QP_TEST_RSLT_HZ>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HZ 报错 : ", ex);
}
return ltQP_TEST_RSLT_HZ;
}
#endregion 钢板物理特性
#region 钢板物理特性
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HA
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HA> GetQP_TEST_RSLT_HA_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HA> ltQP_TEST_RSLT_HA = new List<QP_TEST_RSLT_HA>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HA ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
if(!string.IsNullOrEmpty(strWHerePlate))
{
ltQP_TEST_RSLT_HA = db.Query<QP_TEST_RSLT_HA>(strSql.ToString());
}
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HA_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HA;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HB
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HB> GetQP_TEST_RSLT_HB_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HB> ltQP_TEST_RSLT_HB = new List<QP_TEST_RSLT_HB>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HB ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HB = db.Query<QP_TEST_RSLT_HB>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HB_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HB;
}
///// <summary>
///// 获取钢板物理属性QP_TEST_RSLT_HC
///// </summary>
///// <returns></returns>
public IList<QP_TEST_RSLT_HC> GetQP_TEST_RSLT_HC_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HC> ltQP_TEST_RSLT_HC = new List<QP_TEST_RSLT_HC>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HC ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HC = db.Query<QP_TEST_RSLT_HC>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HC_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HC;
}
///// <summary>
///// 获取钢板物理属性QP_TEST_RSLT_HD
///// </summary>
///// <returns></returns>
public IList<QP_TEST_RSLT_HD> GetQP_TEST_RSLT_HD_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HD> ltQP_TEST_RSLT_HD = new List<QP_TEST_RSLT_HD>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HD ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HD = db.Query<QP_TEST_RSLT_HD>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HD_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HD;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HE
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HE> GetQP_TEST_RSLT_HE_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HE> ltQP_TEST_RSLT_HE = new List<QP_TEST_RSLT_HE>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HE ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HE = db.Query<QP_TEST_RSLT_HE>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HE_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HE;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HF
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HF> GetQP_TEST_RSLT_HF_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HF> ltQP_TEST_RSLT_HF = new List<QP_TEST_RSLT_HF>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HF ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HF = db.Query<QP_TEST_RSLT_HF>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HF_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HF;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HJ
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HJ> GetQP_TEST_RSLT_HJ_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HJ> ltQP_TEST_RSLT_HJ = new List<QP_TEST_RSLT_HJ>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HJ ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HJ = db.Query<QP_TEST_RSLT_HJ>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HJ_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HJ;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HK
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HK> GetQP_TEST_RSLT_HK_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HK> ltQP_TEST_RSLT_HK = new List<QP_TEST_RSLT_HK>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HK ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HK = db.Query<QP_TEST_RSLT_HK>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HK_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HK;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HM
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HM> GetQP_TEST_RSLT_HM_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HM> ltQP_TEST_RSLT_HM = new List<QP_TEST_RSLT_HM>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HM ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HM = db.Query<QP_TEST_RSLT_HM>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HM_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HM;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HN
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HN> GetQP_TEST_RSLT_HN_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HN> ltQP_TEST_RSLT_HN = new List<QP_TEST_RSLT_HN>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HN ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HN = db.Query<QP_TEST_RSLT_HN>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HN_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HN;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HR
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HR> GetQP_TEST_RSLT_HR_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HR> ltQP_TEST_RSLT_HR = new List<QP_TEST_RSLT_HR>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HR ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HR = db.Query<QP_TEST_RSLT_HR>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HR_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HR;
}
/// <summary>
/// 获取钢板物理属性QP_TEST_RSLT_HZ
/// </summary>
/// <returns></returns>
public IList<QP_TEST_RSLT_HZ> GetQP_TEST_RSLT_HZ_SLAB(string strWHerePlate)
{
StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量
DataTable dtCheck = new DataTable();
IList<QP_TEST_RSLT_HZ> ltQP_TEST_RSLT_HZ = new List<QP_TEST_RSLT_HZ>();
strSql.AppendLine("SELECT* FROM NISCO.QP_TEST_RSLT_HZ ");
strSql.AppendLine(" WHERE SMP_NO IN");
strSql.AppendLine("(SELECT DISTINCT GP.SMP_NO FROM NISCO.GP_PLATE GP");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '");
//strSql.AppendLine(" WHERE TEST_KND='0' AND PLATE_NO like '" + strWHerePlate + "%'");
strSql.AppendLine(" WHERE TEST_KND='0'");
strSql.AppendLine(strWHerePlate);
//strSql.AppendLine("%'");
strSql.AppendLine(") ");
try
{
//开启数据库连接查询数据
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
ltQP_TEST_RSLT_HZ = db.Query<QP_TEST_RSLT_HZ>(strSql.ToString());
}
}
catch (Exception ex)
{
logger.Error("GetQP_TEST_RSLT_HZ_SLAB 报错 : ", ex);
}
return ltQP_TEST_RSLT_HZ;
}
#endregion 钢板物理特性
}
}