diff --git a/后端接口/ipd-server/Service/Controller/IPD-PS/SurplusMaterialSubstitutionController.cs b/后端接口/ipd-server/Service/Controller/IPD-PS/SurplusMaterialSubstitutionController.cs index 7aa8dd2..6afc904 100644 --- a/后端接口/ipd-server/Service/Controller/IPD-PS/SurplusMaterialSubstitutionController.cs +++ b/后端接口/ipd-server/Service/Controller/IPD-PS/SurplusMaterialSubstitutionController.cs @@ -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 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 delModel) + { + RequestEntity result = new RequestEntity(); + StringBuilder strSql = new StringBuilder(); + StringBuilder strSql2 = new StringBuilder(); + + using (IDbContext db = ObjectContainer.GetObject("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(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 delModel) + { + RequestEntity result = new RequestEntity(); + StringBuilder strSql = new StringBuilder(); + StringBuilder strSql2 = new StringBuilder(); + + using (IDbContext db = ObjectContainer.GetObject("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; + } + /// /// 获取时间戳 diff --git a/后端接口/ipd-server/Service/Controller/IPD-PS/TbSlabSpeController.cs b/后端接口/ipd-server/Service/Controller/IPD-PS/TbSlabSpeController.cs index d5e2265..1512f29 100644 --- a/后端接口/ipd-server/Service/Controller/IPD-PS/TbSlabSpeController.cs +++ b/后端接口/ipd-server/Service/Controller/IPD-PS/TbSlabSpeController.cs @@ -347,7 +347,7 @@ namespace ibk.IPD.Controller.IPD_PS strSql.AppendLine(" AND F.SLAB_NO = E.SLAB_NO "); strSql.AppendLine(" AND F.ORD_FL = '1' "); strSql.AppendLine(" AND E.PROC_CD = 'CAD') CADPL--CAD "); - strSql.AppendLine(",BOI.CFM_MILL_PLT,BOI.COLOR_STROKE,BOI.CUST_CD "); + strSql.AppendLine(",BOI.CFM_MILL_PLT,BOI.COLOR_STROKE,BOI.CUST_CD ,'' XY_FLG "); strSql.AppendLine("FROM NISCO.cp_prc CPP "); strSql.AppendLine("INNER JOIN "); strSql.AppendLine("NISCO.BP_ORDER_ITEM boi "); @@ -366,7 +366,7 @@ namespace ibk.IPD.Controller.IPD_PS strSql.AppendLine(" FROM NISCO.CP_PRC_DET CPD "); strSql.AppendLine(" GROUP BY CPD.ORD_NO, CPD.ORD_ITEM) C "); strSql.AppendLine(" ON C.ORD_NO = BOI.ORD_NO AND C.ORD_ITEM = BOI.ORD_ITEM "); - strSql.AppendLine("WHERE 1!=1 "); + strSql.AppendLine("WHERE 1<>1 "); strSql.AppendLine(BOI); // P_SLAB_DELI_DET表中字段EST_CD是5或者6开头是协议板。 try @@ -637,12 +637,12 @@ namespace ibk.IPD.Controller.IPD_PS StringBuilder strSql = new StringBuilder(); //声明拼接Sql语句变量 string strSql2 = string.Empty; //声明拼接Sql语句变量 DataTable dtCheck = new DataTable(); - IList TB_HEAT_SPEs = new List(); + IList TB_HEAT_SPEs = new List(); IList TB_HEAT_SPEs2 = new List(); //IList ltResult = new List(); //查询 - strSql.AppendLine("SELECT '' ord_fl ,t.* FROM TB_PLT_SPE t WHERE 1 = 1 "); + strSql.AppendLine("SELECT '' ord_fl ,'' STLGRD,'' SPECIFICATION,'' CUR_INV,t.* FROM TB_PLT_SPE t WHERE 1 = 1 "); if (query != null) { if (!string.IsNullOrWhiteSpace(query.SLAB_NO)) @@ -652,29 +652,43 @@ namespace ibk.IPD.Controller.IPD_PS strSql.AppendLine("Order By INS_DATE DESC "); using (IDbContext db = ObjectContainer.GetObject("db")) { - TB_HEAT_SPEs = db.Query(strSql.ToString()); + TB_HEAT_SPEs = db.Query(strSql.ToString()); } strSql2=string.Join("','", TB_HEAT_SPEs.Select(p=>p.SLAB_NO)); - strSql2 = string.Format("Select slab_no,ord_fl from nisco.fp_slab where slab_no in ('{0}')", strSql2); + strSql2 = string.Format("Select slab_no,ord_fl,STLGRD,(THK || '*' || WID || '*' || LEN) SPECIFICATION,CUR_INV from nisco.fp_slab where slab_no in ('{0}')", strSql2); using (IDbContext db = ObjectContainer.GetObject("db_sur")) { TB_HEAT_SPEs2 = db.Query(strSql2.ToString()); } - foreach (TB_PLT_SPE tb in TB_HEAT_SPEs) + foreach (TB_PLT_SPE_SEL tb in TB_HEAT_SPEs) { if(TB_HEAT_SPEs2.Where(p => p.SLAB_NO == tb.SLAB_NO).Count() > 0) { tb.ORD_FL = TB_HEAT_SPEs2.Where(p => p.SLAB_NO == tb.SLAB_NO).FirstOrDefault().ORD_FL; tb.ORD_FL = tb.ORD_FL == "2" ? "未替代" : "已替代"; + tb.STLGRD= TB_HEAT_SPEs2.Where(p => p.SLAB_NO == tb.SLAB_NO).FirstOrDefault().STLGRD; + tb.SPECIFICATION = TB_HEAT_SPEs2.Where(p => p.SLAB_NO == tb.SLAB_NO).FirstOrDefault().SPECIFICATION; + tb.CUR_INV = TB_HEAT_SPEs2.Where(p => p.SLAB_NO == tb.SLAB_NO).FirstOrDefault().CUR_INV; } else { tb.ORD_FL = "已替代"; } + + } + + if (query != null) + { + if (!string.IsNullOrWhiteSpace(query.ORD_FL)) + TB_HEAT_SPEs = TB_HEAT_SPEs.Where(p => p.ORD_FL == query.ORD_FL).ToList(); + + } + + //foreach (TB_HEAT_SPE order in TB_HEAT_SPEs) //{ // strSql2 += string.Format(" or (boi.ORD_NO = '{0}' and boi.ORD_ITEM = '{1}')", order.ORD_NO, order.ORD_ITEM); diff --git a/后端接口/ipd-server/Service/Entity/IPD-PS/TB_SlabOrdFl.cs b/后端接口/ipd-server/Service/Entity/IPD-PS/TB_SlabOrdFl.cs index 119138e..44a1738 100644 --- a/后端接口/ipd-server/Service/Entity/IPD-PS/TB_SlabOrdFl.cs +++ b/后端接口/ipd-server/Service/Entity/IPD-PS/TB_SlabOrdFl.cs @@ -21,5 +21,21 @@ namespace ibk.IPD.Entity.IPD_PS //更新人员 [Persistent("ORD_FL"), DisplayName("替代状态")] public string ORD_FL { get; set; } + + + //钢种 + [Persistent("STLGRD"), DisplayName("钢种")] + public string STLGRD { get; set; } + + + //规格 + [Persistent("SPECIFICATION"), DisplayName("规格")] + public string SPECIFICATION { get; set; } + + + //仓库 + [Persistent("CUR_INV"), DisplayName("仓库")] + public string CUR_INV { get; set; } + } } diff --git a/后端接口/ipd-server/Service/iBKLinker.IPD.Service.csproj b/后端接口/ipd-server/Service/iBKLinker.IPD.Service.csproj index 374865f..38d4524 100644 --- a/后端接口/ipd-server/Service/iBKLinker.IPD.Service.csproj +++ b/后端接口/ipd-server/Service/iBKLinker.IPD.Service.csproj @@ -382,6 +382,7 @@ + diff --git a/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.csproj.CoreCompileInputs.cache b/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.csproj.CoreCompileInputs.cache index f7938c7..8d221dc 100644 --- a/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.csproj.CoreCompileInputs.cache +++ b/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -63d4f2758b594b1b68dfec34e6aa9ecd4842827c +330fee58d6755566c2662e7ded02c20a20bc8ddc diff --git a/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.dll b/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.dll index 0033878..1b30169 100644 Binary files a/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.dll and b/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.dll differ diff --git a/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.pdb b/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.pdb index e90906c..5908de4 100644 Binary files a/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.pdb and b/后端接口/ipd-server/Service/obj/Debug/iBKLinker.IPD.Service.pdb differ