|
|
|
@ -1360,12 +1360,12 @@ namespace ibk.IPD.Controller.IPD_PS
|
|
|
|
|
//试样号
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QAGP.SMP_NO))
|
|
|
|
|
{
|
|
|
|
|
strSql.AppendLine(" AND SMP_NO = '" + QAGP.SMP_NO + "'");
|
|
|
|
|
strSql.AppendLine(" AND SMP_NO LIKE '%" + QAGP.SMP_NO + "%'");
|
|
|
|
|
}
|
|
|
|
|
//钢板号
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QAGP.PLATE_NO))
|
|
|
|
|
{
|
|
|
|
|
strSql.AppendLine(" AND PLATE_NO = '" + QAGP.PLATE_NO + "'");
|
|
|
|
|
strSql.AppendLine(" AND PLATE_NO LIKE '%" + QAGP.PLATE_NO + "%'");
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(QAGP.CERT_TYPE))
|
|
|
|
|
{
|
|
|
|
@ -1858,7 +1858,7 @@ namespace ibk.IPD.Controller.IPD_PS
|
|
|
|
|
strSql.AppendLine(" SELECT * FROM YCTD_WH_NO_COPY WHERE RATE IS NOT NULL ) ");
|
|
|
|
|
strSql.AppendLine(" WHERE 1 = 1 ");
|
|
|
|
|
//只取当前日期的数据
|
|
|
|
|
strSql.AppendLine("AND TO_CHAR(TO_DATE(INS_DATE,'YYYYMMDDHH24MISS'), 'YYYYMMDD') = TO_CHAR(SYSDATE, 'YYYYMMDD') ");
|
|
|
|
|
//strSql.AppendLine("AND TO_CHAR(TO_DATE(INS_DATE,'YYYYMMDDHH24MISS'), 'YYYYMMDD') = TO_CHAR(SYSDATE, 'YYYYMMDD') ");
|
|
|
|
|
|
|
|
|
|
//标准号
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QAGP.STANDARD_NO))
|
|
|
|
@ -1952,7 +1952,6 @@ namespace ibk.IPD.Controller.IPD_PS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HttpPost, Route("Del_YCTD_WH_NO")]
|
|
|
|
|
public RequestEntity Del_YCTD_WH_NO(IList<YCTD_WH_NO> delModel)
|
|
|
|
|
{
|
|
|
|
@ -1988,13 +1987,12 @@ namespace ibk.IPD.Controller.IPD_PS
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.ORD_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.ORD_ITEM));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.PLATE_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}'", model.STLGRD));
|
|
|
|
|
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}'", model.YP_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}'", model.YP_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}'", model.YP_RST));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}'", model.TS_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}'", model.TS_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.STLGRD));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.YP_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.YP_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.YP_RST));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.TS_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.TS_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}'", model.TS_RST));
|
|
|
|
|
|
|
|
|
|
strSql.AppendLine(string.Format(" ) "));
|
|
|
|
@ -2061,6 +2059,166 @@ namespace ibk.IPD.Controller.IPD_PS
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost, Route("Save_YCTD_WH_NO")]
|
|
|
|
|
public RequestEntity Save_YCTD_WH_NO(IList<YCTD_WH_NO> delModel)
|
|
|
|
|
{
|
|
|
|
|
RequestEntity result = new RequestEntity();
|
|
|
|
|
StringBuilder strSql = new StringBuilder();
|
|
|
|
|
StringBuilder strSql2 = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
db.BeginTransaction();
|
|
|
|
|
//bool b = true;
|
|
|
|
|
foreach (var model in delModel)
|
|
|
|
|
{
|
|
|
|
|
strSql.AppendLine(" INSERT INTO YCTD_WH_NO_COPY (STANDARD_NO, TD_STANDARD_NO, INS_DATE, UPD_DATE, TD_FL,THK_TOL_MIN,THK_TOL_MAX,REMARK" +
|
|
|
|
|
",STEEL_GRD_DETAIL,STDSPEC_STLGRD,STD_FLG" +
|
|
|
|
|
",RATE,ORD_NO,ORD_ITEM,PLATE_NO,STLGRD" +
|
|
|
|
|
",YP_MIN,YP_MAX,YP_RST,TS_MIN,TS_MAX,TS_RST" +
|
|
|
|
|
") VALUES ( ");
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.STANDARD_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.TD_STANDARD_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", DateTime.Now.ToString("yyyyMMddHHmmss")));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", DateTime.Now.ToString("yyyyMMddHHmmss")));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", "维护"));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.THK_TOL_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.THK_TOL_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.REMARK));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.STEEL_GRD_DETAIL));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.STDSPEC_STLGRD));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.STD_FLG));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.RATE));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.ORD_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.ORD_ITEM));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.PLATE_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.STLGRD));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.YP_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.YP_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.YP_RST));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.TS_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.TS_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}'", model.TS_RST));
|
|
|
|
|
|
|
|
|
|
strSql.AppendLine(string.Format(" ) "));
|
|
|
|
|
db.Execute(strSql.ToString());
|
|
|
|
|
|
|
|
|
|
strSql2.AppendLine(" DELETE FROM YCTD_WH_NO WHERE 1 = 1 ");
|
|
|
|
|
strSql2.AppendLine(string.Format("AND STANDARD_NO = '{0}' ", model.STANDARD_NO));
|
|
|
|
|
strSql2.AppendLine(string.Format("AND TD_STANDARD_NO = '{0}' ", model.TD_STANDARD_NO));
|
|
|
|
|
db.Execute(strSql2.ToString()); // 执行删除数据操作
|
|
|
|
|
strSql.Length = 0;
|
|
|
|
|
strSql2.Length = 0;
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|
strData.Append(("BKDMES003").PadRight(10));// FORMID:10位 ,BKDMES011 固定
|
|
|
|
|
strData.Append(model.STANDARD_NO.PadRight(20));// 业务ID号 NUMBER(12) 流水号,需要在应答中带回
|
|
|
|
|
strData.Append(model.TD_STANDARD_NO.PadRight(20));// 工厂代码:VARCHAR2(2), C1 / C2 / C3
|
|
|
|
|
//strData.Append(prSlabDes.SLAB_NO.PadRight(20));// 板坯号: VARCHAR2(10)
|
|
|
|
|
|
|
|
|
|
Result.DATA = strData.ToString();
|
|
|
|
|
|
|
|
|
|
db.Insert<TBDIPDO>(Result);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
db.Commit();
|
|
|
|
|
result.msg = "操作成功";
|
|
|
|
|
result.code = "1";
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.msg = "数据库错误!";
|
|
|
|
|
result.code = "0";
|
|
|
|
|
logger.Error("Del_YCTD_WH_NO 报错", ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost, Route("Only_YCTD_WH_NO")]
|
|
|
|
|
public RequestEntity Only_YCTD_WH_NO(IList<YCTD_WH_NO> delModel)
|
|
|
|
|
{
|
|
|
|
|
RequestEntity result = new RequestEntity();
|
|
|
|
|
StringBuilder strSql = new StringBuilder();
|
|
|
|
|
StringBuilder strSql2 = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
db.BeginTransaction();
|
|
|
|
|
//bool b = true;
|
|
|
|
|
foreach (var model in delModel)
|
|
|
|
|
{
|
|
|
|
|
strSql.AppendLine(" INSERT INTO YCTD_WH_NO_COPY (STANDARD_NO, TD_STANDARD_NO, INS_DATE, UPD_DATE, TD_FL,THK_TOL_MIN,THK_TOL_MAX,REMARK" +
|
|
|
|
|
",STEEL_GRD_DETAIL,STDSPEC_STLGRD,STD_FLG" +
|
|
|
|
|
",RATE,ORD_NO,ORD_ITEM,PLATE_NO,STLGRD" +
|
|
|
|
|
",YP_MIN,YP_MAX,YP_RST,TS_MIN,TS_MAX,TS_RST" +
|
|
|
|
|
") VALUES ( ");
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.STANDARD_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.TD_STANDARD_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", DateTime.Now.ToString("yyyyMMddHHmmss")));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", DateTime.Now.ToString("yyyyMMddHHmmss")));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", "仅一次"));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.THK_TOL_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.THK_TOL_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.REMARK));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.STEEL_GRD_DETAIL));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.STDSPEC_STLGRD));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.STD_FLG));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.RATE));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.ORD_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.ORD_ITEM));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}', ", model.PLATE_NO));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.STLGRD));
|
|
|
|
|
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.YP_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.YP_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.YP_RST));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.TS_MIN));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}',", model.TS_MAX));
|
|
|
|
|
strSql.AppendLine(string.Format(" '{0}'", model.TS_RST));
|
|
|
|
|
|
|
|
|
|
strSql.AppendLine(string.Format(" ) "));
|
|
|
|
|
db.Execute(strSql.ToString());
|
|
|
|
|
|
|
|
|
|
strSql2.AppendLine(" DELETE FROM YCTD_WH_NO WHERE 1 = 1 ");
|
|
|
|
|
strSql2.AppendLine(string.Format("AND STANDARD_NO = '{0}' ", model.STANDARD_NO));
|
|
|
|
|
strSql2.AppendLine(string.Format("AND TD_STANDARD_NO = '{0}' ", model.TD_STANDARD_NO));
|
|
|
|
|
db.Execute(strSql2.ToString()); // 执行删除数据操作
|
|
|
|
|
strSql.Length = 0;
|
|
|
|
|
strSql2.Length = 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
db.Commit();
|
|
|
|
|
result.msg = "操作成功";
|
|
|
|
|
result.code = "1";
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.msg = "数据库错误!";
|
|
|
|
|
result.code = "0";
|
|
|
|
|
logger.Error("Del_YCTD_WH_NO 报错", ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取时间戳
|
|
|
|
|