master
zhaoaomin 2 years ago
parent bc9b5c993f
commit 074b4aa611

Binary file not shown.

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace XGL.Models.Model.OrderPrepare
{
public class WcsSyncResult
{
public string reqCode { get; set; }
public int code { get; set; }
public string message { get; set; }
}
}

@ -110,6 +110,7 @@
<Compile Include="Model\OffProductInfo.cs" /> <Compile Include="Model\OffProductInfo.cs" />
<Compile Include="Model\Orderplan.cs" /> <Compile Include="Model\Orderplan.cs" />
<Compile Include="Model\OrderPrepare\MaterialPlanModel.cs" /> <Compile Include="Model\OrderPrepare\MaterialPlanModel.cs" />
<Compile Include="Model\OrderPrepare\WcsSyncResult.cs" />
<Compile Include="Model\OrderPrepare\WetMaterialModel.cs" /> <Compile Include="Model\OrderPrepare\WetMaterialModel.cs" />
<Compile Include="Model\PlcSetting.cs" /> <Compile Include="Model\PlcSetting.cs" />
<Compile Include="Model\Productinfo.cs" /> <Compile Include="Model\Productinfo.cs" />

@ -1 +1 @@
15e0079c678473a5e3606350c39806472a1461a2 ba8f52b01cbb380daf24abf11e9369249f394d6c

@ -29,7 +29,7 @@
<!--排空区刷新时间 单位秒--> <!--排空区刷新时间 单位秒-->
<add key="EmptyRefresh" value="10" /> <add key="EmptyRefresh" value="10" />
<!--获取设备状态间隔时间 单位秒--> <!--获取设备状态间隔时间 单位秒-->
<add key="GetDeviceStateInterval" value="60" /> <add key="GetDeviceStateInterval" value="30000" />
<add key="thriftIp" value="192.168.3.150" /> <add key="thriftIp" value="192.168.3.150" />
<!--上件点发车thrift端口 7911 ,7912--> <!--上件点发车thrift端口 7911 ,7912-->
<add key="thriftPort" value="7921" /> <add key="thriftPort" value="7921" />

@ -258,19 +258,16 @@
Width="*" Width="*"
Binding="{Binding BatchCode}" Binding="{Binding BatchCode}"
Header="生产批次" />--> Header="生产批次" />-->
<DataGridTextColumn
Width="250"
Binding="{Binding id}"
Header="计划编码" />
<DataGridTextColumn Visibility="Hidden" <DataGridTextColumn Visibility="Hidden"
Width="150" Width="150"
Binding="{Binding workorder_id}" Binding="{Binding workorder_id}"
Header="订单编码" /> Header="订单编码" />
<DataGridTextColumn Visibility="Visible" <DataGridTextColumn Visibility="Visible"
Width="350" Width="350"
Binding="{Binding workorder_code}" Binding="{Binding workorder_code}"
Header="订单码" /> Header="订单码" />
<DataGridTextColumn <DataGridTextColumn
Width="450" Width="450"
Binding="{Binding product_name}" Binding="{Binding product_name}"
@ -279,18 +276,12 @@
Width="200" Width="200"
Binding="{Binding material_code}" Binding="{Binding material_code}"
Header="产品型号" /> Header="产品型号" />
<DataGridTextColumn
Width="200"
Binding="{Binding plan_time}"
Header="工单时间" />
<DataGridTextColumn <DataGridTextColumn
Width="80" Width="80"
Binding="{Binding bucket_code}" Binding="{Binding bucket_code}"
Header="料罐编码" /> Header="料罐编码" />
<DataGridTextColumn
Width="*"
Binding="{Binding shift_desc}"
Header="班次" />
<DataGridTextColumn <DataGridTextColumn
Width="*" Width="*"
Binding="{Binding prod_line_code}" Binding="{Binding prod_line_code}"
@ -309,6 +300,18 @@
</Style> </Style>
</DataGridTextColumn.ElementStyle> </DataGridTextColumn.ElementStyle>
</DataGridTextColumn> </DataGridTextColumn>
<DataGridTextColumn
Width="200"
Binding="{Binding plan_time}"
Header="工单时间" />
<DataGridTextColumn
Width="250"
Binding="{Binding id}"
Header="计划编码" />
<DataGridTextColumn
Width="*"
Binding="{Binding shift_desc}"
Header="班次" />
<DataGridTemplateColumn Width="350" Header="操作"> <DataGridTemplateColumn Width="350" Header="操作">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>

@ -123,7 +123,7 @@ namespace XGL.Views
checkUserWin.ShowDialog(); checkUserWin.ShowDialog();
if (!checkUserWin.loginFlag) if (!checkUserWin.loginFlag)
{ {
CustomMessageBox.Show("请先校验用户!", CustomMessageBoxIcon.Warning); CustomMessageBox.Show("请先校验用户!",CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return; return;
} }
if (WorkOrder.SelectedItems.Count == 0) if (WorkOrder.SelectedItems.Count == 0)
@ -138,7 +138,7 @@ namespace XGL.Views
string status = (WorkOrder.SelectedItem as WetMaterialModel).status; string status = (WorkOrder.SelectedItem as WetMaterialModel).status;
if (sync_flag.Equals("Y")) if (sync_flag.Equals("Y"))
{ {
CustomMessageBox.Show("该工单已同步,请选择其他的工单!", CustomMessageBoxIcon.Warning); CustomMessageBox.Show("该工单已同步,请选择其他的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return; return;
} }
@ -146,7 +146,7 @@ namespace XGL.Views
{ {
if (status != "") if (status != "")
{ {
CustomMessageBox.Show("该工单不符合条件,请选择其他的工单!", CustomMessageBoxIcon.Warning); CustomMessageBox.Show("该工单不符合条件,请选择其他的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return; return;
} }
} }
@ -161,16 +161,16 @@ namespace XGL.Views
//获取湿料计划指定的成型机 //获取湿料计划指定的成型机
//var cxjDt = userDbWareHouse.GetCXJList(orderID); //var cxjDt = userDbWareHouse.GetCXJList(orderID);
DataTable cxjDt = null;
//根据工单获取成型机
//根据工单获取成型机 cxjDt = userDbWareHouse.GetCXJList(workorderID);// 在此处执行数据库查询
var cxjDt = userDbWareHouse.GetCXJList(workorderID);
if (cxjDt == null || cxjDt.Rows.Count == 0) if (cxjDt == null || cxjDt.Rows.Count == 0)
{ {
CustomMessageBox.Show("该工单未指定料罐、成型机,请稍后再试!", CustomMessageBoxIcon.Warning); CustomMessageBox.Show("该工单未指定料罐、成型机,请稍后再试!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return; return;
} }
List<string> cxjList = new List<string>(); List<string> cxjList = new List<string>();
List<string> bucketList = new List<string>(); List<string> bucketList = new List<string>();
//这扯淡的设计,根据湿料计划获取各个工单对应的工序、机台信息,这样式的,[["GX01","C1"],["GX01","C5"],["GX01","C3"],["GX01","C6"],["GX01","C8"],["GX02","H2"],["GX02","H3"],["GX02","H4"],["GX02","H5"],["GX02","H6"],["GX03","X3"],["GX03","X6"]] //这扯淡的设计,根据湿料计划获取各个工单对应的工序、机台信息,这样式的,[["GX01","C1"],["GX01","C5"],["GX01","C3"],["GX01","C6"],["GX01","C8"],["GX02","H2"],["GX02","H3"],["GX02","H4"],["GX02","H5"],["GX02","H6"],["GX03","X3"],["GX03","X6"]]
@ -235,19 +235,28 @@ namespace XGL.Views
// 将要发送的数据序列化为JSON格式 // 将要发送的数据序列化为JSON格式
var jsonContent = JsonConvert.SerializeObject(materialPlanModel); var jsonContent = JsonConvert.SerializeObject(materialPlanModel);
LogHelper.instance.log.Info("给WCS同步计划>>"+ jsonContent);
RestHelper restClient = new RestHelper(); RestHelper restClient = new RestHelper();
var response = await restClient.PostAsync(apiUrl, jsonContent); var response = await restClient.PostAsync(apiUrl, jsonContent);
WcsSyncResult result = Utils.DeJson<WcsSyncResult>(response);
//Console.WriteLine(response); //Console.WriteLine(response);
//更新湿料计划同步状态 if (result.message.ToLower().Equals("ok"))
var updatestatus = userDbWareHouse.UpdateSycnFlag(workorderID); {
if (!updatestatus) //更新湿料计划同步状态
LogHelper.instance.log.Info("更新湿料计划同步状态失败!"); var updatestatus = userDbWareHouse.UpdateSycnFlag(workorderID);
if (!updatestatus)
LogHelper.instance.log.Info("更新湿料计划同步状态失败!");
else
{
GetWorkOrder();
}
}
else else
{ {
GetWorkOrder(); CustomMessageBox.Show("开始工单失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
} }
} }
private void Flow_Click(object sender, RoutedEventArgs e) private void Flow_Click(object sender, RoutedEventArgs e)

@ -29,7 +29,7 @@
<!--排空区刷新时间 单位秒--> <!--排空区刷新时间 单位秒-->
<add key="EmptyRefresh" value="10" /> <add key="EmptyRefresh" value="10" />
<!--获取设备状态间隔时间 单位秒--> <!--获取设备状态间隔时间 单位秒-->
<add key="GetDeviceStateInterval" value="60" /> <add key="GetDeviceStateInterval" value="30000" />
<add key="thriftIp" value="192.168.3.150" /> <add key="thriftIp" value="192.168.3.150" />
<!--上件点发车thrift端口 7911 ,7912--> <!--上件点发车thrift端口 7911 ,7912-->
<add key="thriftPort" value="7921" /> <add key="thriftPort" value="7921" />
@ -37,6 +37,8 @@
<add key="thriftBoxPort" value="7915" /> <add key="thriftBoxPort" value="7915" />
<!--FormBoardthrift端口--> <!--FormBoardthrift端口-->
<add key="FormBoardThriftPort" value="7931" /> <add key="FormBoardThriftPort" value="7931" />
<!--物料同步接口地址-->
<add key="WCSMaterialSyncAddress" value="http://192.168.202.28:9001/api/v1/ReceiveMesMsg/materialPlanSync"/>
</appSettings> </appSettings>
<startup useLegacyV2RuntimeActivationPolicy="true"> <startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />

Loading…
Cancel
Save