1.移植盟讯的盘点下架功能
This commit is contained in:
@ -81,6 +81,12 @@ namespace WCS.BLL.DbModels
|
|||||||
[SugarColumn(ColumnName = "create_user", Length = 100, IsNullable = true, ColumnDescription = "操作员")]
|
[SugarColumn(ColumnName = "create_user", Length = 100, IsNullable = true, ColumnDescription = "操作员")]
|
||||||
public string CreateUser { get; set; }
|
public string CreateUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是盟讯公司盘点生成的出库单
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "is_MXPD", IsNullable = true, ColumnDescription = "是否是盟讯公司盘点生成的出库单")]
|
||||||
|
public bool? IsMXPD { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用于绑定DataGrid中是否选择
|
/// 用于绑定DataGrid中是否选择
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -127,6 +127,12 @@ namespace WCS.BLL.DbModels
|
|||||||
[SugarColumn(ColumnName = "create_user", Length = 100, IsNullable = true, ColumnDescription = "操作员")]
|
[SugarColumn(ColumnName = "create_user", Length = 100, IsNullable = true, ColumnDescription = "操作员")]
|
||||||
public string CreateUser { get; set; }
|
public string CreateUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是盟讯公司盘点生成的出库单
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "is_MXPD", IsNullable = true, ColumnDescription = "是否是盟讯公司盘点生成的出库单")]
|
||||||
|
public bool? IsMXPD { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用于绑定中显示序号
|
/// 用于绑定中显示序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1456,7 +1456,7 @@ namespace WCS.BLL.HardWare
|
|||||||
MatSupplier = inventoryDetail.MatSupplier,
|
MatSupplier = inventoryDetail.MatSupplier,
|
||||||
OrderNumber = orderMatDetails.OrderNumber,
|
OrderNumber = orderMatDetails.OrderNumber,
|
||||||
|
|
||||||
Direction = DirectionEnum.出库,
|
Direction = orderMatDetails.IsMXPD == false ? DirectionEnum.出库 : DirectionEnum.盘点下架,
|
||||||
};
|
};
|
||||||
//库位表 修改
|
//库位表 修改
|
||||||
storeInfo.CurrentMatSn = string.Empty;
|
storeInfo.CurrentMatSn = string.Empty;
|
||||||
@ -1509,6 +1509,7 @@ namespace WCS.BLL.HardWare
|
|||||||
var isExsistOut = CurrentOutStoreMatSNs.Any();
|
var isExsistOut = CurrentOutStoreMatSNs.Any();
|
||||||
|
|
||||||
var tempOrder = CurrentOutOrder;
|
var tempOrder = CurrentOutOrder;
|
||||||
|
var isMXPD = orderMatDetails.IsMXPD == true;
|
||||||
//通知前台刷新
|
//通知前台刷新
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
@ -1519,7 +1520,7 @@ namespace WCS.BLL.HardWare
|
|||||||
{
|
{
|
||||||
IsWarning = false,
|
IsWarning = false,
|
||||||
ClientIp = WebSocketIpAddress,
|
ClientIp = WebSocketIpAddress,
|
||||||
WarningType = WarningTypeEnum.通知刷新出库
|
WarningType = isMXPD ? WarningTypeEnum.通知刷新盟讯盘点 : WarningTypeEnum.通知刷新出库
|
||||||
};
|
};
|
||||||
WarningManager.SendWarning(messageMode);
|
WarningManager.SendWarning(messageMode);
|
||||||
});
|
});
|
||||||
|
@ -15,5 +15,7 @@ namespace WCS.BLL.Services.IService
|
|||||||
public Task<string> generateStockTakingNumber();
|
public Task<string> generateStockTakingNumber();
|
||||||
|
|
||||||
public Task<string> generateOutOrderNumber();
|
public Task<string> generateOutOrderNumber();
|
||||||
|
|
||||||
|
public Task<string> generateMXPDOutOrderNumber();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,6 +134,15 @@ namespace WCS.BLL.Services.Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<string> generateMXPDOutOrderNumber()
|
||||||
|
{
|
||||||
|
lock (stockTakingFlag)
|
||||||
|
{
|
||||||
|
var serialNumber = GetSerialNumber(DocumentTypeEnum.出库单据);
|
||||||
|
return "PDOUT" + DateTime.Now.ToString("yyyyMMdd") + serialNumber.ToString().PadLeft(4, '0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int GetSerialNumber(DocumentTypeEnum documentType)
|
public int GetSerialNumber(DocumentTypeEnum documentType)
|
||||||
{
|
{
|
||||||
var documentSerialNumber = DbHelp.db.Queryable<DocumentSerialNumber>()
|
var documentSerialNumber = DbHelp.db.Queryable<DocumentSerialNumber>()
|
||||||
|
@ -131,6 +131,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
{
|
{
|
||||||
Code = 200,
|
Code = 200,
|
||||||
Message = $"出库单据同步成功!\r\n出库单据号为{request.OrderNumber}",
|
Message = $"出库单据同步成功!\r\n出库单据号为{request.OrderNumber}",
|
||||||
|
Data = request.OrderNumber
|
||||||
}; ;
|
}; ;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -231,7 +232,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
MatQty = t.MatQty,
|
MatQty = t.MatQty,
|
||||||
MatSupplier = t.MatSupplier,
|
MatSupplier = t.MatSupplier,
|
||||||
MatCustomer = t.MatCustomer,
|
MatCustomer = t.MatCustomer,
|
||||||
CreateUser = request.UserName
|
CreateUser = request.UserName,
|
||||||
};
|
};
|
||||||
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
||||||
}).ToList();
|
}).ToList();
|
||||||
@ -289,12 +290,14 @@ namespace WCS.BLL.Services.Service
|
|||||||
outOrder = new OutOrder()
|
outOrder = new OutOrder()
|
||||||
{
|
{
|
||||||
OrderNumber = request.OrderNumber,
|
OrderNumber = request.OrderNumber,
|
||||||
|
OrderType = request.OrderType,
|
||||||
OutOrderExeStatus = OutOrderExeStatus.开始发料,
|
OutOrderExeStatus = OutOrderExeStatus.开始发料,
|
||||||
OrderSource = "WCS前端",
|
OrderSource = "WCS前端",
|
||||||
SyncType = SyncTypeEnum.ByMatSn,
|
SyncType = SyncTypeEnum.ByMatSn,
|
||||||
ShelfTypeName = "智能货架",
|
ShelfTypeName = "智能货架",
|
||||||
ShelfTypeId = 0,
|
ShelfTypeId = 0,
|
||||||
GroupName = LocalFile.Config.GroupName,
|
GroupName = LocalFile.Config.GroupName,
|
||||||
|
IsMXPD = request.IsMXPD,
|
||||||
};
|
};
|
||||||
outOrder.Id = await DbHelp.db.Insertable(outOrder).ExecuteReturnIdentityAsync();
|
outOrder.Id = await DbHelp.db.Insertable(outOrder).ExecuteReturnIdentityAsync();
|
||||||
outOrder = await DbHelp.db.Queryable<OutOrder>().Where(t => t.OrderNumber == request.OrderNumber)
|
outOrder = await DbHelp.db.Queryable<OutOrder>().Where(t => t.OrderNumber == request.OrderNumber)
|
||||||
@ -327,7 +330,8 @@ namespace WCS.BLL.Services.Service
|
|||||||
MatQty = item.MatQty,
|
MatQty = item.MatQty,
|
||||||
MatSupplier = item.MatSupplier,
|
MatSupplier = item.MatSupplier,
|
||||||
MatCustomer = item.MatCustomer,
|
MatCustomer = item.MatCustomer,
|
||||||
CreateUser = request.UserName
|
CreateUser = request.UserName,
|
||||||
|
IsMXPD = request.IsMXPD,
|
||||||
};
|
};
|
||||||
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
@ -362,7 +366,8 @@ namespace WCS.BLL.Services.Service
|
|||||||
MatQty = item.MatQty,
|
MatQty = item.MatQty,
|
||||||
MatSupplier = item.MatSupplier,
|
MatSupplier = item.MatSupplier,
|
||||||
MatCustomer = item.MatCustomer,
|
MatCustomer = item.MatCustomer,
|
||||||
CreateUser = request.UserName
|
CreateUser = request.UserName,
|
||||||
|
IsMXPD = request.IsMXPD,
|
||||||
};
|
};
|
||||||
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
@ -396,7 +401,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
return new ResponseCommon()
|
return new ResponseCommon()
|
||||||
{
|
{
|
||||||
Code = 200,
|
Code = 200,
|
||||||
Message = $"Success",
|
Message = outOrder.OrderNumber,
|
||||||
Data = request.SnList
|
Data = request.SnList
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -466,7 +471,10 @@ namespace WCS.BLL.Services.Service
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
//直接查询
|
//直接查询
|
||||||
var recordsQueryable = DbHelp.db.Queryable<OutOrder>().Where(t => request.OrderExeStatus.Contains(t.OutOrderExeStatus));
|
var recordsQueryable = DbHelp.db.Queryable<OutOrder>()
|
||||||
|
.Where(t => request.OrderExeStatus.Contains(t.OutOrderExeStatus))
|
||||||
|
.WhereIF(request.IsMXPD != null, t => t.IsMXPD == request.IsMXPD)
|
||||||
|
.WhereIF(LocalFile.Config.IsMx, t => t.CreateTime > DateTime.Now.AddDays(-3));
|
||||||
|
|
||||||
var totalCount = await recordsQueryable.CountAsync();
|
var totalCount = await recordsQueryable.CountAsync();
|
||||||
var records = await recordsQueryable
|
var records = await recordsQueryable
|
||||||
@ -693,7 +701,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
var matCode = outOrderDetailCount.First().bb.Key;
|
var matCode = outOrderDetailCount.First().bb.Key;
|
||||||
outOrderMatDetails = outOrderMatDetails.Where(t => t.MatCode == matCode)
|
outOrderMatDetails = outOrderMatDetails.Where(t => t.MatCode == matCode)
|
||||||
.ToList();
|
.ToList();
|
||||||
Logs.Write($"出库单{order.OrderNumber},本次亮灯物料{matCode}!",LogsType.Outstore);
|
Logs.Write($"出库单{order.OrderNumber},本次亮灯物料{matCode}!", LogsType.Outstore);
|
||||||
|
|
||||||
//分批次亮灯再计算一次出哪些货架 以免亮大灯不亮小灯
|
//分批次亮灯再计算一次出哪些货架 以免亮大灯不亮小灯
|
||||||
shelfIds = outOrderMatDetails.Select(t => t.StoreInfo.ShelfId)
|
shelfIds = outOrderMatDetails.Select(t => t.StoreInfo.ShelfId)
|
||||||
@ -843,7 +851,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
Dictionary<string, List<int>> dict = new Dictionary<string, List<int>>();
|
Dictionary<string, List<int>> dict = new Dictionary<string, List<int>>();
|
||||||
foreach (OutOrderMatDetail oomd in outOrderMatDetails)
|
foreach (OutOrderMatDetail oomd in outOrderMatDetails)
|
||||||
{
|
{
|
||||||
List<ModuleInfo> mi= DbHelp.db.Queryable<ModuleInfo>().Where(it => it.ModuleCode == oomd.StoreCode).ToList();
|
List<ModuleInfo> mi = DbHelp.db.Queryable<ModuleInfo>().Where(it => it.ModuleCode == oomd.StoreCode).ToList();
|
||||||
if (mi.Count != 0)
|
if (mi.Count != 0)
|
||||||
{
|
{
|
||||||
if (!StoreCode.Contains(oomd.StoreCode))
|
if (!StoreCode.Contains(oomd.StoreCode))
|
||||||
@ -875,7 +883,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
{
|
{
|
||||||
string sendIP = v.Key;
|
string sendIP = v.Key;
|
||||||
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(sendIP);
|
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(sendIP);
|
||||||
byte[] lightOn = Helper.OutstoreLight(v.Value, LightColor,1);
|
byte[] lightOn = Helper.OutstoreLight(v.Value, LightColor, 1);
|
||||||
tCPClient.Send(lightOn);
|
tCPClient.Send(lightOn);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
@ -900,7 +908,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
for (int i = 0; i < si.Count; i++)
|
for (int i = 0; i < si.Count; i++)
|
||||||
{
|
{
|
||||||
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(si[i].ClientIp);
|
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(si[i].ClientIp);
|
||||||
byte[] warnlightOn = Helper.OutstoreWarnLight(si[i].LightId,LightColor,1,0);
|
byte[] warnlightOn = Helper.OutstoreWarnLight(si[i].LightId, LightColor, 1, 0);
|
||||||
tCPClient.Send(warnlightOn);
|
tCPClient.Send(warnlightOn);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
@ -1199,7 +1207,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
}
|
}
|
||||||
catch (Exception ee)
|
catch (Exception ee)
|
||||||
{
|
{
|
||||||
Logs.Write("查询出库单据:"+request.OrderNumber+"对应库位灯颜色失败,"+ ee.Message);
|
Logs.Write("查询出库单据:" + request.OrderNumber + "对应库位灯颜色失败," + ee.Message);
|
||||||
}
|
}
|
||||||
Dictionary<string, List<int>> dict = new Dictionary<string, List<int>>();
|
Dictionary<string, List<int>> dict = new Dictionary<string, List<int>>();
|
||||||
foreach (OutOrderMatDetail oomd in outOrderMatDetails)
|
foreach (OutOrderMatDetail oomd in outOrderMatDetails)
|
||||||
@ -1236,7 +1244,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
{
|
{
|
||||||
string sendIP = v.Key;
|
string sendIP = v.Key;
|
||||||
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(sendIP);
|
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(sendIP);
|
||||||
byte[] lightOn = Helper.OutstoreLight(v.Value, LightColor,0);
|
byte[] lightOn = Helper.OutstoreLight(v.Value, LightColor, 0);
|
||||||
tCPClient.Send(lightOn);
|
tCPClient.Send(lightOn);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
|
@ -40,5 +40,6 @@ namespace WCS.Model.ApiModel.InOutRecord
|
|||||||
出库 = 1,
|
出库 = 1,
|
||||||
丢失 = 2,
|
丢失 = 2,
|
||||||
盘点 = 3,
|
盘点 = 3,
|
||||||
|
盘点下架 = 4,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class ElectronicSiloPushRequest
|
||||||
|
{
|
||||||
|
public string materialCode { get; set; }
|
||||||
|
public string warehouseCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ElectronicSiloPushDto
|
||||||
|
{
|
||||||
|
public string materialBar { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -10,5 +10,7 @@ namespace WCS.Model
|
|||||||
public class GetOutOrderListByStatusRequest : PageQueryRequestBase
|
public class GetOutOrderListByStatusRequest : PageQueryRequestBase
|
||||||
{
|
{
|
||||||
public List<OutOrderExeStatus> OrderExeStatus { get; set; }
|
public List<OutOrderExeStatus> OrderExeStatus { get; set; }
|
||||||
|
|
||||||
|
public bool? IsMXPD { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,11 @@ namespace WCS.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string OrderType { get; set; }
|
public string OrderType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是盟讯公司盘点生成的出库单
|
||||||
|
/// </summary>
|
||||||
|
public bool IsMXPD { get; set; } = false;
|
||||||
|
|
||||||
public List<string> SnList { get; set; }
|
public List<string> SnList { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,5 +56,6 @@ namespace WCS.Model.WebSocketModel
|
|||||||
恢复正常 = 50,
|
恢复正常 = 50,
|
||||||
通知刷新出库 = 51,
|
通知刷新出库 = 51,
|
||||||
通知刷新盘点 = 52,
|
通知刷新盘点 = 52,
|
||||||
|
通知刷新盟讯盘点 = 53,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,12 @@ namespace WebApi.Controllers
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(request.OrderNumber))
|
if (string.IsNullOrEmpty(request.OrderNumber))
|
||||||
{
|
{
|
||||||
request.OrderNumber = await _generateService.generateOutOrderNumber();
|
if (request.IsMXPD)
|
||||||
|
{
|
||||||
|
request.OrderNumber = await _generateService.generateMXPDOutOrderNumber();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
request.OrderNumber = await _generateService.generateOutOrderNumber();
|
||||||
}
|
}
|
||||||
return await _outstoreService.SysOutOrderByMatSn(request);
|
return await _outstoreService.SysOutOrderByMatSn(request);
|
||||||
}
|
}
|
||||||
|
@ -231,6 +231,7 @@ namespace 货架标准上位机.ViewModel
|
|||||||
{
|
{
|
||||||
var body = new GetOutOrderListByStatusRequest()
|
var body = new GetOutOrderListByStatusRequest()
|
||||||
{
|
{
|
||||||
|
IsMXPD = false,
|
||||||
OrderExeStatus = new List<OutOrderExeStatus>() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 }
|
OrderExeStatus = new List<OutOrderExeStatus>() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 }
|
||||||
};
|
};
|
||||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<OutOrderModel>>(LocalFile.Config.ApiIpHost + "outstore/getOutOrderListByStatus", body, "POST");
|
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<OutOrderModel>>(LocalFile.Config.ApiIpHost + "outstore/getOutOrderListByStatus", body, "POST");
|
||||||
|
429
货架标准上位机/ViewModels/MXViewModel/MXPDViewModel.cs
Normal file
429
货架标准上位机/ViewModels/MXViewModel/MXPDViewModel.cs
Normal file
@ -0,0 +1,429 @@
|
|||||||
|
using HandyControl.Controls;
|
||||||
|
using HandyControl.Data;
|
||||||
|
using MiniExcelLibs;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Ping9719.WpfEx.Mvvm;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using TouchSocket.Core;
|
||||||
|
using WCS.Model;
|
||||||
|
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||||
|
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||||
|
using WCS.Model.ApiModel.OutStore;
|
||||||
|
using WCS.Model.ApiModel.Stocktaking;
|
||||||
|
using 货架标准上位机.Api;
|
||||||
|
using 货架标准上位机.ViewModel;
|
||||||
|
|
||||||
|
namespace 货架标准上位机.ViewModel
|
||||||
|
{
|
||||||
|
public class MXPDViewModel : BindableBase
|
||||||
|
{
|
||||||
|
public MXPDViewModel()
|
||||||
|
{
|
||||||
|
RefreshOutOrderList();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
private OutOrderModel selectedOutOrder;
|
||||||
|
public OutOrderModel SelectedOutOrder
|
||||||
|
{
|
||||||
|
get { return selectedOutOrder; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref selectedOutOrder, value);
|
||||||
|
if (selectedOutOrder != null)
|
||||||
|
{
|
||||||
|
SelectedOutOrderNumber = selectedOutOrder.OrderNumber;
|
||||||
|
RefreshDataGridItemSource();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DataGridItemSource?.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string selectedOutOrderNumber;
|
||||||
|
public string SelectedOutOrderNumber
|
||||||
|
{
|
||||||
|
get => selectedOutOrderNumber;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref selectedOutOrderNumber, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private ObservableCollection<OutOrderModel> outOrderList;
|
||||||
|
public ObservableCollection<OutOrderModel> OutOrderList
|
||||||
|
{
|
||||||
|
get => outOrderList;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref outOrderList, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ObservableCollection<OutOrderMatDetailModel> dataGridItemSource;
|
||||||
|
public ObservableCollection<OutOrderMatDetailModel> DataGridItemSource
|
||||||
|
{
|
||||||
|
get { return dataGridItemSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref dataGridItemSource, value);
|
||||||
|
RefreshCount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//单据总盘数
|
||||||
|
private int totalPan;
|
||||||
|
public int TotalPan
|
||||||
|
{
|
||||||
|
get => totalPan; set
|
||||||
|
{
|
||||||
|
SetProperty(ref totalPan, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int sendedPan;
|
||||||
|
public int SendedPan
|
||||||
|
{
|
||||||
|
get => sendedPan; set
|
||||||
|
{
|
||||||
|
SetProperty(ref sendedPan, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int totalCount;
|
||||||
|
public int TotalCount
|
||||||
|
{
|
||||||
|
get => totalCount;
|
||||||
|
set { SetProperty(ref totalCount, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string orderStatus;
|
||||||
|
public string OrderStatus
|
||||||
|
{
|
||||||
|
get { return orderStatus; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref orderStatus, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RefreshCount()
|
||||||
|
{
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
SendedPan = dataGridItemSource.Where(t => t.IsSended).Count();
|
||||||
|
TotalPan = dataGridItemSource.Count();
|
||||||
|
TotalCount = dataGridItemSource.Sum(t => t.MatQty);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string matCode;
|
||||||
|
public string MatCode
|
||||||
|
{
|
||||||
|
get => matCode;
|
||||||
|
set { SetProperty(ref matCode, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private string wareHouseCode;
|
||||||
|
public string WareHouseCode
|
||||||
|
{
|
||||||
|
get => wareHouseCode;
|
||||||
|
set { SetProperty(ref wareHouseCode, value); }
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Command
|
||||||
|
public ICommand BtnOutOrderCommand { get => new DelegateCommand(BtnOutOrder); }
|
||||||
|
public void BtnOutOrder()
|
||||||
|
{
|
||||||
|
var window = new MXOutOrderView();
|
||||||
|
window.Owner = Application.Current.MainWindow;
|
||||||
|
window.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ICommand BtnStartCommand { get => new DelegateCommand(BtnStart); }
|
||||||
|
public void BtnStart()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//判断是否选择单据
|
||||||
|
if (SelectedOutOrder == null)
|
||||||
|
{
|
||||||
|
Growl.Warning("未选择单据!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 调用接口开始出库
|
||||||
|
var body = new GetOutOrderDetailRequest()
|
||||||
|
{
|
||||||
|
OrderId = selectedOutOrder.Id,
|
||||||
|
OrderNumber = selectedOutOrder.OrderNumber,
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goInOutstore", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
Growl.Warning("已成功开始出库!");
|
||||||
|
RefreshDataGridItemSource();
|
||||||
|
}
|
||||||
|
else if (Result != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("调用接口失败!");
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Growl.Error("出现异常:" + ex.Message);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand BtnPauseCommand { get => new DelegateCommand(BtnPause); }
|
||||||
|
public void BtnPause()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//判断是否选择单据
|
||||||
|
if (SelectedOutOrder == null)
|
||||||
|
{
|
||||||
|
Growl.Warning("未选择单据!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#region 调用接口结束出库
|
||||||
|
var body = new GetOutOrderDetailRequest()
|
||||||
|
{
|
||||||
|
OrderId = selectedOutOrder.Id,
|
||||||
|
OrderNumber = selectedOutOrder.OrderNumber,
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goOutOutstore", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
Growl.Warning("已成功结束盘点!");
|
||||||
|
RefreshDataGridItemSource();
|
||||||
|
}
|
||||||
|
else if (Result != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("操作失败:调用接口失败!");
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Growl.Error("出现异常:" + ex.Message);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand BtnQueryCommand { get => new DelegateCommand(BtnQuery); }
|
||||||
|
public void BtnQuery()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//请求WMS获取物料明细
|
||||||
|
var request = new ElectronicSiloPushRequest()
|
||||||
|
{
|
||||||
|
materialCode = MatCode,
|
||||||
|
warehouseCode = WareHouseCode
|
||||||
|
};
|
||||||
|
var requeststr = JsonConvert.SerializeObject(request);
|
||||||
|
var result = ApiHelp.MXGetDataFromHttp<List<ElectronicSiloPushDto>>(requeststr, "http://192.168.2.23:9213/integrate/inOut/electronicSiloPush", "POST", true);
|
||||||
|
if (result != null && (result.code == 200) && result.data != null && result.data.Count() > 0)
|
||||||
|
{
|
||||||
|
//通过返回的物料明细查询当前库存中有的数据
|
||||||
|
var matSns = result.data.Select(t => t.materialBar).ToList();
|
||||||
|
//调用 比对库存数据 获取库存中有的数据
|
||||||
|
#region 调用接口 比对库存数据 获取库存中有的数据
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var body = new CompareMatInventoryDetailRequest()
|
||||||
|
{
|
||||||
|
MatSns = matSns,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/compareMatInventoryDetail", body, "POST", true);
|
||||||
|
|
||||||
|
//查询到物料信息
|
||||||
|
if (Result != null && Result.Data != null && Result.Data.Lists != null && Result.Data.Lists.Count != 0)
|
||||||
|
{
|
||||||
|
var count = Result.Data.Lists.Count;
|
||||||
|
//是否生成盘点单 实际上是出库单
|
||||||
|
var dialogResult = HandyControl.Controls.MessageBox.Show($"共查询到有{count}盘物料,是否生成盘点单?", "提示", MessageBoxButton.YesNo);
|
||||||
|
if (dialogResult == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
#region 调用接口保存出库单据
|
||||||
|
var body1 = new SysOutOrderByMatSnRequest()
|
||||||
|
{
|
||||||
|
IsMXPD = true,
|
||||||
|
OrderType = "出库",
|
||||||
|
OrderSource = "WCS前端",
|
||||||
|
SnList = Result.Data.Lists.Select(t => t.MatSN).ToList(),
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
UserName = LocalStatic.CurrentUser
|
||||||
|
};
|
||||||
|
var Result1 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatSn", body1, "POST");
|
||||||
|
if (Result1 != null && Result1.Code == 200)
|
||||||
|
{
|
||||||
|
//出库单据保存成功 刷新左侧出库单列表
|
||||||
|
MXPDView.viewModel.RefreshOutOrderList(Result1.Message.ToString());
|
||||||
|
Growl.Success("盘点单据保存成功,请点击【开始盘点】进行盘点下架!");
|
||||||
|
}
|
||||||
|
else if (Result1 != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result1.Message);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (Result != null && Result.Code == 200 && (Result.Data == null || Result.Data.Lists == null || Result.Data.Lists.Count == 0))
|
||||||
|
{
|
||||||
|
HandyControl.Controls.MessageBox.Show($"未查询到需要盘点的明细!所推荐物料在此货架上不存在,请确认是否在其他货架上!\r\n{string.Join(",\r\n", matSns)}");
|
||||||
|
DataGridItemSource = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HandyControl.Controls.MessageBox.Show($"未查询到需要盘点的明细!请重试!");
|
||||||
|
DataGridItemSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
HandyControl.Controls.MessageBox.Show($"未查询到需要盘点的明细!请重试!");
|
||||||
|
DataGridItemSource = null;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("获取WMS系统库存数据失败!" + result?.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
//dia.Close();
|
||||||
|
//dia.Collapse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RefreshOutOrderList(string OrderNumber = "")
|
||||||
|
{
|
||||||
|
#region 调用接口获取发料单
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var body = new GetOutOrderListByStatusRequest()
|
||||||
|
{
|
||||||
|
OrderExeStatus = new List<OutOrderExeStatus>() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 },
|
||||||
|
IsMXPD = true,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<OutOrderModel>>(LocalFile.Config.ApiIpHost + "outstore/getOutOrderListByStatus", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
OutOrderList = new ObservableCollection<OutOrderModel>(Result.Data.Lists);
|
||||||
|
if (!string.IsNullOrEmpty(OrderNumber))
|
||||||
|
{
|
||||||
|
SelectedOutOrder = OutOrderList.Where(t => t.OrderNumber == OrderNumber).FirstOrDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Growl.Warning(ex.Message);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RefreshDataGridItemSource()
|
||||||
|
{
|
||||||
|
if (SelectedOutOrder == null)
|
||||||
|
{
|
||||||
|
//选择的单据为空无法进行查询
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#region 调用接口获取出库单物料明细
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
var body = new GetOutOrderDetailRequest()
|
||||||
|
{
|
||||||
|
OrderId = selectedOutOrder.Id,
|
||||||
|
OrderNumber = selectedOutOrder.OrderNumber,
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<OutOrderMatDetailModel>>>(LocalFile.Config.ApiIpHost + "outStore/getOutOrderMatDetail", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
if (Result.Data.Count > 0)
|
||||||
|
{
|
||||||
|
DataGridItemSource = new ObservableCollection<OutOrderMatDetailModel>(Result.Data);
|
||||||
|
OrderStatus = Result.Message;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
App.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
DataGridItemSource?.Clear();
|
||||||
|
});
|
||||||
|
Growl.Warning("该单据未查询到发料明细!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Result != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("调用接口失败!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
@ -127,7 +127,7 @@
|
|||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
<TextBlock Margin="10,0,0,0" FontSize="16">盘点单据</TextBlock>
|
<TextBlock Margin="10,0,0,0" FontSize="16">PDA盘点单</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
@ -139,7 +139,7 @@
|
|||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
<TextBlock Margin="10,0,0,0" FontSize="16">物料盘点</TextBlock>
|
<TextBlock Margin="10,0,0,0" FontSize="16">PDA盘点</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
@ -147,6 +147,18 @@
|
|||||||
</hc:TransitioningContentControl>
|
</hc:TransitioningContentControl>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}">
|
||||||
|
<TabItem.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
<TextBlock Margin="10,0,0,0" FontSize="16">物料盘点</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem.Header>
|
||||||
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
|
<View:MXPDView/>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}">
|
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}">
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<Ellipse Width="20" Height="20" Fill="LightGreen" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityConverter}}"></Ellipse>
|
<Ellipse Width="20" Height="20" Fill="Green" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityConverter}}"></Ellipse>
|
||||||
<Ellipse Width="20" Height="20" Fill="Gray" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityReConverter}}"></Ellipse>
|
<Ellipse Width="20" Height="20" Fill="Gray" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityReConverter}}"></Ellipse>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
235
货架标准上位机/Views/MXWindows/MXPDView.xaml
Normal file
235
货架标准上位机/Views/MXWindows/MXPDView.xaml
Normal file
@ -0,0 +1,235 @@
|
|||||||
|
<pi:UserControlBase
|
||||||
|
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||||
|
x:Class="货架标准上位机.MXPDView"
|
||||||
|
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:hc="https://handyorg.github.io/handycontrol" xmlns:converter="clr-namespace:货架标准上位机"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="737" d:DesignWidth="1192">
|
||||||
|
<Border Margin="0" Background="LightGray" CornerRadius="3" Padding="0">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1.8*"></RowDefinition>
|
||||||
|
<RowDefinition Height="9*"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Border Grid.Row="0" Margin="0" Background="AliceBlue" Padding="0">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Grid.Column="0"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||||
|
Text="料 号 :" FontSize="20" ></TextBlock>
|
||||||
|
<TextBox Grid.Column="1" Text="{Binding MatCode}"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
|
FontSize="20" MinWidth="160" ></TextBox>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||||
|
Text="仓库代码:" FontSize="20" ></TextBlock>
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding WareHouseCode}"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
|
FontSize="20" MinWidth="160" ></TextBox>
|
||||||
|
|
||||||
|
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||||
|
Grid.Row="1" Grid.Column="2" MinHeight="45" FontSize="28" Content="获取明细" FontFamily="{StaticResource IconFont}"
|
||||||
|
Command="{Binding BtnQueryCommand}">
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||||
|
Grid.Row="1" Grid.Column="4" MinHeight="45" FontSize="28" Content="开始盘点" FontFamily="{StaticResource IconFont}"
|
||||||
|
Command="{Binding BtnStartCommand}"
|
||||||
|
>
|
||||||
|
</Button>
|
||||||
|
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
|
||||||
|
Grid.Row="1" Grid.Column="5" MinHeight="45" FontSize="28" Content="结束盘点" FontFamily="{StaticResource IconFont}"
|
||||||
|
Command="{Binding BtnPauseCommand}">
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Border Grid.Row="1" Margin="0" Background="LightGray" Padding="0">
|
||||||
|
<Border Margin="1" CornerRadius="3" Background="AliceBlue" Padding="0">
|
||||||
|
<Grid >
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.5*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
|
||||||
|
<StackPanel Grid.Column="2" VerticalAlignment="Center" Orientation="Horizontal">
|
||||||
|
<TextBlock FontSize="26" Text="当前盘点单:">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock FontSize="26" Text="{Binding SelectedPickBillNumber}">
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<!--</TabItem>-->
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Border Grid.Row="2" Margin="0" Background="AliceBlue" Padding="0">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="8*"></RowDefinition>
|
||||||
|
<RowDefinition Height="0.8*"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="6*"></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*"></RowDefinition>
|
||||||
|
<RowDefinition Height="12*"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Text="盘点单列表" MouseDown="TextBlock_MouseDown" FontWeight="DemiBold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center"></TextBlock>
|
||||||
|
<Border CornerRadius="3" Margin="1" Grid.Row="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||||
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Visible">
|
||||||
|
<ListView FontSize="18" ItemsSource="{Binding OutOrderList}" SelectedItem="{Binding SelectedOutOrder,Mode=TwoWay}" PreviewMouseWheel="ListView_PreviewMouseWheel">
|
||||||
|
<ListView.View>
|
||||||
|
|
||||||
|
<GridView AllowsColumnReorder="False">
|
||||||
|
<GridView.ColumnHeaderContainerStyle>
|
||||||
|
<Style TargetType="{x:Type GridViewColumnHeader}">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed"/>
|
||||||
|
</Style>
|
||||||
|
</GridView.ColumnHeaderContainerStyle>
|
||||||
|
<GridViewColumn DisplayMemberBinding="{Binding OrderNumber}"/>
|
||||||
|
</GridView>
|
||||||
|
</ListView.View>
|
||||||
|
</ListView>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Border CornerRadius="3" Margin="1" Grid.Row="0" Grid.Column="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*"></RowDefinition>
|
||||||
|
<RowDefinition Height="12*"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" >
|
||||||
|
<TextBlock Text="当前盘点单:" FontSize="24">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding SelectedPickBillNumber}" FontSize="24">
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<DataGrid Grid.Row="2"
|
||||||
|
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||||
|
ItemsSource="{Binding DataGridItemSource}"
|
||||||
|
RowHeight="40"
|
||||||
|
AutoGenerateColumns="False" FontSize="15">
|
||||||
|
<DataGrid.Resources>
|
||||||
|
<converter:WorkItemBackgroundConverter x:Key="converter"/>
|
||||||
|
</DataGrid.Resources>
|
||||||
|
|
||||||
|
<DataGrid.RowStyle>
|
||||||
|
<Style TargetType="DataGridRow">
|
||||||
|
<Setter Property="Background" Value="{Binding Path=IsSend, Converter={StaticResource converter}}"/>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.RowStyle>
|
||||||
|
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn Header="" CanUserResize="False" Width="50">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel>
|
||||||
|
<Ellipse Width="20" Height="20" Fill="Green" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityConverter}}"></Ellipse>
|
||||||
|
<Ellipse Width="20" Height="20" Fill="Gray" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityReConverter}}"></Ellipse>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="已取料" Binding="{Binding IsSended,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding OriginalQty}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" MaxWidth="300" Header="规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="False" Header="最小包装条码" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
|
||||||
|
</DataGrid>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<Grid Grid.Row="2" Grid.ColumnSpan="2">
|
||||||
|
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||||
|
<Grid HorizontalAlignment="Stretch" Margin="5 0 1 0" VerticalAlignment="Top" Width="Auto" Height="40">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="8.5*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="4*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0">
|
||||||
|
<TextBlock Text=" 当前状态:" FontSize="24">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding OrderStatus,FallbackValue=未知}" Foreground="red" FontSize="24">
|
||||||
|
</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
|
||||||
|
<TextBlock Text="物料总数量:" FontSize="20">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding TotalCount,FallbackValue=0}" FontSize="20">
|
||||||
|
</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2">
|
||||||
|
<TextBlock Text="总盘数:" VerticalAlignment="Bottom" FontSize="20">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
|
<TextBlock Text=" 取料进度:" VerticalAlignment="Bottom" FontSize="20">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding SendedPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="/" VerticalAlignment="Bottom" FontSize="20">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||||
|
</TextBlock>
|
||||||
|
<!--<TextBlock Text=" 未出盘数:" VerticalAlignment="Bottom" FontSize="20">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding UnSendedPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||||
|
</TextBlock>-->
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</pi:UserControlBase>
|
59
货架标准上位机/Views/MXWindows/MXPDView.xaml.cs
Normal file
59
货架标准上位机/Views/MXWindows/MXPDView.xaml.cs
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
using Ping9719.WpfEx;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
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.Shapes;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using 货架标准上位机.ViewModel;
|
||||||
|
|
||||||
|
namespace 货架标准上位机
|
||||||
|
{
|
||||||
|
public partial class MXPDView : UserControlBase
|
||||||
|
{
|
||||||
|
public static MXPDViewModel viewModel { get; set; } = new MXPDViewModel();
|
||||||
|
public MXPDView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = viewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DataGrid datagrid = sender as DataGrid;
|
||||||
|
datagrid.UnselectAllCells();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
viewModel.RefreshOutOrderList(viewModel.SelectedOutOrderNumber);
|
||||||
|
}
|
||||||
|
private void ListView_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
if (!e.Handled)
|
||||||
|
{
|
||||||
|
e.Handled = true;
|
||||||
|
// 激发一个鼠标滚轮事件,冒泡给外层ListView接收到
|
||||||
|
var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
|
||||||
|
eventArg.RoutedEvent = UIElement.MouseWheelEvent;
|
||||||
|
eventArg.Source = sender;
|
||||||
|
var parent = ((Control)sender).Parent as UIElement;
|
||||||
|
parent.RaiseEvent(eventArg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -108,6 +108,10 @@ namespace 货架标准上位机
|
|||||||
StockTakingView.viewModel.RefreshDataGridItemSource();
|
StockTakingView.viewModel.RefreshDataGridItemSource();
|
||||||
client.Send(e.DataFrame.ToText());
|
client.Send(e.DataFrame.ToText());
|
||||||
break;
|
break;
|
||||||
|
case WarningTypeEnum.通知刷新盟讯盘点:
|
||||||
|
MXPDView.viewModel.RefreshDataGridItemSource();
|
||||||
|
client.Send(e.DataFrame.ToText());
|
||||||
|
break;
|
||||||
case WarningTypeEnum.恢复正常:
|
case WarningTypeEnum.恢复正常:
|
||||||
var SolvedGuids = warning.SolvedGuids;
|
var SolvedGuids = warning.SolvedGuids;
|
||||||
SolvedGuids.ForEach(guid =>
|
SolvedGuids.ForEach(guid =>
|
||||||
|
Reference in New Issue
Block a user