init: 导入项目到 meswork Gitea
This commit is contained in:
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{F191342C-2DBE-4865-84C3-6B6A286C7686}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MesServerWork.BizFacade</RootNamespace>
|
||||
<AssemblyName>MIS.BizFacade</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<PublishUrl>http://localhost/MIS.BizFacade/</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Web</InstallFrom>
|
||||
<UpdateEnabled>true</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>true</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Debug\MIS.BizFacade.XML</DocumentationFile>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BasicData, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\DLL\BasicData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MES\BaseDataSystemMES.Load.cs" />
|
||||
<Compile Include="QualityData\GetQualityData_GoodBad.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MES\EngineIDCode.cs" />
|
||||
<Compile Include="MES\OpName.MainForm.Launch.cs" />
|
||||
<Compile Include="MES\IsMES.cs" />
|
||||
<Compile Include="QualityData\DataVerify.cs" />
|
||||
<Compile Include="QualityData\QualityData.B5A.cs" />
|
||||
<Compile Include="QualityData\QualityData.B5A.Pack.cs" />
|
||||
<Compile Include="QualityData\QualityData.B5A.Save.cs" />
|
||||
<Compile Include="MES\ShowLED.cs" />
|
||||
<Compile Include="MES\Materials.cs" />
|
||||
<Compile Include="MES\ShaftPosition.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.MesServer.cs" />
|
||||
<Compile Include="MIS\Alarm.cs" />
|
||||
<Compile Include="MIS\AlarmCommonFunction.cs" />
|
||||
<Compile Include="MIS\AlarmOpcServer.cs" />
|
||||
<Compile Include="MIS\MIS.Biz.Alarm.cs" />
|
||||
<Compile Include="MIS\MIS.Biz.QualityData.cs" />
|
||||
<Compile Include="OPC\BaseDataSystemMES.OPC.Alarm.cs" />
|
||||
<Compile Include="OPC\BaseDataSystemMES.OPC.cs" />
|
||||
<Compile Include="OPC\BaseDataSystemMES.OPC.QualityData.cs" />
|
||||
<Compile Include="OPC\BaseDataSystemMES.OPC.QualityData.GoodBad.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="MES\RepairWorkStation.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\02DataLinkMesWork\00_DataLinkMesWork.csproj">
|
||||
<Project>{97127b87-d43d-457c-9894-5f2244e4d2e7}</Project>
|
||||
<Name>00_DataLinkMesWork</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
public static DataTable dt_Signal()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT [TagID],[TagName] ,[工位号],[数据来源],[IP],[TagTypeID],[TagLong]"+
|
||||
" ,[DbName],[变量类型],[变量地址] ,[变量其它],[演示偏移] ,[列位置],[测量位置] ,[测量项目],[测量单位],[变量类型代码],[变量类型名称]"+
|
||||
" ,[机体类型],[线体类型],[TagAdr],[TagAdrDemo],[是否启用],[监控组] ,[监控时间间隔],[OpcServer_OPNAME],[变量特点],[是否监控]"+
|
||||
" ,[变量排序] ,[工序能力],[监控属性代码],[测量位置短],[上限值],[下限值] ,[理论值],[IsGoodBad] ,[IsSaveToSql]"+
|
||||
" ,[IsWebSocket] FROM [MES_基本变量_原始数据]";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
public static DataTable dt_Device()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT [设备IP] ,[设备类型],[是否启用] FROM [MES_基本变量设备类型对应表]";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
public static DataTable dt_TagTypeDataType()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TOP (1000) [序号],[变量类型],[TagTypeDataType],[TagName],[变量类型代码],[TagTypeChange],[MesTagTypeChange],[WebTagTypeChange],[信号点名称][变量类型名称] FROM [MES_基本变量变量类型代码]";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询MesServerCode
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetMesServerCodeFromMIS()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "exec MES_计划BOM_工位与名称_查询应用程序";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询工步属性
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetworkStepPropertyFromMIS()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT distinct 工位号,工步属性 FROM [MES_计划BOM_工位与名称] where 是否监控=1";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修工位号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetOpNameRepairFromMIS()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT distinct 工位号,返修工位号 FROM [MES_计划BOM_工位与名称] where 是否监控=1";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
using DataLinkMesWork;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// select 重量1,重量2,重量差,允许重量差,合格标志
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_分线组件装配关系_增加
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID_SubLine"></param>
|
||||
static public void MailLineAndSubLineData_Insert(string engineID, int engineTypeID, string engineType, string engineID_SubLine)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_分线组件装配关系_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号_分线", engineID_SubLine);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_查询_根据发动机号
|
||||
/// select 工位号,订单号,发动机号,基本机型,机型代码,发动机型号,托盘号,
|
||||
/// 条码类型,零件流水号,零件流水号带空格,壳体编号型号,壳体编号型号带空格,QR码
|
||||
/// from dbo.电子看板_发动机号_线首工位
|
||||
/// where 发动机号=@发动机号 and 是否禁用=0
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineID_Select(string opName,string engineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
28
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MES/IsMES.cs
Normal file
28
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MES/IsMES.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// [MES_计划BOM_工位与名称_查询_是否启用MES]
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// [MES_计划BOM_工位与名称_查询_在线状态]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public static void IsOnLine_Update(string opName, string tagValue)
|
||||
{
|
||||
string sql = "exec MES_计划BOM_工位与名称_更新_在线状态 '" + opName + "'," + tagValue;
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
471
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MES/Materials.cs
Normal file
471
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MES/Materials.cs
Normal file
@@ -0,0 +1,471 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
using System.Data.OleDb;
|
||||
|
||||
|
||||
using DataLinkMesWork;
|
||||
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_MOBY_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="palletCode"></param>
|
||||
/// <param name="repairCode"></param>
|
||||
/// <param name="Is_repairBarcode"></param>
|
||||
/// <param name="repairBarcode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_MOBY_Insert(string opName, string orderForm,
|
||||
int engineTypeID, string engineType, string engineID,int palletCode, int repairCode, int Is_repairBarcode, string repairBarcode)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_MOBY_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[9];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘号", palletCode);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@返修标志", repairCode);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@拆解标志", Is_repairBarcode);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@拆解返修条码", repairBarcode);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_手动打印_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_MaualPrint_Select(string opName, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "SELECT top 1 * FROM [测量数据工位_监控系统_手动打印] "
|
||||
+ "where 工位号='" + opName + "'";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_MOBY_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="palletCode"></param>
|
||||
/// <param name="isRepair"></param>
|
||||
/// <param name="repairCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_Moby_Select(string opName,
|
||||
out string orderForm, out int engineTypeID, out string engineType,
|
||||
out string engineID,out string palletCode,out int isRepair,out string repairCode)
|
||||
{
|
||||
orderForm = "";
|
||||
engineTypeID = 0;
|
||||
engineType = "";
|
||||
engineID = "";
|
||||
palletCode = "";
|
||||
isRepair = 0;
|
||||
repairCode = "";
|
||||
|
||||
string produceName = "测量数据工位_监控系统_MOBY_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", SqlDbType.NVarChar, 50);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号代码", SqlDbType.Int, 4);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", SqlDbType.NVarChar, 50);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@发动机号", SqlDbType.NVarChar, 50);
|
||||
thisParms[4].Direction = ParameterDirection.Output;
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘号", SqlDbType.NVarChar, 50);
|
||||
thisParms[5].Direction = ParameterDirection.Output;
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@拆解标志", SqlDbType.Int, 4);
|
||||
thisParms[6].Direction = ParameterDirection.Output;
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@拆解返修条码", SqlDbType.NVarChar, 50);
|
||||
thisParms[7].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
orderForm = thisParms[1].Value.ToString();
|
||||
engineTypeID = Convert.ToInt32(thisParms[2].Value);
|
||||
engineType = thisParms[3].Value.ToString();
|
||||
engineID = thisParms[4].Value.ToString();
|
||||
palletCode = thisParms[5].Value.ToString();
|
||||
isRepair = Convert.ToInt32(thisParms[6].Value);
|
||||
repairCode = thisParms[7].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_MOBY_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="palletCode"></param>
|
||||
/// <param name="isRepair"></param>
|
||||
/// <param name="repairCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_CreateMoby_Select(string opName,
|
||||
out string orderForm, out int engineTypeID, out string engineType,
|
||||
out string engineID, out string palletCode, out int isRepair, out string repairCode)
|
||||
{
|
||||
orderForm = "";
|
||||
engineTypeID = 0;
|
||||
engineType = "";
|
||||
engineID = "";
|
||||
palletCode = "";
|
||||
isRepair = 0;
|
||||
repairCode = "";
|
||||
|
||||
string produceName = "测量数据工位_监控系统_创建发动机号_扫描方式";
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", SqlDbType.NVarChar, 50);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号代码", SqlDbType.Int, 4);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", SqlDbType.NVarChar, 50);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@发动机号", SqlDbType.NVarChar, 50);
|
||||
thisParms[4].Direction = ParameterDirection.Output;
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘号", SqlDbType.NVarChar, 50);
|
||||
thisParms[5].Direction = ParameterDirection.Output;
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@拆解标志", SqlDbType.Int, 4);
|
||||
thisParms[6].Direction = ParameterDirection.Output;
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@拆解返修条码", SqlDbType.NVarChar, 50);
|
||||
thisParms[7].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
orderForm = thisParms[1].Value.ToString();
|
||||
engineTypeID = Convert.ToInt32(thisParms[2].Value);
|
||||
engineType = thisParms[3].Value.ToString();
|
||||
engineID = thisParms[4].Value.ToString();
|
||||
palletCode = thisParms[5].Value.ToString();
|
||||
isRepair = Convert.ToInt32(thisParms[6].Value);
|
||||
repairCode = thisParms[7].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_临时表_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_Process_EngineTypeOver(string opName)
|
||||
{
|
||||
string produceName = "电子看板_装配零件_临时表_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据发动机在线状态_跟踪发动机条码状态_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MaterialPush_EngineIDStatus_Insert(string opName)
|
||||
{
|
||||
string produceName = "测量数据发动机在线状态_跟踪发动机条码状态_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_临时表_判断_是否允许工作
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="IsAllowWork"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_Judge_IsCanWork(string opName,out int IsAllowWork)
|
||||
{
|
||||
IsAllowWork = 0;
|
||||
string produceName = "电子看板_装配零件_临时表_判断_是否允许工作";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否允许工作", IsAllowWork);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
IsAllowWork = Convert.ToInt32(thisParms[1].Value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_临时表_修改_零件条码
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="barCode"></param>
|
||||
/// <param name="IsSuccess"></param>
|
||||
/// <returns></returns>
|
||||
public static bool PartMaterial_DM_Update(string opName, string barCode, out int IsSuccess)
|
||||
{
|
||||
IsSuccess = 0;
|
||||
string produceName = "电子看板_装配零件_临时表_修改_零件条码";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@条码", barCode);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@条码是否符合", IsSuccess);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
IsSuccess = Convert.ToInt32(thisParms[2].Value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AMES_MES_装配数据_零部件追溯_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="m_ConfirmOkGo"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Material_Insert(string opName, int m_ConfirmOkGo)
|
||||
{
|
||||
string produceName = "MES_装配数据_零部件追溯_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@放行方式", m_ConfirmOkGo);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_增加_不合格
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="m_ConfirmOkGo"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Material_Insert_NG(string opName, int m_ConfirmOkGo)
|
||||
{
|
||||
string produceName = "MES_装配数据_零部件追溯_增加_不合格";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@放行方式", m_ConfirmOkGo);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_临时表_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_ShaftPosition_EngineTypeOver(string opName)
|
||||
{
|
||||
string produceName = "电子看板_工位机型_质量数据测量位置_临时表_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="ProcessCode">拧紧序号</param>
|
||||
/// <param name="BoltCode">套筒号</param>
|
||||
/// <param name="workStepProperty">工步属性</param>
|
||||
/// <param name="sn_WorkingStepIsOver">是否全部完成</param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_ShaftPosition_Select_FinishResult(string opName, out int ProcessCode, out int BoltCode, out int workStepProperty, out bool sn_WorkingStepIsOver)
|
||||
{
|
||||
BoltCode = 0;
|
||||
ProcessCode = 512;
|
||||
workStepProperty = 0;
|
||||
sn_WorkingStepIsOver = true;
|
||||
|
||||
string produceName = "电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@拧紧序号", SqlDbType.Int, 4);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@套筒号", SqlDbType.Int, 4);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@工步属性", SqlDbType.Int, 4);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@是否全部完成", SqlDbType.Int, 4);
|
||||
thisParms[4].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
ProcessCode = Convert.ToInt32(thisParms[1].Value);
|
||||
BoltCode = Convert.ToInt32(thisParms[2].Value);
|
||||
workStepProperty = Convert.ToInt32(thisParms[3].Value);
|
||||
sn_WorkingStepIsOver = Convert.ToBoolean(thisParms[4].Value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_临时表_修改
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="workGroupIndex"></param>
|
||||
/// <param name="IsOK"></param>
|
||||
/// <param name="IsFinish"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_ShaftPosition_Update(string opName,int workGroupIndex,int IsOK,out bool IsFinish)
|
||||
{
|
||||
IsFinish = true;
|
||||
string produceName = "电子看板_工位机型_质量数据测量位置_临时表_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@组号", workGroupIndex);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@合格标志", IsOK);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@是否全部完成",SqlDbType.Int,4);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
IsFinish = Convert.ToBoolean(thisParms[3].Value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备管理_保养_待保养_视图_查询
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MachinePlan_Select(out DataTable dt)
|
||||
{
|
||||
string produceName = "设备管理_保养_待保养_视图_查询";
|
||||
return DataAccess.ExecuteStoredProcedure(produceName,out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES界面显示_弹窗消息_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="notice"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Web_Notice_Insert(string opName,string notice)
|
||||
{
|
||||
string produceName = "MES界面显示_弹窗消息_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@Notice", notice);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_基本变量_合格标志定义(分合格标志)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_IsGoodorbad_Meaning_Item()
|
||||
{
|
||||
DataTable dt = null;
|
||||
string sql;
|
||||
sql = "SELECT 定义合格标志,实际合格标志 from MES_基本变量_合格标志定义 where 类型=1 ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_基本变量_合格标志定义(工位总合格标志)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_IsGoodorbad_Meaning_OpName()
|
||||
{
|
||||
DataTable dt = null;
|
||||
string sql;
|
||||
sql = "SELECT 定义合格标志,实际合格标志 from MES_基本变量_合格标志定义 where 类型=2 ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_流水号_修改
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
static public bool FirstOpName_Code_Update(string opName, string engineID,string partcode)
|
||||
{
|
||||
string procedureName = "电子看板_发动机号_线首工位_流水号_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@托盘号", partcode);
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_自动手动_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="isAutoOrManul"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_AutoOrMaunal_Insert(string opName, int isAutoOrManul)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_自动手动_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@自动手动", isAutoOrManul);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_自动手动_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable OpName_MIS_AutoOrMaunal_Select(string opName)
|
||||
{
|
||||
DataTable dt = null;
|
||||
string sql;
|
||||
sql = "SELECT top 1 自动手动 from 测量数据工位_监控系统_自动手动 where 工位号='" + opName + "' ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,425 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_手动方式
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineType">发动机型号</param>
|
||||
/// <param name="engineYear">年份</param>
|
||||
/// <param name="engineMoon">月份</param>
|
||||
/// <param name="engineDay">日期</param>
|
||||
/// <param name="engineNumber">流水号</param>
|
||||
/// <param name="isSubLine">@是否分线 bit=0 @是否分线 = 0 总线线首(OP2010);=1分线线首(OP1010,OP2100)</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineID_Manual(string opName, string engineType, string engineYear, string engineMoon, string engineDay, int engineNumber, bool isSubLine, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_手动方式";
|
||||
SqlParameter[] thisParms = new SqlParameter[7];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@年份", engineYear);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@月份", engineMoon);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@日期", engineDay);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@流水号", engineNumber);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@是否分线", isSubLine);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码
|
||||
/// 工件机型,机型代码,工件编号,壳体编号型号,工件流水号,QR码,基本流水号
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineType">发动机型号</param>
|
||||
/// <param name="palletCode">托盘号 = 0 总线线首(OP2010);=1分线线首(OP1010,OP2100)</param>
|
||||
/// <param name="dt">工件机型,机型代码,工件编号,壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
static public void GetEngineID_Auto(string opName, string engineType, string palletCode, out DataTable dt)
|
||||
{
|
||||
try
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@托盘号", palletCode);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
dt = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分线线首号生成
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="partcode"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineID_Auto_branch(string opName, string engineType, string partcode, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_分线";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@托盘号", partcode);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_分线_手动方式
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineYear"></param>
|
||||
/// <param name="engineMoon"></param>
|
||||
/// <param name="engineDay"></param>
|
||||
/// <param name="engineNumber"></param>
|
||||
/// <param name="isSubLine"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineID_Manual_branch(string opName, string engineType, string engineYear, string engineMoon, string engineDay, int engineNumber, bool isSubLine, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_分线_手动方式";
|
||||
SqlParameter[] thisParms = new SqlParameter[7];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@年份", engineYear);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@月份", engineMoon);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@日期", engineDay);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@流水号", engineNumber);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@是否分线", isSubLine);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [电子看板_发动机号_线首工位_手动方式_增加]
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="PartPalletCode">托盘号</param>
|
||||
/// <param name="engineType">工件机型</param>
|
||||
/// <param name="dt">工件机型,机型代码,工件编号, 壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
static public bool GetEngineID_ManulEngine_Save(string opName, string orderForm, string PartPalletCode, string engineType, string EngineID_DateTime, DataTable dt)
|
||||
{
|
||||
string engineID;
|
||||
int engineTypeID;
|
||||
string partCode_Space;
|
||||
string partCode;
|
||||
string shellCode;
|
||||
string shellCode_Space;
|
||||
string QR_Code;
|
||||
int engineCount;
|
||||
int barCodeType;
|
||||
string engineTypeBase;
|
||||
string partCode_Text;
|
||||
string partCode_BarCode;
|
||||
string engineType_Text;
|
||||
string engineType_BarCode;
|
||||
|
||||
try
|
||||
{
|
||||
GetEngineIDFromFirstOpName(out engineID, out engineTypeID, out partCode_Space,
|
||||
out partCode, out shellCode, out shellCode_Space, out QR_Code,
|
||||
out engineCount, out barCodeType, out engineTypeBase,
|
||||
out partCode_Text, out partCode_BarCode, out engineType_Text, out engineType_BarCode, dt);
|
||||
|
||||
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_手动方式_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[19];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@基本机型", engineTypeBase);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘号", PartPalletCode);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@条码类型", barCodeType);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@零件流水号", partCode);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@零件流水号带空格", partCode_Space);
|
||||
thisParms[10] = new System.Data.SqlClient.SqlParameter("@壳体编号型号", shellCode);
|
||||
thisParms[11] = new System.Data.SqlClient.SqlParameter("@壳体编号型号带空格", shellCode_Space);
|
||||
thisParms[12] = new System.Data.SqlClient.SqlParameter("@QR码", QR_Code);
|
||||
thisParms[13] = new System.Data.SqlClient.SqlParameter("@基本流水号", engineCount);
|
||||
thisParms[14] = new System.Data.SqlClient.SqlParameter("@流水号文本", partCode_Text);
|
||||
thisParms[15] = new System.Data.SqlClient.SqlParameter("@流水号条码", partCode_BarCode);
|
||||
thisParms[16] = new System.Data.SqlClient.SqlParameter("@型号文本", engineType_Text);
|
||||
thisParms[17] = new System.Data.SqlClient.SqlParameter("@型号条码", engineType_BarCode);
|
||||
thisParms[18] = new System.Data.SqlClient.SqlParameter("@工件编号时间", EngineID_DateTime);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
// return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_增加
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="PartPalletCode">托盘号</param>
|
||||
/// <param name="engineType">工件机型</param>
|
||||
/// <param name="dt">工件机型,机型代码,工件编号, 壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
static public bool GetEngineID_Save(string opName, string orderForm, string PartPalletCode, string engineType, DataTable dt)
|
||||
{
|
||||
string engineID;
|
||||
int engineTypeID;
|
||||
string partCode_Space;
|
||||
string partCode;
|
||||
string shellCode;
|
||||
string shellCode_Space;
|
||||
string QR_Code;
|
||||
int engineCount;
|
||||
int barCodeType;
|
||||
string engineTypeBase;
|
||||
string partCode_Text;
|
||||
string partCode_BarCode;
|
||||
string engineType_Text;
|
||||
string engineType_BarCode;
|
||||
string codeCreatetime;
|
||||
string a_code;
|
||||
string b_code;
|
||||
string c_code;
|
||||
string d_code;
|
||||
|
||||
try
|
||||
{
|
||||
GetEngineIDFromFirstOpName_Auto(out engineID, out engineTypeID, out partCode_Space,
|
||||
out partCode, out shellCode, out shellCode_Space, out QR_Code,
|
||||
out engineCount, out barCodeType, out engineTypeBase,
|
||||
out partCode_Text, out partCode_BarCode, out engineType_Text, out engineType_BarCode, out codeCreatetime,
|
||||
out a_code, out b_code, out c_code, out d_code,
|
||||
dt);
|
||||
|
||||
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[23];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@基本机型", engineTypeBase);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘号", PartPalletCode);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@条码类型", barCodeType);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@零件流水号", partCode);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@零件流水号带空格", partCode_Space);
|
||||
thisParms[10] = new System.Data.SqlClient.SqlParameter("@壳体编号型号", shellCode);
|
||||
thisParms[11] = new System.Data.SqlClient.SqlParameter("@壳体编号型号带空格", shellCode_Space);
|
||||
thisParms[12] = new System.Data.SqlClient.SqlParameter("@QR码", QR_Code);
|
||||
thisParms[13] = new System.Data.SqlClient.SqlParameter("@基本流水号", engineCount);
|
||||
thisParms[14] = new System.Data.SqlClient.SqlParameter("@流水号文本", partCode_Text);
|
||||
thisParms[15] = new System.Data.SqlClient.SqlParameter("@流水号条码", partCode_BarCode);
|
||||
thisParms[16] = new System.Data.SqlClient.SqlParameter("@型号文本", engineType_Text);
|
||||
thisParms[17] = new System.Data.SqlClient.SqlParameter("@型号条码", engineType_BarCode);
|
||||
thisParms[18] = new System.Data.SqlClient.SqlParameter("@条码创建时间", codeCreatetime);
|
||||
thisParms[19] = new System.Data.SqlClient.SqlParameter("@总成代码", a_code);
|
||||
thisParms[20] = new System.Data.SqlClient.SqlParameter("@零件图号", b_code);
|
||||
thisParms[21] = new System.Data.SqlClient.SqlParameter("@邓氏码", c_code);
|
||||
thisParms[22] = new System.Data.SqlClient.SqlParameter("@VPPS码", d_code);
|
||||
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
// return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_增加
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="PartPalletCode">托盘号</param>
|
||||
/// <param name="engineType">工件机型</param>
|
||||
/// <param name="dt">工件机型,机型代码,工件编号, 壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
static public bool GetEngineID_Save_Outline(string opName, string orderForm, string PartPalletCode, string engineType, int engineTypeID, string engineID, string barCodeType)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[19];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@基本机型", engineType);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘号", PartPalletCode);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@条码类型", barCodeType);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@零件流水号", engineID);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@零件流水号带空格", engineID);
|
||||
thisParms[10] = new System.Data.SqlClient.SqlParameter("@壳体编号型号", engineType);
|
||||
thisParms[11] = new System.Data.SqlClient.SqlParameter("@壳体编号型号带空格", engineType);
|
||||
thisParms[12] = new System.Data.SqlClient.SqlParameter("@QR码", engineID);
|
||||
thisParms[13] = new System.Data.SqlClient.SqlParameter("@基本流水号", 1);
|
||||
thisParms[14] = new System.Data.SqlClient.SqlParameter("@流水号文本", engineID);
|
||||
thisParms[15] = new System.Data.SqlClient.SqlParameter("@流水号条码", engineID);
|
||||
thisParms[16] = new System.Data.SqlClient.SqlParameter("@型号文本", engineType);
|
||||
thisParms[17] = new System.Data.SqlClient.SqlParameter("@型号条码", engineType);
|
||||
thisParms[18] = new System.Data.SqlClient.SqlParameter("@条码创建时间", DateTime.Now.ToShortDateString());
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// [电子看板_发动机号_线首工位]信息手动用
|
||||
/// </summary>
|
||||
/// <param name="engineID">发动机号</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="partCode_Space">零件流水号带空格</param>
|
||||
/// <param name="partCode">零件流水号</param>
|
||||
/// <param name="shellCode">壳体编号型号</param>
|
||||
/// <param name="shellCode_Space">壳体编号型号带空格</param>
|
||||
/// <param name="QR_Code">QR码</param>
|
||||
/// <param name="engineCount">基本流水号</param>
|
||||
/// <param name="barCodeType">条码类型</param>
|
||||
/// <param name="engineTypeBase">基本机型</param>
|
||||
/// <param name="partCode_Text">流水号文本</param>
|
||||
/// <param name="partCode_BarCode">流水号条码</param>
|
||||
/// <param name="engineType_Text">型号文本</param>
|
||||
/// <param name="engineType_BarCode">型号条码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineIDFromFirstOpName(out string engineID, out int engineTypeID, out string partCode_Space,
|
||||
out string partCode, out string shellCode, out string shellCode_Space, out string QR_Code,
|
||||
out int engineCount, out int barCodeType, out string engineTypeBase,
|
||||
out string partCode_Text, out string partCode_BarCode,
|
||||
out string engineType_Text, out string engineType_BarCode,
|
||||
DataTable dt)
|
||||
{
|
||||
engineID = "";
|
||||
engineTypeID = 0;
|
||||
partCode_Space = "";
|
||||
partCode = "";
|
||||
shellCode = "";
|
||||
shellCode_Space = "";
|
||||
QR_Code = "";
|
||||
engineCount = 0;
|
||||
barCodeType = 0;
|
||||
engineTypeBase = "";
|
||||
partCode_Text = "";
|
||||
partCode_BarCode = "";
|
||||
engineType_Text = "";
|
||||
engineType_BarCode = "";
|
||||
|
||||
engineID = dt.Rows[0]["发动机号"].ToString();
|
||||
engineTypeID = Convert.ToInt32(dt.Rows[0]["机型代码"]);
|
||||
shellCode = dt.Rows[0]["壳体编号型号"].ToString();
|
||||
shellCode_Space = dt.Rows[0]["壳体编号型号带空格"].ToString();
|
||||
partCode = dt.Rows[0]["零件流水号"].ToString();
|
||||
partCode_Space = dt.Rows[0]["零件流水号带空格"].ToString();
|
||||
QR_Code = dt.Rows[0]["QR码"].ToString();
|
||||
engineCount = Convert.ToInt32(dt.Rows[0]["基本流水号"]);
|
||||
engineTypeBase = dt.Rows[0]["基本机型"].ToString();
|
||||
barCodeType = Convert.ToInt32(dt.Rows[0]["条码类型"]);
|
||||
partCode_Text = dt.Rows[0]["流水号文本"].ToString();
|
||||
partCode_BarCode = dt.Rows[0]["流水号条码"].ToString();
|
||||
engineType_Text = dt.Rows[0]["型号文本"].ToString();
|
||||
engineType_BarCode = dt.Rows[0]["型号条码"].ToString();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [电子看板_发动机号_线首工位]信息自动用
|
||||
/// </summary>
|
||||
/// <param name="engineID">发动机号</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="partCode_Space">零件流水号带空格</param>
|
||||
/// <param name="partCode">零件流水号</param>
|
||||
/// <param name="shellCode">壳体编号型号</param>
|
||||
/// <param name="shellCode_Space">壳体编号型号带空格</param>
|
||||
/// <param name="QR_Code">QR码</param>
|
||||
/// <param name="engineCount">基本流水号</param>
|
||||
/// <param name="barCodeType">条码类型</param>
|
||||
/// <param name="engineTypeBase">基本机型</param>
|
||||
/// <param name="partCode_Text">流水号文本</param>
|
||||
/// <param name="partCode_BarCode">流水号条码</param>
|
||||
/// <param name="engineType_Text">型号文本</param>
|
||||
/// <param name="engineType_BarCode">型号条码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineIDFromFirstOpName_Auto(out string engineID, out int engineTypeID, out string partCode_Space,
|
||||
out string partCode, out string shellCode, out string shellCode_Space, out string QR_Code,
|
||||
out int engineCount, out int barCodeType, out string engineTypeBase,
|
||||
out string partCode_Text, out string partCode_BarCode,
|
||||
out string engineType_Text, out string engineType_BarCode, out string CodeCreatetime,
|
||||
out string a_code, out string b_code, out string c_code, out string d_code,
|
||||
DataTable dt)
|
||||
{
|
||||
engineID = "";
|
||||
engineTypeID = 0;
|
||||
partCode_Space = "";
|
||||
partCode = "";
|
||||
shellCode = "";
|
||||
shellCode_Space = "";
|
||||
QR_Code = "";
|
||||
engineCount = 0;
|
||||
barCodeType = 0;
|
||||
engineTypeBase = "";
|
||||
partCode_Text = "";
|
||||
partCode_BarCode = "";
|
||||
engineType_Text = "";
|
||||
engineType_BarCode = "";
|
||||
|
||||
engineID = dt.Rows[0]["发动机号"].ToString();
|
||||
engineTypeID = Convert.ToInt32(dt.Rows[0]["机型代码"]);
|
||||
shellCode = dt.Rows[0]["壳体编号型号"].ToString();
|
||||
shellCode_Space = dt.Rows[0]["壳体编号型号带空格"].ToString();
|
||||
partCode = dt.Rows[0]["零件流水号"].ToString();
|
||||
partCode_Space = dt.Rows[0]["零件流水号带空格"].ToString();
|
||||
QR_Code = dt.Rows[0]["QR码"].ToString();
|
||||
engineCount = Convert.ToInt32(dt.Rows[0]["基本流水号"]);
|
||||
engineTypeBase = dt.Rows[0]["基本机型"].ToString();
|
||||
barCodeType = Convert.ToInt32(dt.Rows[0]["条码类型"]);
|
||||
partCode_Text = dt.Rows[0]["流水号文本"].ToString();
|
||||
partCode_BarCode = dt.Rows[0]["流水号条码"].ToString();
|
||||
engineType_Text = dt.Rows[0]["型号文本"].ToString();
|
||||
engineType_BarCode = dt.Rows[0]["型号条码"].ToString();
|
||||
CodeCreatetime = dt.Rows[0]["条码创建时间"].ToString();
|
||||
a_code = dt.Rows[0]["总成代码"].ToString();
|
||||
b_code = dt.Rows[0]["零件图号"].ToString();
|
||||
c_code = dt.Rows[0]["邓氏码"].ToString();
|
||||
d_code = dt.Rows[0]["VPPS码"].ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class RepairWorkStation
|
||||
{
|
||||
/// <summary>
|
||||
/// 保存复合工位工作状态
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="Status"></param>
|
||||
public static void StationStatusChanges(string OpName,int Status)
|
||||
{
|
||||
if (NormalOrRepairRecord_Hash.ContainsKey (OpName))
|
||||
{
|
||||
NormalOrRepairRecord_Hash[OpName] = Status;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
NormalOrRepairRecord_Hash.Add(OpName,Status );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询工位工作状态 1为正常,其他为返修
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static int StationStatusSearch(string OpName)
|
||||
{
|
||||
if (NormalOrRepairRecord_Hash.ContainsKey(OpName))
|
||||
{
|
||||
return Convert.ToInt32(NormalOrRepairRecord_Hash[OpName]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Hashtable NormalOrRepairRecord_Hash = new Hashtable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// </summary>
|
||||
public partial class ShaftPosition
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_查询_工作顺序
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void ShaftPosition_Select_WorkingStep(string opName, int engineTypeID, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
|
||||
string sql = "exec 电子看板_工位机型_质量数据测量位置_查询_工作顺序 '" + opName + "'," + engineTypeID.ToString();
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
66
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MES/ShowLED.cs
Normal file
66
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MES/ShowLED.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 基本数据_工作日历_班次产量查询_New
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opNameCount">在线产量</param>
|
||||
/// <param name="opNameCountTime">在线节拍</param>
|
||||
static public void OpNameCount_New(string opName, out int opNameCount, out int opNameCountTime)
|
||||
{
|
||||
opNameCount = 0;
|
||||
opNameCountTime = 0;
|
||||
string procedureName;
|
||||
procedureName = "基本数据_工作日历_班次产量查询_New";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@在线产量", 0);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@在线节拍", 0);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
opNameCount = Convert.ToInt32(thisParms[1].Value);
|
||||
opNameCountTime = Convert.ToInt32(thisParms[2].Value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES界面显示_消息滚动_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="content"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Rolling_news_Add(string opName, string content)
|
||||
{
|
||||
|
||||
string procedureName = "MES界面显示_消息滚动_增加";
|
||||
bool isOK;
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@ScollNotice", content);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MES/vssver2.scc
Normal file
BIN
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MES/vssver2.scc
Normal file
Binary file not shown.
77
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MIS/Alarm.cs
Normal file
77
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MIS/Alarm.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Collections;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
using bizFacade;
|
||||
|
||||
//using Monitor;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// Alarm 的摘要说明。
|
||||
/// </summary>
|
||||
public class Alarm
|
||||
{
|
||||
/// <summary>
|
||||
/// 报警
|
||||
/// </summary>
|
||||
public static DataTable alarmView;
|
||||
/// <summary>
|
||||
/// 产生报警
|
||||
/// </summary>
|
||||
public static Hashtable table_MSGBIT1;
|
||||
/// <summary>
|
||||
/// 解除报警
|
||||
/// </summary>
|
||||
public static Hashtable table_MSGBIT2;
|
||||
/// <summary>
|
||||
/// 报警列表
|
||||
/// </summary>
|
||||
public static Hashtable table_AlarmStart;
|
||||
|
||||
/// <summary>
|
||||
/// 系统启动后,没有解除的报警
|
||||
/// </summary>
|
||||
static public DataTable AlarmStart;
|
||||
/// <summary>
|
||||
/// 新产生报警临时表
|
||||
/// </summary>
|
||||
static public DataTable AlarmTemp;
|
||||
/// <summary>
|
||||
/// 解除的报警临时表
|
||||
/// </summary>
|
||||
static public DataTable AlarmTempOK;
|
||||
/// <summary>
|
||||
/// 时时产生的报警文本
|
||||
/// </summary>
|
||||
static public DataTable PLC_AlgViewCHT_Temp;
|
||||
/// <summary>
|
||||
/// 报警变量基本文本
|
||||
/// </summary>
|
||||
static public DataTable PLC_MSMsgs_WORK;
|
||||
|
||||
//static DataRow[] alarmDataRow;
|
||||
//static string strWhere;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Alarm()
|
||||
{
|
||||
|
||||
table_MSGBIT1 = new Hashtable();
|
||||
table_MSGBIT2 = new Hashtable();
|
||||
table_AlarmStart = new Hashtable();
|
||||
//目的是创建PLC_MSMsgs_WORK数据表结构
|
||||
QualityDataSystem.PLC_MSMsgs_WORKSelect(out PLC_MSMsgs_WORK);
|
||||
//Init_table_AlarmStart(AlarmStart);
|
||||
AlarmTemp = AlarmCommonFunction.BuildDataTablesAlarmView(); // AlarmStart.Clone();
|
||||
AlarmTempOK = AlarmCommonFunction.BuildDataTablesAlarmView();// AlarmStart.Clone();
|
||||
alarmView = AlarmCommonFunction.BuildDataTablesAlarmView(); //GetInitAlarmStart(AlarmStart);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,371 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Collections;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class AlarmCommonFunction
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="AlarmTemp"></param>
|
||||
/// <param name="AlarmTempOK"></param>
|
||||
/// <returns></returns>
|
||||
static public DataTable GetAlarmView(DataTable AlarmTemp, DataTable AlarmTempOK)
|
||||
{
|
||||
DateTime lastupdatetime;
|
||||
DataRow dataRow;
|
||||
DataTable algView = AlarmCommonFunction.BuildDataTablesAlarmView();
|
||||
lastupdatetime = DateTime.Now;
|
||||
for (int i = 0; i < AlarmTemp.Rows.Count; i++)
|
||||
{
|
||||
dataRow = algView.NewRow();
|
||||
dataRow["AlarmID"] = AlarmTemp.Rows[i]["AlarmID"];
|
||||
dataRow["TagID"] = AlarmTemp.Rows[i]["TagID"];
|
||||
dataRow["TagValue"] = AlarmTemp.Rows[i]["TagValue"];
|
||||
|
||||
dataRow["MsgNr"] = AlarmTemp.Rows[i]["MsgNr"];
|
||||
dataRow["State"] = AlarmTemp.Rows[i]["State"];
|
||||
dataRow["DateTime"] = AlarmTemp.Rows[i]["alarmStartTime"];
|
||||
dataRow["alarmStartTime"] = AlarmTemp.Rows[i]["alarmStartTime"];
|
||||
dataRow["alarmEndTime"] = System.DBNull.Value;
|
||||
dataRow["TypeName"] = AlarmTemp.Rows[i]["TypeName"];
|
||||
dataRow["Text1"] = AlarmTemp.Rows[i]["Text1"];
|
||||
dataRow["Text2"] = AlarmTemp.Rows[i]["Text2"];
|
||||
dataRow["lastupdatetime"] = lastupdatetime;
|
||||
algView.Rows.Add(dataRow);
|
||||
}
|
||||
for (int i = 0; i < AlarmTempOK.Rows.Count; i++)
|
||||
{
|
||||
dataRow = algView.NewRow();
|
||||
dataRow["AlarmID"] = AlarmTempOK.Rows[i]["AlarmID"];
|
||||
dataRow["TagID"] = AlarmTempOK.Rows[i]["TagID"];
|
||||
dataRow["TagValue"] = AlarmTempOK.Rows[i]["TagValue"];
|
||||
|
||||
dataRow["MsgNr"] = AlarmTempOK.Rows[i]["MsgNr"];
|
||||
dataRow["State"] = AlarmTempOK.Rows[i]["State"];
|
||||
dataRow["DateTime"] = AlarmTempOK.Rows[i]["alarmEndTime"];
|
||||
dataRow["alarmStartTime"] = AlarmTempOK.Rows[i]["alarmStartTime"];
|
||||
dataRow["alarmEndTime"] = AlarmTempOK.Rows[i]["alarmEndTime"];
|
||||
dataRow["TypeName"] = AlarmTempOK.Rows[i]["TypeName"];
|
||||
dataRow["Text1"] = AlarmTempOK.Rows[i]["Text1"];
|
||||
dataRow["Text2"] = AlarmTempOK.Rows[i]["Text2"];
|
||||
dataRow["TimeDiff"] = AlarmTempOK.Rows[i]["TimeDiff"];
|
||||
dataRow["lastupdatetime"] = lastupdatetime;
|
||||
algView.Rows.Add(dataRow);
|
||||
}
|
||||
return algView;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新产生解除报警临时表
|
||||
/// AlarmTempOK
|
||||
/// </summary>
|
||||
/// <param name="MSGVAR_Value">报警变量TagID</param>
|
||||
/// <param name="inValue">报警变量值</param>
|
||||
/// <param name="dateTimeValue">报警产生时间</param>
|
||||
/// <param name="table_MSGBIT2"></param>
|
||||
/// <param name="PLC_MSMsgs_WORK">全部报警报文</param>
|
||||
/// <param name="AlarmTempOK">被解除的报警列表</param>
|
||||
/// <param name="table_AlarmStart"></param>
|
||||
static public void ReleaseAlarmTemp(int MSGVAR_Value, object inValue, DateTime dateTimeValue,
|
||||
Hashtable table_MSGBIT2, DataTable PLC_MSMsgs_WORK,
|
||||
ref DataTable AlarmTempOK, ref Hashtable table_AlarmStart)
|
||||
{
|
||||
|
||||
AlarmText alarmText = new AlarmText();
|
||||
AlarmText alarmTextStart = new AlarmText();
|
||||
DataRow dataRow;
|
||||
DataTable data = AlarmCommonFunction.BuildDataTablesAlarmView();
|
||||
string strWhere;
|
||||
DataRow[] alarmDataRow;
|
||||
int NR;
|
||||
|
||||
alarmText.AlarmID = 0;
|
||||
alarmText.TagID = MSGVAR_Value;
|
||||
alarmText.TagValue = Convert.ToInt32(inValue);
|
||||
alarmText.alarmStartTime = dateTimeValue;
|
||||
|
||||
AlarmTempOK.Clear();
|
||||
//解除报警
|
||||
for (int i = 0; i < table_MSGBIT2.Count; i++)
|
||||
{
|
||||
|
||||
strWhere = @" (MSGVAR = " + MSGVAR_Value.ToString() + ") AND (MSGBIT=" + table_MSGBIT2[i].ToString() + ")";
|
||||
alarmDataRow = PLC_MSMsgs_WORK.Select(strWhere);
|
||||
|
||||
if (alarmDataRow.Length > 0)
|
||||
{
|
||||
NR = Convert.ToInt32(alarmDataRow[0]["NR"]);
|
||||
//报警存在于table_AlarmStart中
|
||||
if (table_AlarmStart.ContainsKey(NR))
|
||||
{
|
||||
alarmTextStart = (AlarmText)table_AlarmStart[NR];
|
||||
alarmText.AlarmID = alarmTextStart.AlarmID;
|
||||
alarmText.TypeName = alarmDataRow[0]["TypeName"].ToString();
|
||||
alarmText.Text1 = alarmDataRow[0]["Text1"].ToString();
|
||||
alarmText.Text2 = alarmDataRow[0]["Text2"].ToString();
|
||||
alarmText.MsgNr = Convert.ToInt32(alarmDataRow[0]["NR"]);
|
||||
alarmText.State = 2;
|
||||
alarmText.alarmStartTime = alarmTextStart.alarmStartTime;
|
||||
alarmText.alarmEndTime = DateTime.Now;
|
||||
|
||||
System.TimeSpan diff1 = alarmText.alarmEndTime.Subtract(alarmText.alarmStartTime);
|
||||
alarmText.TimeDiff = Convert.ToInt32(diff1.TotalSeconds);
|
||||
|
||||
//[测量数据报警全部];
|
||||
//QualityDataSystem.AlarmStartAllInsert(alarmText.AlarmID,
|
||||
// alarmText.TagID, alarmText.TagValue, alarmText.MsgNr,alarmText.State,
|
||||
// alarmText.alarmStartTime.ToString("G"), alarmText.alarmEndTime.ToString("G"),
|
||||
// alarmText.TimeDiff, alarmText.TypeName, alarmText.Text1, alarmText.Text2);
|
||||
|
||||
table_AlarmStart.Remove(NR);
|
||||
|
||||
dataRow = AlarmTempOK.NewRow();
|
||||
|
||||
dataRow["AlarmID"] = alarmText.AlarmID;
|
||||
dataRow["TagID"] = alarmText.TagID;
|
||||
dataRow["TagValue"] = alarmText.TagValue;
|
||||
dataRow["MsgNr"] = alarmText.MsgNr;
|
||||
dataRow["State"] = alarmText.State;
|
||||
dataRow["alarmStartTime"] = alarmText.alarmStartTime;
|
||||
dataRow["alarmEndTime"] = alarmText.alarmEndTime;
|
||||
dataRow["TimeDiff"] = alarmText.TimeDiff;
|
||||
dataRow["TypeName"] = alarmText.TypeName;
|
||||
dataRow["Text1"] = alarmText.Text1;
|
||||
dataRow["Text2"] = alarmText.Text2;
|
||||
AlarmTempOK.Rows.Add(dataRow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新产生报警临时表
|
||||
/// </summary>
|
||||
/// <param name="MSGVAR_Value"></param>
|
||||
/// <param name="inValue"></param>
|
||||
/// <param name="dateTimeValue"></param>
|
||||
/// <param name="table_MSGBIT1"></param>
|
||||
/// <param name="PLC_MSMsgs_WORK"></param>
|
||||
/// <param name="AlarmTemp"></param>
|
||||
/// <param name="table_AlarmStart"></param>
|
||||
static public void CraeteAlarmTemp(int MSGVAR_Value, object inValue, DateTime dateTimeValue,
|
||||
Hashtable table_MSGBIT1, DataTable PLC_MSMsgs_WORK,
|
||||
ref DataTable AlarmTemp, ref Hashtable table_AlarmStart)
|
||||
{
|
||||
|
||||
AlarmText alarmText;
|
||||
DataRow dataRow;
|
||||
string strWhere;
|
||||
DataRow[] alarmDataRow;
|
||||
int NR;
|
||||
|
||||
|
||||
alarmText = new AlarmText();
|
||||
|
||||
alarmText.AlarmID = 0;
|
||||
alarmText.TagID = MSGVAR_Value;
|
||||
alarmText.TagValue = Convert.ToInt32(inValue);
|
||||
alarmText.alarmStartTime = dateTimeValue;
|
||||
|
||||
AlarmTemp.Clear();
|
||||
|
||||
for (int i = 0; i < table_MSGBIT1.Count; i++)
|
||||
{
|
||||
|
||||
strWhere = @" (MSGVAR = " + MSGVAR_Value.ToString() + ") AND (MSGBIT=" + table_MSGBIT1[i].ToString() + ")";
|
||||
alarmDataRow = PLC_MSMsgs_WORK.Select(strWhere);
|
||||
|
||||
if (alarmDataRow.Length > 0)
|
||||
{
|
||||
NR = Convert.ToInt32(alarmDataRow[0]["NR"]);
|
||||
//报警不存在于table_AlarmStart中
|
||||
if (!table_AlarmStart.ContainsKey(NR))
|
||||
{
|
||||
alarmText.TypeName = alarmDataRow[0]["TypeName"].ToString();
|
||||
alarmText.Text1 = alarmDataRow[0]["Text1"].ToString();
|
||||
alarmText.Text2 = alarmDataRow[0]["Text2"].ToString();
|
||||
alarmText.MsgNr = Convert.ToInt32(alarmDataRow[0]["NR"]);
|
||||
alarmText.State = 1;
|
||||
//[测量数据报警全部];
|
||||
//QualityDataSystem.AlarmStartAllInsert(alarmText.AlarmID,
|
||||
// alarmText.TagID, alarmText.TagValue, alarmText.MsgNr,alarmText.State,
|
||||
// alarmText.alarmStartTime.ToString("G"), alarmText.alarmStartTime.ToString("G"),
|
||||
// 0, alarmText.TypeName, alarmText.Text1, alarmText.Text2);
|
||||
|
||||
dataRow = AlarmTemp.NewRow();
|
||||
|
||||
dataRow["AlarmID"] = alarmText.AlarmID;
|
||||
dataRow["TagID"] = alarmText.TagID;
|
||||
dataRow["TagValue"] = alarmText.TagValue;
|
||||
dataRow["MsgNr"] = alarmText.MsgNr;
|
||||
dataRow["State"] = alarmText.State;
|
||||
dataRow["alarmStartTime"] = alarmText.alarmStartTime;
|
||||
dataRow["TypeName"] = alarmText.TypeName;
|
||||
dataRow["Text1"] = alarmText.Text1;
|
||||
dataRow["Text2"] = alarmText.Text2;
|
||||
|
||||
AlarmTemp.Rows.Add(dataRow);
|
||||
|
||||
table_AlarmStart.Add(NR, alarmText);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获得产生或解除报警的位
|
||||
/// 根据报警值,通过与原始报警列表进行位操作比较,得到该报警值对应的报警文本列表
|
||||
/// </summary>
|
||||
/// <param name="alarmValue"></param>
|
||||
/// <param name="table_MSGBIT1"></param>
|
||||
/// <param name="table_MSGBIT2"></param>
|
||||
static public void GetBit(int alarmValue, out Hashtable table_MSGBIT1, out Hashtable table_MSGBIT2)
|
||||
{
|
||||
|
||||
int count1;
|
||||
int count2;
|
||||
table_MSGBIT1 = new Hashtable();
|
||||
table_MSGBIT2 = new Hashtable();
|
||||
count1 = 0;
|
||||
count2 = 0;
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
|
||||
if ((alarmValue & (int)Math.Pow(2, i)) == Math.Pow(2, i))
|
||||
{
|
||||
table_MSGBIT1.Add(count1, i);
|
||||
count1++;
|
||||
}
|
||||
else
|
||||
{
|
||||
table_MSGBIT2.Add(count2, i);
|
||||
count2++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建报警列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
static public DataTable BuildDataTablesAlarmView()
|
||||
{
|
||||
//数据
|
||||
DataTable table;
|
||||
DataColumnCollection columns;
|
||||
|
||||
table = new DataTable();
|
||||
columns = table.Columns;
|
||||
|
||||
|
||||
columns.Add("AlarmID", typeof(System.Int32));
|
||||
columns.Add("TagID", typeof(System.Int32));
|
||||
columns.Add("TagValue", typeof(System.String));
|
||||
columns.Add("MsgNr", typeof(System.Int32));
|
||||
columns.Add("State", typeof(System.Int16));
|
||||
columns.Add("alarmStartTime", typeof(System.DateTime));
|
||||
columns.Add("alarmEndTime", typeof(System.DateTime));
|
||||
columns.Add("Comment", typeof(System.String));
|
||||
columns.Add("Username", typeof(System.String));
|
||||
columns.Add("Counter", typeof(System.Int32));
|
||||
columns.Add("TimeDiff", typeof(System.Int32));
|
||||
|
||||
columns.Add("TypeName", typeof(System.String));
|
||||
columns.Add("Text1", typeof(System.String));
|
||||
columns.Add("Text2", typeof(System.String));
|
||||
columns.Add("lastupdatetime", typeof(System.DateTime));
|
||||
columns.Add("DateTime", typeof(System.DateTime));
|
||||
|
||||
return table;
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public struct AlarmText
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long ID;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long AlarmID;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int TagID;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int TagValue;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int MsgNr;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int State;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public DateTime alarmStartTime;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public DateTime alarmEndTime;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Comment;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Username;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long Counter;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int TimeDiff;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string TypeName;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Text1;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Text2;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public DateTime lastupdatetime;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int IsOk;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Collections;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
using bizFacade;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// Alarm 产生报警。
|
||||
/// </summary>
|
||||
public class AlarmOpcServer
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static DataTable alarmView;
|
||||
/// <summary>
|
||||
/// 产生报警
|
||||
/// </summary>
|
||||
private Hashtable table_MSGBIT1;
|
||||
/// <summary>
|
||||
/// 解除报警
|
||||
/// </summary>
|
||||
private Hashtable table_MSGBIT2;
|
||||
/// <summary>
|
||||
/// 报警列表
|
||||
/// </summary>
|
||||
private Hashtable table_AlarmStart;
|
||||
|
||||
///// <summary>
|
||||
///// 报警代码
|
||||
///// </summary>
|
||||
//private int NR;
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 系统启动后,没有解除的报警
|
||||
///// </summary>
|
||||
//private static DataTable AlarmStart;
|
||||
/// <summary>
|
||||
/// 新产生报警临时表
|
||||
/// </summary>
|
||||
private DataTable AlarmTemp;
|
||||
/// <summary>
|
||||
/// 解除的报警临时表
|
||||
/// </summary>
|
||||
private DataTable AlarmTempOK;
|
||||
///// <summary>
|
||||
///// 时时产生的报警文本
|
||||
///// </summary>
|
||||
//private DataTable PLC_AlgViewCHT_Temp;
|
||||
/// <summary>
|
||||
/// 报警变量基本文本
|
||||
/// </summary>
|
||||
private DataTable PLC_MSMsgs_WORK;
|
||||
|
||||
//DataRow[] alarmDataRow;
|
||||
//string strWhere;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public AlarmOpcServer()
|
||||
{
|
||||
//
|
||||
// TODO: 在此处添加构造函数逻辑
|
||||
//
|
||||
table_MSGBIT1 = new Hashtable();
|
||||
table_MSGBIT2 = new Hashtable();
|
||||
table_AlarmStart = new Hashtable();
|
||||
//目的是创建AlarmStart数据表结构
|
||||
//QualityDataSystem.AlarmStartSelect(out AlarmStart);
|
||||
QualityDataSystem.PLC_MSMsgs_WORKSelect(out PLC_MSMsgs_WORK);
|
||||
//Init_table_AlarmStart(AlarmStart);
|
||||
AlarmTemp = AlarmCommonFunction.BuildDataTablesAlarmView(); // AlarmStart.Clone();
|
||||
AlarmTempOK = AlarmCommonFunction.BuildDataTablesAlarmView();// AlarmStart.Clone();
|
||||
alarmView = AlarmCommonFunction.BuildDataTablesAlarmView(); //GetInitAlarmStart(AlarmStart);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 产生报警文本
|
||||
/// </summary>
|
||||
/// <param name="MSGVAR_Value"></param>
|
||||
/// <param name="inValue"></param>
|
||||
/// <param name="dateTimeValue"></param>
|
||||
/// <returns></returns>
|
||||
public DataTable AlarmInsert(int MSGVAR_Value, object inValue, DateTime dateTimeValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
//DataRow dataRow;
|
||||
DataTable algView ;//= AlarmCommonFunction.BuildDataTablesAlarmView();
|
||||
int alarmValue;
|
||||
alarmValue = Convert.ToInt32(inValue);
|
||||
|
||||
//获得报警值的报警位
|
||||
AlarmCommonFunction.GetBit(alarmValue,out table_MSGBIT1,out table_MSGBIT2);
|
||||
|
||||
// 新产生报警临时表
|
||||
// AlarmTemp
|
||||
AlarmCommonFunction.CraeteAlarmTemp(MSGVAR_Value, inValue, dateTimeValue,
|
||||
table_MSGBIT1, PLC_MSMsgs_WORK,
|
||||
ref AlarmTemp, ref table_AlarmStart);
|
||||
|
||||
//// 新产生报警临时表
|
||||
//// AlarmTemp
|
||||
//CraeteAlarmTemp(MSGVAR_Value, inValue, dateTimeValue);
|
||||
// 新产生解除报警临时表
|
||||
// AlarmTempOK
|
||||
AlarmCommonFunction.ReleaseAlarmTemp(MSGVAR_Value, inValue, dateTimeValue,
|
||||
table_MSGBIT2, PLC_MSMsgs_WORK,
|
||||
ref AlarmTempOK, ref table_AlarmStart);
|
||||
//ReleaseAlarmTemp(MSGVAR_Value, inValue, dateTimeValue);
|
||||
algView = AlarmCommonFunction.GetAlarmView(AlarmTemp, AlarmTempOK);
|
||||
|
||||
return algView;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, "\r\nAlarmInsert(产生报警模块)\r\nAlarmInsert\r\nMSGVAR_Value(TagID)=" + MSGVAR_Value.ToString() + "\r\ninValue=" + inValue.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
using System.Data.OleDb;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 机床加工时间
|
||||
/// </summary>
|
||||
public partial class QualityDataSystem
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 从Access 数据库获得,报警变量基本文本
|
||||
/// </summary>
|
||||
public static bool PLC_MSMsgs_WORKSelect(out DataTable dt)
|
||||
{
|
||||
string sql = "SELECT * FROM [MES_基本变量_报警报文] ";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// INSERT INTO [测量数据报警全部]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void AlarmStartAllInsert(DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "INSERT INTO [测量数据报警全部]"
|
||||
+ "(AlarmID,TagID, TagValue, MsgNr, State,alarmStartTime,alarmEndTime,TimeDiff,TypeName,Text1, Text2,lastupdatetime)"
|
||||
|
||||
+ "VALUES(@AlarmID,@TagID,@TagValue,@MsgNr,@State,@alarmStartTime,@alarmEndTime,@TimeDiff,@TypeName,@Text1,@Text2,@lastupdatetime)";
|
||||
|
||||
|
||||
OleDbParameter[] thisParmsAccess = new OleDbParameter[12];
|
||||
thisParmsAccess[0] = new OleDbParameter("@AlarmID", OleDbType.Integer, 4, "AlarmID");
|
||||
thisParmsAccess[1] = new OleDbParameter("@TagID", OleDbType.Integer, 4, "TagID");
|
||||
thisParmsAccess[2] = new OleDbParameter("@TagValue", OleDbType.Integer, 4, "TagValue");
|
||||
thisParmsAccess[3] = new OleDbParameter("@MsgNr", OleDbType.Integer, 4, "MsgNr");
|
||||
thisParmsAccess[4] = new OleDbParameter("@State", OleDbType.Integer, 4, "State");
|
||||
thisParmsAccess[5] = new OleDbParameter("@alarmStartTime", OleDbType.Date, 8, "alarmStartTime");
|
||||
thisParmsAccess[6] = new OleDbParameter("@alarmEndTime", OleDbType.Date, 8, "alarmEndTime");
|
||||
thisParmsAccess[7] = new OleDbParameter("@TimeDiff", OleDbType.Integer, 4, "TimeDiff");
|
||||
thisParmsAccess[8] = new OleDbParameter("@TypeName", OleDbType.VarChar, 50, "TypeName");
|
||||
thisParmsAccess[9] = new OleDbParameter("@Text1", OleDbType.VarChar, 50, "Text1");
|
||||
thisParmsAccess[10] = new OleDbParameter("@Text2", OleDbType.VarChar, 50, "Text2");
|
||||
thisParmsAccess[11] = new OleDbParameter("@lastupdatetime", OleDbType.Date, 8, "lastupdatetime");
|
||||
//
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[12];
|
||||
thisParmsSql[0] = new SqlParameter("@AlarmID", SqlDbType.Int, 4, "AlarmID");
|
||||
thisParmsSql[1] = new SqlParameter("@TagID", SqlDbType.Int, 4, "TagID");
|
||||
thisParmsSql[2] = new SqlParameter("@TagValue", SqlDbType.Int, 4, "TagValue");
|
||||
thisParmsSql[3] = new SqlParameter("@MsgNr", SqlDbType.Int, 4, "MsgNr");
|
||||
thisParmsSql[4] = new SqlParameter("@State", SqlDbType.Int, 4, "State");
|
||||
thisParmsSql[5] = new SqlParameter("@alarmStartTime", SqlDbType.DateTime, 8, "alarmStartTime");
|
||||
thisParmsSql[6] = new SqlParameter("@alarmEndTime", SqlDbType.DateTime, 8, "alarmEndTime");
|
||||
thisParmsSql[7] = new SqlParameter("@TimeDiff", SqlDbType.Int, 4, "TimeDiff");
|
||||
thisParmsSql[8] = new SqlParameter("@TypeName", SqlDbType.NVarChar, 50, "TypeName");
|
||||
thisParmsSql[9] = new SqlParameter("@Text1", SqlDbType.NVarChar, 50, "Text1");
|
||||
thisParmsSql[10] = new SqlParameter("@Text2", SqlDbType.NVarChar, 50, "Text2");
|
||||
thisParmsSql[11] = new SqlParameter("@lastupdatetime", SqlDbType.DateTime, 8, "lastupdatetime");
|
||||
|
||||
if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteSQL(sql, ref thisParmsSql, dt);
|
||||
}
|
||||
if (!SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParmsAccess);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// QualityDataSystem 的摘要说明。
|
||||
/// </summary>
|
||||
public partial class QualityDataSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// 全部数据列表
|
||||
/// MES_基本变量_原始数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
static public DataTable BasicDataTagValue()
|
||||
{
|
||||
DataTable dt = null;
|
||||
|
||||
string sql;
|
||||
sql = "SELECT * FROM MES_基本变量_原始数据 where (变量类型代码=101 or 变量类型代码 = 102 or 变量类型代码 = 105) "
|
||||
+ " and (是否启用 = 1)"
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')"
|
||||
+ " order by TagID";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_基本数据_测量范围
|
||||
/// 从数据库服务器获得
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
static public DataTable BasicDataTagValueUpDown()
|
||||
{
|
||||
DataTable dt = null;
|
||||
string sql;
|
||||
sql = "SELECT * FROM MES_基本数据_测量范围 order by 发动机型号代码,TagID";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
BIN
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MIS/vssver2.scc
Normal file
BIN
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/MIS/vssver2.scc
Normal file
Binary file not shown.
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 机床报警变量
|
||||
/// 103
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_Alarm()
|
||||
{
|
||||
//string errorMessage;
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo FROM [MES_基本变量_原始数据] where 变量类型代码 = 103 and 是否启用 = 1"
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 发动机类型转换表
|
||||
/// SELECT ID,发动机机型代码 FROM MES_计划BOM_发动机型号代码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_EngineTypeID()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT ID,发动机机型代码 FROM MES_计划BOM_发动机型号代码 ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测量合格标志
|
||||
/// 全部测量数据的测量工位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_GoodBad_MIS_OpName_B5A()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT distinct 工位号 "
|
||||
+ " FROM MES_基本变量_原始数据 "
|
||||
+ " where 变量特点 = 8 and 是否启用 = 1 "
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量合格标志
|
||||
/// 全部测量数据的测量工位的数据来源
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_GoodBad_MIS_OpName(string opName)
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,工位号,数据来源 "
|
||||
+ " FROM MES_基本变量_原始数据 "
|
||||
+ " where OpcServer_OPNAME = '1' and 是否启用 = 1 "
|
||||
+ " and 工位号='" + opName+"'"
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量合格标志
|
||||
/// 全部测量数据的测量工位的数据来源的测量变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_GoodBad_MIS_OpName(string opName,string opNameFrom)
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID "
|
||||
+ " FROM MES_基本变量_原始数据 "
|
||||
+ " where OpcServer_OPNAME = '2' and 是否启用 = 1 "
|
||||
+ " and 工位号='" + opName + "'"
|
||||
+ " and 数据来源='" + opNameFrom + "'"
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测量工位号和工位名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_OpName_Name()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql = "SELECT distinct [工位号],[工位名称] FROM [MES_计划BOM_工位与名称] "
|
||||
+ " where (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')"
|
||||
+ " ORDER BY 工位号 ";
|
||||
//来源于SQL Server
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_计划BOM_工位与名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_OpName()
|
||||
{
|
||||
//DataTable dt;
|
||||
//string sql = "SELECT * FROM [MES_计划BOM_工位与名称] "
|
||||
// + " where (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')"
|
||||
// + " ORDER BY 工位号 ";
|
||||
//DataAccess.ExecuteDataTable(sql, out dt);
|
||||
//return dt;
|
||||
|
||||
//2022.07.27.LLX 处理了一下子
|
||||
DataTable dt;
|
||||
string sql = "SELECT * FROM [MES_计划BOM_工位与名称] "
|
||||
+ " where (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "') and [是否通过监控系统保存数据] is not null"
|
||||
+ " ORDER BY 工位号 ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// MES_基本变量_DB数据结构_根据工位代码_获得普通变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_OpcServerMES(int mesCode, string opName)
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 "
|
||||
+ " FROM MES_基本变量_原始数据 "
|
||||
+ " where 变量类型代码 = "+mesCode.ToString()+" and 是否启用 = 1"
|
||||
+ " and 工位号='" + opName + "'"
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_DB数据结构_根据工位代码_获得普通变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_OpcServerMES(int mesCode)
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 "
|
||||
+ " FROM MES_基本变量_原始数据 "
|
||||
+ " where 变量类型代码 = " + mesCode.ToString() + " and 是否启用 = 1"
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_基本变量_DB数据结构_获得激发变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_All()
|
||||
{
|
||||
//string errorMessage;
|
||||
DataTable dt = null;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] "
|
||||
+ " where ((变量类型代码 >= 19 and 变量类型代码 <= 27) or (变量类型代码 = 101) or (变量类型代码 = 102) or (变量类型代码 = 105) or (变量类型代码 = 1000) or (变量类型代码 = 1001) or (变量类型代码 = 1002) or (变量类型代码 = 1003) or (变量类型代码 = 1004)) and (是否启用 = 1) "
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')"
|
||||
+ " ORDER BY TagID ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_DB数据结构_获得激发变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_All_B5A()
|
||||
{
|
||||
//string errorMessage;
|
||||
DataTable dt = null;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] "
|
||||
+ " where ((变量类型代码 = 101) or (变量类型代码 = 102) ) and (是否启用 = 1) "
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')"
|
||||
+ " ORDER BY TagID ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 20170310 新加
|
||||
/// MES_基本变量_DB数据结构_获得所有普通变量(除101.102.103.104.105)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_OpcServerMES_ALL_CF()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 "
|
||||
+ " FROM MES_基本变量_原始数据 "
|
||||
+ " where 变量类型代码 <> 101 and 变量类型代码 <> 102 and 变量类型代码 <> 103 and 变量类型代码 <> 104 and 变量类型代码 <> 105 and 是否启用 = 1"
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
BIN
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/OPC/vssver2.scc
Normal file
BIN
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/OPC/vssver2.scc
Normal file
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = "relative:MES.BizFacade"
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过下列属性集
|
||||
// 控制。更改这些属性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("MIS.BizFacade")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MIS.BizFacade")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2010")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 属性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("ac1c74d4-19b0-47e1-8240-fab8ee5b2711")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Binary file not shown.
@@ -0,0 +1,129 @@
|
||||
using DataLinkMesWork;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 通用BizFaced类
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 验证质量数据状态哈希表
|
||||
/// </summary>
|
||||
public static Hashtable QualityVerifyStatus_Hash = new Hashtable();
|
||||
|
||||
/// <summary>
|
||||
/// 读取工位质量数据验证状态
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityVerifyStatus_Hash_Read(string OpName)
|
||||
{
|
||||
if (QualityVerifyStatus_Hash.Contains(OpName))
|
||||
{
|
||||
return Convert.ToBoolean(QualityVerifyStatus_Hash[OpName]);
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 写入工位质量数据验证状态
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="Result"></param>
|
||||
public static void QualityVerifyStatus_Hash_Write(string OpName, bool Result)
|
||||
{
|
||||
if (QualityVerifyStatus_Hash.Contains(OpName))
|
||||
{
|
||||
QualityVerifyStatus_Hash[OpName] = Result;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
QualityVerifyStatus_Hash.Add(OpName, Result);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 部装工位质量数据验证
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool QulityDataVerify(string OpName, string EngineID_Subline, out string AlarmStr)
|
||||
{
|
||||
int IsAlarm = 0;
|
||||
AlarmStr = "";
|
||||
string procedureName;
|
||||
procedureName = "测量数据工位_监控系统_部装质量数据验证";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@部装总成号", EngineID_Subline);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@是否报警", IsAlarm);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@报警工位号", AlarmStr);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
IsAlarm = Convert.ToInt32(thisParms[2].Value.ToString());
|
||||
AlarmStr = thisParms[3].Value.ToString();
|
||||
|
||||
if (IsAlarm == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 线外工位质量数据验证
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool QualityVerifyStatusOutline(string OpName, out string AlarmStr)
|
||||
{
|
||||
int IsAlarm = 0;
|
||||
AlarmStr = "";
|
||||
string procedureName;
|
||||
procedureName = "测量数据工位_监控系统_线外质量数据验证";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否报警", IsAlarm);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@报警工位号", AlarmStr);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
IsAlarm = Convert.ToInt32(thisParms[1].Value.ToString());
|
||||
AlarmStr = thisParms[2].Value.ToString();
|
||||
|
||||
if (IsAlarm == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,639 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
|
||||
using SystemFramework;
|
||||
using BasicData;
|
||||
using OpcData;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 对应玉柴项目
|
||||
/// 20230203 按数据组读取数据
|
||||
///
|
||||
/// 质量数据的上限值,下限值,理论值来源于表[MES_基本数据_测量范围]
|
||||
/// 通过TagID和engineTypeID。如果engineTypeID=0,上限值,下限值,理论值=""
|
||||
/// 质量数据可以读数据 19
|
||||
/// 分散控制
|
||||
/// tagID_CF质量数据激发变量对应的质量数据列表
|
||||
/// </summary>
|
||||
/// <param name="valuList">tagID_CF质量数据激发变量对应的质量数据列表(Hashtable)</param>
|
||||
/// <param name="opName">质量数据列表</param>
|
||||
/// <param name="BasicDataTagValue">质量数据列表</param>
|
||||
/// <param name="BasicDataTagValueUpDown"></param>
|
||||
/// <param name="dt">质量数据列表</param>
|
||||
/// <param name="qualityMask">质量数据总成合格标志 21( =0 数据合格) (= 1数据不合格)</param>
|
||||
/// <param name="engineTypeID">质量数据发动机机型标志 9</param>
|
||||
/// <param name="engineID">质量数据发动机号 10</param>
|
||||
/// <param name="engineType">质量数据发动机机型 11</param>
|
||||
/// <param name="partPallet"></param>
|
||||
/// <param name="engineTraceCode"></param>
|
||||
/// <param name="engineCap">缸盖号[TagValue2]</param>
|
||||
/// <param name="hashtable_EngineTypeID">发动机类型转换表</param>
|
||||
/// <param name="mes_MustTest">发动机类型转换表</param>
|
||||
/// <param name="onLineState">发动机类型转换表</param>
|
||||
/// <param name="partMoveDirection">发动机类型转换表</param>
|
||||
/// <param name="pressIsOK">发动机类型转换表</param>
|
||||
/// <param name="pressIsNoOK">发动机类型转换表</param>
|
||||
static public void GetQualityDataTable_ByOnlyDataGroup(Hashtable valuList, string opName, DataTable BasicDataTagValue,
|
||||
DataTable BasicDataTagValueUpDown,
|
||||
out DataTable dt
|
||||
)
|
||||
{
|
||||
//78 0:屏蔽MES;1:启用MES(必须MIS)
|
||||
//79 通过线体工位PC实现下达工位工作状态:工位有三种状态:在线、离线、屏蔽。在线;0正常状态,实现正常功能。1离线:2屏蔽。(必须MIS)
|
||||
//41 机体流向标志(1 BYTE):0普通工位:1:上线(发动机上线);2:下线(发动机下线);(必须PLC)
|
||||
//51 返修工位,修改后的数据MES将数据写入PLC ,MES通知PLC数据修改完成。(YN)
|
||||
//8 只要返修,必须由mes发送此信号,plc接收此信号后才能放行
|
||||
//(暂时没用)用于有扳手拧紧工位。通知设备螺钉拧紧完成。PC已经将数据保存到数据库中。(B5A)
|
||||
|
||||
QualityDataType qualityData;
|
||||
//是否有数据
|
||||
//bool isUsing;
|
||||
|
||||
DataRow dr;
|
||||
DataRow[] dr_WWW;
|
||||
//MES_基本数据_测量范围
|
||||
DataRow[] dr_WWW_UpDown;
|
||||
|
||||
dt = BuildDataTables_WWW();
|
||||
|
||||
//测量位置
|
||||
string shaftID;
|
||||
//测量项目
|
||||
string item;
|
||||
//测量单位
|
||||
string unit;
|
||||
//机体类型
|
||||
//原始数据中的机型代码
|
||||
int engineTypeID_Source;
|
||||
//上限值
|
||||
string tagValueUp;
|
||||
//下限值
|
||||
string tagValueDown;
|
||||
//理论值
|
||||
string tagValeNormal;
|
||||
//TagValue
|
||||
// 合格标志
|
||||
//string IsGoodBad;
|
||||
|
||||
foreach (DictionaryEntry valueItem in valuList) //ht为一个Hashtable实例
|
||||
{
|
||||
try
|
||||
{
|
||||
qualityData = (QualityDataType)valueItem.Value;
|
||||
|
||||
|
||||
//if ((qualityData.tagProperty != 2) || (qualityData.tagProperty != 6))
|
||||
//{
|
||||
// continue ;
|
||||
//}
|
||||
//if ((qualityData.tagProperty == 2) || (qualityData.tagProperty == 6))
|
||||
{
|
||||
//if (engineTypeID == 0)
|
||||
//{
|
||||
// engineTypeID = 1;
|
||||
//}
|
||||
dr_WWW = BasicDataTagValue.Select("TagID = " + qualityData.tagID);
|
||||
try
|
||||
{
|
||||
dr_WWW_UpDown = BasicDataTagValueUpDown.Select("TagID = " + qualityData.tagID);
|
||||
}
|
||||
catch { dr_WWW_UpDown = null; }
|
||||
|
||||
|
||||
//if (dr_WWW.Length > 0)
|
||||
//{
|
||||
// {
|
||||
// engineTypeID_Source = Convert.ToInt32(dr_WWW[0]["机体类型"]);
|
||||
// int temp;
|
||||
// temp = engineTypeID_Source & engineTypeID;
|
||||
// if (temp == 0)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// if (qualityData.isGoodBad == -1)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// continue;
|
||||
|
||||
//}
|
||||
|
||||
try
|
||||
{
|
||||
shaftID = dr_WWW[0]["测量位置"].ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
shaftID = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
item = dr_WWW[0]["测量项目"].ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
item = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
unit = dr_WWW[0]["测量单位"].ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
unit = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
tagValueUp = "";
|
||||
if (dr_WWW_UpDown != null && dr_WWW_UpDown.Length > 0)
|
||||
{
|
||||
tagValueUp = dr_WWW_UpDown[0]["值上限"].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
tagValueUp = "";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagValueUp = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
tagValueDown = "";
|
||||
if (dr_WWW_UpDown != null && dr_WWW_UpDown.Length > 0)
|
||||
{
|
||||
tagValueDown = dr_WWW_UpDown[0]["值下限"].ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagValueDown = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
tagValeNormal = "";
|
||||
if (dr_WWW_UpDown != null && dr_WWW_UpDown.Length > 0)
|
||||
{
|
||||
tagValeNormal = dr_WWW_UpDown[0]["理论值"].ToString();
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagValeNormal = "";
|
||||
}
|
||||
|
||||
dr = dt.NewRow();
|
||||
|
||||
dr["TagID"] = qualityData.tagID;
|
||||
dr["测量位置"] = shaftID;
|
||||
dr["测量项目"] = item;
|
||||
dr["测量单位"] = unit;
|
||||
dr["上限值"] = tagValueUp;
|
||||
dr["下限值"] = tagValueDown;
|
||||
dr["理论值"] = tagValeNormal;
|
||||
dr["工位号"] = opName;
|
||||
dr["列位置"] = qualityData.tagOrderBy;
|
||||
dr["变量排序"] = qualityData.tagItemOrderBy;
|
||||
|
||||
dr["IsGoodBad"] = qualityData.isGoodBad;
|
||||
|
||||
switch (qualityData.tagTypeID)//
|
||||
{
|
||||
//合格标志数组
|
||||
case 8203:
|
||||
dr["TagValue"] = BaseDataSystemMES.GetQualityData_GoodBad_String((bool[])qualityData.tagValue);
|
||||
break;
|
||||
case 8209:
|
||||
dr["TagValue"] = "";
|
||||
break;
|
||||
//非标准REAL
|
||||
case 8210:
|
||||
dr["TagValue"] = GetNoNormalReal(qualityData.tagValue);
|
||||
dt.Rows.Add(dr);
|
||||
break;
|
||||
default:
|
||||
dr["TagValue"] = Convert.ToString(qualityData.tagValue);
|
||||
dt.Rows.Add(dr);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 对应玉柴项目
|
||||
/// 20111101
|
||||
/// 质量数据的上限值,下限值,理论值来源于表[MES_基本数据_测量范围]
|
||||
/// 通过TagID和engineTypeID。如果engineTypeID=0,上限值,下限值,理论值=""
|
||||
/// 质量数据可以读数据 19
|
||||
/// 分散控制
|
||||
/// tagID_CF质量数据激发变量对应的质量数据列表
|
||||
/// </summary>
|
||||
/// <param name="valuList">tagID_CF质量数据激发变量对应的质量数据列表(Hashtable)</param>
|
||||
/// <param name="opName">质量数据列表</param>
|
||||
/// <param name="BasicDataTagValue">质量数据列表</param>
|
||||
/// <param name="BasicDataTagValueUpDown"></param>
|
||||
/// <param name="dt">质量数据列表</param>
|
||||
/// <param name="qualityMask">质量数据总成合格标志 21( =0 数据合格) (= 1数据不合格)</param>
|
||||
/// <param name="engineTypeID">质量数据发动机机型标志 9</param>
|
||||
/// <param name="engineID">质量数据发动机号 10</param>
|
||||
/// <param name="engineType">质量数据发动机机型 11</param>
|
||||
/// <param name="partPallet"></param>
|
||||
/// <param name="engineTraceCode"></param>
|
||||
/// <param name="engineCap">缸盖号[TagValue2]</param>
|
||||
/// <param name="hashtable_EngineTypeID">发动机类型转换表</param>
|
||||
/// <param name="mes_MustTest">发动机类型转换表</param>
|
||||
/// <param name="onLineState">发动机类型转换表</param>
|
||||
/// <param name="partMoveDirection">发动机类型转换表</param>
|
||||
/// <param name="pressIsOK">发动机类型转换表</param>
|
||||
/// <param name="pressIsNoOK">发动机类型转换表</param>
|
||||
static public void GetQualityDataTable_B5A(Hashtable valuList, string opName, DataTable BasicDataTagValue,
|
||||
DataTable BasicDataTagValueUpDown,
|
||||
out DataTable dt,
|
||||
out int qualityMask,
|
||||
out int engineTypeID,
|
||||
out string engineID,
|
||||
out string engineType,out string partPallet, out string engineTraceCode, out string engineCap, Hashtable hashtable_EngineTypeID,
|
||||
out int mes_MustTest,out int onLineState,out int partMoveDirection,
|
||||
out int pressIsOK, out int pressIsNoOK)
|
||||
{
|
||||
//78 0:屏蔽MES;1:启用MES(必须MIS)
|
||||
//79 通过线体工位PC实现下达工位工作状态:工位有三种状态:在线、离线、屏蔽。在线;0正常状态,实现正常功能。1离线:2屏蔽。(必须MIS)
|
||||
//41 机体流向标志(1 BYTE):0普通工位:1:上线(发动机上线);2:下线(发动机下线);(必须PLC)
|
||||
//51 返修工位,修改后的数据MES将数据写入PLC ,MES通知PLC数据修改完成。(YN)
|
||||
//8 只要返修,必须由mes发送此信号,plc接收此信号后才能放行
|
||||
//(暂时没用)用于有扳手拧紧工位。通知设备螺钉拧紧完成。PC已经将数据保存到数据库中。(B5A)
|
||||
mes_MustTest = 0;
|
||||
onLineState = 0;
|
||||
partMoveDirection = 0;
|
||||
pressIsOK = 0;
|
||||
pressIsNoOK = 0;
|
||||
QualityDataType qualityData;
|
||||
//是否有数据
|
||||
//bool isUsing;
|
||||
|
||||
DataRow dr;
|
||||
DataRow[] dr_WWW;
|
||||
//MES_基本数据_测量范围
|
||||
DataRow[] dr_WWW_UpDown;
|
||||
|
||||
dt = BuildDataTables_WWW();
|
||||
qualityMask = 0;
|
||||
engineTypeID = 0;
|
||||
engineID = "";
|
||||
engineType = "";
|
||||
engineTraceCode = "";
|
||||
engineCap = "";
|
||||
partPallet = "";
|
||||
//测量位置
|
||||
string shaftID;
|
||||
//测量项目
|
||||
string item;
|
||||
//测量单位
|
||||
string unit;
|
||||
//机体类型
|
||||
//原始数据中的机型代码
|
||||
int engineTypeID_Source;
|
||||
//上限值
|
||||
string tagValueUp;
|
||||
//下限值
|
||||
string tagValueDown;
|
||||
//理论值
|
||||
string tagValeNormal;
|
||||
//TagValue
|
||||
// 合格标志
|
||||
//string IsGoodBad;
|
||||
|
||||
|
||||
foreach (DictionaryEntry valueItem in valuList) //ht为一个Hashtable实例
|
||||
{
|
||||
try
|
||||
{
|
||||
qualityData = (QualityDataType)valueItem.Value;
|
||||
|
||||
switch (qualityData.tagValueType)
|
||||
{
|
||||
case 21:
|
||||
qualityMask = Convert.ToInt32(qualityData.tagValue);
|
||||
//转变一下
|
||||
//qualityMask = transferIsOK_OpName_2(Convert.ToInt32(qualityData.tagValue));
|
||||
break;
|
||||
case 8:
|
||||
//8 只要返修,必须由mes发送此信号,plc接收此信号后才能放行
|
||||
//(暂时没用)用于有扳手拧紧工位。通知设备螺钉拧紧完成。PC已经将数据保存到数据库中。(B5A)
|
||||
pressIsNoOK = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
//质量数据发动机机型标志 22(玉柴) 发动机机型标志 9 (有MOBY)需要换算成2的n次幂的形式,以便生成报表
|
||||
case 9:
|
||||
engineTypeID = Convert.ToInt32(qualityData.tagValue);
|
||||
if (engineTypeID == 0)
|
||||
{
|
||||
engineTypeID = 1;
|
||||
}
|
||||
if (hashtable_EngineTypeID.ContainsKey(engineTypeID))
|
||||
{
|
||||
string engineTypeIDString = hashtable_EngineTypeID[engineTypeID].ToString();
|
||||
engineTypeID = Convert.ToInt32(engineTypeIDString);
|
||||
if (engineTypeID == 0)
|
||||
{
|
||||
engineTypeID = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
//发动机编号 23 10
|
||||
//case 23:
|
||||
case 10:
|
||||
engineID = Convert.ToString(qualityData.tagValue);
|
||||
break;
|
||||
//质量数据发动机机型 24(玉柴) 11(有MOBY)
|
||||
//case 24:
|
||||
case 11:
|
||||
engineType = Convert.ToString(qualityData.tagValue);
|
||||
break;
|
||||
case 41:
|
||||
//41 机体流向标志(1 BYTE):0普通工位:1:上线(发动机上线);
|
||||
//2:下线(发动机下线);(必须PLC)
|
||||
partMoveDirection = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
case 51:
|
||||
//51 返修工位,修改后的数据MES将数据写入PLC ,MES通知PLC数据修改完成。(YN)
|
||||
pressIsOK = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
//78 0:屏蔽MES;1:启用MES(必须MIS)
|
||||
case 78:
|
||||
mes_MustTest = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
//79 通过线体工位PC实现下达工位工作状态:工位有三种状态:在线、离线、屏蔽。在线:
|
||||
//0正常状态,实现正常功能。1离线:2屏蔽。(必须MIS)
|
||||
case 79:
|
||||
onLineState = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
//托盘编号(B5A)
|
||||
case 80:
|
||||
partPallet = Convert.ToString(qualityData.tagValue);
|
||||
break;
|
||||
}
|
||||
//if ((qualityData.tagProperty != 2) || (qualityData.tagProperty != 6))
|
||||
//{
|
||||
// continue ;
|
||||
//}
|
||||
if ((qualityData.tagProperty == 2) || (qualityData.tagProperty == 6))
|
||||
{
|
||||
if (engineTypeID == 0)
|
||||
{
|
||||
engineTypeID = 1;
|
||||
}
|
||||
dr_WWW = BasicDataTagValue.Select("TagID = " + qualityData.tagID);
|
||||
try
|
||||
{
|
||||
dr_WWW_UpDown = BasicDataTagValueUpDown.Select("TagID = " + qualityData.tagID);
|
||||
}
|
||||
catch { dr_WWW_UpDown = null; }
|
||||
|
||||
|
||||
if (dr_WWW.Length > 0)
|
||||
{
|
||||
{
|
||||
engineTypeID_Source = Convert.ToInt32(dr_WWW[0]["机体类型"]);
|
||||
int temp;
|
||||
temp = engineTypeID_Source & engineTypeID;
|
||||
if (temp == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (qualityData.isGoodBad == -1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
shaftID = dr_WWW[0]["测量位置"].ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
shaftID = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
item = dr_WWW[0]["测量项目"].ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
item = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
unit = dr_WWW[0]["测量单位"].ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
unit = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
tagValueUp = "";
|
||||
if (dr_WWW_UpDown != null&& dr_WWW_UpDown.Length >0)
|
||||
{
|
||||
tagValueUp = dr_WWW_UpDown[0]["值上限"].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
tagValueUp = "";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagValueUp = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
tagValueDown = "";
|
||||
if (dr_WWW_UpDown != null && dr_WWW_UpDown.Length > 0)
|
||||
{
|
||||
tagValueDown = dr_WWW_UpDown[0]["值下限"].ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagValueDown = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
tagValeNormal = "";
|
||||
if (dr_WWW_UpDown != null && dr_WWW_UpDown.Length > 0)
|
||||
{
|
||||
tagValeNormal = dr_WWW_UpDown[0]["理论值"].ToString();
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagValeNormal = "";
|
||||
}
|
||||
|
||||
dr = dt.NewRow();
|
||||
|
||||
dr["TagID"] = qualityData.tagID;
|
||||
dr["测量位置"] = shaftID;
|
||||
dr["测量项目"] = item;
|
||||
dr["测量单位"] = unit;
|
||||
dr["上限值"] = tagValueUp;
|
||||
dr["下限值"] = tagValueDown;
|
||||
dr["理论值"] = tagValeNormal;
|
||||
dr["工位号"] = opName;
|
||||
dr["列位置"] = qualityData.tagOrderBy;
|
||||
dr["变量排序"] = qualityData.tagItemOrderBy;
|
||||
|
||||
dr["IsGoodBad"] = qualityData.isGoodBad;
|
||||
|
||||
switch (qualityData.tagTypeID)//
|
||||
{
|
||||
//合格标志数组
|
||||
case 8203:
|
||||
dr["TagValue"] = BaseDataSystemMES.GetQualityData_GoodBad_String((bool[])qualityData.tagValue);
|
||||
break;
|
||||
case 8209:
|
||||
dr["TagValue"] = "";
|
||||
break;
|
||||
//非标准REAL
|
||||
case 8210:
|
||||
dr["TagValue"] = GetNoNormalReal(qualityData.tagValue);
|
||||
dt.Rows.Add(dr);
|
||||
break;
|
||||
default:
|
||||
dr["TagValue"] = Convert.ToString(qualityData.tagValue);
|
||||
dt.Rows.Add(dr);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
static public DataTable BuildDataTables_WWW()
|
||||
{
|
||||
DataTable table;
|
||||
DataColumnCollection columns;
|
||||
table = new DataTable();
|
||||
columns = table.Columns;
|
||||
table.Columns.Add("TagID", typeof(System.String));
|
||||
table.Columns.Add("TagValue", typeof(System.String));
|
||||
table.Columns.Add("IsGoodBad", typeof(System.Int32));
|
||||
table.Columns.Add("测量位置", typeof(System.String));
|
||||
table.Columns.Add("测量项目", typeof(System.String));
|
||||
table.Columns.Add("工位号", typeof(System.String));
|
||||
table.Columns.Add("理论值", typeof(System.String));
|
||||
table.Columns.Add("上限值", typeof(System.String));
|
||||
table.Columns.Add("下限值", typeof(System.String));
|
||||
table.Columns.Add("测量单位", typeof(System.String));
|
||||
table.Columns.Add("列位置", typeof(System.Int32));
|
||||
table.Columns.Add("变量排序", typeof(System.Int32));
|
||||
|
||||
return table;
|
||||
}
|
||||
/// <summary>
|
||||
/// 返回非标准real
|
||||
/// </summary>
|
||||
/// <param name="vDataValue"></param>
|
||||
/// <returns></returns>
|
||||
static private string GetNoNormalReal(object vDataValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
string real_a;
|
||||
string real_b;
|
||||
string groupValueString;
|
||||
int length;
|
||||
|
||||
//int real_b_Int;
|
||||
|
||||
length = ((System.Array)(vDataValue)).Length;
|
||||
groupValueString = "";
|
||||
if (length != 2)
|
||||
return "0.0";
|
||||
|
||||
real_a = Convert.ToUInt16((((System.Array)(vDataValue)).GetValue(0))).ToString();
|
||||
real_b = Convert.ToUInt16((((System.Array)(vDataValue)).GetValue(1))).ToString("00");
|
||||
groupValueString = real_a + "." + real_b;
|
||||
return groupValueString;
|
||||
}
|
||||
catch
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, "GetNoNormalReal");
|
||||
return "0.0";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 29 工位具体零件合格标志
|
||||
/// </summary>
|
||||
/// <param name="QualityData_GoodBad"></param>
|
||||
static public string GetQualityData_GoodBad_String(bool[] QualityData_GoodBad)
|
||||
{
|
||||
string str;
|
||||
str = "";
|
||||
if (QualityData_GoodBad != null)
|
||||
{
|
||||
|
||||
for (int i = 0; i < QualityData_GoodBad.Length; i++)
|
||||
{
|
||||
str = str + (Convert.ToInt32(QualityData_GoodBad[i])).ToString() + "|";
|
||||
}
|
||||
|
||||
}
|
||||
return str;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据合格索引_分线数据_删除
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_SubTable_Delete
|
||||
(string engineID,string opName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_分线数据_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// alter PROCEDURE [dbo].[测量数据合格_手动拧紧_增加]
|
||||
///@EngineTypeID int =null,
|
||||
///@EngineType nvarchar(50)=null,
|
||||
///@EngineID nvarchar(100)=null,
|
||||
///@TagValue nvarchar(100)=null,
|
||||
///@合格标志 int=null,
|
||||
///@工位号 nvarchar(50)=null,
|
||||
///@托盘编号 nvarchar(50)=null,
|
||||
///@TagID int=null,
|
||||
///@TagID_CF int=null
|
||||
/// </summary>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
/// <param name="isGoodBad"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="partPallet"></param>
|
||||
/// <param name="tagID"></param>
|
||||
/// <param name="tagID_CF"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_Insert
|
||||
(int engineTypeID, string engineType, string engineID,
|
||||
string tagValue, int isGoodBad,
|
||||
string opName, string partPallet, int tagID, int tagID_CF)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_手动拧紧_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[9];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineType", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagValue", tagValue);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘编号", partPallet);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@TagID", tagID);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID_CF);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ALTER PROCEDURE [dbo].[电子看板_发动机号_总合格标志_增加]
|
||||
///@工位号 nvarchar(50) = null,
|
||||
///@发动机号 nvarchar(50) = null,
|
||||
///@合格标志 int = 0测量数据合格索引_增加
|
||||
///0合格;1不合格
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="isOK"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsOK_Insert
|
||||
(string opName, string EngineID, int isOK)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_总合格标志_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@合格标志", isOK);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_不合格放行_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsNG_Select
|
||||
(string opName, string EngineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_不合格放行_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms,out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if(dt.Rows.Count==1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_不合格放行_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="worker"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsNG_Insert
|
||||
(string opName, string EngineID, string worker,string text)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_不合格放行_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@操作者编号", worker);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@不合格原因", text);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_不合格放行_删除
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsNG_Delete
|
||||
(string opName, string EngineID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_不合格放行_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 测量数据合格索引_增加
|
||||
/// 用于B5A项目
|
||||
/// ALTER PROCEDURE [dbo].[测量数据合格索引_增加]
|
||||
///@EngineID nvarchar(50)=null,
|
||||
///@TagID_CF int = null,
|
||||
///@EngineType nvarchar(50)=null,
|
||||
///@EngineTypeID int = null,
|
||||
///@工位号 nvarchar(50)=null,
|
||||
///@订单号 nvarchar(50)=null,
|
||||
///@合格标志 int=null,
|
||||
///@TagValue1 nvarchar(50)=null,
|
||||
///@TagValue2 nvarchar(50)=null,
|
||||
///@TagValue3 nvarchar(50)=null,
|
||||
///@TagValue4 nvarchar(50)=null,
|
||||
///@TagValue5 nvarchar(50)=null,
|
||||
///@TagValue6 nvarchar(50)=null,
|
||||
///@TagValue7 nvarchar(50)=null,
|
||||
///@TagValue8 nvarchar(50)=null,
|
||||
///@TagValue9 nvarchar(50)=null,
|
||||
///@TagValue10 nvarchar(50)=null,
|
||||
///@TagValue nvarchar(50)=null,
|
||||
///@Id_tagCF int=null output
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_IndexInsert
|
||||
(string EngineID, string tagID, string EngineType, int EngineTypeID, string opName,
|
||||
int isGoodBad,string PartPalletCode, out int Id_tagCF)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_增加";
|
||||
Id_tagCF = 0;
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineType", EngineType);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", EngineTypeID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘编号", PartPalletCode);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
|
||||
thisParms[7].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
Id_tagCF = Convert.ToInt32(thisParms[7].Value.ToString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// alter PROCEDURE dbo.[测量数据合格_增加]
|
||||
///@Id_tagCF int = null,
|
||||
///@EngineTypeID int =null,
|
||||
///@EngineID nvarchar(100)=null,
|
||||
///@TagID int=null,
|
||||
///@TagValue nvarchar(100)=null,
|
||||
///@IsGoodBad int=null,
|
||||
/// </summary>
|
||||
/// <param name="Id_tagCF"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_Insert
|
||||
(int Id_tagCF,int engineTypeID,string engineID,string opName,DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[6];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagID", SqlDbType.NVarChar, 50, "TagID");
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@TagValue", SqlDbType.NVarChar, 100, "TagValue");
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@IsGoodBad", SqlDbType.Int, 4, "IsGoodBad");
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, dt);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 测量数据项目
|
||||
/// 用于B5A项目
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_Item_B5A()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] "
|
||||
+ " where (TagID <> 0 ) and "
|
||||
+ " ((变量类型代码 = 9) "
|
||||
+ " or (变量类型代码 = 10) "
|
||||
+ " or (变量类型代码 = 11) "
|
||||
+ " or (变量类型代码 = 80) "
|
||||
+ " or (变量类型代码 = 101) "
|
||||
+ " or (变量类型代码 = 102) "
|
||||
|
||||
+ " or (变量类型代码 = 78) "
|
||||
+ " or (变量类型代码 = 79) "
|
||||
+ " or (变量类型代码 = 41) "
|
||||
+ " or (变量类型代码 = 51) "
|
||||
+ " or (变量类型代码 = 8) "
|
||||
+ " or (变量类型代码 = 21) "
|
||||
|
||||
+ " or (变量类型代码 = 105)) "
|
||||
+ " and (是否启用 = 1)"
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')";
|
||||
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量工位
|
||||
/// 变量特点=1001需要自动测量工位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_OpName_B5A()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql = "SELECT distinct 工位号 as 工位代码,[工位号] FROM [MES_基本变量_原始数据] "
|
||||
+ " where ((变量类型代码 >= 19 and 变量类型代码 <= 24) or (变量类型代码 = 101) or (变量类型代码 = 102)) and (是否启用 = 1) and (变量特点=1001)"
|
||||
+ " and (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
SCC = This is a Source Code Control file
|
||||
|
||||
[P1.MIS.BizFacade.csproj]
|
||||
SCC_Aux_Path = "\\192.168.0.100\vss\MES4.0"
|
||||
SCC_Project_Name = "$/MisData/MisData/MisData/MES.BizFacade", WFHAAAAA
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" />
|
||||
</packages>
|
||||
BIN
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/vssver2.scc
Normal file
BIN
MisData_3.0_2022.08.23.1622.LLX/MES.BizFacade/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user