change - 物料特征上传数据组改为参数配置

master
wenjy 2 years ago
parent 81d1ba7821
commit a5a6aa74e9

@ -2190,7 +2190,7 @@ namespace MaterialTraceability.Business.Impl
operationRevision = inifile.IniReadValue("MachineIntegrationServiceParam", "operationRevision"),
activityId = inifile.IniReadValue("MachineIntegrationServiceParam", "activityId"),
resource = appConfig.resource,
dcGroup = upLoadBusiness.GerDcGroupByResource(),
dcGroup = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroup"),
dcGroupRevision = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroupRevision"),
parametricArray = data,
modeProcessSfc = WebService.MachineIntegrationServiceService.ModeProcessSfc.MODE_COMPLETE_SFC_POST_DC
@ -2555,7 +2555,7 @@ namespace MaterialTraceability.Business.Impl
positionId = position,
resource = appConfig.resource,
operation = appConfig.operation,
dcGroup = upLoadBusiness.GerDcGroupByResource(),
dcGroup = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroup"),
upDirection = datas.Where(x => x.name == "LY_FJFX").FirstOrDefault().value,
downDirection = datas.Where(x => x.name == "LY_SJFX").FirstOrDefault().value,
downPosition = datas.Where(x => x.name == "LY_SJZ").FirstOrDefault().value,

@ -2389,11 +2389,18 @@ namespace MaterialTraceability.Business.Impl
//物料面向
string mqMaterialFace = "";
string stargetcwStr = "";
var lyMaterialFace = lyMaterialCharacter.paramValues.Where(x => x.parameter == "LY_WLMX").FirstOrDefault();
var S_TARGETCW = lyMaterialCharacter.paramValues.Where(x => x.parameter == "S_TARGETCW").FirstOrDefault();
if (lyMaterialFace != null)
{
mqMaterialFace = MaterialFaceStr(lyMaterialFace.value, upShaftInfo.endFlag, shaftInfo.endFlag);
mqMaterialFace = MaterialFaceStr(lyMaterialFace.value, upShaftInfo.endFlag, shaftInfo.endFlag);
}
if(S_TARGETCW != null){
stargetcwStr = S_TARGETCW.value;
}else{
LogHelperBusiness.LogInfo("手动完工获取模切数据S_TARGETCW为null");
}
LogHelper.Info(String.Format("冷压物料面向:{0};模切物料面向:{1}", lyMaterialFace, mqMaterialFace));
@ -2405,7 +2412,7 @@ namespace MaterialTraceability.Business.Impl
if (position % 2 != 0)
{
jrDirection = downDirection;
jrDirection = shaftInfo.endFlag == 0 ? "逆时针" : "顺时针";
var LY_S_X01 = lyMaterialCharacter.paramValues.Where(x => x.parameter == "LY_S_X01").FirstOrDefault();
var LY_B_X01 = lyMaterialCharacter.paramValues.Where(x => x.parameter == "LY_B_X01").FirstOrDefault();
@ -2415,7 +2422,7 @@ namespace MaterialTraceability.Business.Impl
}
else
{
jrDirection = shaftInfo.endFlag == 0 ? "逆时针" : "顺时针";
jrDirection = downDirection;
var LY_S_X02 = lyMaterialCharacter.paramValues.Where(x => x.parameter == "LY_S_X02").FirstOrDefault();
var LY_B_X02 = lyMaterialCharacter.paramValues.Where(x => x.parameter == "LY_B_X02").FirstOrDefault();
@ -2436,13 +2443,14 @@ namespace MaterialTraceability.Business.Impl
new machineIntegrationParametricData() {name ="S_CW",dataType=ParameterDataType.TEXT, value=StringExtension.IsBlank(S_CW) ? "0" : S_CW},
new machineIntegrationParametricData() {name ="B_CW",dataType=ParameterDataType.TEXT, value=StringExtension.IsBlank(B_CW) ? "0" : B_CW},
ccdTreetopAmount[0], // ccd打标数
new machineIntegrationParametricData() {name ="S_TARGETCW",dataType=ParameterDataType.TEXT, value=StringExtension.IsBlank(S_TARGETCW.value) ? "0" : S_TARGETCW.value},
new machineIntegrationParametricData() {name ="S_TARGETCW",dataType=ParameterDataType.TEXT, value=StringExtension.IsBlank(stargetcwStr) ? "0" : stargetcwStr},
};
LogHelper.Info("GetMaterialWeight获取模切物料特征数据" + JsonChange.ModeToJson(data));
return data;
}catch(Exception ex)
{
LogRefreshEvent?.Invoke(LogType.AlarmLog, "模切物料特征数据获取异常:" + ex.Message);
LogHelper.Error("模切物料特种数据获取异常",ex);
return null;
}
@ -2467,7 +2475,7 @@ namespace MaterialTraceability.Business.Impl
positionId = positionId,
resource = appConfig.resource,
operation = appConfig.operation,
dcGroup = upLoadBusiness.GerDcGroupByResource(),
dcGroup = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroup"),
upDirection = data.Where(x => x.name == "MQ_FJFX").FirstOrDefault().value,
downDirection = data.Where(x => x.name == "MQ_SJFX").FirstOrDefault().value,
downPosition = data.Where(x => x.name == "MQ_SJZ").FirstOrDefault().value,
@ -2563,7 +2571,7 @@ namespace MaterialTraceability.Business.Impl
operationRevision = inifile.IniReadValue("MachineIntegrationServiceParam", "operationRevision"),
activityId = inifile.IniReadValue("MachineIntegrationServiceParam", "activityId"),
resource = appConfig.resource,
dcGroup = upLoadBusiness.GerDcGroupByResource(),
dcGroup = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroup"),
dcGroupRevision = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroupRevision"),
parametricArray = data,
modeProcessSfc = WebService.MachineIntegrationServiceService.ModeProcessSfc.MODE_COMPLETE_SFC_POST_DC

@ -126,6 +126,7 @@ namespace MaterialTraceability.Business
//物料面向
string mqMaterialFace = "";
string stargetcwStr = "";
var lyMaterialFace = lyMaterialCharacter.paramValues.Where(x => x.parameter == "LY_WLMX").FirstOrDefault();
var S_TARGETCW = lyMaterialCharacter.paramValues.Where(x => x.parameter == "S_TARGETCW").FirstOrDefault();
if (lyMaterialFace != null)
@ -133,6 +134,12 @@ namespace MaterialTraceability.Business
mqMaterialFace = MaterialFaceStr_Mq(lyMaterialFace.value, upShaftInfo.endFlag, downDirectionNumber);
}
if(S_TARGETCW != null){
stargetcwStr = S_TARGETCW.value;
}else{
LogHelperBusiness.LogInfo("手动完工获取模切数据S_TARGETCW为null");
}
LogHelper.Info(String.Format("冷压物料面向:{0};模切物料面向:{1}", lyMaterialFace, mqMaterialFace));
//upLoadBusiness.SaveLogRecord(position, String.Format("冷压物料面向:{0};模切物料面向:{1}", lyMaterialFace, mqMaterialFace));
@ -172,13 +179,14 @@ namespace MaterialTraceability.Business
new machineIntegrationParametricData() {name ="S_CW",dataType=ParameterDataType.TEXT, value=StringExtension.IsBlank(S_CW) ? "0" : S_CW},
new machineIntegrationParametricData() {name ="B_CW",dataType=ParameterDataType.TEXT, value=StringExtension.IsBlank(B_CW) ? "0" : B_CW},
new machineIntegrationParametricData() {name ="CCD",dataType=ParameterDataType.TEXT, value=StringExtension.IsBlank(ccdLableAmount) ? "0" : ccdLableAmount},
new machineIntegrationParametricData() {name ="S_TARGETCW",dataType=ParameterDataType.TEXT, value=StringExtension.IsBlank(S_TARGETCW.value) ? "0" : S_TARGETCW.value},
new machineIntegrationParametricData() {name ="S_TARGETCW",dataType=ParameterDataType.TEXT, value=StringExtension.IsBlank(stargetcwStr) ? "0" : stargetcwStr},
};
return data;
}
catch (Exception ex)
{
LogHelper.Info("模切物料特征数据获取异常:" + ex.Message);
LogHelper.Error("模切物料特征数据获取异常",ex);
return null;
}
}

@ -72,9 +72,7 @@ namespace MaterialTraceability.WebService
MiBatchCompleteSfcAndAdujustQty.MiBatchCompleteSfcAndAdujustQtyRequest.modeProcessSfc = miBatchCompleteSfcAndAdujustQtyServiceServiceParam.modeProcessSfc;
MiBatchCompleteSfcAndAdujustQty.MiBatchCompleteSfcAndAdujustQtyRequest.sfcList = miBatchCompleteSfcAndAdujustQtyServiceServiceParam.sfcList;
//MiBatchCompleteSfcAndAdujustQty.MiBatchCompleteSfcAndAdujustQtyRequest.tailmark = miBatchCompleteSfcAndAdujustQtyServiceServiceParam.tailmark;
//MiBatchCompleteSfcAndAdujustQty.MiBatchCompleteSfcAndAdujustQtyRequest.taiMark = miBatchCompleteSfcAndAdujustQtyServiceServiceParam.tailmark;
DateTime beginTime = DateTime.Now;

@ -154,8 +154,10 @@
<TextBox Height="26" FontSize="18" x:Name="MachineIntegrationServiceParamOperationRevision" HorizontalAlignment="Left" VerticalAlignment="Center" Width="450" Margin="206,134,0,216.667"/>
<Label Content="activityId" Height="30" FontSize="18" Foreground="#007DFA" Width="125" VerticalAlignment="Center" HorizontalAlignment="Left" RenderTransformOrigin="1.347,-4.605" Margin="96,185,0,161.667"/>
<TextBox Height="26" FontSize="18" x:Name="MachineIntegrationServiceParamActivityId" HorizontalAlignment="Left" VerticalAlignment="Center" Width="450" Margin="206,190,0,160.667"/>
<Label Content="dcGroupRevision" Height="30" FontSize="18" Foreground="#007DFA" Width="180" VerticalAlignment="Center" HorizontalAlignment="Left" RenderTransformOrigin="1.347,-4.605" Margin="31,245,0,101.667"/>
<TextBox Height="26" FontSize="18" x:Name="MachineIntegrationServiceParamDcGroupRevision" HorizontalAlignment="Left" VerticalAlignment="Center" Width="450" Margin="206,244,0,106.667"/>
<Label Content="dcGroupRevision" Height="30" FontSize="18" Foreground="#007DFA" Width="165" VerticalAlignment="Top" HorizontalAlignment="Left" RenderTransformOrigin="1.347,-4.605" Margin="392,233,0,0"/>
<TextBox Height="26" FontSize="18" x:Name="MachineIntegrationServiceParamDcGroupRevision" HorizontalAlignment="Left" VerticalAlignment="Top" Width="93" Margin="562,235,0,0"/>
<Label Content="dcGroup" Height="30" FontSize="18" Foreground="#007DFA" Width="90" VerticalAlignment="Top" HorizontalAlignment="Left" RenderTransformOrigin="1.347,-4.605" Margin="96,233,0,0"/>
<TextBox Height="26" FontSize="18" x:Name="MachineIntegrationServiceParamDcGroup" HorizontalAlignment="Left" VerticalAlignment="Top" Width="181" Margin="206,235,0,0"/>
</Grid>
</TabItem>

@ -92,6 +92,7 @@ namespace MaterialTraceabilityUI
inifile.IniWriteValue("MachineIntegrationServiceParam", "operationRevision", this.MachineIntegrationServiceParamOperationRevision.Text);
inifile.IniWriteValue("MachineIntegrationServiceParam", "activityId", this.MachineIntegrationServiceParamActivityId.Text);
inifile.IniWriteValue("MachineIntegrationServiceParam", "dcGroupRevision", this.MachineIntegrationServiceParamDcGroupRevision.Text);
inifile.IniWriteValue("MachineIntegrationServiceParam", "dcGroup", this.MachineIntegrationServiceParamDcGroup.Text);
// 获取Mes数据TBParametricValueParam节点
inifile.IniWriteValue("TBParametricValueParam", "url", this.TBParametricValueParamUrl.Text);
inifile.IniWriteValue("TBParametricValueParam", "site", this.TBParametricValueParamSite.Text);
@ -172,6 +173,7 @@ namespace MaterialTraceabilityUI
this.MachineIntegrationServiceParamOperationRevision.Text = inifile.IniReadValue("MachineIntegrationServiceParam", "operationRevision");
this.MachineIntegrationServiceParamActivityId.Text = inifile.IniReadValue("MachineIntegrationServiceParam", "activityId");
this.MachineIntegrationServiceParamDcGroupRevision.Text = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroupRevision");
this.MachineIntegrationServiceParamDcGroup.Text = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroup");
// 获取Mes数据TBParametricValueParam节点
this.TBParametricValueParamUrl.Text = inifile.IniReadValue("TBParametricValueParam", "url");
this.TBParametricValueParamSite.Text = inifile.IniReadValue("TBParametricValueParam", "site");

@ -1,88 +0,0 @@
<Window x:Class="MaterialTraceabilityUI.Login"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MaterialTraceabilityUI"
mc:Ignorable="d" ResizeMode="NoResize"
Title="登录RFID物料追溯系统" Height="350" Width="400" Icon="芯片.png">
<Border Margin="5" Background="White" CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Border Background="#007DFA" CornerRadius="10,10,0,0" Height="80" VerticalAlignment="Top"></Border>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="75"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--左侧标题-->
<StackPanel Margin="1,1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image Source="Assets/Images/宁德LOG.png" Width="150"/>
<StackPanel Margin="15,15">
<TextBlock Text="RFID物料追溯系统" Foreground="White" FontSize="20"/>
<TextBlock Text="RFID material tracking system" Foreground="#88DDDDDD"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" Height="215">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="0,10" VerticalAlignment="Center" HorizontalAlignment="Center">
<Border Background="#007DFA" BorderBrush="#007DFA" BorderThickness="2" CornerRadius="15">
<Image Source="Assets/Images/芯片.png" Width="100" Height="90"/>
</Border>
</StackPanel>
<StackPanel Grid.Column="1" Margin="0,10" VerticalAlignment="Center">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="60"/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Label Content="账号" Width="50" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBox x:Name="username" Height="23" TextWrapping="Wrap" Width="120" VerticalAlignment="Center" HorizontalAlignment="Right">
<TextBox.Resources>
<VisualBrush x:Key="HIntText" TileMode="None" Opacity="0.5" Stretch="None" AlignmentX="Left">
<VisualBrush.Visual>
<TextBlock Text="请输入登录账号"/>
</VisualBrush.Visual>
</VisualBrush>
</TextBox.Resources>
<TextBox.Style>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="Text" Value="{x:Null}">
<Setter Property="Background" Value="{StaticResource HIntText}"/>
</Trigger>
<Trigger Property="Text" Value="">
<Setter Property="Background" Value="{StaticResource HIntText}"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<Label Content="密码" Width="50" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<PasswordBox Height="23" HorizontalAlignment="Left" Name="password" VerticalContentAlignment="Center" Width="120" PasswordChar="*"/>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="登录" Background="#007DFA" Foreground="White" BorderBrush="DeepSkyBlue" BorderThickness="1" Width="80" Height="30" VerticalAlignment="Center" HorizontalAlignment="Center" Click="Button_Click"/>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</Grid>
</Border>
</Window>

@ -1,87 +0,0 @@
using MaterialTraceability.Entity.DAO;
using MaterialTraceability.SqlSugar;
using MaterialTraceability.SqlSugar.ServiceImpl;
using MaterialTraceabilityUI.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace MaterialTraceabilityUI
{
/// <summary>
/// Login.xaml 的交互逻辑
/// </summary>
public partial class Login : Window
{
private IBaseServices<SysUserInfo> baseServices = new BaseServices<SysUserInfo>();
public Login()
{
InitializeComponent();
}
/// <summary>
/// 登录方法
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click(object sender, RoutedEventArgs e)
{
string userName = this.username.Text.ToString();
string password = this.password.Password.ToString();
if (StringExtension.IsBlank(userName) || StringExtension.IsBlank(password))
{
MessageBox.Show("登录失败,用户名或密码为空");
return;
}
this.userLogin(userName, password);
}
/// <summary>
/// 登录验证
/// </summary>
/// <param name="userName"></param>
/// <param name="userPwd"></param>
public async void userLogin(string userName, string userPwd)
{
Expression<Func<SysUserInfo, bool>> expression = s1 => true;
expression = expression.And(x => x.userName == userName);
SysUserInfo sysUserInfo = await baseServices.QuerySingle(expression);
if (sysUserInfo == null)
{
MessageBox.Show(String.Format("登录失败,用户{0}不存在", userName));
DialogResult = false;
return;
}
if (userPwd == MD5Helper.MD5Decrypt(sysUserInfo.userPwd, sysUserInfo.pwdKey))
{
MessageBox.Show(String.Format("用户{0}登录成功",userName));
ConfigHelper.UpdateAppConfig("userName", sysUserInfo.userName);
ConfigHelper.UpdateAppConfig("roleId", sysUserInfo.roleId);
DialogResult = true;
}
else
{
MessageBox.Show("登录失败,用户名或密码错误");
DialogResult = false;
}
}
}
}

@ -37,8 +37,6 @@ namespace MaterialTraceabilityUI
//记录报表
private secondPage secondPage = new secondPage();
private SysConfigPage threadPage = new SysConfigPage();
private ConfigInfo configInfo = new ConfigInfo();
private SqlSugarClient _db = SqlGenerator.GetMySqlInstance();
@ -273,14 +271,15 @@ namespace MaterialTraceabilityUI
/// <param name="e"></param>
private void ConfigPage_Click(object sender, RoutedEventArgs e)
{
if (!"2".Equals(ConfigHelper.GetConfig("roleId")))
{
System.Windows.MessageBox.Show("请登录系统管理账号进行操作");
}
else
{
UserContent = configInfo;
}
//if (!"2".Equals(ConfigHelper.GetConfig("roleId")))
//{
// System.Windows.MessageBox.Show("请登录系统管理账号进行操作");
//}
//else
//{
// UserContent = configInfo;
//}
UserContent = configInfo;
}
public System.Windows.Controls.UserControl _content;
@ -319,14 +318,14 @@ namespace MaterialTraceabilityUI
if ((bool)login.DialogResult)
{
this.loginUser.Text = ConfigHelper.GetConfig("userName");
//timer = new System.Timers.Timer(1000 * 60 * 5);
//if (!timer.Enabled)
//{
// timer.Elapsed += new System.Timers.ElapsedEventHandler(ReadRfidByTimer);
// timer.AutoReset = true;
// timer.Enabled = false;
// timer.Start();
//}
timer = new System.Timers.Timer(1000 * 60 * 3);
if (!timer.Enabled)
{
timer.Elapsed += new System.Timers.ElapsedEventHandler(ReadRfidByTimer);
timer.AutoReset = true;
timer.Enabled = false;
timer.Start();
}
}
}

@ -137,9 +137,6 @@
<Compile Include="ShaftInfoControl.xaml.cs">
<DependentUpon>ShaftInfoControl.xaml</DependentUpon>
</Compile>
<Compile Include="SysConfigPage.xaml.cs">
<DependentUpon>SysConfigPage.xaml</DependentUpon>
</Compile>
<Compile Include="TBAlarmRecord.xaml.cs">
<DependentUpon>TBAlarmRecord.xaml</DependentUpon>
</Compile>
@ -149,9 +146,6 @@
<Compile Include="WriteInfo.xaml.cs">
<DependentUpon>WriteInfo.xaml</DependentUpon>
</Compile>
<Compile Include="Login.xaml.cs">
<DependentUpon>Login.xaml</DependentUpon>
</Compile>
<Compile Include="MesRequestControl.xaml.cs">
<DependentUpon>MesRequestControl.xaml</DependentUpon>
</Compile>
@ -201,10 +195,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SysConfigPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="TBAlarmRecord.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -217,10 +207,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Login.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MesRequestControl.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

@ -51,5 +51,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.5.5")]
[assembly: AssemblyVersion("1.0.5.7")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -170,7 +170,7 @@ namespace MaterialTraceabilityUI
operationRevision = inifile.IniReadValue("MachineIntegrationServiceParam", "operationRevision"),
activityId = inifile.IniReadValue("MachineIntegrationServiceParam", "activityId"),
resource = appConfig.resource,
dcGroup = upLoadBusiness.GerDcGroupByResource(),
dcGroup = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroup"),
dcGroupRevision = inifile.IniReadValue("MachineIntegrationServiceParam", "dcGroupRevision"),
parametricArray = data,
user = inifile.IniReadValue("HandSplitSfcParam", "user"),
@ -421,7 +421,7 @@ namespace MaterialTraceabilityUI
machineIntegrationParametricData[] data = {
new machineIntegrationParametricData() {name ="LY_FJFX",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(lyUpLoad.upDirection)?"0":lyUpLoad.upDirection},
new machineIntegrationParametricData() {name ="LY_SJFX",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(lyUpLoad.downDirection)?"0":lyUpLoad.downDirection},
new machineIntegrationParametricData() {name ="LY_SJZ",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(lyUpLoad.downPosition)?"0":lyUpLoad.downPosition},
new machineIntegrationParametricData() {name ="LY_SJZ",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(shaftName)?"0":shaftName},
new machineIntegrationParametricData() {name ="LY_HXMQ",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(lyUpLoad.crosswiseArea)?"0":lyUpLoad.crosswiseArea},
new machineIntegrationParametricData() {name ="LY_ZXMQ",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(lyUpLoad.erectArea)?"0":lyUpLoad.erectArea},
new machineIntegrationParametricData() {name ="LY_WLMX",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(lyUpLoad.materialFace)?"0":lyUpLoad.materialFace},
@ -442,7 +442,7 @@ namespace MaterialTraceabilityUI
machineIntegrationParametricData[] data = {
new machineIntegrationParametricData() {name ="LY_FJFX",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_SJFX",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_SJZ",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_SJZ",dataType=ParameterDataType.TEXT, value=shaftName},
new machineIntegrationParametricData() {name ="LY_HXMQ",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_ZXMQ",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_WLMX",dataType=ParameterDataType.TEXT, value="0"},
@ -468,7 +468,7 @@ namespace MaterialTraceabilityUI
machineIntegrationParametricData[] data = {
new machineIntegrationParametricData() {name ="LY_FJFX",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_SJFX",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_SJZ",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_SJZ",dataType=ParameterDataType.TEXT, value=shaftName},
new machineIntegrationParametricData() {name ="LY_HXMQ",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_ZXMQ",dataType=ParameterDataType.TEXT, value="0"},
new machineIntegrationParametricData() {name ="LY_WLMX",dataType=ParameterDataType.TEXT, value="0"},
@ -656,7 +656,7 @@ namespace MaterialTraceabilityUI
}
else
{
eaStr = sfcTextBox.Text;
eaStr = eaTextBox.Text;
}
//判断是否为冷压工序是否为最后一卷最后一卷按照MES EA进行拆分
@ -677,7 +677,7 @@ namespace MaterialTraceabilityUI
}
Split(downRecord.Rfid,eaTextBox.Text, eaStr, downRecord.PositionId);
Split(downRecord.Rfid, eaStr, sfcTextBox.Text, downRecord.PositionId);
}
private void Complete_Click(object sender, RoutedEventArgs e)

@ -1,111 +0,0 @@
<UserControl x:Class="MaterialTraceabilityUI.SysConfigPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:MaterialTraceabilityUI"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Background="Transparent" Loaded="UserControl_Loaded">
<Border CornerRadius="10" Background="White" Margin="0,10,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#007DFA" BorderThickness="1" CornerRadius="10" Background="Transparent">
<Grid>
<StackPanel Margin="15,0" Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center">
<Label Margin="20,0,0,0" Content="参数类型" Foreground="#007DFA" Height="30" HorizontalAlignment="Left"/>
<ComboBox x:Name="paramType" Width="150" Foreground="#007DFA" HorizontalAlignment="Left" VerticalAlignment="Center" Height="30">
</ComboBox>
<Label Content="参数名称" Foreground="#007DFA" Height="30" HorizontalAlignment="Left"/>
<TextBox x:Name="paramKey" Width="150" HorizontalAlignment="Left" Height="30"/>
<Button x:Name="seachClick" Content="查询" Background="#007DFA" Foreground="White" Margin="20,0,0,0" Height="30" BorderBrush="DeepSkyBlue" BorderThickness="1" Width="80" Click="Seach_Click"/>
<Button x:Name="saveClick" Content="保存" Background="#007DFA" Foreground="White" Margin="20,0,0,0" Height="30" BorderBrush="DeepSkyBlue" BorderThickness="1" Width="80" Click="Save_Click"/>
<Button x:Name="editClick" Content="设置" Background="#007DFA" Foreground="White" Margin="20,0,0,0" Height="30" BorderBrush="DeepSkyBlue" BorderThickness="1" Width="80" Click="Edit_Click"/>
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="1" Margin="0,5,0,0" BorderBrush="#007DFA" BorderThickness="1" CornerRadius="0" Background="Transparent">
<DataGrid x:Name="SysCientDataGrid" Style="{DynamicResource DataGridStyle}" ColumnHeaderHeight="22" RowHeight="20" AutoGenerateColumns="False" RowHeaderWidth="0" GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden">
<DataGrid.Resources>
<Style x:Key="DataGridStyle" TargetType="DataGrid">
<Setter Property="AlternationCount" Value="2"/>
<Setter Property="ColumnHeaderStyle" Value="{DynamicResource DataGridColumnHeaderStyle}"/>
<Setter Property="CellStyle" Value="{DynamicResource DataGridCellStyle}"/>
<Setter Property="RowStyle" Value="{DynamicResource DataGridRowStyle}"/>
</Style>
<Style x:Key="DataGridColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="White"/>
</Style>
<Style x:Key="DataGridRowStyle" TargetType="{x:Type DataGridRow}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRow}">
<Grid x:Name="DGR_Border" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1"/>
<DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="#00BCD4"/>
</Trigger>
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="#E9F3FD"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsNewItem" Value="True">
<Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Gray"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Id}" Header="编号" IsReadOnly="True" Width="30"/>
<DataGridTextColumn Binding="{Binding paramType}" Header="参数类型" Width="*"/>
<DataGridTextColumn Binding="{Binding paramKey}" Header="参数名称" Width="*"/>
<DataGridTextColumn Binding="{Binding paramValue}" Header="参数值" Width="*"/>
<DataGridTextColumn Binding="{Binding remark}" Header="备注" Width="*"/>
</DataGrid.Columns>
</DataGrid>
</Border>
</Grid>
</Border>
</UserControl>

@ -1,155 +0,0 @@
using MaterialTraceability.Business;
using MaterialTraceability.Entity.DAO;
using MaterialTraceability.Entity.DTO;
using MaterialTraceability.SqlSugar;
using MaterialTraceability.SqlSugar.ServiceImpl;
using MaterialTraceabilityUI.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace MaterialTraceabilityUI
{
/// <summary>
/// SysConfigPage.xaml 的交互逻辑
/// </summary>
public partial class SysConfigPage : UserControl
{
private IBaseServices<SysClient> baseServices = new BaseServices<SysClient>();
private AppConfigDto appConfig = AppConfigDto.Instance;
/// <summary>
/// 系统配置页面
/// </summary>
public SysConfigPage()
{
InitializeComponent();
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
List<SysClient> info = getList();
this.SysCientDataGrid.ItemsSource = info;
var paramTypeInfo = info.GroupBy(x => x.paramType).Distinct().Select(a => a.Key).ToList();
paramTypeInfo.Add("");
this.paramType.ItemsSource = paramTypeInfo;
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Seach_Click(object sender, RoutedEventArgs e)
{
this.SysCientDataGrid.ItemsSource = getList();
}
/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Save_Click(object sender, RoutedEventArgs e)
{
try
{
List<SysClient> sysClients = getList();
List<SysClient> clients = (List<SysClient>)this.SysCientDataGrid.ItemsSource;
foreach(var x in clients)
{
var info = sysClients.Where(z => z.paramType == x.paramType && z.paramKey == x.paramKey).FirstOrDefault();
if (info == null)
{
baseServices.Add(new SysClient()
{
paramKey = x.paramKey,
paramType = x.paramType,
paramValue = x.paramValue,
remark = x.remark,
processId = appConfig.processId,
});
}
else
{
x.processId = appConfig.processId;
baseServices.Update(x);
}
}
}catch(Exception ex)
{
LogHelperBusiness.LogError("参数配置保存异常",ex);
}
}
private List<SysClient> getList()
{
Expression<Func<SysClient, bool>> exp = s1 => true;
if (StringExtension.IsNotBlank(this.paramKey.Text))
{
exp = exp.And(x => x.paramKey == this.paramKey.Text);
}
if (StringExtension.IsNotBlank(Convert.ToString(this.paramType.SelectedItem)))
{
exp = exp.And(x => x.paramType == this.paramType.SelectedItem.ToString());
}
exp = exp.And(x => x.processId == appConfig.processId);
List<SysClient> info = baseServices.Query(exp).Result;
return info;
}
/// <summary>
/// 编辑Sys_Client表
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Edit_Click(object sender, RoutedEventArgs e)
{
try
{
if (!"1".Equals(ConfigHelper.GetConfig("roleId")) && !"2".Equals(ConfigHelper.GetConfig("roleId")))
{
System.Windows.MessageBox.Show("请登录系统管理账号进行操作");
}
else
{
string deleteStr = @"delete from Sys_Client";
baseServices.QueryBySql<SysClient>(deleteStr, null);
string sqlStr = @"ALTER TABLE Sys_Client ADD processId VARCHAR(64) ";
var info = baseServices.QueryBySql<SysClient>(sqlStr, null);
List<SysClient> clients = baseServices.Query().Result;
clients.ForEach(x => x.processId = appConfig.processId);
baseServices.Update(clients);
}
}catch(Exception ex)
{
LogHelperBusiness.LogError("编辑Sys_Client表异常", ex);
}
}
}
}
Loading…
Cancel
Save