|
|
|
|
|
using CentralControl.DBDAO;
|
|
|
|
|
|
using CommonFunc.Tools;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
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;
|
|
|
|
|
|
using XGL.Models.Model.OrderPrepare;
|
|
|
|
|
|
using XGL.Thrift;
|
|
|
|
|
|
|
|
|
|
|
|
namespace XGL.Views
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// LanJu_Prepare.xaml 的交互逻辑
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class LanJu_Prepare : UserControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public LanJu_Prepare()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<WorkOrder> modelWareHouse = new List<WorkOrder>();
|
|
|
|
|
|
DBService userDbWareHouse = new DBService();
|
|
|
|
|
|
WorkOrder list_modelWareHouse = new WorkOrder();
|
|
|
|
|
|
|
|
|
|
|
|
List<WetMaterialModel> wetList = new List<WetMaterialModel>();
|
|
|
|
|
|
WetMaterialModel wet = new WetMaterialModel();
|
|
|
|
|
|
string messageOrderCode = "";
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取主页显示订单
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
private void GetWorkOrder()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
//modelWareHouse = new List<WorkOrder>();
|
|
|
|
|
|
//userDbWareHouse = new DBService();
|
|
|
|
|
|
var Items = userDbWareHouse.GetWetPlanInfo();
|
|
|
|
|
|
foreach (DataRow i in Items.Rows)
|
|
|
|
|
|
{
|
|
|
|
|
|
wet.id = i["id"].ToString();
|
|
|
|
|
|
wet.workorder_id = i["workorder_id"].ToString();
|
|
|
|
|
|
wet.product_name = i["product_name"].ToString();
|
|
|
|
|
|
|
|
|
|
|
|
wet.material_code = i["material_code"].ToString();
|
|
|
|
|
|
wet.plan_time = Convert.ToDateTime(i["plan_time"].ToString());
|
|
|
|
|
|
wet.bucket_code = i["bucket_code"].ToString();
|
|
|
|
|
|
wet.shift_desc = i["shift_desc"].ToString();
|
|
|
|
|
|
wetList.Add(wet);
|
|
|
|
|
|
// list_modelWareHouse.WorkOrderCode = i["WorkOrderCode"].ToString();
|
|
|
|
|
|
// list_modelWareHouse.OrderCode = i["OrderCode"].ToString();
|
|
|
|
|
|
// list_modelWareHouse.ProductName = i["ProductName"].ToString();
|
|
|
|
|
|
// list_modelWareHouse.ProductSpc = i["ProductSpc"].ToString();
|
|
|
|
|
|
// list_modelWareHouse.QuantitySplit = i["QuantitySplit"].ToString();
|
|
|
|
|
|
// list_modelWareHouse.BatchCode = i["BatchCode"].ToString();
|
|
|
|
|
|
// modelWareHouse.Add(list_modelWareHouse);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.WorkOrder.ItemsSource = modelWareHouse;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void Flow_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
var selectedRow = WorkOrder.SelectedItem as WorkOrder;
|
|
|
|
|
|
var workordercode = selectedRow.WorkOrderCode;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
GetWorkOrder();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void btnStartOrders_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (WorkOrder.SelectedItems.Count == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
CustomMessageBox.Show("请选择要开始的工单!", CustomMessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
string orderID = (WorkOrder.SelectedItem as WetMaterialModel).id;
|
|
|
|
|
|
var wmsState = userDbWareHouse.GetWorkOrderQitaoLv(orderID);
|
|
|
|
|
|
if (wmsState == null || wmsState.Rows[0][0].Equals("0"))
|
|
|
|
|
|
{
|
|
|
|
|
|
CustomMessageBox.Show("该工单未准备好,请稍后再试!", CustomMessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
string apiUrl = "http://example.com/api/endpoint";
|
|
|
|
|
|
|
|
|
|
|
|
string jsonContent = "{\"key1\":\"value1\",\"key2\":\"value2\"}";
|
|
|
|
|
|
MaterialPlanModel materialPlanModel = new MaterialPlanModel();
|
|
|
|
|
|
//materialPlanModel.reqCode = CommonFunc.Common.
|
|
|
|
|
|
RestHelper restClient = new RestHelper();
|
|
|
|
|
|
var response = restClient.PostAsync(apiUrl, jsonContent);
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|