1.增加盟讯公司业务逻辑相关适配 前后端增加配置参数“ISMX”进行控制
2.前端websocket取消心跳机制(原有心跳和断线重连当服务端网线断开后需要等tcp保活期到期后才能发现重连),自己实现心跳和重连 3.前端关闭后任占用后台线程问题修复
This commit is contained in:
@ -18,6 +18,18 @@ namespace WCS.BLL.Config
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSameMatCodeOut { get; set; }
|
public bool IsSameMatCodeOut { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 数据-数据库路径
|
||||||
|
/// </summary>
|
||||||
|
public string DataDbPath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 日志-数据库路径
|
||||||
|
/// </summary>
|
||||||
|
public string LogDbPath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 权限-数据库路径
|
||||||
|
/// </summary>
|
||||||
|
public string AuthDbPath { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 是否接入WMS系统
|
/// 是否接入WMS系统
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsAccessWMS { get; set; }
|
public bool IsAccessWMS { get; set; }
|
||||||
@ -25,5 +37,25 @@ namespace WCS.BLL.Config
|
|||||||
/// WMS系统
|
/// WMS系统
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? WMSUrl { get; set; }
|
public string? WMSUrl { get; set; }
|
||||||
|
|
||||||
|
#region 盟讯公司后台配置
|
||||||
|
public bool IsMx { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 回传Mes入库/移库
|
||||||
|
/// </summary>
|
||||||
|
public string InputStockInStr { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 回传Mes出库
|
||||||
|
/// </summary>
|
||||||
|
public string BunkerOutStr { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 通过条码查询物料信息接口
|
||||||
|
/// </summary>
|
||||||
|
public string QueryBybar { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 后台配置的组别
|
||||||
|
/// </summary>
|
||||||
|
public string GroupName { get; set; }
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
WCS.BLL/DbModels/DingDingSendUser.cs
Normal file
19
WCS.BLL/DbModels/DingDingSendUser.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WCS.BLL.DbModels
|
||||||
|
{
|
||||||
|
[SugarTable("ding_ding_send_user")]
|
||||||
|
public class DingDingSendUser
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 工号
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "user_name", Length = 50, IsNullable = true, ColumnDescription = "创建人")]
|
||||||
|
public string UserName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -12,7 +12,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用于记录单据生成到哪个序号了
|
/// 用于记录单据生成到哪个序号了
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("document_serial_number")]
|
[SugarTable("wcs_document_serial_number")]
|
||||||
public class DocumentSerialNumber
|
public class DocumentSerialNumber
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -12,7 +12,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出入库记录
|
/// 出入库记录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("in_out_record")]
|
[SugarTable("wcs_in_out_record")]
|
||||||
public class InOutRecord
|
public class InOutRecord
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -115,6 +115,33 @@ namespace WCS.BLL.DbModels
|
|||||||
[SugarColumn(ColumnName = "operate_user", Length = 100, IsNullable = true, ColumnDescription = "创建人")]
|
[SugarColumn(ColumnName = "operate_user", Length = 100, IsNullable = true, ColumnDescription = "创建人")]
|
||||||
public string OperateUser { get; set; }
|
public string OperateUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 串联绑定后的大货架编码
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Bind_shelf_code", IsNullable = true, ColumnDescription = "串联绑定后的大货架编码")]
|
||||||
|
public string? BigShelfCode { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// Row 行
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "R", Length = 10, IsNullable = true, ColumnDescription = "库位 行")]
|
||||||
|
public string R { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Column 列
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "C", Length = 10, IsNullable = true, ColumnDescription = "库位 列")]
|
||||||
|
public string C { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Column 位
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Wei", Length = 10, IsNullable = true, ColumnDescription = "库位 位 第几个库位灯")]
|
||||||
|
public string Wei { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "group_name", Length = 50, IsNullable = false, DefaultValue = "0", ColumnDescription = "货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)")]
|
||||||
|
public string GroupName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序号
|
/// 序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -11,7 +11,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 库存明细表
|
/// 库存明细表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("inventory_detail")]
|
[SugarTable("wcs_inventory_detail")]
|
||||||
public class InventoryDetail
|
public class InventoryDetail
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -102,7 +102,38 @@ namespace WCS.BLL.DbModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "is_locked", IsNullable = false, ColumnDescription = "物料是否已被锁定")]
|
[SugarColumn(ColumnName = "is_locked", IsNullable = false, ColumnDescription = "物料是否已被锁定")]
|
||||||
public bool IsLocked { get; set; } = false;
|
public bool IsLocked { get; set; } = false;
|
||||||
|
/// <summary>
|
||||||
|
/// 串联绑定后的大货架编码
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "big_shelf_code", IsNullable = true, ColumnDescription = "串联绑定后的大货架编码")]
|
||||||
|
public string? BigShelfCode { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// Row 行
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "R", Length = 10, IsNullable = true, ColumnDescription = "库位 行")]
|
||||||
|
public string R { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Column 列
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "C", Length = 10, IsNullable = true, ColumnDescription = "库位 列")]
|
||||||
|
public string C { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Column 位
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Wei", Length = 10, IsNullable = true, ColumnDescription = "库位 位 第几个库位灯")]
|
||||||
|
public string Wei { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// WarehouseCode 仓库代码
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "WarehouseCode", Length = 10, IsNullable = true, ColumnDescription = "仓库代码")]
|
||||||
|
public string WarehouseCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "group_name", Length = 50, IsNullable = false, DefaultValue = "0", ColumnDescription = "货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)")]
|
||||||
|
public string GroupName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序号
|
/// 序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -10,7 +10,7 @@ namespace WCS.BLL.DbModels
|
|||||||
///<summary>
|
///<summary>
|
||||||
///物料基础信息
|
///物料基础信息
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarTable("mat_base_info")]
|
[SugarTable("wcs_mat_base_info")]
|
||||||
public partial class MatBaseInfo
|
public partial class MatBaseInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -10,7 +10,7 @@ namespace WCS.BLL.DbModels
|
|||||||
///<summary>
|
///<summary>
|
||||||
///物料信息表
|
///物料信息表
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarTable("mat_info")]
|
[SugarTable("wcs_mat_info")]
|
||||||
public class MatInfo
|
public class MatInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -11,7 +11,7 @@ namespace WCS.DAL.DbModels
|
|||||||
///<summary>
|
///<summary>
|
||||||
///模组信息表
|
///模组信息表
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarTable("module_info")]
|
[SugarTable("wcs_module_info")]
|
||||||
public class ModuleInfo
|
public class ModuleInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -62,7 +62,11 @@ namespace WCS.DAL.DbModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "client_ip", Length = 50, IsNullable = false, ColumnDescription = "货架对应Can模块的Ip")]
|
[SugarColumn(ColumnName = "client_ip", Length = 50, IsNullable = false, ColumnDescription = "货架对应Can模块的Ip")]
|
||||||
public string CleintIp { get; set; }
|
public string CleintIp { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "group_name", Length = 50, IsNullable = false, ColumnDescription = "货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)")]
|
||||||
|
public string GroupName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// R 行
|
/// R 行
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -6,7 +6,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出库单据
|
/// 出库单据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("out_order")]
|
[SugarTable("wcs_out_order")]
|
||||||
public class OutOrder
|
public class OutOrder
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -63,6 +63,12 @@ namespace WCS.BLL.DbModels
|
|||||||
[SugarColumn(ColumnName = "shelf_type_id", IsNullable = false, DefaultValue = "0", ColumnDescription = "货架类型Id")]
|
[SugarColumn(ColumnName = "shelf_type_id", IsNullable = false, DefaultValue = "0", ColumnDescription = "货架类型Id")]
|
||||||
public int ShelfTypeId { get; set; } = 0;
|
public int ShelfTypeId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "group_name", Length = 50, IsNullable = false, DefaultValue = "0", ColumnDescription = "货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)")]
|
||||||
|
public string GroupName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建时间
|
/// 创建时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -6,7 +6,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出库单据明细表
|
/// 出库单据明细表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("out_order_detail")]
|
[SugarTable("wcs_out_order_detail")]
|
||||||
public class OutOrderDetail
|
public class OutOrderDetail
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -11,7 +11,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出库物料明细(库存数据加锁后缓存对应的数据并记录状态)
|
/// 出库物料明细(库存数据加锁后缓存对应的数据并记录状态)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("out_order_mat_detail")]
|
[SugarTable("wcs_out_order_mat_detail")]
|
||||||
public class OutOrderMatDetail
|
public class OutOrderMatDetail
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -8,7 +8,7 @@ using WCS.BLL.HardWare;
|
|||||||
|
|
||||||
namespace WCS.DAL.DbModels
|
namespace WCS.DAL.DbModels
|
||||||
{
|
{
|
||||||
[SugarTable("shelf_info")]
|
[SugarTable("wcs_shelf_info")]
|
||||||
public class ShelfInfo
|
public class ShelfInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ namespace WCS.DAL.DbModels
|
|||||||
/// 串联绑定后的大货架编码
|
/// 串联绑定后的大货架编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "Bind_shelf_code", IsNullable = true, ColumnDescription = "串联绑定后的大货架编码")]
|
[SugarColumn(ColumnName = "Bind_shelf_code", IsNullable = true, ColumnDescription = "串联绑定后的大货架编码")]
|
||||||
public string? BindShelfCode { get; set; } = string.Empty;
|
public string? BigShelfCode { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序号
|
/// 序号
|
||||||
|
@ -10,7 +10,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货架类型
|
/// 货架类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("shelf_type")]
|
[SugarTable("wcs_shelf_type")]
|
||||||
public class ShelfTypeInfo
|
public class ShelfTypeInfo
|
||||||
{
|
{
|
||||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)]
|
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)]
|
||||||
|
@ -11,7 +11,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 盘点单据
|
/// 盘点单据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("stock_taking_order")]
|
[SugarTable("wcs_stock_taking_order")]
|
||||||
public class StockTakingOrder
|
public class StockTakingOrder
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -11,7 +11,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 盘点单据物料明细
|
/// 盘点单据物料明细
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("stock_taking_order_matdetail")]
|
[SugarTable("wcs_stock_taking_order_matdetail")]
|
||||||
public class StockTakingOrderMatDetail
|
public class StockTakingOrderMatDetail
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace WCS.DAL.DbModels
|
namespace WCS.DAL.DbModels
|
||||||
{
|
{
|
||||||
[SugarTable("store_info")]
|
[SugarTable("wcs_store_info")]
|
||||||
public partial class StoreInfo
|
public partial class StoreInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -25,7 +25,7 @@ namespace WCS.DAL.DbModels
|
|||||||
/// 货架类型Id
|
/// 货架类型Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "shelf_type_id", IsNullable = false, DefaultValue = "0", ColumnDescription = "货架类型Id")]
|
[SugarColumn(ColumnName = "shelf_type_id", IsNullable = false, DefaultValue = "0", ColumnDescription = "货架类型Id")]
|
||||||
public int ShelfTypeId { get; set; }
|
public int ShelfTypeId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模组Id
|
/// 模组Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -92,6 +92,33 @@ namespace WCS.DAL.DbModels
|
|||||||
[SugarColumn(ColumnName = "offset_voltage", IsNullable = true, ColumnDescription = "电压偏移值")]
|
[SugarColumn(ColumnName = "offset_voltage", IsNullable = true, ColumnDescription = "电压偏移值")]
|
||||||
public decimal OffsetVoltage { get; set; }
|
public decimal OffsetVoltage { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 串联绑定后的大货架编码
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Bind_shelf_code", IsNullable = true, ColumnDescription = "串联绑定后的大货架编码")]
|
||||||
|
public string? BigShelfCode { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// Row 行
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "R", Length = 10, IsNullable = true, ColumnDescription = "库位 行")]
|
||||||
|
public string R { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Column 列
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "C", Length = 10, IsNullable = true, ColumnDescription = "库位 列")]
|
||||||
|
public string C { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Column 位
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Wei", Length = 10, IsNullable = true, ColumnDescription = "库位 位 第几个库位灯")]
|
||||||
|
public string Wei { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "group_name", Length = 50, IsNullable = false, DefaultValue = "0", ColumnDescription = "货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)")]
|
||||||
|
public string GroupName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序号
|
/// 序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -10,7 +10,7 @@ namespace WCS.BLL.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统接口日志记录
|
/// 系统接口日志记录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("system_api_log_record")]
|
[SugarTable("wcs_system_api_log_record")]
|
||||||
public class SystemApiLogRecord
|
public class SystemApiLogRecord
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -949,6 +949,12 @@ namespace WCS.BLL.HardWare
|
|||||||
StoreCode = storeInfo.StoreCode,
|
StoreCode = storeInfo.StoreCode,
|
||||||
StoreId = storeInfo.Id,
|
StoreId = storeInfo.Id,
|
||||||
|
|
||||||
|
R = storeInfo.R,
|
||||||
|
C = storeInfo.C,
|
||||||
|
Wei = storeInfo.Wei,
|
||||||
|
BigShelfCode = storeInfo.BigShelfCode,
|
||||||
|
GroupName = storeInfo.GroupName,
|
||||||
|
|
||||||
MatSN = this.InStoreData.materialBar,
|
MatSN = this.InStoreData.materialBar,
|
||||||
MatCode = this.InStoreData.materialCode,
|
MatCode = this.InStoreData.materialCode,
|
||||||
MatName = this.InStoreData.materialName,
|
MatName = this.InStoreData.materialName,
|
||||||
@ -969,6 +975,12 @@ namespace WCS.BLL.HardWare
|
|||||||
StoreId = storeInfo.Id,
|
StoreId = storeInfo.Id,
|
||||||
StoreInfo = storeInfo,
|
StoreInfo = storeInfo,
|
||||||
|
|
||||||
|
R = storeInfo.R,
|
||||||
|
C = storeInfo.C,
|
||||||
|
Wei = storeInfo.Wei,
|
||||||
|
BigShelfCode = storeInfo.BigShelfCode,
|
||||||
|
GroupName = storeInfo.GroupName,
|
||||||
|
|
||||||
MatSN = this.InStoreData.materialBar,
|
MatSN = this.InStoreData.materialBar,
|
||||||
MatCode = this.InStoreData.materialCode,
|
MatCode = this.InStoreData.materialCode,
|
||||||
MatName = this.InStoreData.materialName,
|
MatName = this.InStoreData.materialName,
|
||||||
@ -1344,6 +1356,12 @@ namespace WCS.BLL.HardWare
|
|||||||
StoreId = storeInfo.Id,
|
StoreId = storeInfo.Id,
|
||||||
StoreInfo = storeInfo,
|
StoreInfo = storeInfo,
|
||||||
|
|
||||||
|
R = storeInfo.R,
|
||||||
|
C = storeInfo.C,
|
||||||
|
Wei = storeInfo.Wei,
|
||||||
|
BigShelfCode = storeInfo.BigShelfCode,
|
||||||
|
GroupName = storeInfo.GroupName,
|
||||||
|
|
||||||
MatSN = inventoryDetail.MatSN,
|
MatSN = inventoryDetail.MatSN,
|
||||||
MatCode = inventoryDetail.MatCode,
|
MatCode = inventoryDetail.MatCode,
|
||||||
MatName = inventoryDetail.MatName,
|
MatName = inventoryDetail.MatName,
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
using System;
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using WCS.BLL.Config;
|
||||||
using WCS.BLL.DbModels;
|
using WCS.BLL.DbModels;
|
||||||
|
using WCS.BLL.HardWare;
|
||||||
|
using WCS.DAL;
|
||||||
using WCS.DAL.Db;
|
using WCS.DAL.Db;
|
||||||
using WCS.DAL.Db.AuthDb;
|
using WCS.DAL.Db.AuthDb;
|
||||||
using WCS.DAL.DbModels;
|
using WCS.DAL.DbModels;
|
||||||
@ -15,7 +19,49 @@ namespace WCS.BLL.Manager
|
|||||||
public static void InitDb()
|
public static void InitDb()
|
||||||
{
|
{
|
||||||
Logs.Write("【初始化数据库】开始", LogsType.StartBoot);
|
Logs.Write("【初始化数据库】开始", LogsType.StartBoot);
|
||||||
|
//初始化数据库对象
|
||||||
|
if (LocalFile.Config.IsMx)
|
||||||
|
{
|
||||||
|
DbHelp.db = new SqlSugarScope(new ConnectionConfig()
|
||||||
|
{
|
||||||
|
ConnectionString = LocalFile.Config.DataDbPath,
|
||||||
|
DbType = DbType.SqlServer,//[Sqlite]安装[System.Data.SQLite];
|
||||||
|
IsAutoCloseConnection = true
|
||||||
|
}, db =>
|
||||||
|
{
|
||||||
|
db.Aop.OnError = ex =>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
DbHelp.dbLog = new SqlSugarScope(new ConnectionConfig()
|
||||||
|
{
|
||||||
|
ConnectionString = LocalFile.Config.LogDbPath,
|
||||||
|
DbType = DbType.SqlServer,//[Sqlite]安装[System.Data.SQLite];
|
||||||
|
IsAutoCloseConnection = true
|
||||||
|
}, db =>
|
||||||
|
{
|
||||||
|
db.Aop.OnError = ex =>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
AuthDbHelp.db = new SqlSugarScope(new ConnectionConfig()
|
||||||
|
{
|
||||||
|
ConnectionString = LocalFile.Config.AuthDbPath,
|
||||||
|
DbType = DbType.SqlServer,//[Sqlite]安装[System.Data.SQLite];
|
||||||
|
IsAutoCloseConnection = true
|
||||||
|
}, db =>
|
||||||
|
{
|
||||||
|
db.Aop.OnError = ex =>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DbHelp.db.DbMaintenance.CreateDatabase();
|
DbHelp.db.DbMaintenance.CreateDatabase();
|
||||||
|
DbHelp.dbLog.DbMaintenance.CreateDatabase();
|
||||||
|
|
||||||
DbHelp.db.CodeFirst.InitTables(typeof(ModuleInfo), typeof(ShelfInfo), typeof(StoreInfo)
|
DbHelp.db.CodeFirst.InitTables(typeof(ModuleInfo), typeof(ShelfInfo), typeof(StoreInfo)
|
||||||
, typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail)
|
, typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail)
|
||||||
@ -46,8 +92,25 @@ namespace WCS.BLL.Manager
|
|||||||
DbHelp.db.Insertable(outDocumentSerialNumber).ExecuteCommand();
|
DbHelp.db.Insertable(outDocumentSerialNumber).ExecuteCommand();
|
||||||
DbHelp.db.Insertable(stockTakingDocumentSerialNumber).ExecuteCommand();
|
DbHelp.db.Insertable(stockTakingDocumentSerialNumber).ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
//初始化货架类型
|
||||||
|
if (!DbHelp.db.Queryable<ShelfTypeInfo>().Any())
|
||||||
|
{
|
||||||
|
var smartShelf = new ShelfTypeInfo()
|
||||||
|
{
|
||||||
|
ShelfTypeName = "智能货架"
|
||||||
|
};
|
||||||
|
var singleLight = new ShelfTypeInfo()
|
||||||
|
{
|
||||||
|
ShelfTypeName = "信息化货架"
|
||||||
|
};
|
||||||
|
DbHelp.db.Insertable(smartShelf).ExecuteCommand();
|
||||||
|
DbHelp.db.Insertable(singleLight).ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
Logs.Write("【初始化数据库】结束", LogsType.StartBoot);
|
Logs.Write("【初始化数据库】结束", LogsType.StartBoot);
|
||||||
|
|
||||||
|
//初始化权限数据库
|
||||||
|
AuthDbHelp.InitDb();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
255
WCS.BLL/Manager/MXBackgroundThread.cs
Normal file
255
WCS.BLL/Manager/MXBackgroundThread.cs
Normal file
@ -0,0 +1,255 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using WCS.BLL.Config;
|
||||||
|
using WCS.BLL.DbModels;
|
||||||
|
using WCS.BLL.Tool;
|
||||||
|
using WCS.DAL;
|
||||||
|
using WCS.DAL.Db;
|
||||||
|
using WCS.DAL.Db.AuthDb;
|
||||||
|
using WCS.Model;
|
||||||
|
using WCS.Model.ApiModel.InOutRecord;
|
||||||
|
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||||
|
|
||||||
|
namespace WCS.BLL.Manager
|
||||||
|
{
|
||||||
|
//盟讯公司后台方法
|
||||||
|
public static class MXBackgroundThread
|
||||||
|
{
|
||||||
|
public static void InitBackgroundThread()
|
||||||
|
{
|
||||||
|
#region 定时任务:回传Mes入库出库
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
//每5秒同步一次
|
||||||
|
Thread.Sleep(5000);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var records = DbHelp.db.Queryable<InOutRecord>()
|
||||||
|
.Where(t => t.OperateTime > DateTime.Now.AddDays(-3)) //只查询回传三天内数据
|
||||||
|
.Where(t => t.IsUpload == false)
|
||||||
|
.Includes(t => t.StoreInfo)
|
||||||
|
.OrderBy(t => t.Id)
|
||||||
|
.ToList();
|
||||||
|
//入库记录上传
|
||||||
|
var inventoryDetails = records.Where(t => t.Direction == DirectionEnum.入库)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName)
|
||||||
|
.ToList();
|
||||||
|
if (inventoryDetails != null && inventoryDetails.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < inventoryDetails.Count; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//请求WMS上传入库记录
|
||||||
|
var data = new InputStockInRequest
|
||||||
|
{
|
||||||
|
materialBar = inventoryDetails[i].MatSN,
|
||||||
|
shelfCode = inventoryDetails[i].BigShelfCode,
|
||||||
|
shelfX = "R" + inventoryDetails[i].R,
|
||||||
|
shelfY = "C" + inventoryDetails[i].C,
|
||||||
|
shelfZ = inventoryDetails[i].Wei,
|
||||||
|
inUser = inventoryDetails[i].OperateUser,
|
||||||
|
inTime = inventoryDetails[i].OperateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
|
};
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
var result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.InputStockInStr, data, "POST", true);
|
||||||
|
if (result != null && (result.Code == 200))
|
||||||
|
{
|
||||||
|
//上传成功 更改上传状态
|
||||||
|
inventoryDetails[i].IsUpload = true;
|
||||||
|
DbHelp.db.Updateable(inventoryDetails[i]).ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
Thread.Sleep(200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//出库记录上传
|
||||||
|
var outRecord = records.Where(t => t.Direction == DirectionEnum.出库)
|
||||||
|
.Where(t => !string.IsNullOrEmpty(t.OrderNumber))
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName)
|
||||||
|
.ToList();
|
||||||
|
if (outRecord != null && outRecord.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < outRecord.Count; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var retString = string.Empty;
|
||||||
|
|
||||||
|
var data = new BunkerOutRequest()
|
||||||
|
{
|
||||||
|
materialBar = outRecord[i].MatSN,
|
||||||
|
outType = 0,
|
||||||
|
pickBillNumber = outRecord[i].OrderNumber,
|
||||||
|
qty = outRecord[i].MatQty,
|
||||||
|
};
|
||||||
|
var result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.BunkerOutStr, data, "POST", true);
|
||||||
|
//请求成功
|
||||||
|
if (result != null && result.Code == 200)
|
||||||
|
{
|
||||||
|
//上传成功 更改上传状态
|
||||||
|
outRecord[i].IsUpload = true;
|
||||||
|
DbHelp.db.Updateable(outRecord[i]).ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
Thread.Sleep(200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logs.Write("【定时任务】上传异常:" + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 定时任务:超时退出 出库、入库、盘点模式
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 定时任务:海康未扫物料码的物料更新数据
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
//间隔20秒同步一次
|
||||||
|
Thread.Sleep(20000);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var inventoryDetails = DbHelp.db.Queryable<InventoryDetail>()
|
||||||
|
.Where(t => t.MatName == "暂时未知")
|
||||||
|
.Where(t => t.InstoreTime > DateTime.Now.AddDays(-3))
|
||||||
|
.ToList();
|
||||||
|
if (inventoryDetails != null && inventoryDetails.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < inventoryDetails.Count; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//请求WMS获取物料的信息
|
||||||
|
var request = new QueryBybarRequest()
|
||||||
|
{
|
||||||
|
materialBar = inventoryDetails[i].MatSN
|
||||||
|
};
|
||||||
|
var result = ApiHelp.GetDataFromHttp<QueryBybarResponse>(LocalFile.Config.QueryBybar, request, "POST", true);
|
||||||
|
if (result != null && (result.code == 200) && result.data != null && result.data.Count() > 0)
|
||||||
|
{
|
||||||
|
//查询成功 更改数值
|
||||||
|
var instoreDto = result.data.FirstOrDefault();
|
||||||
|
inventoryDetails[i].MatCode = instoreDto.materialCode;
|
||||||
|
inventoryDetails[i].MatName = instoreDto.materialName;
|
||||||
|
inventoryDetails[i].MatBatch = instoreDto.batchNo;
|
||||||
|
inventoryDetails[i].MatSpec = instoreDto.materialSpec;
|
||||||
|
inventoryDetails[i].MatQty = (int)instoreDto.materialQty;
|
||||||
|
DbHelp.db.Updateable(inventoryDetails[i]).ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
Thread.Sleep(500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logs.Write("【定时任务】更新海康物料信息异常:" + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread.Sleep(3000);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var inventoryDetails = DbHelp.db.Queryable<InventoryDetail>()
|
||||||
|
.Where(t => t.WarehouseCode == null)
|
||||||
|
.Where(t => t.InstoreTime > DateTime.Now.AddDays(-30))
|
||||||
|
.ToList();
|
||||||
|
if (inventoryDetails != null && inventoryDetails.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < inventoryDetails.Count; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var url = $"http://192.168.2.23:9213/integrate/hkwsInventoryDetail/selectMaterialBar?materialBar={inventoryDetails[i].MatSN}";
|
||||||
|
var result = ApiHelp.GetDataFromHttp<SelectMaterialBarResponse>(url, null, "POST", false);
|
||||||
|
if (result != null && result.code == 200 && result.data != null && !string.IsNullOrEmpty(result.data.warehouseCode))
|
||||||
|
{
|
||||||
|
//查询成功 更改数值
|
||||||
|
inventoryDetails[i].WarehouseCode = result.data.warehouseCode;
|
||||||
|
DbHelp.db.Updateable(inventoryDetails[i]).ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logs.Write("【定时任务】更新仓库代码异常:" + ex.Message);
|
||||||
|
}
|
||||||
|
Thread.Sleep(500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 定时任务:紧机复原和监测警示灯关灯机制
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发送钉钉消息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="msg">发送的消息内容</param>
|
||||||
|
/// <param name="errMsg">错误信息</param>
|
||||||
|
/// <param name="idList">工号列表</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool SendDingDingMsg(string msg, List<string> idList, ref string errMsg)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
#region 获取所有工程研发人员
|
||||||
|
var list = AuthDbHelp.db.Queryable<UserBase>().Where(t => t.IsGCYF)
|
||||||
|
.Select(t => t.LoginName)
|
||||||
|
.ToList();
|
||||||
|
#endregion
|
||||||
|
string ids = string.Join(",", list);
|
||||||
|
string url = "http://192.168.2.23:9213/integrate/cmccMonitor/rateAlertByCMCC?" + $"context={msg}&messageType=软件管理平台&username={ids}";
|
||||||
|
#region 调用接口请求发送钉钉消息
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<MXMesResponseCommon>(url, null, "GET");
|
||||||
|
if (Result != null && Result.code != 200)
|
||||||
|
{
|
||||||
|
errMsg = Result.msg;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
errMsg = "接口调用失败";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using WCS.BLL.Config;
|
||||||
using WCS.BLL.DbModels;
|
using WCS.BLL.DbModels;
|
||||||
using WCS.BLL.HardWare;
|
using WCS.BLL.HardWare;
|
||||||
using WCS.DAL.Db;
|
using WCS.DAL.Db;
|
||||||
@ -22,7 +23,10 @@ namespace WCS.BLL.Manager
|
|||||||
{
|
{
|
||||||
Logs.Write("【InitShelves】开始", LogsType.StartBoot);
|
Logs.Write("【InitShelves】开始", LogsType.StartBoot);
|
||||||
|
|
||||||
var shelvesInDb = DbHelp.db.Queryable<ShelfInfo>().ToList();
|
var shelvesInDbQueryable = DbHelp.db.Queryable<ShelfInfo>();
|
||||||
|
if (LocalFile.Config.IsMx)
|
||||||
|
shelvesInDbQueryable = shelvesInDbQueryable.Where(t => t.GroupName == LocalFile.Config.GroupName);
|
||||||
|
var shelvesInDb = shelvesInDbQueryable.ToList();
|
||||||
foreach (var shelfInDb in shelvesInDb)
|
foreach (var shelfInDb in shelvesInDb)
|
||||||
{
|
{
|
||||||
Shelves.Add(InitShelf(shelfInDb));
|
Shelves.Add(InitShelf(shelfInDb));
|
||||||
|
@ -139,7 +139,6 @@ namespace WCS.BLL.Manager
|
|||||||
public static void SolveLoss(WebSocketMessageModel warning)
|
public static void SolveLoss(WebSocketMessageModel warning)
|
||||||
{
|
{
|
||||||
#region 【后台】丢失的数据处理
|
#region 【后台】丢失的数据处理
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//获取库位
|
//获取库位
|
||||||
@ -164,6 +163,12 @@ namespace WCS.BLL.Manager
|
|||||||
StoreId = storeInfo.Id,
|
StoreId = storeInfo.Id,
|
||||||
StoreInfo = storeInfo,
|
StoreInfo = storeInfo,
|
||||||
|
|
||||||
|
R = storeInfo.R,
|
||||||
|
C = storeInfo.C,
|
||||||
|
Wei = storeInfo.Wei,
|
||||||
|
BigShelfCode = storeInfo.BigShelfCode,
|
||||||
|
GroupName = storeInfo.GroupName,
|
||||||
|
|
||||||
MatSN = inventoryDetail.MatSN,
|
MatSN = inventoryDetail.MatSN,
|
||||||
MatCode = inventoryDetail.MatCode,
|
MatCode = inventoryDetail.MatCode,
|
||||||
MatName = inventoryDetail.MatName,
|
MatName = inventoryDetail.MatName,
|
||||||
@ -174,9 +179,29 @@ namespace WCS.BLL.Manager
|
|||||||
MatSupplier = inventoryDetail.MatSupplier,
|
MatSupplier = inventoryDetail.MatSupplier,
|
||||||
|
|
||||||
Direction = DirectionEnum.丢失,
|
Direction = DirectionEnum.丢失,
|
||||||
|
OperateUser = warning.SolvedUser,
|
||||||
};
|
};
|
||||||
DbHelp.db.Insertable(inOutRecord).ExecuteCommand();
|
DbHelp.db.Insertable(inOutRecord).ExecuteCommand();
|
||||||
DbHelp.db.Deleteable(inventoryDetail).ExecuteCommand();
|
DbHelp.db.Deleteable(inventoryDetail).ExecuteCommand();
|
||||||
|
|
||||||
|
#region 如果是出库 删除正在出库缓存的数据
|
||||||
|
if (warning.WarningType == WarningTypeEnum.出库自检丢失)
|
||||||
|
{
|
||||||
|
//清掉需要出库的缓存
|
||||||
|
var shelf = ShelfManager.Shelves
|
||||||
|
.Where(t => t.ShelfId == warning.ShelfId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (shelf != null)
|
||||||
|
{
|
||||||
|
var smartShelf = shelf as SmartShelf;
|
||||||
|
if (smartShelf != null)
|
||||||
|
{
|
||||||
|
smartShelf.CurrentOutStoreMatSNs.RemoveAll(t => t == inventoryDetail.MatSN);
|
||||||
|
//TODO 如何保证丢失的继续进行
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
DbHelp.db.CommitTran();
|
DbHelp.db.CommitTran();
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,13 @@ namespace WCS.BLL.Manager
|
|||||||
.UseAutoPong();//当收到ping报文时自动回应pong
|
.UseAutoPong();//当收到ping报文时自动回应pong
|
||||||
a.Add<WebSocketServicePlugin>();//自定义插件。
|
a.Add<WebSocketServicePlugin>();//自定义插件。
|
||||||
}));
|
}));
|
||||||
|
//客户端成功连接
|
||||||
|
service.Connected = (client, e) =>
|
||||||
|
{
|
||||||
|
Logs.Write("[WebSocket]" + client.GetIPPort() + "成功连接!", LogsType.StartBoot);
|
||||||
|
Console.WriteLine("[WebSocket]" + client.GetIPPort() +"成功连接!");
|
||||||
|
return EasyTask.CompletedTask;
|
||||||
|
};
|
||||||
service.Start();
|
service.Start();
|
||||||
Console.WriteLine("【启动WebSocket】结束");
|
Console.WriteLine("【启动WebSocket】结束");
|
||||||
Logs.Write("【启动WebSocket】结束", LogsType.StartBoot);
|
Logs.Write("【启动WebSocket】结束", LogsType.StartBoot);
|
||||||
|
@ -15,5 +15,7 @@ namespace WCS.BLL.Services.IService
|
|||||||
public Task<PageQueryResponse<InventoryDetail>> exportMatInventoryDetail(GetMatInventoryDetailRequest request);
|
public Task<PageQueryResponse<InventoryDetail>> exportMatInventoryDetail(GetMatInventoryDetailRequest request);
|
||||||
|
|
||||||
public Task<ResponseCommon<List<MatInventorySummaryModel>>> getMatInventorySummary(GetMatInventorySummaryRequest request);
|
public Task<ResponseCommon<List<MatInventorySummaryModel>>> getMatInventorySummary(GetMatInventorySummaryRequest request);
|
||||||
|
|
||||||
|
public Task<PageQueryResponse<InventoryDetail>> compareMatInventoryDetail(CompareMatInventoryDetailRequest request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ using WCS.DAL.Db;
|
|||||||
using WCS.DAL.DbModels;
|
using WCS.DAL.DbModels;
|
||||||
using WCS.Model;
|
using WCS.Model;
|
||||||
using WCS.Model.ApiModel.InOutRecord;
|
using WCS.Model.ApiModel.InOutRecord;
|
||||||
|
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||||
|
|
||||||
namespace WCS.BLL.Services.Service
|
namespace WCS.BLL.Services.Service
|
||||||
{
|
{
|
||||||
@ -180,7 +181,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
materialSpec = data.materialSpec,
|
materialSpec = data.materialSpec,
|
||||||
batchNo = data.batchNo,
|
batchNo = data.batchNo,
|
||||||
supplier = "",
|
supplier = "",
|
||||||
customer = data.materialBar,
|
customer = "",
|
||||||
|
|
||||||
InstoreUser = request.UserName
|
InstoreUser = request.UserName
|
||||||
};
|
};
|
||||||
@ -207,6 +208,47 @@ namespace WCS.BLL.Services.Service
|
|||||||
else if (Result != null && Result.Code == 200 && Result.Data == null)
|
else if (Result != null && Result.Code == 200 && Result.Data == null)
|
||||||
{
|
{
|
||||||
//Mes系统中未获取到物料信息
|
//Mes系统中未获取到物料信息
|
||||||
|
|
||||||
|
//简单校验看是否满足海康物料
|
||||||
|
//海康物料 只扫了外箱码 未扫条码
|
||||||
|
if ((request.MatSn.Length == 54 || request.MatSn.Length == 56) && !request.MatSn.Contains("\\") && !request.MatSn.Contains("/"))
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!request.SingleLightIn && shelf != null)
|
||||||
|
shelf.InStoreData = new MatInfoResponse()
|
||||||
|
{
|
||||||
|
materialBar = request.MatSn,
|
||||||
|
materialCode = "暂时未知",
|
||||||
|
materialName = "暂时未知",
|
||||||
|
materialQty = 0,
|
||||||
|
materialSpec = "暂时未知",
|
||||||
|
batchNo = "暂时未知",
|
||||||
|
supplier = "",
|
||||||
|
customer = "",
|
||||||
|
|
||||||
|
InstoreUser = request.UserName
|
||||||
|
};
|
||||||
|
|
||||||
|
var matInfo = new MatInfo()
|
||||||
|
{
|
||||||
|
MatSn = request.MatSn,
|
||||||
|
MatCode = "暂时未知",
|
||||||
|
MatName = "暂时未知",
|
||||||
|
MatBatch = "暂时未知",
|
||||||
|
MatQty = 0,
|
||||||
|
MatSpec = "暂时未知",
|
||||||
|
MatSupplier = "",
|
||||||
|
MatCustomer = "",
|
||||||
|
};
|
||||||
|
|
||||||
|
return new ResponseCommon<MatInfo>()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Data = matInfo,
|
||||||
|
Message = "success"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return new ResponseCommon<MatInfo>()
|
return new ResponseCommon<MatInfo>()
|
||||||
{
|
{
|
||||||
Code = 201,
|
Code = 201,
|
||||||
|
@ -6,6 +6,7 @@ using System.Text;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TouchSocket.Core;
|
using TouchSocket.Core;
|
||||||
|
using WCS.BLL.Config;
|
||||||
using WCS.BLL.DbModels;
|
using WCS.BLL.DbModels;
|
||||||
using WCS.BLL.Services.IService;
|
using WCS.BLL.Services.IService;
|
||||||
using WCS.DAL.Db;
|
using WCS.DAL.Db;
|
||||||
@ -149,5 +150,48 @@ namespace WCS.BLL.Services.Service
|
|||||||
Data = inventortyDetails
|
Data = inventortyDetails
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<PageQueryResponse<InventoryDetail>> compareMatInventoryDetail(CompareMatInventoryDetailRequest request)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//查询 本分组中 是否含有所传SN的物料
|
||||||
|
var recordsQueryable = DbHelp.db.Queryable<InventoryDetail>()
|
||||||
|
.Where(t => request.MatSns.Contains(t.MatSN))
|
||||||
|
.OrderBy(t => t.MatCode)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.StoreInfo.GroupName == LocalFile.Config.GroupName);
|
||||||
|
var totalCount = await recordsQueryable.CountAsync();
|
||||||
|
var records = await recordsQueryable.ToListAsync();
|
||||||
|
//生成序号 选中
|
||||||
|
for (int i = 0; i < records.Count; i++)
|
||||||
|
{
|
||||||
|
records[i].RowNumber = i + 1;
|
||||||
|
records[i].IsSelected = true;
|
||||||
|
}
|
||||||
|
return new PageQueryResponse<InventoryDetail>()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = $"success",
|
||||||
|
Data = new PageQueryResponseData<InventoryDetail>()
|
||||||
|
{
|
||||||
|
TotalCount = totalCount,
|
||||||
|
Count = records.Count,
|
||||||
|
Lists = records.ToList()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return new PageQueryResponse<InventoryDetail>()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = $"success",
|
||||||
|
Data = new PageQueryResponseData<InventoryDetail>()
|
||||||
|
{
|
||||||
|
Lists = new List<InventoryDetail>()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using SqlSugar;
|
using Microsoft.Data.SqlClient;
|
||||||
|
using SqlSugar;
|
||||||
using WCS.BLL.Config;
|
using WCS.BLL.Config;
|
||||||
using WCS.BLL.DbModels;
|
using WCS.BLL.DbModels;
|
||||||
using WCS.BLL.Manager;
|
using WCS.BLL.Manager;
|
||||||
@ -154,103 +155,262 @@ namespace WCS.BLL.Services.Service
|
|||||||
Message = "出库单据同步失败:缺少物料明细!"
|
Message = "出库单据同步失败:缺少物料明细!"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
//库存有无校验 & 库存已锁校验
|
//标准版逻辑-库存有无校验 & 库存已锁校验
|
||||||
try
|
if (!LocalFile.Config.IsMx)
|
||||||
{
|
{
|
||||||
await DbHelp.db.BeginTranAsync();
|
try
|
||||||
var inventoryDetails = await DbHelp.db.Queryable<InventoryDetail>()
|
|
||||||
.Where(t => request.SnList.Contains(t.MatSN))
|
|
||||||
.TranLock(DbLockType.Wait)
|
|
||||||
.ToListAsync();
|
|
||||||
if (inventoryDetails.Count < request.SnList.Count)//库存的物料少于需求的物料数量
|
|
||||||
{
|
{
|
||||||
var existsSns = inventoryDetails.Select(t => t.MatSN).ToList();
|
await DbHelp.db.BeginTranAsync();
|
||||||
request.SnList.RemoveAll(t => existsSns.Contains(t));
|
var inventoryDetails = await DbHelp.db.Queryable<InventoryDetail>()
|
||||||
await DbHelp.db.RollbackTranAsync();
|
.Where(t => request.SnList.Contains(t.MatSN))
|
||||||
//返回提示哪些物料库存不存在
|
.TranLock(DbLockType.Wait)
|
||||||
|
.ToListAsync();
|
||||||
|
if (inventoryDetails.Count < request.SnList.Count)//库存的物料少于需求的物料数量
|
||||||
|
{
|
||||||
|
var existsSns = inventoryDetails.Select(t => t.MatSN).ToList();
|
||||||
|
request.SnList.RemoveAll(t => existsSns.Contains(t));
|
||||||
|
await DbHelp.db.RollbackTranAsync();
|
||||||
|
//返回提示哪些物料库存不存在
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = "出库单据同步失败:存在物料不在库存中!",
|
||||||
|
Data = request.SnList
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else if (inventoryDetails.Where(t => t.IsLocked).Any())
|
||||||
|
{
|
||||||
|
await DbHelp.db.RollbackTranAsync();
|
||||||
|
//返回提示哪些物料库存已被锁定
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = "出库单据同步失败:存在物料被锁定!",
|
||||||
|
Data = inventoryDetails.Where(t => t.IsLocked).Select(t => t.MatSN).ToList()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 保存数据
|
||||||
|
|
||||||
|
//锁库存
|
||||||
|
inventoryDetails.ForEach(t =>
|
||||||
|
{
|
||||||
|
t.IsLocked = true;
|
||||||
|
});
|
||||||
|
var lockTask = DbHelp.db.Updateable(inventoryDetails).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
//保存数据
|
||||||
|
var order = new OutOrder()
|
||||||
|
{
|
||||||
|
OrderNumber = request.OrderNumber,
|
||||||
|
OrderSource = request.OrderSource,
|
||||||
|
OrderType = request.OrderType,
|
||||||
|
SyncType = SyncTypeEnum.ByMatSn,
|
||||||
|
CreateUser = request.UserName,
|
||||||
|
};
|
||||||
|
order.Id = await DbHelp.db.Insertable(order).ExecuteReturnIdentityAsync();
|
||||||
|
|
||||||
|
//通过库存数据保存出库物料明细表
|
||||||
|
var matDetailTasks = inventoryDetails.Select(async t =>
|
||||||
|
{
|
||||||
|
var orderMatDetail = new OutOrderMatDetail()
|
||||||
|
{
|
||||||
|
OrderId = order.Id,
|
||||||
|
OrderNumber = order.OrderNumber,
|
||||||
|
InventoryDetailId = t.Id,
|
||||||
|
StoreId = t.StoreId,
|
||||||
|
StoreCode = t.StoreCode,
|
||||||
|
MatSN = t.MatSN,
|
||||||
|
MatCode = t.MatCode,
|
||||||
|
MatName = t.MatName,
|
||||||
|
MatSpec = t.MatSpec,
|
||||||
|
MatBatch = t.MatBatch,
|
||||||
|
MatQty = t.MatQty,
|
||||||
|
MatSupplier = t.MatSupplier,
|
||||||
|
MatCustomer = t.MatCustomer,
|
||||||
|
CreateUser = request.UserName
|
||||||
|
};
|
||||||
|
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
await lockTask;
|
||||||
|
await Task.WhenAll(matDetailTasks);
|
||||||
|
|
||||||
|
await DbHelp.db.CommitTranAsync();
|
||||||
return new ResponseCommon()
|
return new ResponseCommon()
|
||||||
{
|
{
|
||||||
Code = 201,
|
Code = 200,
|
||||||
Message = "出库单据同步失败:存在物料不在库存中!",
|
Message = $"出库单据同步成功!\r\n出库单据号为{request.OrderNumber}",
|
||||||
Data = request.SnList
|
Data = order.Id
|
||||||
|
|
||||||
};
|
};
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
else if (inventoryDetails.Where(t => t.IsLocked).Any())
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
await DbHelp.db.RollbackTranAsync();
|
await DbHelp.db.RollbackTranAsync();
|
||||||
//返回提示哪些物料库存已被锁定
|
return new ResponseBase()
|
||||||
return new ResponseCommon()
|
|
||||||
{
|
{
|
||||||
Code = 201,
|
Code = 201,
|
||||||
Message = "出库单据同步失败:存在物料被锁定!",
|
Message = $"出库单据同步失败:{ex.Message}"
|
||||||
Data = inventoryDetails.Where(t => t.IsLocked).Select(t => t.MatSN).ToList()
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 保存数据
|
|
||||||
|
|
||||||
//锁库存
|
|
||||||
inventoryDetails.ForEach(t =>
|
|
||||||
{
|
|
||||||
t.IsLocked = true;
|
|
||||||
});
|
|
||||||
var lockTask = DbHelp.db.Updateable(inventoryDetails).ExecuteCommandAsync();
|
|
||||||
|
|
||||||
//保存数据
|
|
||||||
var order = new OutOrder()
|
|
||||||
{
|
|
||||||
OrderNumber = request.OrderNumber,
|
|
||||||
OrderSource = request.OrderSource,
|
|
||||||
OrderType = request.OrderType,
|
|
||||||
SyncType = SyncTypeEnum.ByMatSn,
|
|
||||||
CreateUser = request.UserName,
|
|
||||||
};
|
|
||||||
order.Id = await DbHelp.db.Insertable(order).ExecuteReturnIdentityAsync();
|
|
||||||
|
|
||||||
//通过库存数据保存出库物料明细表
|
|
||||||
var matDetailTasks = inventoryDetails.Select(async t =>
|
|
||||||
{
|
|
||||||
var orderMatDetail = new OutOrderMatDetail()
|
|
||||||
{
|
|
||||||
OrderId = order.Id,
|
|
||||||
OrderNumber = order.OrderNumber,
|
|
||||||
InventoryDetailId = t.Id,
|
|
||||||
StoreId = t.StoreId,
|
|
||||||
StoreCode = t.StoreCode,
|
|
||||||
MatSN = t.MatSN,
|
|
||||||
MatCode = t.MatCode,
|
|
||||||
MatName = t.MatName,
|
|
||||||
MatSpec = t.MatSpec,
|
|
||||||
MatBatch = t.MatBatch,
|
|
||||||
MatQty = t.MatQty,
|
|
||||||
MatSupplier = t.MatSupplier,
|
|
||||||
MatCustomer = t.MatCustomer,
|
|
||||||
CreateUser = request.UserName
|
|
||||||
};
|
|
||||||
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
|
||||||
}).ToList();
|
|
||||||
|
|
||||||
await lockTask;
|
|
||||||
await Task.WhenAll(matDetailTasks);
|
|
||||||
|
|
||||||
await DbHelp.db.CommitTranAsync();
|
|
||||||
return new ResponseCommon()
|
|
||||||
{
|
|
||||||
Code = 200,
|
|
||||||
Message = $"出库单据同步成功!\r\n出库单据号为{request.OrderNumber}",
|
|
||||||
Data = order.Id
|
|
||||||
};
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
//盟讯公司逻辑 不锁库存 直接保存数据/清除未发送的
|
||||||
|
else
|
||||||
{
|
{
|
||||||
await DbHelp.db.RollbackTranAsync();
|
try
|
||||||
return new ResponseBase()
|
|
||||||
{
|
{
|
||||||
Code = 201,
|
DbHelp.db.BeginTran();
|
||||||
Message = $"出库单据同步失败:{ex.Message}"
|
//1. 获取库存物料明细
|
||||||
};
|
var inventoryDetails = await DbHelp.db.Queryable<InventoryDetail>()
|
||||||
|
.Where(t => request.SnList.Contains(t.MatSN))
|
||||||
|
.ToListAsync();
|
||||||
|
if (inventoryDetails == null || inventoryDetails.Count == 0)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = "保存出库单失败!请重试!",
|
||||||
|
Data = request.SnList
|
||||||
|
};
|
||||||
|
}
|
||||||
|
//2. 先获取对应单号是否已经保存
|
||||||
|
var outOrder = DbHelp.db.Queryable<OutOrder>()
|
||||||
|
.Where(t => t.OrderNumber == request.OrderNumber)
|
||||||
|
.Where(t => t.GroupName == LocalFile.Config.GroupName)
|
||||||
|
.First();
|
||||||
|
//数据库中没有才添加
|
||||||
|
if (outOrder == null)
|
||||||
|
{
|
||||||
|
//OutOrder
|
||||||
|
outOrder = new OutOrder()
|
||||||
|
{
|
||||||
|
OrderNumber = request.OrderNumber,
|
||||||
|
OutOrderExeStatus = OutOrderExeStatus.开始发料,
|
||||||
|
OrderSource = "WCS前端",
|
||||||
|
SyncType = SyncTypeEnum.ByMatSn,
|
||||||
|
ShelfTypeName = "智能货架",
|
||||||
|
ShelfTypeId = 0,
|
||||||
|
GroupName = LocalFile.Config.GroupName,
|
||||||
|
};
|
||||||
|
outOrder.Id = await DbHelp.db.Insertable(outOrder).ExecuteReturnIdentityAsync();
|
||||||
|
outOrder = await DbHelp.db.Queryable<OutOrder>().Where(t => t.OrderNumber == request.OrderNumber)
|
||||||
|
.Where(t => t.Id == outOrder.Id)
|
||||||
|
.FirstAsync();
|
||||||
|
//保存单据失败了
|
||||||
|
if (outOrder == null)
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = "保存出库单失败!保存Order失败!",
|
||||||
|
Data = request.SnList
|
||||||
|
};
|
||||||
|
|
||||||
|
//出库物料明细
|
||||||
|
foreach (var item in inventoryDetails)
|
||||||
|
{
|
||||||
|
var orderMatDetail = new OutOrderMatDetail()
|
||||||
|
{
|
||||||
|
OrderId = outOrder.Id,
|
||||||
|
OrderNumber = outOrder.OrderNumber,
|
||||||
|
InventoryDetailId = item.Id,
|
||||||
|
StoreId = item.StoreId,
|
||||||
|
StoreCode = item.StoreCode,
|
||||||
|
MatSN = item.MatSN,
|
||||||
|
MatCode = item.MatCode,
|
||||||
|
MatName = item.MatName,
|
||||||
|
MatSpec = item.MatSpec,
|
||||||
|
MatBatch = item.MatBatch,
|
||||||
|
MatQty = item.MatQty,
|
||||||
|
MatSupplier = item.MatSupplier,
|
||||||
|
MatCustomer = item.MatCustomer,
|
||||||
|
CreateUser = request.UserName
|
||||||
|
};
|
||||||
|
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
DbHelp.db.CommitTran();
|
||||||
|
}
|
||||||
|
//数据库已有该Order
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outOrder.CreateTime = DateTime.Now;
|
||||||
|
DbHelp.db.Updateable(outOrder).ExecuteCommand();
|
||||||
|
//删除未出库的
|
||||||
|
var outOrderDetails = DbHelp.db.Deleteable<OutOrderMatDetail>()
|
||||||
|
.Where(t => t.OrderId == outOrder.Id)
|
||||||
|
.Where(t => t.IsSended == false)
|
||||||
|
.ExecuteCommand();
|
||||||
|
//当前已出库的 //已出库的也不在库存中了 应该查询不到了
|
||||||
|
//避免影响效率 就不查重了
|
||||||
|
foreach (var item in inventoryDetails)
|
||||||
|
{
|
||||||
|
var orderMatDetail = new OutOrderMatDetail()
|
||||||
|
{
|
||||||
|
OrderId = outOrder.Id,
|
||||||
|
OrderNumber = outOrder.OrderNumber,
|
||||||
|
InventoryDetailId = item.Id,
|
||||||
|
StoreId = item.StoreId,
|
||||||
|
StoreCode = item.StoreCode,
|
||||||
|
MatSN = item.MatSN,
|
||||||
|
MatCode = item.MatCode,
|
||||||
|
MatName = item.MatName,
|
||||||
|
MatSpec = item.MatSpec,
|
||||||
|
MatBatch = item.MatBatch,
|
||||||
|
MatQty = item.MatQty,
|
||||||
|
MatSupplier = item.MatSupplier,
|
||||||
|
MatCustomer = item.MatCustomer,
|
||||||
|
CreateUser = request.UserName
|
||||||
|
};
|
||||||
|
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
DbHelp.db.CommitTran();
|
||||||
|
|
||||||
|
//更新订单状态
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
if (outOrder != null)
|
||||||
|
{
|
||||||
|
#region 物料明细表是否已发完
|
||||||
|
var orderMatDetails = DbHelp.db.Queryable<OutOrderMatDetail>()
|
||||||
|
.Where(t => t.OrderId == outOrder.Id)
|
||||||
|
.ToList();
|
||||||
|
var isExistNoSendMat = orderMatDetails.Where(t => t.IsSended == false)
|
||||||
|
.Any();
|
||||||
|
if (isExistNoSendMat)
|
||||||
|
{
|
||||||
|
outOrder.OrderStatus = OutOrderStatus.部分发料;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outOrder.OrderStatus = OutOrderStatus.全部发料;
|
||||||
|
outOrder.OutOrderExeStatus = OutOrderExeStatus.发料完成;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
DbHelp.db.Updateable(outOrder).ExecuteCommand();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = $"Success",
|
||||||
|
Data = request.SnList
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DbHelp.db.RollbackTran();
|
||||||
|
Logs.Write($"同步出库单据发生异常{ex.Message}", LogsType.Info);
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"保存出库单失败!{ex.Message}!",
|
||||||
|
Data = request.SnList
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -887,7 +1047,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
t.GoOutOutstore();
|
t.GoOutOutstore();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return new ResponseCommon()
|
return new ResponseCommon()
|
||||||
{
|
{
|
||||||
|
@ -941,6 +941,12 @@ namespace WCS.BLL.Services.Service
|
|||||||
StoreCode = inventoryDetail.StoreCode,
|
StoreCode = inventoryDetail.StoreCode,
|
||||||
StoreId = inventoryDetail.StoreId,
|
StoreId = inventoryDetail.StoreId,
|
||||||
|
|
||||||
|
R = inventoryDetail.R,
|
||||||
|
C = inventoryDetail.C,
|
||||||
|
Wei = inventoryDetail.Wei,
|
||||||
|
BigShelfCode = inventoryDetail.BigShelfCode,
|
||||||
|
GroupName = inventoryDetail.GroupName,
|
||||||
|
|
||||||
MatSN = inventoryDetail.MatSN,
|
MatSN = inventoryDetail.MatSN,
|
||||||
MatCode = inventoryDetail.MatCode,
|
MatCode = inventoryDetail.MatCode,
|
||||||
MatName = inventoryDetail.MatName,
|
MatName = inventoryDetail.MatName,
|
||||||
|
@ -5,7 +5,9 @@ using System.Text;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TouchSocket.Core;
|
using TouchSocket.Core;
|
||||||
|
using WCS.BLL.Config;
|
||||||
using WCS.BLL.DbModels;
|
using WCS.BLL.DbModels;
|
||||||
|
using WCS.BLL.Manager;
|
||||||
using WCS.BLL.Services.IService;
|
using WCS.BLL.Services.IService;
|
||||||
using WCS.DAL;
|
using WCS.DAL;
|
||||||
using WCS.DAL.Db;
|
using WCS.DAL.Db;
|
||||||
@ -107,7 +109,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
shelfnfo.ClientIp = request.ShelfInfo.ClientIp;
|
shelfnfo.ClientIp = request.ShelfInfo.ClientIp;
|
||||||
shelfnfo.GroupName = request.ShelfInfo.GroupName;
|
shelfnfo.GroupName = request.ShelfInfo.GroupName;
|
||||||
shelfnfo.IsBind = request.ShelfInfo.IsBind;
|
shelfnfo.IsBind = request.ShelfInfo.IsBind;
|
||||||
shelfnfo.BindShelfCode = request.ShelfInfo.BindShelfCode;
|
shelfnfo.BigShelfCode = request.ShelfInfo.BigShelfCode;
|
||||||
|
|
||||||
var rowNum = await DbHelp.db.Updateable(shelfnfo).ExecuteCommandAsync();
|
var rowNum = await DbHelp.db.Updateable(shelfnfo).ExecuteCommandAsync();
|
||||||
if (rowNum == 0)
|
if (rowNum == 0)
|
||||||
@ -154,7 +156,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
ClientIp = request.ShelfInfo.ClientIp,
|
ClientIp = request.ShelfInfo.ClientIp,
|
||||||
GroupName = request.ShelfInfo.GroupName,
|
GroupName = request.ShelfInfo.GroupName,
|
||||||
IsBind = request.ShelfInfo.IsBind,
|
IsBind = request.ShelfInfo.IsBind,
|
||||||
BindShelfCode = request.ShelfInfo.BindShelfCode,
|
BigShelfCode = request.ShelfInfo.BigShelfCode,
|
||||||
};
|
};
|
||||||
var rowNum = await DbHelp.db.Insertable(newShelfInfo).ExecuteCommandAsync();
|
var rowNum = await DbHelp.db.Insertable(newShelfInfo).ExecuteCommandAsync();
|
||||||
if (rowNum == 0)
|
if (rowNum == 0)
|
||||||
@ -243,29 +245,36 @@ namespace WCS.BLL.Services.Service
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ResponseCommon<object>> GenerateStoreInfo()
|
public async Task<ResponseCommon<object>> GenerateStoreInfo()
|
||||||
{
|
{
|
||||||
var shelfInfo = await DbHelp.db.Queryable<ShelfInfo>().Where(t => t.ShelfCode == "C04-1").FirstAsync();
|
var shelfInfos = DbHelp.db.Queryable<ShelfInfo>().ToList();
|
||||||
var ModuleInfos = await DbHelp.db.Queryable<ModuleInfo>().Where(t => t.ShelfId == shelfInfo.Id).ToListAsync();
|
foreach (var shelfInfo in shelfInfos)
|
||||||
ModuleInfos.ForEach(moduleInfo =>
|
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= moduleInfo.LightCount; i++)
|
var ModuleInfos = await DbHelp.db.Queryable<ModuleInfo>().Where(t => t.ShelfId == shelfInfo.Id).ToListAsync();
|
||||||
|
ModuleInfos.ForEach(moduleInfo =>
|
||||||
{
|
{
|
||||||
var storeInfo = new StoreInfo()
|
for (int i = 1; i <= moduleInfo.LightCount; i++)
|
||||||
{
|
{
|
||||||
StoreCode = moduleInfo.ModuleCode + "-" + i.ToString(),
|
var storeInfo = new StoreInfo()
|
||||||
ModuleId = moduleInfo.Id,
|
{
|
||||||
ModuleCode = moduleInfo.ModuleCode,
|
StoreCode = moduleInfo.ModuleCode + "-" + i.ToString(),
|
||||||
ShelfId = shelfInfo.Id,
|
ShelfTypeId = 1,
|
||||||
ShelfCode = shelfInfo.ShelfCode,
|
ModuleId = moduleInfo.Id,
|
||||||
BoardId = moduleInfo.BoardId,
|
ModuleCode = moduleInfo.ModuleCode,
|
||||||
LightNumber = i,
|
ShelfId = shelfInfo.Id,
|
||||||
Priority = 1,
|
ShelfCode = shelfInfo.ShelfCode,
|
||||||
CurrentMatSn = string.Empty,
|
BoardId = moduleInfo.BoardId,
|
||||||
};
|
LightNumber = i,
|
||||||
DbHelp.db.Insertable(storeInfo).ExecuteCommand();
|
Priority = 1,
|
||||||
|
CurrentMatSn = string.Empty,
|
||||||
}
|
BigShelfCode = moduleInfo.Bigshelfcode,
|
||||||
});
|
R = moduleInfo.R,
|
||||||
|
C = moduleInfo.C,
|
||||||
|
Wei = i.ToString(),
|
||||||
|
GroupName = moduleInfo.GroupName,
|
||||||
|
};
|
||||||
|
DbHelp.db.Insertable(storeInfo).ExecuteCommand();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
return new ResponseCommon<object>() { Message = "111" };
|
return new ResponseCommon<object>() { Message = "111" };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,11 +342,16 @@ namespace WCS.BLL.Services.Service
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
DbHelp.db.BeginTran();
|
DbHelp.db.BeginTran();
|
||||||
//禁用需要删除当前库存数据
|
//禁用
|
||||||
if (request.DisableOrEnable == DisableOrEnableEnum.Disable)
|
if (request.DisableOrEnable == DisableOrEnableEnum.Disable)
|
||||||
{
|
{
|
||||||
moduleInfo.IsEnable = false;
|
moduleInfo.IsEnable = false;
|
||||||
|
//盟讯公司发送钉钉消息
|
||||||
|
if (LocalFile.Config.IsMx)
|
||||||
|
{
|
||||||
|
var DingDing = string.Empty;
|
||||||
|
MXBackgroundThread.SendDingDingMsg($"【智能货架】模组{moduleInfo.ModuleCode}被屏蔽", new List<string> { "104379", "103595" }, ref DingDing);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -444,6 +458,12 @@ namespace WCS.BLL.Services.Service
|
|||||||
StoreId = storeInfo.Id,
|
StoreId = storeInfo.Id,
|
||||||
StoreInfo = storeInfo,
|
StoreInfo = storeInfo,
|
||||||
|
|
||||||
|
R = storeInfo.R,
|
||||||
|
C = storeInfo.C,
|
||||||
|
Wei = storeInfo.Wei,
|
||||||
|
BigShelfCode = storeInfo.BigShelfCode,
|
||||||
|
GroupName = storeInfo.GroupName,
|
||||||
|
|
||||||
MatSN = inventory.MatSN,
|
MatSN = inventory.MatSN,
|
||||||
MatCode = inventory.MatCode,
|
MatCode = inventory.MatCode,
|
||||||
MatName = inventory.MatName,
|
MatName = inventory.MatName,
|
||||||
|
@ -26,6 +26,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (warning != null)
|
if (warning != null)
|
||||||
{
|
{
|
||||||
|
warning.SolvedUser = request.UserName;
|
||||||
WarningManager.ClearWarning(warning, request.SolveType);
|
WarningManager.ClearWarning(warning, request.SolveType);
|
||||||
}
|
}
|
||||||
//判断一下是否还存在对应报警
|
//判断一下是否还存在对应报警
|
||||||
|
@ -274,7 +274,7 @@ namespace WCS.BLL.Tool
|
|||||||
public static T GetDataFromHttp<T>(string url, object dataObj, string httpMethod, bool isSaveLog = false)
|
public static T GetDataFromHttp<T>(string url, object dataObj, string httpMethod, bool isSaveLog = false)
|
||||||
{
|
{
|
||||||
Guid guid = Guid.NewGuid();
|
Guid guid = Guid.NewGuid();
|
||||||
var data = JsonConvert.SerializeObject(dataObj);
|
var data = dataObj == null ? string.Empty : JsonConvert.SerializeObject(dataObj);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (isSaveLog)
|
if (isSaveLog)
|
||||||
|
@ -49,7 +49,7 @@ namespace WCS.DAL
|
|||||||
{
|
{
|
||||||
Id = 1,
|
Id = 1,
|
||||||
LoginName = "admin",
|
LoginName = "admin",
|
||||||
Password = "",
|
Password = "admin123",
|
||||||
RoleIds = new List<int> () { 1 },
|
RoleIds = new List<int> () { 1 },
|
||||||
IsAdmin = true,
|
IsAdmin = true,
|
||||||
Time = dt,
|
Time = dt,
|
||||||
|
@ -10,7 +10,7 @@ namespace WCS.DAL.Db.AuthDb
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户
|
/// 用户
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("User")]
|
[SugarTable("wcs_user")]
|
||||||
public class UserBase
|
public class UserBase
|
||||||
{
|
{
|
||||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
@ -37,6 +37,13 @@ namespace WCS.DAL.Db.AuthDb
|
|||||||
/// 是否最大权限
|
/// 是否最大权限
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsAdmin { get; set; }
|
public bool IsAdmin { get; set; }
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 是否是工程研发
|
||||||
|
///// </summary>
|
||||||
|
//[SugarColumn(ColumnName = "IsGCYF", IsNullable = true, ColumnDescription = "是否是工程研发人员")]
|
||||||
|
public bool IsGCYF { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建时间
|
/// 创建时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -52,7 +59,7 @@ namespace WCS.DAL.Db.AuthDb
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色
|
/// 角色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("Role")]
|
[SugarTable("wcs_role")]
|
||||||
public class RoleBase
|
public class RoleBase
|
||||||
{
|
{
|
||||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -21,11 +22,8 @@ namespace WCS.DAL.Db
|
|||||||
{
|
{
|
||||||
db.Aop.OnError = ex =>
|
db.Aop.OnError = ex =>
|
||||||
{
|
{
|
||||||
//TO DO LOG
|
|
||||||
//Logs.Write($@"{nameof(db)}{Environment.NewLine}SQL:{ex?.Sql}{Environment.NewLine}Parametres:{JsonConvert.SerializeObject(ex?.Parametres)}{Environment.NewLine}InnerException:{ex?.InnerException?.ToString()}{Environment.NewLine}Exception:{ex?.ToString()}{Environment.NewLine}", LogsType.DbErr);
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 日志数据库
|
/// 日志数据库
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -38,23 +36,7 @@ namespace WCS.DAL.Db
|
|||||||
{
|
{
|
||||||
db.Aop.OnError = ex =>
|
db.Aop.OnError = ex =>
|
||||||
{
|
{
|
||||||
//TO DO LOG
|
|
||||||
//Logs.Write($@"{nameof(dbAuth)}{Environment.NewLine}SQL:{ex?.Sql}{Environment.NewLine}Parametres:{JsonConvert.SerializeObject(ex?.Parametres)}{Environment.NewLine}InnerException:{ex?.InnerException?.ToString()}{Environment.NewLine}Exception:{ex?.ToString()}{Environment.NewLine}", LogsType.DbErr);
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
public static void InitDb()
|
|
||||||
{
|
|
||||||
//#region 初始化业务数据库
|
|
||||||
////不存在创建数据库,存在不会创建
|
|
||||||
//db.DbMaintenance.CreateDatabase();
|
|
||||||
////创建表根据实体类
|
|
||||||
//db.CodeFirst.InitTables(typeof(ModuleInfo), typeof(ShelfInfo), typeof(StoreInfo));
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
//#region 初始化日志数据库
|
|
||||||
//dbLog.DbMaintenance.CreateDatabase();
|
|
||||||
//#endregion
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
51
WCS.Model/ApiModel/MXBackgroundThread/ApiResult.cs
Normal file
51
WCS.Model/ApiModel/MXBackgroundThread/ApiResult.cs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class ApiResult
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 处理结果 200成功
|
||||||
|
/// </summary>
|
||||||
|
public int code { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 处理消息
|
||||||
|
/// </summary>
|
||||||
|
public string message { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ApiResult<T> : ApiResult
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据
|
||||||
|
/// </summary>
|
||||||
|
public T data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ApiResultMsg
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 处理结果 200成功
|
||||||
|
/// </summary>
|
||||||
|
public int code { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 处理消息
|
||||||
|
/// </summary>
|
||||||
|
public string msg { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ApiResultMsg<T> : ApiResultMsg
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据
|
||||||
|
/// </summary>
|
||||||
|
public T data { get; set; }
|
||||||
|
}
|
||||||
|
}
|
27
WCS.Model/ApiModel/MXBackgroundThread/BunkerOutRequest.cs
Normal file
27
WCS.Model/ApiModel/MXBackgroundThread/BunkerOutRequest.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class BunkerOutRequest
|
||||||
|
{
|
||||||
|
public string materialBar { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int outType { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string pickBillNumber { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int qty { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int warehouseType { get; set; } = 20;
|
||||||
|
}
|
||||||
|
}
|
25
WCS.Model/ApiModel/MXBackgroundThread/InputStockInRequest.cs
Normal file
25
WCS.Model/ApiModel/MXBackgroundThread/InputStockInRequest.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class InputStockInRequest
|
||||||
|
{
|
||||||
|
public string materialBar { get; set; }
|
||||||
|
|
||||||
|
public string shelfCode { get; set; }
|
||||||
|
|
||||||
|
public string shelfX { get; set; }
|
||||||
|
|
||||||
|
public string shelfY { get; set; }
|
||||||
|
|
||||||
|
public string shelfZ { get; set; }
|
||||||
|
|
||||||
|
public string inUser { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string inTime { get; set; }
|
||||||
|
|
||||||
|
public int warehouseType { get; set; } = 20;
|
||||||
|
}
|
||||||
|
}
|
14
WCS.Model/ApiModel/MXBackgroundThread/MXMesResponseCommon.cs
Normal file
14
WCS.Model/ApiModel/MXBackgroundThread/MXMesResponseCommon.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class MXMesResponseCommon
|
||||||
|
{
|
||||||
|
public int code { get; set; }
|
||||||
|
public string message { get; set; }
|
||||||
|
public string msg { get; set; }
|
||||||
|
public object data { get; set; }
|
||||||
|
}
|
||||||
|
}
|
72
WCS.Model/ApiModel/MXBackgroundThread/PickOrderRequest.cs
Normal file
72
WCS.Model/ApiModel/MXBackgroundThread/PickOrderRequest.cs
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class PickOrderRequest
|
||||||
|
{
|
||||||
|
public string orderProdNumber { get; set; }
|
||||||
|
public string orderWorkNumber { get; set; }
|
||||||
|
public string pickBillNumber { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PickOrderResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int code { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string msg { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<PickOrder> data { get; set; }
|
||||||
|
}
|
||||||
|
public class PickOrder
|
||||||
|
{
|
||||||
|
public bool IsSelected { get; set; }
|
||||||
|
public int id { get; set; }
|
||||||
|
public string pickBillNumber { get; set; }
|
||||||
|
public string relationPickNumber { get; set; }
|
||||||
|
public string orderProdIds { get; set; }
|
||||||
|
public string orderProdNumbers { get; set; }
|
||||||
|
public string orderWorkIds { get; set; }
|
||||||
|
public string orderWorkNumbers { get; set; }
|
||||||
|
public string dictType { get; set; }
|
||||||
|
public string dictTypeStr
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (dictType)
|
||||||
|
{
|
||||||
|
case "1":
|
||||||
|
return "生产领料";
|
||||||
|
default: return "其他";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string dictStatus { get; set; }
|
||||||
|
public string dictStatusStr
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (dictStatus)
|
||||||
|
{
|
||||||
|
case "15":
|
||||||
|
return "待领料";
|
||||||
|
case "10":
|
||||||
|
return "部分领料";
|
||||||
|
default: return dictStatus.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string createdBy { get; set; }
|
||||||
|
public string createdDt { get; set; }
|
||||||
|
public string updatedBy { get; set; }
|
||||||
|
public string updatedDt { get; set; }
|
||||||
|
}
|
||||||
|
}
|
49
WCS.Model/ApiModel/MXBackgroundThread/QueryByBar.cs
Normal file
49
WCS.Model/ApiModel/MXBackgroundThread/QueryByBar.cs
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class QueryBybarRequest
|
||||||
|
{
|
||||||
|
//条码
|
||||||
|
public string materialBar { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InStoreDto
|
||||||
|
{
|
||||||
|
public string materialBar { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string materialCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 有源蜂鸣器
|
||||||
|
/// </summary>
|
||||||
|
public string materialName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// TMB09A03/5X9电压3V
|
||||||
|
/// </summary>
|
||||||
|
public string materialSpec { get; set; }
|
||||||
|
|
||||||
|
public double materialQty { get; set; }
|
||||||
|
|
||||||
|
public string batchNo { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryBybarResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int code { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string message { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<InStoreDto> data { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class RecommendedBarCodeRequest
|
||||||
|
{
|
||||||
|
public string pickBillNumber { get; set; }
|
||||||
|
public string warehouseCode { get; set; } = string.Empty;
|
||||||
|
public int warehouseType { get; set; } = 10;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class FistPushRecommendedBarCodeRequest : RecommendedBarCodeRequest
|
||||||
|
{
|
||||||
|
public string reportSide { get; set; } = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RecommendedBarCodeResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int code { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string message { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<PickOrderDetailGetReturnList> data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PickOrderDetailGetReturnList
|
||||||
|
{
|
||||||
|
public bool IsInstore { get; set; }
|
||||||
|
public int id { get; set; }
|
||||||
|
public string materialBar { get; set; }
|
||||||
|
public string materialId { get; set; }
|
||||||
|
public string materialCode { get; set; }
|
||||||
|
public string materialName { get; set; }
|
||||||
|
public string materialSpec { get; set; }
|
||||||
|
public string unitOfMeasure { get; set; }
|
||||||
|
public string batchNo { get; set; }
|
||||||
|
public double qty { get; set; }
|
||||||
|
public string warehouseId { get; set; }
|
||||||
|
public string warehouseCode { get; set; }
|
||||||
|
public string warehouseName { get; set; }
|
||||||
|
public string shelfCode { get; set; }
|
||||||
|
public string shelfX { get; set; }
|
||||||
|
public string shelfY { get; set; }
|
||||||
|
public string shelfZ { get; set; }
|
||||||
|
public string inUser { get; set; }
|
||||||
|
public string inTime { get; set; }
|
||||||
|
public string outUser { get; set; }
|
||||||
|
public string outTime { get; set; }
|
||||||
|
public string createdBy { get; set; }
|
||||||
|
public string createdDt { get; set; }
|
||||||
|
public string updatedBy { get; set; }
|
||||||
|
public string updatedDt { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class SelectMaterialBarDto
|
||||||
|
{
|
||||||
|
public string materialBar { get; set; }
|
||||||
|
|
||||||
|
public string warehouseCode { get; set; }
|
||||||
|
|
||||||
|
public string warehouseName { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SelectMaterialBarResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int code { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string msg { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public SelectMaterialBarDto data { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MatInventoryDetail
|
||||||
|
{
|
||||||
|
public class CompareMatInventoryDetailRequest : RequestBase
|
||||||
|
{
|
||||||
|
public List<string> MatSns { get; set; }
|
||||||
|
|
||||||
|
public string GroupName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -24,7 +24,7 @@ namespace WCS.Model.ApiModel.StoreInfo
|
|||||||
|
|
||||||
public string C { get; set; }
|
public string C { get; set; }
|
||||||
|
|
||||||
public string? Bigshelfcode { get; set; }
|
public string? BigShelfCode { get; set; }
|
||||||
|
|
||||||
public bool IsEnable { get; set; }
|
public bool IsEnable { get; set; }
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ namespace WCS.Model.ApiModel.StoreInfo
|
|||||||
|
|
||||||
public bool IsBind { get; set; }
|
public bool IsBind { get; set; }
|
||||||
|
|
||||||
public string BindShelfCode { get; set; } = string.Empty;
|
public string BigShelfCode { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public int RowNumber { get; set; }
|
public int RowNumber { get; set; }
|
||||||
|
@ -4,7 +4,7 @@ using System.Text;
|
|||||||
|
|
||||||
namespace WCS.Model.WebSocketModel
|
namespace WCS.Model.WebSocketModel
|
||||||
{
|
{
|
||||||
public class SolveWarningRequest
|
public class SolveWarningRequest : RequestBase
|
||||||
{
|
{
|
||||||
public Guid Guid { get; set; }
|
public Guid Guid { get; set; }
|
||||||
public SolveTypeEnum SolveType { get; set; }
|
public SolveTypeEnum SolveType { get; set; }
|
||||||
|
@ -25,6 +25,12 @@ namespace WCS.Model.WebSocketModel
|
|||||||
|
|
||||||
//恢复正常需要消除的报警guid
|
//恢复正常需要消除的报警guid
|
||||||
public List<Guid> SolvedGuids { get; set; }
|
public List<Guid> SolvedGuids { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 异常处理人
|
||||||
|
/// </summary>
|
||||||
|
public string SolvedUser { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum WarningTypeEnum
|
public enum WarningTypeEnum
|
||||||
|
@ -44,7 +44,7 @@ namespace WCS.WebApi.Controllers
|
|||||||
[HttpGet("getLatestAppName")]
|
[HttpGet("getLatestAppName")]
|
||||||
public ResponseCommon<string> getLatestAppName()
|
public ResponseCommon<string> getLatestAppName()
|
||||||
{
|
{
|
||||||
string directoryPath = Path.Combine(Directory.GetCurrentDirectory(), $"Files");
|
string directoryPath = Path.Combine(AppContext.BaseDirectory, $"Files");
|
||||||
|
|
||||||
// 获取目录下的所有文件信息
|
// 获取目录下的所有文件信息
|
||||||
FileInfo[] files = Directory.GetFiles(directoryPath, "*.APK")
|
FileInfo[] files = Directory.GetFiles(directoryPath, "*.APK")
|
||||||
|
@ -86,5 +86,13 @@ namespace WCS.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
return await _matInventoryDetailService.getMatInventorySummary(request);
|
return await _matInventoryDetailService.getMatInventorySummary(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Route("compareMatInventoryDetail")]
|
||||||
|
[HttpPost(Name = "compareMatInventoryDetail")]
|
||||||
|
public async Task<ResponseBase> compareMatInventoryDetail(CompareMatInventoryDetailRequest request)
|
||||||
|
{
|
||||||
|
return await _matInventoryDetailService.compareMatInventoryDetail(request);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,60 +20,76 @@ namespace WebApi
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
//<2F><>ʼ<EFBFBD><CABC>websocket
|
try
|
||||||
WebSoceketManager.InitWebSocket();
|
|
||||||
|
|
||||||
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>
|
|
||||||
DbInit.InitDb();
|
|
||||||
|
|
||||||
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
||||||
LocalFile.SaveConfig();
|
|
||||||
|
|
||||||
//<2F><>ʼ<EFBFBD><CABC>TCP<43><50><EFBFBD><EFBFBD>
|
|
||||||
TCPClientManager.InitTcpClient();
|
|
||||||
|
|
||||||
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
ShelfManager.InitShelves();
|
|
||||||
|
|
||||||
|
|
||||||
WarningManager.StartWarningMessageThread();
|
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
|
||||||
|
|
||||||
// Add services to the container.
|
|
||||||
builder.Services.AddControllers();
|
|
||||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
||||||
builder.Services.AddEndpointsApiExplorer();
|
|
||||||
builder.Services.AddSwaggerGen();
|
|
||||||
|
|
||||||
builder.Services.AddScoped<IInstoreService, InstoreService>();
|
|
||||||
builder.Services.AddScoped<IOutstoreService, OutstoreService>();
|
|
||||||
builder.Services.AddScoped<IHomerService, HomerService>();
|
|
||||||
builder.Services.AddScoped<IUserService, UserService>();
|
|
||||||
builder.Services.AddScoped<IInterfaceRecordService, InterfaceRecordService>();
|
|
||||||
builder.Services.AddScoped<IMatBaseInfoService, MatBaseInfoService>();
|
|
||||||
builder.Services.AddScoped<IMatInventoryDetailService, MatInventoryDetailService>();
|
|
||||||
builder.Services.AddScoped<IStoreInfoService, StoreInfoService>();
|
|
||||||
builder.Services.AddScoped<IStockTakingService, StockTakingService>();
|
|
||||||
builder.Services.AddScoped<ISelfCheckService, SelfCheckService>();
|
|
||||||
builder.Services.AddScoped<IWarningService, WarningService>();
|
|
||||||
builder.Services.AddScoped<IInOutRecordService, InOutRecordService>();
|
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롢<EFBFBD><EBA1A2><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ģʽ
|
|
||||||
builder.Services.AddSingleton<IGenerateService, GenerateService>();
|
|
||||||
|
|
||||||
var app = builder.Build();
|
|
||||||
|
|
||||||
app.UseMiddleware<RequestResponseLoggingMiddleware>();
|
|
||||||
// Configure the HTTP request pipeline.
|
|
||||||
if (app.Environment.IsDevelopment())
|
|
||||||
{
|
{
|
||||||
app.UseSwagger();
|
//<2F><>ʼ<EFBFBD><CABC>websocket
|
||||||
app.UseSwaggerUI();
|
WebSoceketManager.InitWebSocket();
|
||||||
}
|
|
||||||
|
|
||||||
app.UseAuthorization();
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>
|
||||||
app.MapControllers();
|
DbInit.InitDb();
|
||||||
app.Run("http://0.0.0.0:8888");//0.0.0.0<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ipv4
|
|
||||||
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||||
|
LocalFile.SaveConfig();
|
||||||
|
|
||||||
|
//<2F><>ʼ<EFBFBD><CABC>TCP<43><50><EFBFBD><EFBFBD>
|
||||||
|
TCPClientManager.InitTcpClient();
|
||||||
|
|
||||||
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ܻ<EFBFBD><DCBB><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||||
|
ShelfManager.InitShelves();
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ط<EFBFBD><D8B7>߳<EFBFBD>
|
||||||
|
WarningManager.StartWarningMessageThread();
|
||||||
|
|
||||||
|
//<2F><>Ѷ<EFBFBD><D1B6>˾<EFBFBD><CBBE>̨<EFBFBD>߳<EFBFBD>
|
||||||
|
if (LocalFile.Config.IsMx)
|
||||||
|
{
|
||||||
|
MXBackgroundThread.InitBackgroundThread();
|
||||||
|
var str = string.Empty;
|
||||||
|
//MXBackgroundThread.SendDingDingMsg("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>", new List<string> { "104379" }, ref str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
// Add services to the container.
|
||||||
|
builder.Services.AddControllers();
|
||||||
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||||
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
builder.Services.AddSwaggerGen();
|
||||||
|
|
||||||
|
builder.Services.AddScoped<IInstoreService, InstoreService>();
|
||||||
|
builder.Services.AddScoped<IOutstoreService, OutstoreService>();
|
||||||
|
builder.Services.AddScoped<IHomerService, HomerService>();
|
||||||
|
builder.Services.AddScoped<IUserService, UserService>();
|
||||||
|
builder.Services.AddScoped<IInterfaceRecordService, InterfaceRecordService>();
|
||||||
|
builder.Services.AddScoped<IMatBaseInfoService, MatBaseInfoService>();
|
||||||
|
builder.Services.AddScoped<IMatInventoryDetailService, MatInventoryDetailService>();
|
||||||
|
builder.Services.AddScoped<IStoreInfoService, StoreInfoService>();
|
||||||
|
builder.Services.AddScoped<IStockTakingService, StockTakingService>();
|
||||||
|
builder.Services.AddScoped<ISelfCheckService, SelfCheckService>();
|
||||||
|
builder.Services.AddScoped<IWarningService, WarningService>();
|
||||||
|
builder.Services.AddScoped<IInOutRecordService, InOutRecordService>();
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롢<EFBFBD><EBA1A2><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ģʽ
|
||||||
|
builder.Services.AddSingleton<IGenerateService, GenerateService>();
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
app.UseMiddleware<RequestResponseLoggingMiddleware>();
|
||||||
|
// Configure the HTTP request pipeline.
|
||||||
|
if (app.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
app.UseAuthorization();
|
||||||
|
app.MapControllers();
|
||||||
|
app.Run("http://0.0.0.0:8888");//0.0.0.0<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ipv4
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex.Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||||||
-->
|
-->
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<DeleteExistingFiles>false</DeleteExistingFiles>
|
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
@ -13,5 +13,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||||||
<PublishUrl>bin\Release\net6.0\publish\</PublishUrl>
|
<PublishUrl>bin\Release\net6.0\publish\</PublishUrl>
|
||||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
<_TargetId>Folder</_TargetId>
|
<_TargetId>Folder</_TargetId>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||||
|
<ProjectGuid>118d453b-1693-4c00-8378-20ecbfcf2700</ProjectGuid>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
|
<PublishSingleFile>false</PublishSingleFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
@ -13,6 +13,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using WCS.Model;
|
using WCS.Model;
|
||||||
|
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||||
|
|
||||||
namespace 货架标准上位机.Api
|
namespace 货架标准上位机.Api
|
||||||
{
|
{
|
||||||
@ -320,5 +321,100 @@ namespace 货架标准上位机.Api
|
|||||||
return default(T);
|
return default(T);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 调用接口-长延时(MX MES接口返回时间偶尔10秒+为保证业务能正常进行所以增加此接口)
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <param name="url"></param>
|
||||||
|
/// <param name="httpMethod"></param>
|
||||||
|
/// <param name="isSaveLog"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ApiResult<T> MXGetDataFromHttpLongWait<T>(string data, string url, string httpMethod, bool isSaveLog = false)
|
||||||
|
{
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (isSaveLog)
|
||||||
|
Logs.Write($"【{guid}】开始请求调用接口 url:{url} 请求方式:{httpMethod} 数据:{data}");
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
request.Method = httpMethod;
|
||||||
|
request.ContentType = "application/json";
|
||||||
|
request.Timeout = 20000;
|
||||||
|
if (!string.IsNullOrEmpty(data))
|
||||||
|
{
|
||||||
|
string strContent = data; //参数data
|
||||||
|
using (StreamWriter dataStream = new StreamWriter(request.GetRequestStream()))
|
||||||
|
{
|
||||||
|
dataStream.Write(strContent);
|
||||||
|
dataStream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
string encoding = response.ContentEncoding;
|
||||||
|
if (encoding == null || encoding.Length < 1)
|
||||||
|
{
|
||||||
|
encoding = "UTF-8"; //默认编码
|
||||||
|
}
|
||||||
|
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding));
|
||||||
|
string retString = reader.ReadToEnd();
|
||||||
|
if (isSaveLog)
|
||||||
|
Logs.Write($"【{guid}】请求调用接口结束 返回数据为{retString}");
|
||||||
|
return JsonConvert.DeserializeObject<ApiResult<T>>(retString);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logs.Write($"【{guid}】请求调用遇到异常 异常信息为{ex.Message}");
|
||||||
|
return new ApiResult<T>()
|
||||||
|
{
|
||||||
|
code = 500,
|
||||||
|
message = ex.Message,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static ApiResult<T> MXGetDataFromHttp<T>(string data, string url, string httpMethod, bool isSaveLog = false)
|
||||||
|
{
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (isSaveLog)
|
||||||
|
Logs.Write($"【{guid}】开始请求调用接口 url:{url} 请求方式:{httpMethod} 数据:{data}");
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
request.Method = httpMethod;
|
||||||
|
request.ContentType = "application/json";
|
||||||
|
request.Timeout = 8000;
|
||||||
|
if (!string.IsNullOrEmpty(data))
|
||||||
|
{
|
||||||
|
string strContent = data; //参数data
|
||||||
|
using (StreamWriter dataStream = new StreamWriter(request.GetRequestStream()))
|
||||||
|
{
|
||||||
|
dataStream.Write(strContent);
|
||||||
|
dataStream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
string encoding = response.ContentEncoding;
|
||||||
|
if (encoding == null || encoding.Length < 1)
|
||||||
|
{
|
||||||
|
encoding = "UTF-8"; //默认编码
|
||||||
|
}
|
||||||
|
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding));
|
||||||
|
string retString = reader.ReadToEnd();
|
||||||
|
if (isSaveLog)
|
||||||
|
Logs.Write($"【{guid}】请求调用接口结束 返回数据为{retString}");
|
||||||
|
return JsonConvert.DeserializeObject<ApiResult<T>>(retString);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logs.Write($"【{guid}】请求调用遇到异常 异常信息为{ex.Message}");
|
||||||
|
return new ApiResult<T>()
|
||||||
|
{
|
||||||
|
code = 500,
|
||||||
|
message = ex.Message,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="clr-namespace:货架标准上位机"
|
xmlns:local="clr-namespace:货架标准上位机"
|
||||||
StartupUri="Views/MainWindows/MainWindow1.xaml"
|
|
||||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol">
|
xmlns:hc="https://handyorg.github.io/handycontrol">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
@ -3,8 +3,10 @@ using System.Collections.Generic;
|
|||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Management.Instrumentation;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace 货架标准上位机
|
namespace 货架标准上位机
|
||||||
{
|
{
|
||||||
@ -13,5 +15,20 @@ namespace 货架标准上位机
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnStartup(e);
|
||||||
|
|
||||||
|
if (LocalFile.Config.IsMx)
|
||||||
|
{
|
||||||
|
MainWindow = new MXMainWindow();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindow = new MainWindow1();
|
||||||
|
}
|
||||||
|
MainWindow.ShowDialog();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,26 @@ namespace 货架标准上位机
|
|||||||
/// 串口扫码枪延时
|
/// 串口扫码枪延时
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ScannerTimeOut { get; set; }
|
public int ScannerTimeOut { get; set; }
|
||||||
|
|
||||||
|
#region 盟讯公司配置
|
||||||
|
public bool IsMx { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///MX-获取要料单接口地址
|
||||||
|
/// </summary>
|
||||||
|
public string GetPickOrderUrl { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///MX-获取要料明细接口地址
|
||||||
|
/// </summary>
|
||||||
|
public string RecommendedBarCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///MX-首盘发料明细接口地址
|
||||||
|
/// </summary>
|
||||||
|
public string FirstSendRecommendedBarCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///MX-后续发料明细接口地址
|
||||||
|
/// </summary>
|
||||||
|
public string ElectronicSiloPush { get; set; }
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class JsSysConfig
|
public class JsSysConfig
|
||||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
305
货架标准上位机/ViewModels/MXViewModel/MXOutInventoryViewModel.cs
Normal file
305
货架标准上位机/ViewModels/MXViewModel/MXOutInventoryViewModel.cs
Normal file
@ -0,0 +1,305 @@
|
|||||||
|
using HandyControl.Controls;
|
||||||
|
using HandyControl.Data;
|
||||||
|
using MiniExcelLibs;
|
||||||
|
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.OutStore;
|
||||||
|
using WCS.Model.ApiModel.Stocktaking;
|
||||||
|
using 货架标准上位机.Api;
|
||||||
|
using 货架标准上位机.ViewModel;
|
||||||
|
|
||||||
|
namespace 货架标准上位机.ViewModel
|
||||||
|
{
|
||||||
|
public class MXOutInventoryViewModel : BindableBase
|
||||||
|
{
|
||||||
|
public MXOutInventoryViewModel()
|
||||||
|
{
|
||||||
|
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 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();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
#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 void RefreshOutOrderList(string OrderNumber = "")
|
||||||
|
{
|
||||||
|
#region 调用接口获取发料单
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var body = new GetOutOrderListByStatusRequest()
|
||||||
|
{
|
||||||
|
OrderExeStatus = new List<OutOrderExeStatus>() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 }
|
||||||
|
};
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
216
货架标准上位机/ViewModels/MXViewModel/MXOutOrderDetailViewViewModel.cs
Normal file
216
货架标准上位机/ViewModels/MXViewModel/MXOutOrderDetailViewViewModel.cs
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
using HandyControl.Controls;
|
||||||
|
using HandyControl.Data;
|
||||||
|
using MiniExcelLibs;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Ping9719.WpfEx.Mvvm;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using TouchSocket.Core;
|
||||||
|
using System.Windows.Markup;
|
||||||
|
using System.Security.Policy;
|
||||||
|
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||||
|
using 货架标准上位机;
|
||||||
|
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||||
|
using 货架标准上位机.Api;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using WCS.Model;
|
||||||
|
|
||||||
|
namespace 货架标准上位机.ViewModel
|
||||||
|
{
|
||||||
|
public class MXOutOrderDetailViewViewModel : BindableBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="billNumber"></param>
|
||||||
|
/// <param name="warehouseCode"></param>
|
||||||
|
/// <param name="orderProdNumbers"></param>
|
||||||
|
/// <param name="orderWorkNumbers"></param>
|
||||||
|
/// <param name="isFirstSend">是否是首盘发料</param>
|
||||||
|
public MXOutOrderDetailViewViewModel(
|
||||||
|
string billNumber, string warehouseCode
|
||||||
|
, string orderProdNumbers, string orderWorkNumbers
|
||||||
|
, int isFirstSend = 0, string reportSide = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
BillNumber = billNumber;
|
||||||
|
OrderProdNumbers = orderProdNumbers;
|
||||||
|
OrderWorkNumbers = orderWorkNumbers;
|
||||||
|
WarehouseCode = warehouseCode;
|
||||||
|
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
var request = new RecommendedBarCodeRequest()
|
||||||
|
{
|
||||||
|
pickBillNumber = billNumber,
|
||||||
|
warehouseCode = warehouseCode,
|
||||||
|
warehouseType = 20
|
||||||
|
};
|
||||||
|
var requeststr = JsonConvert.SerializeObject(request);
|
||||||
|
var url = string.Empty;
|
||||||
|
if (isFirstSend == 0)
|
||||||
|
{
|
||||||
|
url = LocalFile.Config.RecommendedBarCode;
|
||||||
|
}
|
||||||
|
else if (isFirstSend == 1)
|
||||||
|
{
|
||||||
|
request = new FistPushRecommendedBarCodeRequest()
|
||||||
|
{
|
||||||
|
pickBillNumber = billNumber,
|
||||||
|
warehouseCode = warehouseCode,
|
||||||
|
warehouseType = 20,
|
||||||
|
reportSide = reportSide,
|
||||||
|
};
|
||||||
|
requeststr = JsonConvert.SerializeObject(request);
|
||||||
|
url = LocalFile.Config.FirstSendRecommendedBarCode;
|
||||||
|
}
|
||||||
|
//后续料
|
||||||
|
else
|
||||||
|
{
|
||||||
|
url = LocalFile.Config.ElectronicSiloPush;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = ApiHelp.MXGetDataFromHttp<List<PickOrderDetailGetReturnList>>(requeststr, url, "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)
|
||||||
|
{
|
||||||
|
DataGridItemSource = Result.Data.Lists;
|
||||||
|
}
|
||||||
|
else if (Result != null && Result.Code == 200 && (Result.Data == null || Result.Data.Lists == null || Result.Data.Lists.Count == 0))
|
||||||
|
{
|
||||||
|
MessageBox.Show($"未查询到领料明细!所推荐物料在此货架上不存在,请确认是否在其他货架上!\r\n{string.Join(",\r\n", matSns)}");
|
||||||
|
DataGridItemSource = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show($"未查询到领料明细!请重试!");
|
||||||
|
DataGridItemSource = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"未查询到领料明细!请重试!");
|
||||||
|
DataGridItemSource = null;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
else if (result != null && result.code == 200 && (result.data == null || result.data.Count == 0))
|
||||||
|
{
|
||||||
|
Growl.Warning("未查询到物料明细!MES推荐物料明细为空!");
|
||||||
|
DataGridItemSource = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("未查询到领料明细!请求MES接口失败!");
|
||||||
|
DataGridItemSource = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
private int selectedCount;
|
||||||
|
public int SelectedCount
|
||||||
|
{
|
||||||
|
get { return selectedCount; }
|
||||||
|
set { SetProperty(ref selectedCount, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private int selectedPan;
|
||||||
|
public int SelectedPan
|
||||||
|
{
|
||||||
|
get { return selectedPan; }
|
||||||
|
set { SetProperty(ref selectedPan, value); }
|
||||||
|
}
|
||||||
|
//发料单号
|
||||||
|
private string billNumber;
|
||||||
|
public string BillNumber
|
||||||
|
{
|
||||||
|
get { return billNumber; }
|
||||||
|
set { SetProperty(ref billNumber, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
//订单号
|
||||||
|
private string orderProdNumbers;
|
||||||
|
public string OrderProdNumbers
|
||||||
|
{
|
||||||
|
get { return orderProdNumbers; }
|
||||||
|
set { SetProperty(ref orderProdNumbers, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
//工单号
|
||||||
|
private string orderWorkNumbers;
|
||||||
|
public string OrderWorkNumbers
|
||||||
|
{
|
||||||
|
get { return orderWorkNumbers; }
|
||||||
|
set { SetProperty(ref orderWorkNumbers, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
//输入的仓库代码
|
||||||
|
private string warehouseCode;
|
||||||
|
public string WarehouseCode
|
||||||
|
{
|
||||||
|
get { return warehouseCode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref warehouseCode, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<MatInventoryDetailModel> dataGridItemSource;
|
||||||
|
public List<MatInventoryDetailModel> DataGridItemSource
|
||||||
|
{
|
||||||
|
get { return dataGridItemSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref dataGridItemSource, value);
|
||||||
|
RefreshCount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void RefreshCount()
|
||||||
|
{
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SelectedCount = dataGridItemSource.Where(t => t.IsSelected == true).Sum(t => t.MatQty);
|
||||||
|
SelectedPan = dataGridItemSource.Where(t => t.IsSelected == true).Count();
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Command
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
132
货架标准上位机/ViewModels/MXViewModel/MXOutOrderViewModel.cs
Normal file
132
货架标准上位机/ViewModels/MXViewModel/MXOutOrderViewModel.cs
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
using HandyControl.Controls;
|
||||||
|
using HandyControl.Data;
|
||||||
|
using MiniExcelLibs;
|
||||||
|
using Ping9719.WpfEx.Mvvm;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using TouchSocket.Core;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||||
|
using 货架标准上位机.Api;
|
||||||
|
|
||||||
|
namespace 货架标准上位机.ViewModel
|
||||||
|
{
|
||||||
|
public class MXOutOrderViewModel : BindableBase
|
||||||
|
{
|
||||||
|
public MXOutOrderViewModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
private string matCode1;
|
||||||
|
public string MatCode1
|
||||||
|
{
|
||||||
|
get { return matCode1; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref matCode1, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string orderProdNumber;
|
||||||
|
public string OrderProdNumber
|
||||||
|
{
|
||||||
|
get { return orderProdNumber; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref orderProdNumber, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string orderWorkNumber;
|
||||||
|
public string OrderWorkNumber
|
||||||
|
{
|
||||||
|
get { return orderWorkNumber; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref orderWorkNumber, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string pickBillNumber;
|
||||||
|
public string PickBillNumber
|
||||||
|
{
|
||||||
|
get { return pickBillNumber; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref pickBillNumber, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string warehouseCode;
|
||||||
|
public string WarehouseCode
|
||||||
|
{
|
||||||
|
get { return warehouseCode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref warehouseCode, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private List<PickOrder> dataGridItemSource;
|
||||||
|
public List<PickOrder> DataGridItemSource
|
||||||
|
{
|
||||||
|
get { return dataGridItemSource; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref dataGridItemSource, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Command
|
||||||
|
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearch); }
|
||||||
|
public void BtnSearch()
|
||||||
|
{
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
var request = new PickOrderRequest()
|
||||||
|
{
|
||||||
|
orderProdNumber = OrderProdNumber,
|
||||||
|
orderWorkNumber = OrderWorkNumber,
|
||||||
|
pickBillNumber = PickBillNumber
|
||||||
|
};
|
||||||
|
var requeststr = JsonConvert.SerializeObject(request);
|
||||||
|
var result = ApiHelp.MXGetDataFromHttpLongWait<List<PickOrder>>(requeststr, LocalFile.Config.GetPickOrderUrl, "POST");
|
||||||
|
if (result != null && result.code == 200 && result.data != null && result.data.Count() > 0)
|
||||||
|
{
|
||||||
|
DataGridItemSource = result.data;
|
||||||
|
}
|
||||||
|
else if (result != null && result.code == 200 && (result.data == null || result.data.Count == 0))
|
||||||
|
{
|
||||||
|
result.message = "输入的搜索条件未查询到发料单信息!";
|
||||||
|
Growl.Warning(result.message);
|
||||||
|
DataGridItemSource = result.data;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("调用MES接口超时:搜索失败!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -33,7 +33,7 @@ namespace 货架标准上位机.ViewModel
|
|||||||
ClientIp = shelfInfoModel.ClientIp;
|
ClientIp = shelfInfoModel.ClientIp;
|
||||||
GroupName = shelfInfoModel.GroupName;
|
GroupName = shelfInfoModel.GroupName;
|
||||||
IsBind = shelfInfoModel.IsBind;
|
IsBind = shelfInfoModel.IsBind;
|
||||||
BindShelfCode = shelfInfoModel.BindShelfCode;
|
BigShelfCode = shelfInfoModel.BigShelfCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ namespace 货架标准上位机.ViewModel
|
|||||||
ClientIp = ClientIp,
|
ClientIp = ClientIp,
|
||||||
GroupName = GroupName,
|
GroupName = GroupName,
|
||||||
IsBind = IsBind,
|
IsBind = IsBind,
|
||||||
BindShelfCode = BindShelfCode,
|
BigShelfCode = BigShelfCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,13 +156,13 @@ namespace 货架标准上位机.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string bindShelfCode;
|
private string bigShelfCode;
|
||||||
public string BindShelfCode
|
public string BigShelfCode
|
||||||
{
|
{
|
||||||
get { return bindShelfCode; }
|
get { return bigShelfCode; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
SetProperty(ref bindShelfCode, value);
|
SetProperty(ref bigShelfCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
hc:BorderElement.CornerRadius="15"
|
hc:BorderElement.CornerRadius="15"
|
||||||
MinHeight="40"
|
MinHeight="40"
|
||||||
FontSize="20"
|
FontSize="20"
|
||||||
Content="结束入库"
|
Content="结束所有入库"
|
||||||
FontFamily="{StaticResource IconFont}"
|
FontFamily="{StaticResource IconFont}"
|
||||||
Command="{Binding BtnEndCommand}">
|
Command="{Binding BtnEndCommand}">
|
||||||
</Button>
|
</Button>
|
||||||
@ -42,17 +42,33 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Border Grid.Row="1" Margin="5,5,5,5" BorderThickness="1" Background="White" BorderBrush="DodgerBlue" CornerRadius="3">
|
<Grid Grid.Row="1">
|
||||||
<WrapPanel Name="scannersWrapPanel">
|
<Grid.ColumnDefinitions>
|
||||||
</WrapPanel>
|
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||||
</Border>
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Border Margin="5,5,5,5" Grid.Column="0" BorderThickness="1" Background="White" BorderBrush="DodgerBlue" CornerRadius="3">
|
||||||
|
<WrapPanel Name="scannersWrapPanel">
|
||||||
|
</WrapPanel>
|
||||||
|
</Border>
|
||||||
|
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<TextBlock Margin="5" FontWeight="Bold" FontSize="24" Text="停止入库扫码"></TextBlock>
|
||||||
|
<Image Margin="5" Width="120" Height="120" Source="/Resources/goOutInstore.png"></Image>
|
||||||
|
</StackPanel>
|
||||||
|
<!--<GroupBox Grid.Column="1" Header="停止入库码" Padding="10">-->
|
||||||
|
<!--<Border Background="{DynamicResource RegionBrush}" CornerRadius="4">-->
|
||||||
|
|
||||||
|
<!--</Border>-->
|
||||||
|
<!--</GroupBox>-->
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
<Border Grid.Row="2" Margin="5,5,5,5" BorderThickness="1" Background="White" BorderBrush="DodgerBlue" CornerRadius="3">
|
<Border Grid.Row="2" Margin="5,5,5,5" BorderThickness="1" Background="White" BorderBrush="DodgerBlue" CornerRadius="3">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<GroupBox Grid.Column="1" Background="White" Padding="0" Style="{StaticResource GroupBoxTab}">
|
<GroupBox Grid.Column="1" Background="White" Padding="0" Style="{StaticResource GroupBoxTab}">
|
||||||
<GroupBox.Header>
|
<GroupBox.Header>
|
||||||
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
||||||
|
@ -36,8 +36,10 @@ namespace 货架标准上位机
|
|||||||
t.ScannerDisplayControl = control;
|
t.ScannerDisplayControl = control;
|
||||||
scannersWrapPanel.Children.Add(control);
|
scannersWrapPanel.Children.Add(control);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
|
//ImageSource = new BitmapImage(new Uri("/Resources/goOutInstore.png"));
|
||||||
|
}
|
||||||
|
//public BitmapImage ImageSource { get; set; }
|
||||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||||
{
|
{
|
||||||
DataGrid datagrid = sender as DataGrid;
|
DataGrid datagrid = sender as DataGrid;
|
||||||
|
308
货架标准上位机/Views/MXWindows/MXMainWindow.xaml
Normal file
308
货架标准上位机/Views/MXWindows/MXMainWindow.xaml
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
<hc:Window xmlns:View="clr-namespace:货架标准上位机" x:Class="货架标准上位机.MXMainWindow"
|
||||||
|
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:local="clr-namespace:货架标准上位机"
|
||||||
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
|
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||||
|
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
mc:Ignorable="d" Closed="Window_Closed"
|
||||||
|
Title="{Binding Title}" NonClientAreaBackground="#FFDCEEFF" Height="800" Width="1280" Icon="/Resources/Logo.ico"
|
||||||
|
Background="#FFDCEEFF" WindowStartupLocation="CenterScreen" Loaded="load">
|
||||||
|
<!--标题栏-->
|
||||||
|
<hc:Window.NonClientAreaContent>
|
||||||
|
<StackPanel HorizontalAlignment="Right">
|
||||||
|
<Menu Height="29" Background="#FFDCEEFF">
|
||||||
|
<!--<MenuItem Height="29" Command="{Binding OpenUserCommand}" Visibility="{Binding IsLogin,Converter={StaticResource Boolean2VisibilityConverter}}">-->
|
||||||
|
<MenuItem Height="29" Command="{Binding OpenUserCommand}">
|
||||||
|
<MenuItem.Header>
|
||||||
|
<TextBlock Text="{Binding LoginName,Source={x:Static local:UserInfoView.viewModel},TargetNullValue=登录}" Foreground="DimGray" Margin="-5,0"></TextBlock>
|
||||||
|
</MenuItem.Header>
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<TextBlock Text="" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<!--<MenuItem Height="29" Width="35" Header="">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<TextBlock Text="" FontSize="15" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
<MenuItem Width="120" Header="蓝色">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<TextBlock Text="" Foreground="Blue" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Width="120" Header="紫色">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<TextBlock Text="" Foreground="Purple" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Width="120" Header="黑夜">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<TextBlock Text="" Foreground="Black" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
</MenuItem>-->
|
||||||
|
<MenuItem Height="29" Width="35">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<TextBlock Text="" FontSize="15" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
<MenuItem Width="120" Header="本地日志" Command="{Binding OpenLogCommand}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<TextBlock Text="" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Width="120" Header="操作说明" Command="{Binding OpenHelpCommand}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<TextBlock Text="" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem Width="120" Header="关 于" Command="{Binding OpenWeCommand}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<TextBlock Text="" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
</MenuItem.Icon>
|
||||||
|
</MenuItem>
|
||||||
|
</MenuItem>
|
||||||
|
</Menu>
|
||||||
|
</StackPanel>
|
||||||
|
</hc:Window.NonClientAreaContent>
|
||||||
|
<!--内容-->
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="3"></RowDefinition>
|
||||||
|
<RowDefinition Height="*"></RowDefinition>
|
||||||
|
<RowDefinition Height="auto"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<!--内容-->
|
||||||
|
<TabControl Grid.Row="1" TabStripPlacement="Left" Margin="5,0,5,2" Padding="0,0,3,0" BorderThickness="0" Style="{StaticResource TabControlRectangle}" PreviewKeyDown="tabControl_PreviewKeyDown">
|
||||||
|
<TabItem Padding="10,10,40,10" IsSelected="True">
|
||||||
|
<TabItem.Header>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||||
|
<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:HomeView />
|
||||||
|
</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.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:InInventoryView/>
|
||||||
|
</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.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:OutInventoryDocumentView/>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>-->
|
||||||
|
|
||||||
|
<TabItem IsSelected="{Binding GoToOutVentoryView}" 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:MXOutInventoryView/>
|
||||||
|
</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.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:StocktakingDocumentView/>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem IsSelected="{Binding GoToStockTakingView}" 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:StockTakingView/>
|
||||||
|
</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.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:MatInventoryDetailView/>
|
||||||
|
</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.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:InOutRecordView/>
|
||||||
|
</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.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
<TextBlock Margin="10,0,0,0" FontSize="16">库位管理</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem.Header>
|
||||||
|
<TabControl Style="{StaticResource TabControlBaseStyle.MouseOver}">
|
||||||
|
<TabItem Header="货架管理" >
|
||||||
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
|
<View:ShelfInfoView />
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="模组管理">
|
||||||
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
|
<View:ModuleInfoView />
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="库位管理">
|
||||||
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
|
<View:StoreInfoView />
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</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:MatBaseInfoView/>
|
||||||
|
</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.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:MatInfoView/>
|
||||||
|
</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.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:InterfaceRecordView/>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Padding="10,10,40,10" >
|
||||||
|
<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>
|
||||||
|
<TabControl Margin="5" Style="{StaticResource TabControlBaseStyle.MouseOver}">
|
||||||
|
<TabItem Header="角色管理">
|
||||||
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
|
<View:RoleView Margin="0,5"/>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="用户管理" >
|
||||||
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
|
<View:UserView Margin="0,5"/>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</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" HorizontalAlignment="Left">
|
||||||
|
<TextBlock Text="" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||||
|
<TextBlock Margin="10,0,0,0" FontSize="16">调试</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem.Header>
|
||||||
|
<TabControl Margin="5" Style="{StaticResource TabControlBaseStyle.MouseOver}">
|
||||||
|
<TabItem Header="PLC">
|
||||||
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
|
<View:DeviceView Margin="0,5"/>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="扫码枪">
|
||||||
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
|
<pi:TextBoxScanner Style="{StaticResource TextBoxExtend.Multi}" hc:InfoElement.Placeholder="鼠标点击此处激活" hc:InfoElement.Title="码信息" hc:InfoElement.TitlePlacement="Top" AutoClear="NextClear" IsAutoFocus="True"></pi:TextBoxScanner>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</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:SetView />
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
</TabControl>
|
||||||
|
<!--状态栏-->
|
||||||
|
<Border Margin="5,3" Grid.Row="2" Grid.ColumnSpan="2" Background="AliceBlue" CornerRadius="3">
|
||||||
|
<Grid>
|
||||||
|
<!--<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Left">
|
||||||
|
<pi:IotState Content="WebSocket连接" IsOk="False" Height="auto" Width="auto" InteriorHeight="13" Foreground="Gray" Background="{x:Null}"></pi:IotState>
|
||||||
|
<Button Content="手动重连" ></Button>
|
||||||
|
</StackPanel>-->
|
||||||
|
<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<TextBlock Margin="0,0" Text="{Binding Time,StringFormat=yyyy-MM-dd HH:mm:ss,FallbackValue=2000-01-01 00:00:00}" Foreground="#FF3A90C1" VerticalAlignment="Center"></TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<!--全局提示-->
|
||||||
|
<ScrollViewer Background="{x:Null}" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
||||||
|
<StackPanel Background="{x:Null}" hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,10" HorizontalAlignment="Right"/>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</hc:Window>
|
57
货架标准上位机/Views/MXWindows/MXMainWindow.xaml.cs
Normal file
57
货架标准上位机/Views/MXWindows/MXMainWindow.xaml.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Controls.Primitives;
|
||||||
|
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 System.Windows.Threading;
|
||||||
|
using 货架标准上位机.ViewModel;
|
||||||
|
using HandyControl.Controls;
|
||||||
|
|
||||||
|
namespace 货架标准上位机
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// MainWindow1.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class MXMainWindow : HandyControl.Controls.Window
|
||||||
|
{
|
||||||
|
public static MainViewModel viewModel = MainWindow.viewModel;
|
||||||
|
public MXMainWindow()
|
||||||
|
{
|
||||||
|
if (!viewModel.InitAgo())
|
||||||
|
{
|
||||||
|
this.Close();
|
||||||
|
System.Environment.Exit(0);
|
||||||
|
}
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = viewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void load(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
viewModel.Init(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tabControl_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
//取消tabControl快捷键切换
|
||||||
|
if (e.Key == Key.LeftCtrl || e.Key == Key.LeftCtrl || e.Key == Key.Tab)
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_Closed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
System.Environment.Exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
194
货架标准上位机/Views/MXWindows/MXOutInventoryView.xaml
Normal file
194
货架标准上位机/Views/MXWindows/MXOutInventoryView.xaml
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
<pi:UserControlBase
|
||||||
|
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||||
|
x:Class="货架标准上位机.MXOutInventoryView"
|
||||||
|
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:货架标准上位机="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="0.9*"></RowDefinition>
|
||||||
|
<RowDefinition Height="0.9*"></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>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
|
||||||
|
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||||
|
Grid.Column="3" MinHeight="45" FontSize="28" Content="开始发料" FontFamily="{StaticResource IconFont}"
|
||||||
|
Command="{Binding BtnStartCommand}"
|
||||||
|
>
|
||||||
|
</Button>
|
||||||
|
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
|
||||||
|
Grid.Column="4" 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="0" 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>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
hc:BorderElement.CornerRadius="15"
|
||||||
|
Background="Green" Foreground="White"
|
||||||
|
Grid.Column="1" MinHeight="45" FontSize="28" Content=" 发 料 单" FontFamily="{StaticResource IconFont}"
|
||||||
|
Command="{Binding BtnOutOrderCommand}">
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<StackPanel Grid.Column="2" VerticalAlignment="Center" Orientation="Horizontal">
|
||||||
|
<TextBlock FontSize="26" Text="发料单号:">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock FontSize="26" Text="{Binding SelectedOutOrderNumber}">
|
||||||
|
</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 FontSize="24">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding SelectedOutOrderNumber}" FontSize="24">
|
||||||
|
</TextBlock>
|
||||||
|
</StackPanel>-->
|
||||||
|
|
||||||
|
<DataGrid Grid.Row="0"
|
||||||
|
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||||
|
ItemsSource="{Binding DataGridItemSource}"
|
||||||
|
RowHeight="40"
|
||||||
|
AutoGenerateColumns="False" FontSize="15">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn Header="" CanUserResize="False" Width="50">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel>
|
||||||
|
<Ellipse Width="20" Height="20" Fill="LightGreen" 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 MaxWidth="100" IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn MaxWidth="150" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn MaxWidth="150" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn MaxWidth="150" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn MaxWidth="150" Header="规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn MaxWidth="150" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||||
|
|
||||||
|
<DataGridTextColumn IsReadOnly="False" Header="物料SN" 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="5*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
|
||||||
|
<TextBlock Text="当前状态:" FontSize="22">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding OrderStatus,FallbackValue=未知}" Foreground="Red" FontSize="22"></TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2">
|
||||||
|
<TextBlock Text="总盘数:" VerticalAlignment="Bottom" FontSize="22">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="22">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text=" 取料进度:" VerticalAlignment="Bottom" FontSize="22">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding SendedPan}" VerticalAlignment="Bottom" FontSize="22">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="/" VerticalAlignment="Bottom" FontSize="22">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="22">
|
||||||
|
</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</pi:UserControlBase>
|
69
货架标准上位机/Views/MXWindows/MXOutInventoryView.xaml.cs
Normal file
69
货架标准上位机/Views/MXWindows/MXOutInventoryView.xaml.cs
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
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 MXOutInventoryView : UserControlBase
|
||||||
|
{
|
||||||
|
public static MXOutInventoryViewModel viewModel = new MXOutInventoryViewModel();
|
||||||
|
public MXOutInventoryView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = viewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var viewModel = this.DataContext as InInventoryViewModel;
|
||||||
|
DataGrid datagrid = sender as DataGrid;
|
||||||
|
var index = datagrid.SelectedIndex;
|
||||||
|
if (index >= 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
datagrid.UnselectAllCells();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ListView_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
if (!e.Handled)
|
||||||
|
{
|
||||||
|
// ListView拦截鼠标滚轮事件
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
viewModel.RefreshOutOrderList(viewModel.SelectedOutOrderNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
80
货架标准上位机/Views/MXWindows/MXOutOrderDetailView.xaml
Normal file
80
货架标准上位机/Views/MXWindows/MXOutOrderDetailView.xaml
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<hc:Window x:Class="货架标准上位机.MXOutOrderDetailView"
|
||||||
|
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"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
|
Height="480" Width="800" WindowStyle="None" Background="{x:Null}" BorderThickness="0" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
|
||||||
|
<hc:Window.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
|
||||||
|
<Setter Property="Padding" Value="25,0"></Setter>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</hc:Window.Resources>
|
||||||
|
|
||||||
|
<Border Background="AliceBlue" CornerRadius="10" BorderThickness="1.5" BorderBrush="RosyBrown" >
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1.5*"></RowDefinition>
|
||||||
|
<RowDefinition Height="1.5*"></RowDefinition>
|
||||||
|
<RowDefinition Height="10*"></RowDefinition>
|
||||||
|
<RowDefinition Height="0.8*"></RowDefinition>
|
||||||
|
<RowDefinition Height="1.5*"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock FontSize="25" Name="Title" Text="发 料 明 细" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
|
<Button Margin="-5,-1" Visibility="{Binding IsClose,Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource CloseGeometry}" HorizontalAlignment="Right" VerticalAlignment="Top" Click="closeClick"/>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
|
<TextBlock FontSize="23" Text="当前发料单号:"></TextBlock>
|
||||||
|
<TextBlock FontSize="23" Text="{Binding BillNumber}"></TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
|
||||||
|
<Grid Margin="5,0" Grid.Row="2" >
|
||||||
|
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||||
|
RowHeight="39" ItemsSource="{Binding DataGridItemSource}"
|
||||||
|
AutoGenerateColumns="False" Name="dg1" FontSize="13">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn CanUserResize="False">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox Width="30" Height="30"
|
||||||
|
Checked="CheckBox_Checked"
|
||||||
|
Unchecked="CheckBox_Checked"
|
||||||
|
IsChecked="{Binding IsSelected , UpdateSourceTrigger=PropertyChanged}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox Width="30" Height="30" IsChecked="True" Unchecked="allChecked_Unchecked" Checked="allChecked_Checked" Name="allChecked"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="最小包装条码" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="入库时间" Binding="{Binding InstoreTime}"></DataGridTextColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</Grid>
|
||||||
|
<StackPanel Grid.Row="3" HorizontalAlignment="Right" Orientation="Horizontal" >
|
||||||
|
<TextBlock FontSize="20" Text="料盘数:"></TextBlock>
|
||||||
|
<TextBlock FontSize="20" Name="selectedPan" Text="{Binding SelectedPan}"></TextBlock>
|
||||||
|
|
||||||
|
<TextBlock FontSize="20" Text=" 已勾选数量:"></TextBlock>
|
||||||
|
<TextBlock FontSize="20" Name="selectedCount" Text="{Binding SelectedCount}"></TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="3" x:Name="spacingPanel" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<Button Margin="0" Content="确 认" Background="RosyBrown" Foreground="White" MinHeight="40" FontSize="21" Click="comfirmClick"/>
|
||||||
|
<TextBlock Margin="20" Text=""></TextBlock>
|
||||||
|
<Button Margin="0" Content="取 消" Background="CadetBlue" Foreground="White" MinHeight="40" FontSize="21" Click="closeClick"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</hc:Window>
|
158
货架标准上位机/Views/MXWindows/MXOutOrderDetailView.xaml.cs
Normal file
158
货架标准上位机/Views/MXWindows/MXOutOrderDetailView.xaml.cs
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
using HandyControl.Controls;
|
||||||
|
using HandyControl.Data;
|
||||||
|
using HandyControl.Tools.Extension;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Media;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using WCS.Model;
|
||||||
|
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||||
|
using 货架标准上位机.Api;
|
||||||
|
using 货架标准上位机.ViewModel;
|
||||||
|
using 货架标准上位机.Views.Controls;
|
||||||
|
|
||||||
|
namespace 货架标准上位机
|
||||||
|
{
|
||||||
|
public partial class MXOutOrderDetailView : HandyControl.Controls.Window
|
||||||
|
{
|
||||||
|
public MXOutOrderDetailViewViewModel viewModel;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="billNumber"></param>
|
||||||
|
/// <param name="warehouseCode"></param>
|
||||||
|
/// <param name="orderProdNumbers"></param>
|
||||||
|
/// <param name="orderWorkNumbers"></param>
|
||||||
|
/// <param name="isFirstSend">是否是首盘发料</param>
|
||||||
|
public MXOutOrderDetailView(string billNumber, string warehouseCode
|
||||||
|
, string orderProdNumbers, string orderWorkNumbers, int isFirstSend = 0, string reportSide = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
viewModel = new MXOutOrderDetailViewViewModel(billNumber, warehouseCode, orderProdNumbers, orderWorkNumbers, isFirstSend, reportSide);
|
||||||
|
this.DataContext = viewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.DialogResult = false;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||||
|
{
|
||||||
|
DataGrid datagrid = sender as DataGrid;
|
||||||
|
var index = datagrid.SelectedIndex;
|
||||||
|
if (index >= 0)
|
||||||
|
{
|
||||||
|
if (viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > index)
|
||||||
|
{
|
||||||
|
var data = viewModel.DataGridItemSource.ElementAt(index);
|
||||||
|
data.IsSelected = !data.IsSelected;
|
||||||
|
viewModel.DataGridItemSource = viewModel.DataGridItemSource.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datagrid.UnselectAllCells();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txtMatQty1_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||||
|
{
|
||||||
|
if (!Regex.IsMatch(e.Text, "^[0-9]"))
|
||||||
|
{
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MatInventoryDetailModel> DataGridItemSource = new List<MatInventoryDetailModel>();
|
||||||
|
|
||||||
|
private void comfirmClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.DialogResult = true;
|
||||||
|
if (viewModel.DataGridItemSource != null)
|
||||||
|
{
|
||||||
|
DataGridItemSource = viewModel.DataGridItemSource.Where(t => t.IsSelected).ToList();
|
||||||
|
|
||||||
|
if (DataGridItemSource != null && DataGridItemSource.Count > 0)
|
||||||
|
{
|
||||||
|
var dia = Dialog.Show(new TextDialog());
|
||||||
|
try
|
||||||
|
{
|
||||||
|
#region 调用接口保存出库单据
|
||||||
|
var body1 = new SysOutOrderByMatSnRequest()
|
||||||
|
{
|
||||||
|
OrderNumber = viewModel.BillNumber,
|
||||||
|
OrderType = "出库",
|
||||||
|
OrderSource = "WCS前端",
|
||||||
|
SnList = DataGridItemSource.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)
|
||||||
|
{
|
||||||
|
//出库单据保存成功 刷新左侧出库单列表
|
||||||
|
MXOutInventoryView.viewModel.RefreshOutOrderList(viewModel.BillNumber);
|
||||||
|
Growl.Success("出库单据保存成功,请点击【开始发料】进行发料!");
|
||||||
|
}
|
||||||
|
else if (Result1 != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result1.Message);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Growl.Error("保存出库单据失败:" + ex.Message);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
App.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
dia.Close();
|
||||||
|
dia.Collapse();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
viewModel.RefreshCount();
|
||||||
|
}
|
||||||
|
private void allChecked_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in viewModel.DataGridItemSource)
|
||||||
|
{
|
||||||
|
item.IsSelected = true;
|
||||||
|
}
|
||||||
|
viewModel.DataGridItemSource = viewModel.DataGridItemSource.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void allChecked_Unchecked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in viewModel.DataGridItemSource)
|
||||||
|
{
|
||||||
|
item.IsSelected = false;
|
||||||
|
}
|
||||||
|
viewModel.DataGridItemSource = viewModel.DataGridItemSource.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
123
货架标准上位机/Views/MXWindows/MXOutOrderView.xaml
Normal file
123
货架标准上位机/Views/MXWindows/MXOutOrderView.xaml
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<hc:Window x:Class="货架标准上位机.MXOutOrderView"
|
||||||
|
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"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
|
Height="500" Width="900" WindowStyle="None" BorderThickness="0" Background="{x:Null}" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
|
||||||
|
<hc:Window.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
|
||||||
|
<Setter Property="Padding" Value="25,0"></Setter>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</hc:Window.Resources>
|
||||||
|
|
||||||
|
<Border BorderThickness="1.5" BorderBrush="Black" Background="AliceBlue" CornerRadius="10" >
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1.5*"></RowDefinition>
|
||||||
|
<RowDefinition Height="1.5*"></RowDefinition>
|
||||||
|
<RowDefinition Height="9*"></RowDefinition>
|
||||||
|
<RowDefinition Height="1.5*"></RowDefinition>
|
||||||
|
<RowDefinition Height="1.5*"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock FontSize="25" Name="Title" Text="选 择 发 料 单" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
|
<Button Margin="-5,-1" Visibility="{Binding IsClose,Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource CloseGeometry}" HorizontalAlignment="Right" VerticalAlignment="Top" Click="closeClick"/>
|
||||||
|
|
||||||
|
<Border Grid.Row="1" Margin="2 2 2 0" Background="LightGray" Padding="0">
|
||||||
|
<Border Background="AliceBlue" Padding="0">
|
||||||
|
<Grid >
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.8*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="0.8*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="5" Grid.Column="0" Margin="2" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Text="订单号:">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBox MinWidth="120" Grid.Column="1" MaxWidth="120" Text="{Binding OrderProdNumber}" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Black" ></TextBox>
|
||||||
|
<TextBlock Grid.Column="2" Margin="10 2 2 2" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Text="工单号:">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBox Grid.Column="3" MinWidth="120" MaxWidth="120" Text="{Binding OrderWorkNumber}" PreviewTextInput="txtMatQty1_PreviewTextInput" Name="txtMatQty1" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Black" >
|
||||||
|
</TextBox>
|
||||||
|
<TextBlock Grid.Column="4" Margin="10 2 2 2" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Text="领料单号:">
|
||||||
|
</TextBlock>
|
||||||
|
<TextBox Grid.Column="5" MinWidth="120" MaxWidth="120" Text="{Binding PickBillNumber}" PreviewTextInput="txtMatQty1_PreviewTextInput" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Black" >
|
||||||
|
</TextBox>
|
||||||
|
|
||||||
|
<Button Grid.Column="6" Style="{StaticResource ButtonSuccess}"
|
||||||
|
Command="{Binding BtnSearchCommand}"
|
||||||
|
hc:BorderElement.CornerRadius="10"
|
||||||
|
MinHeight="35" FontSize="20" Content=" 搜索" FontFamily="{StaticResource IconFont}" />
|
||||||
|
|
||||||
|
|
||||||
|
<!--</StackPanel>-->
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<!--</TabItem>-->
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Grid Margin="5,0" Grid.Row="2" >
|
||||||
|
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||||
|
RowHeight="39" ItemsSource="{Binding DataGridItemSource}"
|
||||||
|
AutoGenerateColumns="False" Name="dg1" FontSize="13">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn CanUserResize="False">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<RadioButton Width="30" Height="30"
|
||||||
|
GroupName="111222333"
|
||||||
|
IsChecked="{Binding IsSelected , UpdateSourceTrigger=PropertyChanged}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="订单号" Binding="{Binding orderProdNumbers}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="工单号" Binding="{Binding orderWorkNumbers}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="领料单号" Binding="{Binding pickBillNumber}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="类型" Binding="{Binding dictTypeStr}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="状态" Binding="{Binding dictStatusStr}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="创建时间" Binding="{Binding createdDt}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="创建人" Binding="{Binding createdBy}"></DataGridTextColumn>
|
||||||
|
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
|
||||||
|
<TextBlock Margin="3" Text="仓库代码:" VerticalAlignment="Center" FontSize="26"></TextBlock>
|
||||||
|
<TextBox Margin="3" Name="txtWarehouseCode" FontSize="26" MinWidth="120" MaxWidth="120" Text="{Binding WarehouseCode}"></TextBox>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Margin="3" x:Name="spacingPanel" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<Button Margin="0" Content="全部发料" Background="ForestGreen" Foreground="White" MinHeight="40" FontSize="21" Click="comfirmClick">
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<TextBlock Margin="13 0 0 0" VerticalAlignment="Center" FontSize="20" Text=" AB面选择:"></TextBlock>
|
||||||
|
|
||||||
|
<ComboBox Name="reportSideCbx">
|
||||||
|
<ComboBoxItem></ComboBoxItem>
|
||||||
|
<ComboBoxItem>A</ComboBoxItem>
|
||||||
|
<ComboBoxItem>B</ComboBoxItem>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<Button Margin="0" Content="首盘发料" Background="RosyBrown" Foreground="White" MinHeight="40" FontSize="21" Click="comfirmClick">
|
||||||
|
</Button>
|
||||||
|
<Button Margin="0" Content="后续料" Background="RoyalBlue" Foreground="White" MinHeight="40" FontSize="21" Click="comfirmClick">
|
||||||
|
</Button>
|
||||||
|
<TextBlock Margin="13" Text=""></TextBlock>
|
||||||
|
<Button Margin="0" Content="取消" Background="CadetBlue" Foreground="White" MinHeight="40" FontSize="21" Click="closeClick"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</hc:Window>
|
156
货架标准上位机/Views/MXWindows/MXOutOrderView.xaml.cs
Normal file
156
货架标准上位机/Views/MXWindows/MXOutOrderView.xaml.cs
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
using HandyControl.Controls;
|
||||||
|
using HandyControl.Data;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics.Eventing.Reader;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Media;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using TouchSocket.Core;
|
||||||
|
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||||
|
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||||
|
using 货架标准上位机.ViewModel;
|
||||||
|
|
||||||
|
namespace 货架标准上位机
|
||||||
|
{
|
||||||
|
public partial class MXOutOrderView : HandyControl.Controls.Window
|
||||||
|
{
|
||||||
|
public MXOutOrderViewModel viewModel = new MXOutOrderViewModel();
|
||||||
|
public MXOutOrderView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = viewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.DialogResult = false;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||||
|
{
|
||||||
|
System.Windows.Controls.DataGrid datagrid = sender as System.Windows.Controls.DataGrid;
|
||||||
|
index = datagrid.SelectedIndex;
|
||||||
|
if (index >= 0)
|
||||||
|
{
|
||||||
|
if (viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > index)
|
||||||
|
{
|
||||||
|
var data = viewModel.DataGridItemSource.ElementAt(index);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var current = viewModel.DataGridItemSource.Where(t => t.IsSelected).First();
|
||||||
|
current.IsSelected = false;
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
data.IsSelected = true;
|
||||||
|
viewModel.DataGridItemSource = viewModel.DataGridItemSource.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//datagrid.UnselectAllCells();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txtMatQty1_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||||
|
{
|
||||||
|
if (!Regex.IsMatch(e.Text, "^[0-9]"))
|
||||||
|
{
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public PickOrder SelectedOrder { get; set; }
|
||||||
|
|
||||||
|
public List<MatInventoryDetailModel> inventoryDetails { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void comfirmClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var isFirstSend = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var button = sender as System.Windows.Controls.Button;
|
||||||
|
if (button != null)
|
||||||
|
{
|
||||||
|
if (button.Content.Equals("首盘发料"))
|
||||||
|
isFirstSend = 1;
|
||||||
|
else if (button.Content.Equals("全部发料"))
|
||||||
|
isFirstSend = 0;
|
||||||
|
else
|
||||||
|
isFirstSend = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logs.Write("button获取失败了!!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (viewModel.DataGridItemSource == null)
|
||||||
|
{
|
||||||
|
Growl.Warning("请搜索并选择领料单后进行确认!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectedOrder = viewModel.DataGridItemSource.Where(t => t.IsSelected).FirstOrDefault();
|
||||||
|
if (SelectedOrder == null)
|
||||||
|
{
|
||||||
|
Growl.Warning("请选择领料单后进行确认!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SelectedOrder.pickBillNumber.Contains("SCLL"))
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(viewModel.WarehouseCode))
|
||||||
|
{
|
||||||
|
Growl.Warning("请输入仓库代码!");
|
||||||
|
txtWarehouseCode.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(viewModel.WarehouseCode))
|
||||||
|
{
|
||||||
|
|
||||||
|
Growl.Warning("非生产领料无需输入仓库代码!");
|
||||||
|
txtWarehouseCode.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
viewModel.WarehouseCode = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Hide();
|
||||||
|
var detailWindow = new MXOutOrderDetailView(SelectedOrder.pickBillNumber, viewModel.WarehouseCode
|
||||||
|
, SelectedOrder.orderProdNumbers, SelectedOrder.orderWorkNumbers, isFirstSend, reportSideCbx.Text
|
||||||
|
);
|
||||||
|
System.Windows.Interop.WindowInteropHelper mainUI = new System.Windows.Interop.WindowInteropHelper(detailWindow);
|
||||||
|
mainUI.Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
|
||||||
|
|
||||||
|
detailWindow.ShowDialog();
|
||||||
|
if (detailWindow.DialogResult == true && detailWindow.DataGridItemSource != null && detailWindow.DataGridItemSource.Count > 0)
|
||||||
|
{
|
||||||
|
inventoryDetails = detailWindow.DataGridItemSource;
|
||||||
|
//LocalStatic.CurrentPickBillNumber = SelectedOrder.pickBillNumber;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
this.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -27,7 +27,10 @@ namespace 货架标准上位机
|
|||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
if (!viewModel.InitAgo())
|
if (!viewModel.InitAgo())
|
||||||
|
{
|
||||||
this.Close();
|
this.Close();
|
||||||
|
System.Environment.Exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||||
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
Closed="Window_Closed"
|
||||||
Title="{Binding Title}" NonClientAreaBackground="#FFDCEEFF" Height="800" Width="1280" Icon="/Resources/Logo.ico"
|
Title="{Binding Title}" NonClientAreaBackground="#FFDCEEFF" Height="800" Width="1280" Icon="/Resources/Logo.ico"
|
||||||
Background="#FFDCEEFF" WindowStartupLocation="CenterScreen" Loaded="load">
|
Background="#FFDCEEFF" WindowStartupLocation="CenterScreen" Loaded="load">
|
||||||
<!--标题栏-->
|
<!--标题栏-->
|
||||||
|
@ -29,8 +29,10 @@ namespace 货架标准上位机
|
|||||||
public MainWindow1()
|
public MainWindow1()
|
||||||
{
|
{
|
||||||
if (!viewModel.InitAgo())
|
if (!viewModel.InitAgo())
|
||||||
|
{
|
||||||
this.Close();
|
this.Close();
|
||||||
|
System.Environment.Exit(0);
|
||||||
|
}
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.DataContext = viewModel;
|
this.DataContext = viewModel;
|
||||||
}
|
}
|
||||||
@ -46,5 +48,10 @@ namespace 货架标准上位机
|
|||||||
if (e.Key == Key.LeftCtrl || e.Key == Key.LeftCtrl || e.Key == Key.Tab)
|
if (e.Key == Key.LeftCtrl || e.Key == Key.LeftCtrl || e.Key == Key.Tab)
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Window_Closed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
System.Environment.Exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
<DataGridTextColumn IsReadOnly="True" Header="R" Binding="{Binding R}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="R" Binding="{Binding R}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="C" Binding="{Binding C}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="C" Binding="{Binding C}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="是否启用" Binding="{Binding IsEnable,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="是否启用" Binding="{Binding IsEnable,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="绑定后货架编码" Binding="{Binding BindShelfCode}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="绑定后货架编码" Binding="{Binding BigShelfCode}"></DataGridTextColumn>
|
||||||
<DataGridTemplateColumn CanUserResize="False" Width="auto">
|
<DataGridTemplateColumn CanUserResize="False" Width="auto">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
|
@ -121,9 +121,9 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Margin="5">
|
<StackPanel Orientation="Horizontal" Margin="5">
|
||||||
<TextBlock Text="绑定后货架编码:" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
<TextBlock Text="绑定后货架编码:" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
||||||
<TextBox Name="txtBindShelfCode" MinWidth="150" MaxWidth="150" Grid.Row="0" Grid.Column="1" FontSize="15"
|
<TextBox Name="txtBigShelfCode" MinWidth="150" MaxWidth="150" Grid.Row="0" Grid.Column="1" FontSize="15"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||||
Text="{Binding BindShelfCode}"
|
Text="{Binding BigShelfCode}"
|
||||||
Style="{StaticResource TextBoxExtend}">
|
Style="{StaticResource TextBoxExtend}">
|
||||||
</TextBox>
|
</TextBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
@ -69,10 +69,10 @@ namespace 货架标准上位机
|
|||||||
txtGroupName.Focus();
|
txtGroupName.Focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ViewModel.IsBind && string.IsNullOrEmpty(ViewModel.BindShelfCode))
|
if (ViewModel.IsBind && string.IsNullOrEmpty(ViewModel.BigShelfCode))
|
||||||
{
|
{
|
||||||
Growl.Warning("需要绑定的货架需要输入绑定后货架编码!");
|
Growl.Warning("需要绑定的货架需要输入绑定后货架编码!");
|
||||||
txtBindShelfCode.Focus();
|
txtBigShelfCode.Focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -120,7 +120,7 @@
|
|||||||
<DataGridTextColumn IsReadOnly="True" Header="TCP连接信息" Binding="{Binding ClientIp}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="TCP连接信息" Binding="{Binding ClientIp}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="货架区域(组别)" Binding="{Binding GroupName}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="货架区域(组别)" Binding="{Binding GroupName}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="是否绑定" Binding="{Binding IsBind,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="是否绑定" Binding="{Binding IsBind,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="绑定后货架编码" Binding="{Binding BindShelfCode}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="绑定后货架编码" Binding="{Binding BigShelfCode}"></DataGridTextColumn>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
AutoGenerateColumns="False" Name="dg1" FontSize="13">
|
AutoGenerateColumns="False" Name="dg1" FontSize="13">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="已盘点" Binding="{Binding IsStocktaking,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="盘点单据编码" Binding="{Binding StocktakingOrderNumber}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="盘点单据编码" Binding="{Binding StocktakingOrderNumber}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||||
@ -37,7 +38,6 @@
|
|||||||
<DataGridTextColumn IsReadOnly="True" Header="物料规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="物料规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="物料批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="物料批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="是否盘点" Binding="{Binding IsStocktaking}"></DataGridTextColumn>
|
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="盘点数量" Binding="{Binding StocktakingQty}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="盘点数量" Binding="{Binding StocktakingQty}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="物料SN" Binding="{Binding MatSN}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="物料SN" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
|
@ -114,6 +114,8 @@ namespace 货架标准上位机
|
|||||||
{
|
{
|
||||||
Guid = _warning.Guid,
|
Guid = _warning.Guid,
|
||||||
SolveType = clikename == "确认" ? SolveTypeEnum.处理 : SolveTypeEnum.忽略,
|
SolveType = clikename == "确认" ? SolveTypeEnum.处理 : SolveTypeEnum.忽略,
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = "WCS前端",
|
||||||
};
|
};
|
||||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<object>>(LocalFile.Config.ApiIpHost + "warning/solveWarning", body, "POST");
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<object>>(LocalFile.Config.ApiIpHost + "warning/solveWarning", body, "POST");
|
||||||
if (Result != null && Result.Code == 200)
|
if (Result != null && Result.Code == 200)
|
||||||
|
@ -3,8 +3,10 @@ using Newtonsoft.Json;
|
|||||||
using Ping9719.WpfEx;
|
using Ping9719.WpfEx;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.Eventing.Reader;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using TouchSocket.Core;
|
using TouchSocket.Core;
|
||||||
@ -30,12 +32,33 @@ namespace 货架标准上位机
|
|||||||
{
|
{
|
||||||
a.Add<WebSocketClientPlugin>();
|
a.Add<WebSocketClientPlugin>();
|
||||||
//配置心跳
|
//配置心跳
|
||||||
a.UseWebSocketHeartbeat()//使用心跳插件
|
//a.UseWebSocketHeartbeat()//使用心跳插件
|
||||||
.SetTick(TimeSpan.FromSeconds(5));//每5秒ping一次。
|
// .SetTick(TimeSpan.FromSeconds(5));//每5秒ping一次。
|
||||||
//配置断线重连
|
//配置断线重连
|
||||||
a.UseReconnection(-1, true, 1000);//-1表示一直重连
|
a.UseReconnection(-1, true, 1000);//-1表示一直重连
|
||||||
}));
|
}));
|
||||||
client.Connect();
|
client.Connect();
|
||||||
|
//自定义实现心跳和重连
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
await Task.Delay(4000);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WebSocket.client.Ping();
|
||||||
|
await Task.Delay(200);
|
||||||
|
if (WebSocket.client.LastReceivedTime < DateTime.Now.AddSeconds(-10))
|
||||||
|
{
|
||||||
|
WebSocket.client.TryConnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class WebSocketClientPlugin : PluginBase, IWebSocketReceivedPlugin
|
public class WebSocketClientPlugin : PluginBase, IWebSocketReceivedPlugin
|
||||||
@ -75,7 +98,10 @@ namespace 货架标准上位机
|
|||||||
switch (warning.WarningType)
|
switch (warning.WarningType)
|
||||||
{
|
{
|
||||||
case WarningTypeEnum.通知刷新出库:
|
case WarningTypeEnum.通知刷新出库:
|
||||||
OutVentoryView.viewModel.RefreshDataGridItemSource();
|
if (LocalFile.Config.IsMx)
|
||||||
|
MXOutInventoryView.viewModel.RefreshDataGridItemSource();
|
||||||
|
else
|
||||||
|
OutVentoryView.viewModel.RefreshDataGridItemSource();
|
||||||
client.Send(e.DataFrame.ToText());
|
client.Send(e.DataFrame.ToText());
|
||||||
break;
|
break;
|
||||||
case WarningTypeEnum.通知刷新盘点:
|
case WarningTypeEnum.通知刷新盘点:
|
||||||
@ -97,7 +123,6 @@ namespace 货架标准上位机
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
WarningManager.AddWarning(warning);
|
WarningManager.AddWarning(warning);
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
//连接不上加:SslMode=none;
|
//连接不上加:SslMode=none;
|
||||||
"MySql": "server=localhost;Database=db1;Uid=root;Pwd=123456;Convert Zero Datetime=True",
|
"MySql": "server=localhost;Database=db1;Uid=root;Pwd=123456;Convert Zero Datetime=True",
|
||||||
//货架服务器的IP和端口号
|
//货架服务器的IP和端口号
|
||||||
"ApiIpHost": "http://127.0.0.1:8888/",
|
"ApiIpHost": "http://192.168.5.84:8888/",
|
||||||
//WebSocket的地址
|
//WebSocket的地址
|
||||||
"WebSocketUrl": "ws://127.0.0.1:7789/ws",
|
"WebSocketUrl": "ws://192.168.5.84:7789/ws",
|
||||||
//货架分区
|
//货架分区
|
||||||
"GroupName": [ "13寸智能货架", "7寸智能货架" ],
|
"GroupName": [ "C0"],
|
||||||
//设备类型 可以配置为每个电脑不一样
|
//设备类型 可以配置为每个电脑不一样
|
||||||
"DeviceType": "WCS前端",
|
"DeviceType": "WCS前端",
|
||||||
//货架类型的是否开机自检
|
//货架类型的是否开机自检
|
||||||
@ -15,6 +15,16 @@
|
|||||||
"ScannerComList": [],
|
"ScannerComList": [],
|
||||||
//串口扫码枪延时
|
//串口扫码枪延时
|
||||||
"ScannerTimeOut": 2000,
|
"ScannerTimeOut": 2000,
|
||||||
|
//盟讯公司配置-是否是盟讯
|
||||||
|
"IsMX": true,
|
||||||
|
//盟讯公司配置-获取要料单
|
||||||
|
"GetPickOrderUrl": "http://192.168.2.23:9289/integrate/inOut/missPickListR",
|
||||||
|
//盟讯公司配置-获取要料明细接口
|
||||||
|
"RecommendedBarCode": "http://192.168.2.23:9289/integrate/inOut/recommendedBarCode",
|
||||||
|
//盟讯公司配置-首盘发料获取要料单明细
|
||||||
|
"FirstSendRecommendedBarCode": "http://192.168.2.23:9213/integrate/inOut/firstsetPush",
|
||||||
|
//盟讯公司配置-后续发料获取要料单明细
|
||||||
|
"ElectronicSiloPush": "http://192.168.2.23:9213/integrate/inOut/electronicSiloPush",
|
||||||
//系统配置
|
//系统配置
|
||||||
"Sys": {
|
"Sys": {
|
||||||
//是否保存登录历史
|
//是否保存登录历史
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Fonts\iconfont.ttf" />
|
<None Remove="Fonts\iconfont.ttf" />
|
||||||
<None Remove="Resources\cloud.png" />
|
<None Remove="Resources\cloud.png" />
|
||||||
|
<None Remove="Resources\goOutInstore.png" />
|
||||||
<None Remove="Resources\Logo.ico" />
|
<None Remove="Resources\Logo.ico" />
|
||||||
<None Remove="Resources\Logo.png" />
|
<None Remove="Resources\Logo.png" />
|
||||||
<None Remove="Resources\LogoAll.zip" />
|
<None Remove="Resources\LogoAll.zip" />
|
||||||
@ -73,6 +74,9 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Resource>
|
</Resource>
|
||||||
<Resource Include="Resources\cloud.png" />
|
<Resource Include="Resources\cloud.png" />
|
||||||
|
<Resource Include="Resources\goOutInstore.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Resource>
|
||||||
<Resource Include="Resources\Logo.ico" />
|
<Resource Include="Resources\Logo.ico" />
|
||||||
<Resource Include="Resources\Logo.png" />
|
<Resource Include="Resources\Logo.png" />
|
||||||
<Resource Include="Resources\主页.png" />
|
<Resource Include="Resources\主页.png" />
|
||||||
|
Reference in New Issue
Block a user