添加开始工单

master
zhaojian 2 years ago
parent 3a067640b4
commit 8fb5c22370

@ -50,7 +50,7 @@
<TextBox x:Name="username" materialDesign:HintAssist.Hint="账号" Margin="0,5" FontFamily="Champagne &amp; Limousines" FontSize="18"></TextBox>
<PasswordBox x:Name="userpwd" materialDesign:HintAssist.Hint="密码" Margin="0,10" FontFamily="Champagne &amp; Limousines" FontSize="18"></PasswordBox>
<ComboBox x:Name="comboBoxTeam" Margin="0,5"/>
<!--<ComboBox x:Name="comboBoxTeam" Margin="0,5"/>-->
<ComboBox x:Name="comboBoxShift" Margin="0,5"/>
<DatePicker x:Name="datepickerWorkDate" Margin="0,5"/>
</StackPanel>

@ -41,7 +41,7 @@ namespace XGLFinishPro
//Main mainWindow = new Main();
//mainWindow.Show();
InitVersion();
InitTeamInfo();
//InitTeamInfo();
InitShiftInfo();
}
@ -64,22 +64,22 @@ namespace XGLFinishPro
comboBoxShift.DisplayMemberPath = "shift_desc";
}
private void InitTeamInfo()
{
DataTable dt = formingMachineService.GetTeamList();
if (dt == null)
{
CustomMessageBox.Show("没有查询到班组信息,请联系管理员!", CustomMessageBoxIcon.Warning);
return;
}
//private void InitTeamInfo()
//{
// DataTable dt = formingMachineService.GetTeamList();
// if (dt == null)
// {
// CustomMessageBox.Show("没有查询到班组信息,请联系管理员!", CustomMessageBoxIcon.Warning);
// return;
// }
List<TeamInfoModel> listTeam = Utils.ToDataList<TeamInfoModel>(dt);
// List<TeamInfoModel> listTeam = Utils.ToDataList<TeamInfoModel>(dt);
//绑定
comboBoxTeam.ItemsSource = listTeam;
comboBoxTeam.SelectedValuePath = "team_id";
comboBoxTeam.DisplayMemberPath = "team_desc";
}
// //绑定
// comboBoxTeam.ItemsSource = listTeam;
// comboBoxTeam.SelectedValuePath = "team_id";
// comboBoxTeam.DisplayMemberPath = "team_desc";
//}
private void InitVersion()
{
@ -99,12 +99,12 @@ namespace XGLFinishPro
//this.dldh.IsActive = true;//遮罩层可见
this.dldh.Visibility = Visibility.Visible;//遮罩层可见
zzdl.Visibility = Visibility.Visible;
if (comboBoxTeam.SelectedValue == null || string.IsNullOrEmpty(comboBoxTeam.SelectedValue.ToString()))
{
CustomMessageBox.Show("登录失败,请选择班组", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
comboBoxTeam.Focus();
return;
}
//if (comboBoxTeam.SelectedValue == null || string.IsNullOrEmpty(comboBoxTeam.SelectedValue.ToString()))
//{
// CustomMessageBox.Show("登录失败,请选择班组", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
// comboBoxTeam.Focus();
// return;
//}
if (comboBoxShift.SelectedValue == null || string.IsNullOrEmpty(comboBoxShift.SelectedValue.ToString()))
{
CustomMessageBox.Show("登录失败,请选择班次", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
@ -124,7 +124,7 @@ namespace XGLFinishPro
username = username.Text.Trim(),
pwd = userpwd.Password.Trim(),
IsChecked = rememberpwd.IsChecked,
teamID = comboBoxTeam.SelectedValue.ToString(),
//teamID = comboBoxTeam.SelectedValue.ToString(),
shiftID = comboBoxShift.SelectedValue.ToString(),
workDate = datepickerWorkDate.Text,
startTime = lst.Shift_Start_Time,

@ -193,6 +193,27 @@
Grid.Row="0"
Grid.Column="0"
Height="90">
<Button
x:Name="btnPause1"
Click="btnPause1_Click"
Style="{StaticResource btnKey}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="#2B7EE6">
<Button.Content>
<TextBlock
VerticalAlignment="Center"
FontSize="20"
Foreground="White"
Text="开始工单" />
</Button.Content>
</Button>
</StackPanel>
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="1"
Height="90">
<Button
x:Name="btnPause"
Click="btnPause_Click"
@ -212,7 +233,7 @@
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="1"
Grid.Column="2"
Height="90">
<Button x:Name="btnRecover"
Style="{StaticResource btnKey}"
@ -231,7 +252,7 @@
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="2"
Grid.Column="3"
Height="90">
<Button
Style="{StaticResource btnKey}"
@ -251,7 +272,7 @@
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="3"
Grid.Column="4"
Height="90">
<Button
Style="{StaticResource btnKey}"
@ -271,7 +292,7 @@
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="4"
Grid.Column="5"
>
<Button
Style="{StaticResource btnKey}"
@ -344,7 +365,7 @@
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="6"
Grid.Column="7"
>
<Button
x:Name="btnRefresh"
@ -360,7 +381,7 @@
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="5"
Grid.Column="6"
Height="90" Visibility="Visible">
<Button Style="{StaticResource btnKey}"
x:Name="btnComplete"

@ -11,6 +11,7 @@ using XGL.Data.DBService;
using XGL.Dats.DBServiceFinishProd;
using XGL.Models.Model.FoamingMac;
using XGL.Models.Model.OrderPrepare;
using XGL.Thrift;
namespace XGLFinishPro.Views
@ -97,13 +98,14 @@ namespace XGLFinishPro.Views
timerDeciveState.Interval = Utils.GetAppSetting("GetDeviceStateInterval") == "" ? 15000 : Convert.ToInt32(Utils.GetAppSetting("GetDeviceStateInterval"));
timerDeciveState.Elapsed += TimerDeciveState_Elapsed;
timerDeciveState.Start();
Complete_Click(null,null);
GetWorkOrderInfo();
}
string isbaiye;
string plantime;
private void TimerDeciveState_Elapsed(object sender, ElapsedEventArgs e)
{
if (Utils.isAnyBodyPerating) return;
//if (Utils.isAnyBodyPerating) return;
try
{
List<FoamingMacModel> orderList = new List<FoamingMacModel>();
@ -423,6 +425,10 @@ namespace XGLFinishPro.Views
string newReportCode = "";
DataTable dtNewReportCode = formingMachineService.GetReportCode();
if (dtNewReportCode == null || dtNewReportCode.Rows.Count == 0)
{
newReportCode = DateTime.Now.ToString("yyyyMMdd")+"0001";
}
else
{
newReportCode = (Convert.ToInt64(dtNewReportCode.Rows[0]["report_code"].ToString()) + 1).ToString();
}
@ -505,6 +511,45 @@ namespace XGLFinishPro.Views
HBLogWin HFPlcWin = new HBLogWin();
HFPlcWin.ShowDialog();
}
private void btnPause1_Click(object sender, RoutedEventArgs e)
{
CheckUserWin checkUserWin = new CheckUserWin();
checkUserWin.ShowDialog();
if (!checkUserWin.loginFlag)
{
CustomMessageBox.Show("请先校验用户!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
if (dgWorkOrderInfo.SelectedItems.Count == 0)
{
CustomMessageBox.Show("请选择要开始的工单!", CustomMessageBoxIcon.Warning);
return;
}
string workorderID = (dgWorkOrderInfo.SelectedItem as DataRowView)["workorder_id"].ToString();
string status = (dgWorkOrderInfo.SelectedItem as DataRowView)["status"].ToString();
if (!status.Equals("w1"))
{
if (status != "")
{
CustomMessageBox.Show("该工单不符合条件,请选择其他的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
}
//更新工单状态
var updatestatus = userDbWareHouse.UpdateSycnFlag(workorderID);
if (!updatestatus)
{
CustomMessageBox.Show("开始工单失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
}
else
{
TimerDeciveState_Elapsed(null,null);
}
}
}
public class ReportWork
{

Loading…
Cancel
Save