diff --git a/JY.Inspection/ConstValue.cs b/JY.DAL/ConstValue.cs similarity index 98% rename from JY.Inspection/ConstValue.cs rename to JY.DAL/ConstValue.cs index 302a900..ef31caa 100644 --- a/JY.Inspection/ConstValue.cs +++ b/JY.DAL/ConstValue.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace JY.Inspection +namespace JY.DAL { public class ConstValue { diff --git a/JY.DAL/JY.DAL.csproj b/JY.DAL/JY.DAL.csproj index 9dbd8fb..b389671 100644 --- a/JY.DAL/JY.DAL.csproj +++ b/JY.DAL/JY.DAL.csproj @@ -154,6 +154,7 @@ + diff --git a/JY.DAL/OpSqlDataBase.cs b/JY.DAL/OpSqlDataBase.cs index 82074c6..9e7f66f 100644 --- a/JY.DAL/OpSqlDataBase.cs +++ b/JY.DAL/OpSqlDataBase.cs @@ -376,34 +376,38 @@ namespace JY.DAL } break; case 1: - strSql = @" SELECT [ID] ID + string preSql = @" SELECT [ID] ID ,[TD] 序号 ,[WorkShift] 班次 ,[TDGroup] 主道 ,[ArrivalBarCode] 入站条码 ,[DepartureBarCode] 出站条码 ,[TMDB] 条码对比 - ,CONVERT(varchar, [OutTime], 120) 出站时间 - ,[CCD1] '正面(2D/3D)' - ,[CCD2] '反面(2D/3D)' - ,[CCD3] '左侧面(2D/3D)' - ,[CCD4] '右侧面(2D/3D)' - ,[CCD5] '顶面(2D/3D)' - ,[CCD6] '底面(2D/3D)' - ,[CCD7] 底WE1 - ,[CCD8] 底WE2 - ,[CCD9] 底WE3 - ,[CCD10] 底WE4 - ,[CCD11] 中ME1 - ,[CCD12] 中ME2 - ,[CCD13] 中ME3 - ,[CCD14] 中ME4 - ,[CCD15] '极柱(POS/NEG)' - ,[CCD16] '防爆阀(PRO)' - ,[Result] 综合结果 - ,[Remark] 备注 - ,[Flag] 状态 + ,CONVERT(varchar, [OutTime], 120) 出站时间 "; + + StringBuilder sb = new StringBuilder(); + foreach (var propName in ConstValue.CCD_SDict.Keys) + { + sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'"); + } + + foreach (var propName in ConstValue.CCD_FDict.Keys) + { + sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'"); + } + + foreach (var propName in ConstValue.CCD_IDict.Keys) + { + sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'"); + } + string formatSql = sb.ToString(); + + string nextSql = @",[Result] 综合结果 + ,[Remark] 备注 + ,[Flag] 状态 FROM [dbo].[BlankingData] where OutTime >= '" + strDate1 + "' and OutTime <= '" + strDate2 + "' "; + strSql = string.Concat(preSql, formatSql, nextSql); + if (strBarCode != "") { strSql += " and DepartureBarCode like '%" + strBarCode + "' "; diff --git a/JY.Inspection/JY.Inspection.csproj b/JY.Inspection/JY.Inspection.csproj index 6527327..d79d98f 100644 --- a/JY.Inspection/JY.Inspection.csproj +++ b/JY.Inspection/JY.Inspection.csproj @@ -194,7 +194,6 @@ - Form diff --git a/数据库/20260814.sql b/数据库/20260814.sql new file mode 100644 index 0000000..11c7f84 --- /dev/null +++ b/数据库/20260814.sql @@ -0,0 +1,9 @@ +ALTER TABLE S1270.dbo.BlankingData ADD CCDF1 float NULL; +ALTER TABLE S1270.dbo.BlankingData ADD CCDF2 float NULL; +ALTER TABLE S1270.dbo.BlankingData ADD CCDF3 float NULL; +ALTER TABLE S1270.dbo.BlankingData ADD CCDI1 int NULL; +ALTER TABLE S1270.dbo.BlankingData ADD CCDI2 int NULL; +ALTER TABLE S1270.dbo.BlankingData ADD CCDI3 int NULL; +ALTER TABLE S1270.dbo.BlankingData ADD CCDI4 int NULL; +ALTER TABLE S1270.dbo.BlankingData ADD CCDI5 int NULL; +ALTER TABLE S1270.dbo.BlankingData ADD CCDI6 int NULL;