You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
165 lines
6.4 KiB
165 lines
6.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
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;
|
|
using System.Data;
|
|
|
|
namespace SiaSun.LMS.WPFClient.MANAGE
|
|
{
|
|
|
|
|
|
public partial class MANAGE_AGV : AvalonDock.DocumentContent
|
|
{
|
|
public MANAGE_AGV(string MANAGE_TYPE_CODE)
|
|
{
|
|
InitializeComponent();
|
|
this.InitManagePosotion();
|
|
}
|
|
|
|
private void InitManagePosotion()
|
|
{
|
|
this.cbbCell_code.DisplayMemberPath = "CELL_NAME";
|
|
this.cbbCell_code.SelectedValuePath = "CELL_ID";
|
|
try
|
|
{
|
|
string strSQL = string.Format(@"SELECT CELL_ID,
|
|
CELL_NAME
|
|
FROM WH_CELL
|
|
WHERE CELL_FLAG='1' AND CELL_TYPE = 'Station'
|
|
AND logic_id=3
|
|
ORDER BY CELL_ID");
|
|
DataTable dt = MainApp._I_BaseService.GetList(strSQL);
|
|
DataRow dr = dt.NewRow();
|
|
this.cbbCell_code.ItemsSource = dt.DefaultView;
|
|
|
|
if (this.cbbCell_code.Items.Count > 0)
|
|
{
|
|
this.cbbCell_code.SelectedIndex = 0;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MainApp._MessageDialog.ShowException(ex);
|
|
}
|
|
}
|
|
|
|
private void BtnSave_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
bool bResult = true;
|
|
string sResult = string.Empty;
|
|
|
|
//if (string.IsNullOrEmpty(this.tbGoods_code.Text))
|
|
//{
|
|
// MessageBox.Show("物料条码为空");
|
|
// return;
|
|
//}
|
|
if (string.IsNullOrEmpty(this.cbbCell_code.SelectedValue.ToString()))
|
|
{
|
|
MessageBox.Show("站台编码为空");
|
|
return;
|
|
}
|
|
//没有物料条码,直接下达控制任务
|
|
bResult = MainApp._I_BaseService.Invoke("ControlBase", "ControlCreate",
|
|
new object[] {
|
|
Convert.ToInt32(this.cbbCell_code.SelectedValue.ToString()),
|
|
0
|
|
}, out sResult);
|
|
//if (string.IsNullOrEmpty(this.tbGoods_code.Text))
|
|
//{
|
|
// bResult = MainApp._I_BaseService.Invoke("ControlBase", "ControlCreate",
|
|
// new object[] {
|
|
// Convert.ToInt32(this.cbbCell_code.SelectedValue.ToString()),
|
|
// 0
|
|
// }, out sResult);
|
|
//}
|
|
////有物料条码,直接组盘
|
|
//else
|
|
//{
|
|
// string[] strArr = this.tbGoods_code.Text.Split('-');
|
|
// if (strArr.Length != 4)
|
|
// {
|
|
// MessageBox.Show("物料条码规则不正确,请参考P1-22081101-001-01");
|
|
// return;
|
|
// }
|
|
// //P1-22081101-001-01代表2022年8月11日入库01供应商磷酸铁锂成品,001批次,01包
|
|
// DataTable gOODS_MAIN = MainApp._I_BaseService.GetList(string.Format(@"select goods_id from goods_main where goods_code = '{0}'", strArr[0]));
|
|
// DataTable cell = MainApp._I_BaseService.GetList(string.Format(@"select cell_id from wh_cell where cell_code = '31001'"));
|
|
// if (gOODS_MAIN == null || gOODS_MAIN.Rows.Count < 1)
|
|
// {
|
|
// MessageBox.Show(string.Format(@"不存在{0}的基础物料信息", this.tbGoods_code.Text));
|
|
// return;
|
|
// }
|
|
// Model.MANAGE_MAIN mANAGE_MAIN = new Model.MANAGE_MAIN();
|
|
// Model.MANAGE_LIST mANAGE_LIST = new Model.MANAGE_LIST();
|
|
// List<SiaSun.LMS.Model.MANAGE_LIST> lsMANAGE_LIST = new List<Model.MANAGE_LIST>();
|
|
// mANAGE_MAIN.STOCK_BARCODE = string.Empty;
|
|
// mANAGE_MAIN.MANAGE_TYPE_CODE = "ManageIn";
|
|
// mANAGE_MAIN.MANAGE_OPERATOR = MainApp._USER.USER_NAME;
|
|
// mANAGE_MAIN.MANAGE_BEGIN_TIME = Common.StringUtil.GetDateTime();
|
|
// mANAGE_MAIN.MANAGE_STATUS = "WaitingAGV";
|
|
// mANAGE_MAIN.START_CELL_ID = Convert.ToInt32(this.cbbCell_code.SelectedValue.ToString());
|
|
// mANAGE_MAIN.END_CELL_ID = Convert.ToInt32(cell.Rows[0]["CELL_ID"].ToString());
|
|
// mANAGE_LIST.GOODS_ID = Convert.ToInt32(gOODS_MAIN.Rows[0]["GOODS_ID"].ToString());
|
|
// mANAGE_LIST.MANAGE_ID = 0;
|
|
// mANAGE_LIST.MANAGE_LIST_QUANTITY = 1;
|
|
// mANAGE_LIST.PLAN_LIST_ID = 0;
|
|
// //批次
|
|
// mANAGE_LIST.GOODS_PROPERTY1 = strArr[2];
|
|
// //日期/供应商
|
|
// mANAGE_LIST.GOODS_PROPERTY2 = strArr[1];
|
|
// //包数
|
|
// mANAGE_LIST.GOODS_PROPERTY3 = strArr[3];
|
|
// mANAGE_LIST.STORAGE_LIST_ID = 0;
|
|
// lsMANAGE_LIST.Add(mANAGE_LIST);
|
|
// bResult = MainApp._I_BaseService.Invoke("ManageIn", "ManageCreate",
|
|
// new object[] {
|
|
// mANAGE_MAIN,
|
|
// lsMANAGE_LIST,
|
|
// true,//事务
|
|
// true,//检查库存
|
|
// false,//是否完成
|
|
// true//是否下达任务
|
|
// }, out sResult);
|
|
//}
|
|
if (bResult)
|
|
{
|
|
MessageBox.Show("下达成功");
|
|
//this.tbGoods_code.Text = string.Empty;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show(sResult);
|
|
return;
|
|
}
|
|
}
|
|
|
|
private void BtnClear_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
//this.tbGoods_code.Text = string.Empty;
|
|
}
|
|
|
|
private void TbStock_barcode_MouseLeave(object sender, MouseEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void TbStock_barcode_KeyUp(object sender, KeyEventArgs e)
|
|
{
|
|
//lb1.Content = "";
|
|
}
|
|
|
|
private void TbGoods_code_KeyUp(object sender, KeyEventArgs e)
|
|
{
|
|
lb2.Content = "";
|
|
}
|
|
}
|
|
}
|