2
This commit is contained in:
@ -1,105 +0,0 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WCS.BLL.HardWare;
|
||||
|
||||
namespace WCS.DAL.DbModels
|
||||
{
|
||||
///<summary>
|
||||
///模组信息表
|
||||
///</summary>
|
||||
[SugarTable("wcs_module_info")]
|
||||
public class ModuleInfo
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 主键 Id 自增
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模组编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "module_code", Length = 50, IsNullable = false, ColumnDescription = "模组编码")]
|
||||
public string ModuleCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架类型Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "shelf_type_id", IsNullable = false,DefaultValue ="0", ColumnDescription = "货架类型Id")]
|
||||
public int ShelfTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "shelf_id", IsNullable = false, ColumnDescription = "货架Id")]
|
||||
public int ShelfId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "shelf_code", Length = 50, IsNullable = false, ColumnDescription = "货架编码;货架一般按照报警灯来区分 一个报警灯指示的是一个货架")]
|
||||
public string ShelfCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 板子的Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "board_id", IsNullable = false, ColumnDescription = "模组pcb板id")]
|
||||
public int BoardId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 板子上第几个灯
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "light_count", IsNullable = false, ColumnDescription = "板子上灯的数量")]
|
||||
public int LightCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 对应Can模块的Ip
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "client_ip", Length = 50, IsNullable = false, ColumnDescription = "货架对应Can模块的Ip")]
|
||||
public string CleintIp { get; set; }
|
||||
/// <summary>
|
||||
/// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "group_name", Length = 50, IsNullable = false, ColumnDescription = "货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)")]
|
||||
public string GroupName { get; set; }
|
||||
/// <summary>
|
||||
/// R 行
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "R", Length = 50, IsNullable = false, ColumnDescription = "R 行")]
|
||||
public string R { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// C 列
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "C", Length = 50, IsNullable = false, ColumnDescription = " C 列")]
|
||||
public string C { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 串联后大货架编码;大货架编码:未串联时是与货架编码是一对一的关系;串联后与货架编码是一对多的关系
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "big_shelf_code", Length = 50, IsNullable = true, ColumnDescription = "串联后大货架编码;大货架编码:未串联时是与货架编码是一对一的关系;串联后与货架编码是一对多的关系")]
|
||||
public string? Bigshelfcode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "is_enable", IsNullable = false, ColumnDescription = "串联后大货架编码;大货架编码:未串联时是与货架编码是一对一的关系;串联后与货架编码是一对多的关系")]
|
||||
public bool IsEnable { get; set; } = true;
|
||||
|
||||
[SugarColumn(ColumnName = "current_mode", IsNullable = true, ColumnDescription = "串联后大货架编码;大货架编码:未串联时是与货架编码是一对一的关系;串联后与货架编码是一对多的关系")]
|
||||
public Mode CurrentMode { get; set; } = Mode.待机模式;
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public int RowNumber { get; set; }
|
||||
/// <summary>
|
||||
/// 是否已经选择
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public bool IsSelected { get; set; }
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WCS.Model.ApiModel.OutStore;
|
||||
|
||||
namespace WCS.BLL.DbModels
|
||||
{
|
||||
[SugarTable("order_light")]
|
||||
public class OrderLight
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键 自增Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出库单据号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "order_number", Length = 50, IsNullable = true, ColumnDescription = "出库单据号")]
|
||||
public string OrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单据执行状态: 待发料, 开始发料, 暂停发料, 发料完成
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "order_exe_status", IsNullable = true, ColumnDescription = "执行状态:\t待发料,\t开始发料,\t暂停发料,\t发料完成")]
|
||||
public OutOrderExeStatus OutOrderExeStatus { get; set; } = OutOrderExeStatus.待发料;
|
||||
|
||||
/// <summary>
|
||||
/// 单灯颜色
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "lightcolor", Length = 50, IsNullable = false, ColumnDescription = "单灯颜色")]
|
||||
public string LightColor { get; set; }
|
||||
}
|
||||
}
|
@ -27,26 +27,6 @@ namespace WCS.BLL.HardWare
|
||||
ClientIp = shelfInfo.ClientIp;
|
||||
LightId = shelfInfo.LightId;
|
||||
WarningLight = new WarningLight() { LightId = shelfInfo.LightId };
|
||||
|
||||
//初始化Module
|
||||
Task.Run(() =>
|
||||
{
|
||||
var modules = DbHelp.db.Queryable<ModuleInfo>().Where(t => t.ShelfId == ShelfId).ToList();
|
||||
foreach (var module in modules)
|
||||
{
|
||||
Modules.Add(new SmartShelfModule()
|
||||
{
|
||||
ModuleId = module.Id,
|
||||
ModuleCode = module.ModuleCode,
|
||||
BoardId = module.BoardId,
|
||||
IsEnable = module.IsEnable,
|
||||
CurrentMode = module.CurrentMode
|
||||
});
|
||||
}
|
||||
ModulesStr = string.Join(";", Modules.Select(t => t.ModuleCode));
|
||||
|
||||
ModuleIds = Modules.Select(t => t.BoardId).ToList();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,11 +70,11 @@ namespace WCS.BLL.Manager
|
||||
DbHelp.dbLog.DbMaintenance.CreateDatabase();
|
||||
Logs.Write("【初始化数据库】创建数据库", LogsType.StartBoot);
|
||||
|
||||
DbHelp.db.CodeFirst.InitTables(typeof(ModuleInfo), typeof(ShelfInfo), typeof(StoreInfo)
|
||||
DbHelp.db.CodeFirst.InitTables( typeof(ShelfInfo), typeof(StoreInfo)
|
||||
, typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail)
|
||||
, typeof(MatBaseInfo), typeof(MatInfo)
|
||||
, typeof(StockTakingOrder), typeof(StockTakingOrderMatDetail), typeof(InOutRecord)
|
||||
, typeof(DocumentSerialNumber), typeof(OrderLight), typeof(MatInfoLog)
|
||||
, typeof(DocumentSerialNumber), typeof(MatInfoLog)
|
||||
, typeof(AppVersion)
|
||||
);
|
||||
|
||||
|
@ -190,52 +190,6 @@ namespace WCS.BLL.Manager
|
||||
var DingDing = string.Empty;
|
||||
MXBackgroundThread.SendDingDingMsg($"【智能货架】库位{storeInfo.StoreCode}被 {warning.SolvedUser} “未扫描上架弹窗”屏蔽,请及时调查或维保硬件!", new List<string> { "104379", "103595" }, ref DingDing);
|
||||
Logs.Write($"【智能货架】库位{storeInfo.StoreCode}被 {warning.SolvedUser} “未扫描上架弹窗”屏蔽,请及时调查或维保硬件!");
|
||||
#region 计算库位禁用率并发送
|
||||
Task.Run(() =>
|
||||
{
|
||||
var disabledStore = DbHelp.db.Queryable<StoreInfo>()
|
||||
.Where(t => t.CurrentMatSn == "禁用")
|
||||
.ToList();
|
||||
var allStore = DbHelp.db.Queryable<StoreInfo>()
|
||||
.ToList();
|
||||
|
||||
var disabledCount = disabledStore.Count();
|
||||
var allCount = allStore.Count();
|
||||
|
||||
var disabledACount = disabledStore.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
var allACount = allStore.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
|
||||
var disabledCCount = disabledStore.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
var allCCount = allStore.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
|
||||
|
||||
var disabledModule = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.Where(t => t.IsEnable == false)
|
||||
.ToList();
|
||||
var allModule = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.ToList();
|
||||
|
||||
var disabledModuleCount = disabledModule.Count();
|
||||
var allModuleCount = allModule.Count();
|
||||
|
||||
var disabledAModuleCount = disabledModule.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
var allAModuleCount = allModule.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
|
||||
var disabledCModuleCount = disabledModule.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
var allCModuleCount = allModule.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
|
||||
var message = $"【智能货架】当前库位总数{allCount},禁用总数{disabledCount},禁用率{((double)disabledCount / allCount).ToString("P")}," +
|
||||
$"其中A区库位总数{allACount},禁用数{disabledACount},禁用率{((double)disabledACount / allACount).ToString("P")}," +
|
||||
$"C区库位总数{allCCount},禁用数{disabledCCount},禁用率{((double)disabledCCount / allCCount).ToString("P")}。\r\n" +
|
||||
$"当前模组总数{allModuleCount},禁用总数{disabledModuleCount},禁用率{((double)disabledModuleCount / allModuleCount).ToString("P")}," +
|
||||
$"其中A区模组总数{allAModuleCount},禁用数{disabledAModuleCount},禁用率{((double)disabledAModuleCount / allAModuleCount).ToString("P")}," +
|
||||
$"C区模组总数{allCModuleCount},禁用数{disabledCModuleCount},禁用率{((double)disabledCModuleCount / allCModuleCount).ToString("P")}。";
|
||||
|
||||
Logs.Write(message);
|
||||
var dd = string.Empty;
|
||||
MXBackgroundThread.SendDingDingMsg(message, new List<string> { "104379", "103595" }, ref dd);
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,9 +15,6 @@ namespace WCS.BLL.Services.IService
|
||||
public Task<ResponseBase> queryByMatSn(QueryByMatSnRequest request);
|
||||
public Task<ResponseBase> queryByMatSnOut(QueryByMatSnRequest request);
|
||||
public Task<ResponseBase> queryInstoreStatus(QueryByMatSnRequest request);
|
||||
public Task<ResponseBase> queryInstoreStatusSingle(QueryByMatSnRequestSingle request);
|
||||
|
||||
public Task<ResponseBase> debugStoreinfoSingle(DebugStoreinfoSingleRequest request);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -29,10 +29,8 @@ namespace WCS.BLL.Services.IService
|
||||
|
||||
public Task<ResponseBase> GoOutOutstore(GetOutOrderDetailRequest request);
|
||||
|
||||
public Task<ResponseBase> GoInOutstoreSingle(GetOutOrderDetailRequest request);
|
||||
|
||||
public Task<ResponseBase> SingleLightConfirmOutstore(OutOrderMatDetailModelSingle request);
|
||||
|
||||
public Task<ResponseBase> GoOutOutstoreSingle(GetOutOrderDetailRequest request);
|
||||
}
|
||||
}
|
||||
|
@ -27,38 +27,6 @@ namespace WCS.BLL.Services.IService
|
||||
/// <returns></returns>
|
||||
public Task<ResponseCommon<object>> addOrUpdateShelfInfo(AddShelfInfoRequest<ShelfInfo> request);
|
||||
|
||||
|
||||
public Task<ResponseCommon<object>> GenerateStoreInfo();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询模组列表
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public Task<PageQueryResponse<ModuleInfo>> GetModules(GetModulesRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// 禁用或启用模组
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public Task<ResponseCommon> disableOrEnableModule(DisableOrEnableModuleRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// 查询模组电压值
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public Task<ResponseCommon> queryModuleVoltage(QueryModuleVoltageRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// 标定+设置偏移量
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public Task<ResponseCommon> calibrationSetOffset(CalibrationSetOffsetRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// 查询库位列表
|
||||
/// </summary>
|
||||
@ -73,6 +41,5 @@ namespace WCS.BLL.Services.IService
|
||||
/// <returns></returns>
|
||||
public Task<ResponseCommon> disableOrEnableStore(DisableOrEnableStoreRequest request);
|
||||
|
||||
public Task<ResponseCommon> getDisablePercent();
|
||||
}
|
||||
}
|
||||
|
@ -435,143 +435,5 @@ namespace WCS.BLL.Services.Service
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<ResponseBase> queryInstoreStatusSingle(QueryByMatSnRequestSingle request)
|
||||
{
|
||||
//获取货架
|
||||
List<ModuleInfo> MI = DbHelp.db.Queryable<ModuleInfo>().Where(it => it.ModuleCode == request.ShelfCode).ToList();
|
||||
if (MI.Count == 0)
|
||||
{
|
||||
return new ResponseCommonSingle()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"货架[{request.ShelfCode}]不存在!",
|
||||
};
|
||||
}
|
||||
ResponseCommonSingle rcs = new ResponseCommonSingle();
|
||||
rcs.Data = new List<Detail>();
|
||||
|
||||
string sendIP = MI[0].CleintIp; //单灯IP
|
||||
int PCBId = MI[0].BoardId; //单灯PCB板ID
|
||||
|
||||
List<StoreInfo> SI = DbHelp.db.Queryable<StoreInfo>().Where(it => it.ModuleCode == request.ShelfCode).ToList();
|
||||
|
||||
List<ShelfInfo> si = DbHelp.db.Queryable<ShelfInfo>().Where(it => it.ShelfCode == MI[0].ShelfCode).ToList();
|
||||
int warnLightID = si[0].LightId;
|
||||
|
||||
foreach (QueryByMatSnRequestSingle.MatSnListDetail matSnListDetail in request.MatSnList)
|
||||
{
|
||||
Detail detail = new Detail();
|
||||
try
|
||||
{
|
||||
InventoryDetail inventoryDetail = new InventoryDetail();
|
||||
inventoryDetail.MatSN = matSnListDetail.MatSn;
|
||||
inventoryDetail.MatCode = matSnListDetail.MatCode;
|
||||
inventoryDetail.MatName = matSnListDetail.MatName;
|
||||
inventoryDetail.MatSpec = matSnListDetail.MatSpec;
|
||||
inventoryDetail.MatBatch = matSnListDetail.MatBatch;
|
||||
inventoryDetail.MatQty = matSnListDetail.MatQty;
|
||||
inventoryDetail.MatCustomer = matSnListDetail.MatCustomer;
|
||||
inventoryDetail.MatSupplier = matSnListDetail.MatSupplier;
|
||||
inventoryDetail.StoreCode = request.ShelfCode;
|
||||
inventoryDetail.StoreId = SI[0].Id;
|
||||
inventoryDetail.GroupName = SI[0].GroupName;
|
||||
|
||||
int count = DbHelp.db.Insertable(inventoryDetail).ExecuteCommand();
|
||||
|
||||
InOutRecord ior = new InOutRecord();
|
||||
ior.MatSN = matSnListDetail.MatSn;
|
||||
ior.MatCode = matSnListDetail.MatCode;
|
||||
ior.MatName = matSnListDetail.MatName;
|
||||
ior.MatSpec = matSnListDetail.MatSpec;
|
||||
ior.MatBatch = matSnListDetail.MatBatch;
|
||||
ior.MatQty = matSnListDetail.MatQty;
|
||||
ior.MatCustomer = matSnListDetail.MatCustomer;
|
||||
ior.MatSupplier = matSnListDetail.MatSupplier;
|
||||
ior.StoreCode = request.ShelfCode;
|
||||
ior.StoreId = SI[0].Id;
|
||||
ior.Direction = DirectionEnum.入库;
|
||||
ior.OperateTime = DateTime.Now;
|
||||
ior.OperateUser = request.UserName;
|
||||
ior.GroupName = SI[0].GroupName;
|
||||
int count1 = DbHelp.db.Insertable(ior).ExecuteCommand();
|
||||
|
||||
detail.matsn = matSnListDetail.MatSn;
|
||||
detail.result = "入库成功";
|
||||
rcs.Data.Add(detail);
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
detail.matsn = matSnListDetail.MatSn;
|
||||
detail.result = "入库失败";
|
||||
detail.reason = ee.Message;
|
||||
rcs.Data.Add(detail);
|
||||
}
|
||||
}
|
||||
//亮灯
|
||||
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(sendIP);
|
||||
//byte[] data1 = new byte[8];
|
||||
//data1[0] = 0xff;
|
||||
//data1[1] = 0x02;
|
||||
//data1[2] = 0x00;
|
||||
//data1[3] = 0x0a;
|
||||
//data1[4] = (byte)warnLightID;
|
||||
//data1[5] = 0x03;
|
||||
//data1[6] = 0x02;
|
||||
//data1[7] = 0x02;
|
||||
//byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, false);
|
||||
//byte[] senddata1 = Tool.Helper.InstoreWarnLight(warnLightID);
|
||||
//tCPClient.Send(senddata1); //报警灯短亮一次
|
||||
|
||||
//byte[] data2 = new byte[8];
|
||||
//data2[0] = 0xff;
|
||||
//data2[1] = 0x01;
|
||||
//data2[2] = 0x00;
|
||||
//data2[3] = 0x0a;
|
||||
//data2[4] = 0x01;
|
||||
//data2[5] = (byte)PCBId;
|
||||
//data2[6] = 0x03;
|
||||
//data2[7] = 0x02;
|
||||
//byte[] senddata2 = Tool.Helper.Crc16(data2, data2.Length, true);
|
||||
//byte[] senddata2 = Tool.Helper.InstoreLight(PCBId);
|
||||
//tCPClient.Send(senddata2); //库位灯短亮一次
|
||||
|
||||
byte[] senddata1 = Tool.Helper.InstoreLightAndWarnLight(PCBId, warnLightID);
|
||||
tCPClient.Send(senddata1); //报警灯和库位灯同时短亮
|
||||
|
||||
|
||||
return new ResponseCommonSingle()
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"入库成功!",
|
||||
Data = rcs.Data,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
public async Task<ResponseBase> debugStoreinfoSingle(DebugStoreinfoSingleRequest request)
|
||||
{
|
||||
//找到模组
|
||||
var module = await DbHelp.db.Queryable<ModuleInfo>().Where(it => it.ModuleCode == request.ShelfCode).FirstAsync();
|
||||
if (module == null)
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"模组[{request.ShelfCode}]不存在!",
|
||||
};
|
||||
}
|
||||
string sendIP = module.CleintIp; //单灯IP
|
||||
int PCBId = module.BoardId; //单灯PCB板ID
|
||||
|
||||
TCPClient tcpClient = TCPClientManager.GetTCPClientByIPHost(sendIP);
|
||||
byte[] senddata = Tool.Helper.StoreLightOnOff(PCBId, "绿", request.OnOff == true ? 0x01 : 0x00);
|
||||
tcpClient.Send(senddata); //库位灯短亮一次
|
||||
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"Success",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -808,194 +808,6 @@ namespace WCS.BLL.Services.Service
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ResponseBase> GoInOutstoreSingle(GetOutOrderDetailRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
//获取出库单
|
||||
var order = await DbHelp.db.Queryable<OutOrder>()
|
||||
.WhereIF(request.OrderId != 0, t => t.Id == request.OrderId)
|
||||
.WhereIF(!string.IsNullOrEmpty(request.OrderNumber), t => t.OrderNumber == request.OrderNumber)
|
||||
.FirstAsync();
|
||||
if (order == null)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"不存在对应的出库单据{request.OrderNumber}!",
|
||||
Data = null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//如果是按物料编码出库 需要计算物料明细、并进行物料锁定
|
||||
if (order.SyncType == SyncTypeEnum.ByMatCode)
|
||||
{
|
||||
var result = CaculateOutOrderMatDetails(order, request.UserName);
|
||||
if (result.Code != 200)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//获取需要出库的物料明细
|
||||
var outOrderMatDetails = DbHelp.db.Queryable<OutOrderMatDetail>()
|
||||
.Where(t => t.OrderId == order.Id)
|
||||
.Where(t => t.IsSended == false)
|
||||
.Includes(t => t.StoreInfo)
|
||||
.ToList();
|
||||
if (outOrderMatDetails == null || outOrderMatDetails.Count == 0)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"出库单据{request.OrderNumber}物料已全部完成出库!",
|
||||
Data = null
|
||||
};
|
||||
}
|
||||
|
||||
if (request.IsStart)//&& order.OutOrderExeStatus != OutOrderExeStatus.发料完成
|
||||
{
|
||||
order.OutOrderExeStatus = OutOrderExeStatus.开始发料;
|
||||
DbHelp.db.Updateable(order).ExecuteCommand();
|
||||
}
|
||||
//获取亮灯颜色
|
||||
List<string> UsedColor = new List<string>();
|
||||
string LightColor = "";
|
||||
List<OrderLight> ol = DbHelp.db.Queryable<OrderLight>().OrderBy(it => it.Id, OrderByType.Asc).ToList();
|
||||
foreach (OrderLight orderLight in ol)
|
||||
{
|
||||
UsedColor.Add(orderLight.LightColor);
|
||||
if (orderLight.OrderNumber == request.OrderNumber)
|
||||
{
|
||||
LightColor = orderLight.LightColor;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (LightColor == "")
|
||||
{
|
||||
foreach (OrderLight orderLight in ol)
|
||||
{
|
||||
if (orderLight.OrderNumber == null)
|
||||
{
|
||||
LightColor = orderLight.LightColor;
|
||||
DbHelp.db.Updateable<OrderLight>().SetColumns(it => it.OrderNumber, request.OrderNumber).Where(it => it.LightColor == LightColor).ExecuteCommand();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取出库需求
|
||||
List<OutOrderDetail> outorderdetal = DbHelp.db.Queryable<OutOrderDetail>()
|
||||
.WhereIF(request.OrderId != 0, t => t.OrderId == request.OrderId)
|
||||
.WhereIF(!string.IsNullOrEmpty(request.OrderNumber), t => t.OrderNumber == request.OrderNumber)
|
||||
.ToList();
|
||||
|
||||
OutResponseCommonSingle orcs = new OutResponseCommonSingle();
|
||||
orcs.Data = new List<OutDetail>();
|
||||
foreach (OutOrderDetail outdetail in outorderdetal)
|
||||
{
|
||||
OutDetail od = new OutDetail();
|
||||
od.OrderId = outdetail.OrderId;
|
||||
od.OrderNumber = outdetail.OrderNumber;
|
||||
od.MatCode = outdetail.MatCode;
|
||||
od.MatBatch = outdetail.MatBatch;
|
||||
od.ReqQty = outdetail.ReqQty;
|
||||
od.CreateTime = outdetail.CreateTime;
|
||||
od.CreateUser = outdetail.CreateUser;
|
||||
od.MatName = outdetail.MatName;
|
||||
od.OutQty = outdetail.OutQty;
|
||||
od.LightColor = LightColor;
|
||||
orcs.Data.Add(od);
|
||||
}
|
||||
//需要出库的货架名
|
||||
List<string> StoreCode = new List<string>();
|
||||
//库位灯亮灯
|
||||
Dictionary<string, List<int>> dict = new Dictionary<string, List<int>>();
|
||||
foreach (OutOrderMatDetail oomd in outOrderMatDetails)
|
||||
{
|
||||
List<ModuleInfo> mi = DbHelp.db.Queryable<ModuleInfo>().Where(it => it.ModuleCode == oomd.StoreCode).ToList();
|
||||
if (mi.Count != 0)
|
||||
{
|
||||
if (!StoreCode.Contains(oomd.StoreCode))
|
||||
{
|
||||
StoreCode.Add(oomd.StoreCode);
|
||||
}
|
||||
if (!dict.Keys.Contains(mi[0].CleintIp))
|
||||
{
|
||||
List<int> board_id = new List<int>();
|
||||
board_id.Add(mi[0].BoardId);
|
||||
dict.Add(mi[0].CleintIp, board_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var v in dict)
|
||||
{
|
||||
if (v.Key == mi[0].CleintIp)
|
||||
{
|
||||
if (!v.Value.Contains(mi[0].BoardId))
|
||||
{
|
||||
v.Value.Add(mi[0].BoardId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var v in dict)
|
||||
{
|
||||
string sendIP = v.Key;
|
||||
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(sendIP);
|
||||
byte[] lightOn = Helper.OutstoreLight(v.Value, LightColor, 1);
|
||||
tCPClient.Send(lightOn);
|
||||
Logs.Write("出库,库位灯亮:" + BitConverter.ToString(lightOn));
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
//报警灯亮
|
||||
List<string> WarnLightShelfCode = new List<string>();
|
||||
foreach (string storecode in StoreCode)
|
||||
{
|
||||
List<ModuleInfo> mi = DbHelp.db.Queryable<ModuleInfo>().Where(it => it.ModuleCode == storecode).ToList();
|
||||
if (mi.Count != 0)
|
||||
{
|
||||
if (!WarnLightShelfCode.Contains(mi[0].ShelfCode))
|
||||
{
|
||||
WarnLightShelfCode.Add(mi[0].ShelfCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
//发送间隔
|
||||
Thread.Sleep(300);
|
||||
foreach (string shelfcode in WarnLightShelfCode)
|
||||
{
|
||||
List<ShelfInfo> si = DbHelp.db.Queryable<ShelfInfo>().Where(it => it.ShelfCode == shelfcode).ToList();
|
||||
if (si.Count != 0)
|
||||
{
|
||||
for (int i = 0; i < si.Count; i++)
|
||||
{
|
||||
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(si[i].ClientIp);
|
||||
//byte[] warnlightOn = Helper.OutstoreWarnLight(si[i].LightId, LightColor, 1, 0);
|
||||
byte[] warnlightOn = Helper.OutstoreWarnLight_1(si[i].LightId, LightColor, 1, 1);
|
||||
tCPClient.Send(warnlightOn);
|
||||
Logs.Write("出库,报警灯亮:" + BitConverter.ToString(warnlightOn));
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
//返回
|
||||
return new OutResponseCommonSingle()
|
||||
{
|
||||
Code = 200,
|
||||
Message = LightColor,
|
||||
Data = orcs.Data
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await GoOutOutstore(request);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
//计算、加锁
|
||||
private ResponseBase CaculateOutOrderMatDetails(OutOrder order, string createUser = "")
|
||||
{
|
||||
@ -1211,153 +1023,6 @@ namespace WCS.BLL.Services.Service
|
||||
|
||||
}
|
||||
|
||||
public async Task<ResponseBase> GoOutOutstoreSingle(GetOutOrderDetailRequest request)
|
||||
{
|
||||
|
||||
//获取出库单
|
||||
var order = await DbHelp.db.Queryable<OutOrder>()
|
||||
.WhereIF(request.OrderId != 0, t => t.Id == request.OrderId)
|
||||
.WhereIF(!string.IsNullOrEmpty(request.OrderNumber), t => t.OrderNumber == request.OrderNumber)
|
||||
.FirstAsync();
|
||||
if (order == null)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"不存在对应的出库单据{request.OrderNumber}!",
|
||||
Data = null
|
||||
};
|
||||
}
|
||||
|
||||
//判断出库状态
|
||||
bool isComplete = true;
|
||||
List<OutOrderDetail> ood = DbHelp.db.Queryable<OutOrderDetail>().Where(it => it.OrderNumber == request.OrderNumber).ToList();
|
||||
foreach (OutOrderDetail detail in ood)
|
||||
{
|
||||
if (detail.ReqQty > detail.OutQty)
|
||||
{
|
||||
isComplete = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isComplete == false)
|
||||
{
|
||||
order.OutOrderExeStatus = OutOrderExeStatus.暂停发料;
|
||||
DbHelp.db.Updateable(order).ExecuteCommand();
|
||||
}
|
||||
else
|
||||
{
|
||||
order.OutOrderExeStatus = OutOrderExeStatus.发料完成;
|
||||
DbHelp.db.Updateable(order).ExecuteCommand();
|
||||
}
|
||||
//解锁物料
|
||||
List<OutOrderMatDetail> List = DbHelp.db.Queryable<OutOrderMatDetail>().Where(it => it.OrderNumber == request.OrderNumber).ToList();
|
||||
foreach (OutOrderMatDetail listdetail in List)
|
||||
{
|
||||
DbHelp.db.Updateable<InventoryDetail>().SetColumns(it => it.IsLocked == false).Where(it => it.MatSN == listdetail.MatSN).ExecuteCommand();
|
||||
}
|
||||
|
||||
//灭灯
|
||||
//获取需要出库的物料明细
|
||||
var outOrderMatDetails = DbHelp.db.Queryable<OutOrderMatDetail>()
|
||||
.Where(t => t.OrderNumber == request.OrderNumber)
|
||||
.ToList();
|
||||
//需要出库的货架名
|
||||
List<string> StoreCode = new List<string>();
|
||||
//库位灯灭灯
|
||||
string LightColor = "无";
|
||||
try
|
||||
{
|
||||
List<OrderLight> ol = DbHelp.db.Queryable<OrderLight>().Where(it => it.OrderNumber == request.OrderNumber).ToList();
|
||||
LightColor = ol[0].LightColor;
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
Logs.Write("查询出库单据:" + request.OrderNumber + "对应库位灯颜色失败," + ee.Message);
|
||||
}
|
||||
Dictionary<string, List<int>> dict = new Dictionary<string, List<int>>();
|
||||
foreach (OutOrderMatDetail oomd in outOrderMatDetails)
|
||||
{
|
||||
List<ModuleInfo> mi = DbHelp.db.Queryable<ModuleInfo>().Where(it => it.ModuleCode == oomd.StoreCode).ToList();
|
||||
if (mi.Count != 0)
|
||||
{
|
||||
if (!StoreCode.Contains(oomd.StoreCode))
|
||||
{
|
||||
StoreCode.Add(oomd.StoreCode);
|
||||
}
|
||||
if (!dict.Keys.Contains(mi[0].CleintIp))
|
||||
{
|
||||
List<int> board_id = new List<int>();
|
||||
board_id.Add(mi[0].BoardId);
|
||||
dict.Add(mi[0].CleintIp, board_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var v in dict)
|
||||
{
|
||||
if (v.Key == mi[0].CleintIp)
|
||||
{
|
||||
if (!v.Value.Contains(mi[0].BoardId))
|
||||
{
|
||||
v.Value.Add(mi[0].BoardId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var v in dict)
|
||||
{
|
||||
string sendIP = v.Key;
|
||||
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(sendIP);
|
||||
byte[] lightOn = Helper.OutstoreLight(v.Value, LightColor, 0);
|
||||
tCPClient.Send(lightOn);
|
||||
Logs.Write("出库,库位灯灭:" + BitConverter.ToString(lightOn));
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
//报警灯灭
|
||||
List<string> WarnLightShelfCode = new List<string>();
|
||||
foreach (string storecode in StoreCode)
|
||||
{
|
||||
List<ModuleInfo> mi = DbHelp.db.Queryable<ModuleInfo>().Where(it => it.ModuleCode == storecode).ToList();
|
||||
if (mi.Count != 0)
|
||||
{
|
||||
if (!WarnLightShelfCode.Contains(mi[0].ShelfCode))
|
||||
{
|
||||
WarnLightShelfCode.Add(mi[0].ShelfCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
//发送间隔
|
||||
//Thread.Sleep(300);
|
||||
foreach (string shelfcode in WarnLightShelfCode)
|
||||
{
|
||||
List<ShelfInfo> si = DbHelp.db.Queryable<ShelfInfo>().Where(it => it.ShelfCode == shelfcode).ToList();
|
||||
if (si.Count != 0)
|
||||
{
|
||||
for (int i = 0; i < si.Count; i++)
|
||||
{
|
||||
Thread.Sleep(250);
|
||||
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(si[i].ClientIp);
|
||||
byte[] warnlightOn = Helper.OutstoreWarnLight_1(si[i].LightId, LightColor, 0, 0);
|
||||
tCPClient.Send(warnlightOn);
|
||||
Logs.Write("出库,报警灯灭:" + BitConverter.ToString(warnlightOn));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isComplete == true)
|
||||
{
|
||||
DbHelp.db.Updateable<OrderLight>().SetColumns(it => it.OrderNumber == null).Where(it => it.OrderNumber == request.OrderNumber).ExecuteCommand();
|
||||
}
|
||||
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 200,
|
||||
Message = "Success",
|
||||
Data = null
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
public async Task<ResponseBase> SingleLightConfirmOutstore(OutOrderMatDetailModelSingle request)
|
||||
{
|
||||
|
@ -22,138 +22,5 @@ using static WCS.BLL.Tool.Helper;
|
||||
|
||||
namespace WCS.BLL.Services.Service
|
||||
{
|
||||
public class SingleLightService : ISingleLightService
|
||||
{
|
||||
/// <summary>
|
||||
/// 单灯 一个库位对应一个硬件
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ResponseCommon<object>> SingleLightControl(SingleLightControlRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
//传入数据校验
|
||||
if (request.StoreList == null || request.StoreList.Count == 0)
|
||||
{
|
||||
return new ResponseCommon<object>()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "操作失败:没有需要控制的库位",
|
||||
};
|
||||
}
|
||||
//库位编码去重
|
||||
var storeCodes = request.StoreList.Select(t => t.StoreCode)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
var stores = DbHelp.db.Queryable<StoreInfo>()
|
||||
.Where(t => storeCodes.Contains(t.StoreCode))
|
||||
.ToList();
|
||||
if (stores == null || stores.Count == 0)
|
||||
{
|
||||
return new ResponseCommon<object>
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"操作失败:所有库位不存在!"
|
||||
};
|
||||
}
|
||||
|
||||
//对应货架(获取TCP和报警灯ID)
|
||||
var shelfIds = stores.Select(t => t.ShelfId).Distinct().ToList();
|
||||
var shelfs = DbHelp.db.Queryable<ShelfInfo>().Where(t => shelfIds.Contains(t.Id))
|
||||
.ToList();
|
||||
|
||||
//对应模组信息
|
||||
var moduleIds = stores.Select(t => t.ModuleId).Distinct().ToList();
|
||||
var modules = DbHelp.db.Queryable<ModuleInfo>().Where(t => moduleIds.Contains(t.Id))
|
||||
.ToList();
|
||||
|
||||
//加载请求参数中的库位灯 板子ID和货架ID
|
||||
foreach (var store in request.StoreList)
|
||||
{
|
||||
var storeInDb = stores.Where(t => t.StoreCode == store.StoreCode).FirstOrDefault();
|
||||
if (storeInDb == null)
|
||||
{
|
||||
return new ResponseCommon<object>
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"操作失败:库位{store.StoreCode}不存在(store)!"
|
||||
};
|
||||
}
|
||||
else
|
||||
store.ShelfId = storeInDb.ShelfId;
|
||||
|
||||
var moduleInDb = modules.Where(t => t.Id == storeInDb.ModuleId).FirstOrDefault();
|
||||
if (moduleInDb == null)
|
||||
{
|
||||
return new ResponseCommon<object>
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"操作失败:库位{store.StoreCode}不存在(module)!"
|
||||
};
|
||||
}
|
||||
else
|
||||
store.BoardId = moduleInDb.BoardId;
|
||||
}
|
||||
|
||||
//合并:同一个货架的库位合并
|
||||
var shelfModels = new List<SingleLightShelfModel>();
|
||||
foreach (var shelf in shelfs)
|
||||
{
|
||||
var shelfModel = new SingleLightShelfModel();
|
||||
//报警灯
|
||||
shelfModel.WarningLightMode = request.WarningLightMode;
|
||||
shelfModel.WarningBuzzerMode = request.WarningBuzzerMode;
|
||||
shelfModel.WarningLightColor = request.WarningLightColor;
|
||||
shelfModel.WarningBoardId = shelf.LightId;
|
||||
shelfModel.ClientIp = shelf.ClientIp;
|
||||
//库位
|
||||
var storesThisShelf = request.StoreList
|
||||
.Where(t => t.ShelfId == shelf.Id)
|
||||
.ToList();
|
||||
foreach (var storeThisShelf in storesThisShelf)
|
||||
{
|
||||
shelfModel.StoreList.Add(new SingleLightStoreModel()
|
||||
{
|
||||
BoardId = storeThisShelf.BoardId,
|
||||
LightColor = storeThisShelf.LightColor,
|
||||
LightMode = storeThisShelf.LightMode,
|
||||
});
|
||||
}
|
||||
shelfModels.Add(shelfModel);
|
||||
}
|
||||
|
||||
//合并:同一个TCP的货架合并 报警灯和库位灯统一只发送一条指令
|
||||
var clientIpList = shelfs.Select(t => t.ClientIp)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
foreach (var clientIp in clientIpList)
|
||||
{
|
||||
var shelfModelsInOneIp = shelfModels.Where(t => t.ClientIp == clientIp).ToList();
|
||||
var sendData = Helper.SingleLightControl(shelfModelsInOneIp);
|
||||
|
||||
TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(clientIp);
|
||||
tCPClient.Send(sendData);
|
||||
Logs.Write("【单灯单独控制】发送指令" + BitConverter.ToString(sendData));
|
||||
}
|
||||
|
||||
//返回成功
|
||||
return new ResponseCommon<object>()
|
||||
{
|
||||
Code = 200,
|
||||
Message = "success",
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
//操作失败
|
||||
return new ResponseCommon<object>()
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"操作失败:{ex.Message}",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
public class StoreInfoService : IStoreInfoService
|
||||
{
|
||||
public StoreInfoService() { }
|
||||
|
||||
public async Task<PageQueryResponse<ShelfInfo>> GetShelves(GetShelvesRequest request)
|
||||
{
|
||||
@ -240,300 +239,15 @@ namespace WCS.BLL.Services.Service
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<ResponseCommon<object>> GenerateStoreInfo()
|
||||
{
|
||||
//var shelfInfos = DbHelp.db.Queryable<ShelfInfo>().ToList();
|
||||
//foreach (var shelfInfo in shelfInfos)
|
||||
//{
|
||||
var ModuleInfos = await DbHelp.db.Queryable<ModuleInfo>().ToListAsync();
|
||||
ModuleInfos.ForEach(moduleInfo =>
|
||||
{
|
||||
for (int i = 1; i <= moduleInfo.LightCount; i++)
|
||||
{
|
||||
var storeInfo = new StoreInfo()
|
||||
{
|
||||
StoreCode = moduleInfo.ModuleCode + "-" + i.ToString(),
|
||||
ShelfTypeId = 1,
|
||||
ModuleId = moduleInfo.Id,
|
||||
ModuleCode = moduleInfo.ModuleCode,
|
||||
ShelfId = moduleInfo.ShelfId,
|
||||
ShelfCode = moduleInfo.ShelfCode,
|
||||
BoardId = moduleInfo.BoardId,
|
||||
LightNumber = i,
|
||||
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" };
|
||||
}
|
||||
|
||||
#region 模组管理
|
||||
public async Task<PageQueryResponse<ModuleInfo>> GetModules(GetModulesRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var recordsQueryable = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.WhereIF(!string.IsNullOrEmpty(request.ModuleCode), t => t.ModuleCode.Contains(request.ModuleCode))
|
||||
.WhereIF(!string.IsNullOrEmpty(request.ShelfCode), t => t.ShelfCode.Contains(request.ShelfCode));
|
||||
var totalCount = await recordsQueryable.CountAsync();
|
||||
var records = await recordsQueryable
|
||||
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
|
||||
.ToListAsync();
|
||||
//生成序号
|
||||
for (int i = 0; i < records.Count; i++)
|
||||
{
|
||||
records[i].RowNumber = (request.PageNumber - 1) * request.PageSize + i + 1;
|
||||
}
|
||||
return new PageQueryResponse<ModuleInfo>()
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"success",
|
||||
Data = new PageQueryResponseData<ModuleInfo>()
|
||||
{
|
||||
TotalCount = totalCount,
|
||||
MaxPage = request.PageSize == 0 ? 0 : (int)Math.Ceiling((decimal)totalCount / request.PageSize),
|
||||
Count = records.Count,
|
||||
Lists = records.ToList()
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new PageQueryResponse<ModuleInfo>()
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"操作失败:{ex.Message}",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 禁用或启用模组
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ResponseCommon> disableOrEnableModule(DisableOrEnableModuleRequest request)
|
||||
{
|
||||
//找到库位
|
||||
var moduleInfo = await DbHelp.db.Queryable<ModuleInfo>()
|
||||
.Where(t => t.Id == request.ModuleId)
|
||||
.FirstAsync();
|
||||
//库位不存在
|
||||
if (moduleInfo == null)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"操作失败:模组{request.ModuleCode}不存在!"
|
||||
};
|
||||
}
|
||||
try
|
||||
{
|
||||
DbHelp.db.BeginTran();
|
||||
//禁用
|
||||
if (request.DisableOrEnable == DisableOrEnableEnum.Disable)
|
||||
{
|
||||
moduleInfo.IsEnable = false;
|
||||
//盟讯公司发送钉钉消息
|
||||
if (LocalFile.Config.IsMx)
|
||||
{
|
||||
var DingDing = string.Empty;
|
||||
MXBackgroundThread.SendDingDingMsg($"【智能货架】模组{moduleInfo.ModuleCode}被屏蔽(模组管理),请及时调查或维保硬件!", new List<string> { "104379", "103595" }, ref DingDing);
|
||||
Logs.Write($"【智能货架】模组{moduleInfo.ModuleCode}被屏蔽(模组管理),请及时调查或维保硬件!");
|
||||
|
||||
#region 计算库位禁用率并发送
|
||||
Task.Run(() =>
|
||||
{
|
||||
var disabledStore = DbHelp.db.Queryable<StoreInfo>()
|
||||
.Where(t => t.CurrentMatSn == "禁用")
|
||||
.ToList();
|
||||
var allStore = DbHelp.db.Queryable<StoreInfo>()
|
||||
.ToList();
|
||||
|
||||
var disabledCount = disabledStore.Count();
|
||||
var allCount = allStore.Count();
|
||||
|
||||
var disabledACount = disabledStore.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
var allACount = allStore.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
|
||||
var disabledCCount = disabledStore.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
var allCCount = allStore.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
|
||||
|
||||
var disabledModule = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.Where(t => t.IsEnable == false)
|
||||
.ToList();
|
||||
var allModule = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.ToList();
|
||||
|
||||
var disabledModuleCount = disabledModule.Count();
|
||||
var allModuleCount = allModule.Count();
|
||||
|
||||
var disabledAModuleCount = disabledModule.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
var allAModuleCount = allModule.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
|
||||
var disabledCModuleCount = disabledModule.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
var allCModuleCount = allModule.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
|
||||
var message = $"【智能货架】当前库位总数{allCount},禁用总数{disabledCount},禁用率{((double)disabledCount / allCount).ToString("P")}," +
|
||||
$"其中A区库位总数{allACount},禁用数{disabledACount},禁用率{((double)disabledACount / allACount).ToString("P")}," +
|
||||
$"C区库位总数{allCCount},禁用数{disabledCCount},禁用率{((double)disabledCCount / allCCount).ToString("P")}。\r\n" +
|
||||
$"当前模组总数{allModuleCount},禁用总数{disabledModuleCount},禁用率{((double)disabledModuleCount / allModuleCount).ToString("P")}," +
|
||||
$"其中A区模组总数{allAModuleCount},禁用数{disabledAModuleCount},禁用率{((double)disabledAModuleCount / allAModuleCount).ToString("P")}," +
|
||||
$"C区模组总数{allCModuleCount},禁用数{disabledCModuleCount},禁用率{((double)disabledCModuleCount / allCModuleCount).ToString("P")}。";
|
||||
|
||||
Logs.Write(message);
|
||||
var dd = string.Empty;
|
||||
MXBackgroundThread.SendDingDingMsg(message, new List<string> { "104379", "103595" }, ref dd);
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
moduleInfo.IsEnable = true;
|
||||
}
|
||||
DbHelp.db.Updateable(moduleInfo).ExecuteCommand();
|
||||
DbHelp.db.CommitTran();
|
||||
|
||||
#region 更新缓存中的禁用/启动状态
|
||||
try
|
||||
{
|
||||
var shelf = ShelfManager.Shelves.Where(t => t.ShelfId == moduleInfo.ShelfId)
|
||||
.FirstOrDefault();
|
||||
if (shelf != null)
|
||||
{
|
||||
|
||||
var moduleInPc = shelf.Modules.Where(t => t.ModuleId == moduleInfo.Id)
|
||||
.First();
|
||||
if (moduleInPc != null)
|
||||
moduleInPc.IsEnable = request.DisableOrEnable == DisableOrEnableEnum.Enable;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"Success"
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DbHelp.db.RollbackTran();
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"操作失败:异常{ex.Message}!"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发送指令获取模组的电压值
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<ResponseCommon> queryModuleVoltage(QueryModuleVoltageRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var modules = await DbHelp.db.Queryable<ModuleInfo>().Where(t => request.MouduleIds.Contains(t.Id)).ToListAsync();
|
||||
var isSend = false;
|
||||
foreach (var module in modules)
|
||||
{
|
||||
var shelf = ShelfManager.Shelves.Where(t => t.ShelfId == module.ShelfId).FirstOrDefault();
|
||||
if (shelf != null && shelf is SmartShelf)
|
||||
{
|
||||
var smartShelf = (SmartShelf)shelf;
|
||||
smartShelf.QueryVoltage(module.Id);
|
||||
isSend = true;
|
||||
}
|
||||
}
|
||||
if (isSend)
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 200,
|
||||
Message = "Success"
|
||||
};
|
||||
else
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "操作失败:未找到对应模组"
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 300,
|
||||
Message = "操作失败:" + ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ResponseCommon> calibrationSetOffset(CalibrationSetOffsetRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var modules = await DbHelp.db.Queryable<ModuleInfo>().Where(t => request.MouduleIds.Contains(t.Id)).ToListAsync();
|
||||
var isSend = false;
|
||||
foreach (var module in modules)
|
||||
{
|
||||
var shelf = ShelfManager.Shelves.Where(t => t.ShelfId == module.ShelfId).FirstOrDefault();
|
||||
if (shelf != null && shelf is SmartShelf)
|
||||
{
|
||||
var smartShelf = (SmartShelf)shelf;
|
||||
smartShelf.CalibrationSetOffset(module.Id, request.OffSet);
|
||||
isSend = true;
|
||||
}
|
||||
}
|
||||
if (isSend)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 200,
|
||||
Message = "Success"
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "操作失败:未找到对应模组"
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 300,
|
||||
Message = "操作失败:" + ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 库位管理
|
||||
@ -608,53 +322,6 @@ namespace WCS.BLL.Services.Service
|
||||
MXBackgroundThread.SendDingDingMsg($"【智能货架】库位{storeInfo.StoreCode}被屏蔽(库位管理),请及时调查或维保硬件!", new List<string> { "104379", "103595" }, ref DingDing);
|
||||
Logs.Write($"【智能货架】库位{storeInfo.StoreCode}被屏蔽(库位管理),请及时调查或维保硬件!");
|
||||
|
||||
#region 计算库位禁用率并发送
|
||||
Task.Run(() =>
|
||||
{
|
||||
var disabledStore = DbHelp.db.Queryable<StoreInfo>()
|
||||
.Where(t => t.CurrentMatSn == "禁用")
|
||||
.ToList();
|
||||
var allStore = DbHelp.db.Queryable<StoreInfo>()
|
||||
.ToList();
|
||||
|
||||
var disabledCount = disabledStore.Count();
|
||||
var allCount = allStore.Count();
|
||||
|
||||
var disabledACount = disabledStore.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
var allACount = allStore.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
|
||||
var disabledCCount = disabledStore.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
var allCCount = allStore.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
|
||||
|
||||
var disabledModule = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.Where(t => t.IsEnable == false)
|
||||
.ToList();
|
||||
var allModule = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.ToList();
|
||||
|
||||
var disabledModuleCount = disabledModule.Count();
|
||||
var allModuleCount = allModule.Count();
|
||||
|
||||
var disabledAModuleCount = disabledModule.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
var allAModuleCount = allModule.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
|
||||
var disabledCModuleCount = disabledModule.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
var allCModuleCount = allModule.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
|
||||
var message = $"【智能货架】当前库位总数{allCount},禁用总数{disabledCount},禁用率{((double)disabledCount / allCount).ToString("P")}," +
|
||||
$"其中A区库位总数{allACount},禁用数{disabledACount},禁用率{((double)disabledACount / allACount).ToString("P")}," +
|
||||
$"C区库位总数{allCCount},禁用数{disabledCCount},禁用率{((double)disabledCCount / allCCount).ToString("P")}。\r\n" +
|
||||
$"当前模组总数{allModuleCount},禁用总数{disabledModuleCount},禁用率{((double)disabledModuleCount / allModuleCount).ToString("P")}," +
|
||||
$"其中A区模组总数{allAModuleCount},禁用数{disabledAModuleCount},禁用率{((double)disabledAModuleCount / allAModuleCount).ToString("P")}," +
|
||||
$"C区模组总数{allCModuleCount},禁用数{disabledCModuleCount},禁用率{((double)disabledCModuleCount / allCModuleCount).ToString("P")}。";
|
||||
|
||||
Logs.Write(message);
|
||||
|
||||
var dd = string.Empty;
|
||||
MXBackgroundThread.SendDingDingMsg(message, new List<string> { "104379", "103595" }, ref dd);
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
|
||||
//库位
|
||||
@ -719,76 +386,6 @@ namespace WCS.BLL.Services.Service
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ResponseCommon> getDisablePercent()
|
||||
{
|
||||
try
|
||||
{
|
||||
#region 计算库位禁用率
|
||||
var disabledStore = DbHelp.db.Queryable<StoreInfo>()
|
||||
.Where(t => t.CurrentMatSn == "禁用")
|
||||
.ToList();
|
||||
var allStore = DbHelp.db.Queryable<StoreInfo>()
|
||||
.ToList();
|
||||
|
||||
var disabledCount = disabledStore.Count();
|
||||
var allCount = allStore.Count();
|
||||
|
||||
var disabledACount = disabledStore.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
var allACount = allStore.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
|
||||
var disabledCCount = disabledStore.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
var allCCount = allStore.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
|
||||
|
||||
var disabledModule = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.Where(t => t.IsEnable == false)
|
||||
.ToList();
|
||||
var allModule = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.ToList();
|
||||
|
||||
var disabledModuleCount = disabledModule.Count();
|
||||
var allModuleCount = allModule.Count();
|
||||
|
||||
var disabledAModuleCount = disabledModule.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
var allAModuleCount = allModule.Where(t => t.ShelfCode.Contains("A")).ToList().Count();
|
||||
|
||||
var disabledCModuleCount = disabledModule.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
var allCModuleCount = allModule.Where(t => t.ShelfCode.Contains("C")).ToList().Count();
|
||||
|
||||
var message = $"【智能货架】当前库位总数{allCount},禁用总数{disabledCount},禁用率{((double)disabledCount / allCount).ToString("P")}," +
|
||||
$"其中A区库位总数{allACount},禁用数{disabledACount},禁用率{((double)disabledACount / allACount).ToString("P")}," +
|
||||
$"C区库位总数{allCCount},禁用数{disabledCCount},禁用率{((double)disabledCCount / allCCount).ToString("P")}。\r\n" +
|
||||
$"当前模组总数{allModuleCount},禁用总数{disabledModuleCount},禁用率{((double)disabledModuleCount / allModuleCount).ToString("P")}," +
|
||||
$"其中A区模组总数{allAModuleCount},禁用数{disabledAModuleCount},禁用率{((double)disabledAModuleCount / allAModuleCount).ToString("P")}," +
|
||||
$"C区模组总数{allCModuleCount},禁用数{disabledCModuleCount},禁用率{((double)disabledCModuleCount / allCModuleCount).ToString("P")}。";
|
||||
#endregion
|
||||
|
||||
//非盟讯公司的展示
|
||||
if (LocalFile.Config.IsMx == false)
|
||||
{
|
||||
message = $"【智能货架】当前库位总数{allCount},禁用总数{disabledCount},禁用率{((double)disabledCount / allCount).ToString("P")}。";
|
||||
}
|
||||
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"Success",
|
||||
Data = message,
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DbHelp.db.RollbackTran();
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"操作失败:异常{ex.Message}!"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -133,52 +133,5 @@ namespace WebApi.Controllers
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Route("singleLightCommitInstore")]
|
||||
[HttpPost(Name = "singleLightCommitInstore")]
|
||||
public async Task<ResponseBase> singleLightCommitInstore(QueryByMatSnRequestSingle request)
|
||||
{
|
||||
try
|
||||
{
|
||||
//var aa = Helper.Query();
|
||||
//var bb = Helper.SetId();
|
||||
return await _instoreService.queryInstoreStatusSingle(request);
|
||||
//ShelfManager.
|
||||
//
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"<22><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>:{ex.Message}",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
[Route("debugStoreinfoSingle")]
|
||||
[HttpPost(Name = "debugStoreinfoSingle")]
|
||||
public async Task<ResponseBase> debugStoreinfoSingle(DebugStoreinfoSingleRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _instoreService.debugStoreinfoSingle(request);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"<22><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>:{ex.Message}",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -284,54 +284,6 @@ namespace WebApi.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>ƿ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Route("singleLightGoInOutstore")]
|
||||
[HttpPost(Name = "singleLightGoInOutstore")]
|
||||
public async Task<ResponseBase> singleLightGoInOutstore(GetOutOrderDetailRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _outstoreService.GoInOutstoreSingle(request);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 300,
|
||||
Message = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽʧ<CABD>ܣ<EFBFBD>" + ex.Message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Route("singleLightGoOutOutstore")]
|
||||
[HttpPost(Name = "singleLightGoOutOutstore")]
|
||||
public async Task<ResponseBase> singleLightGoOutOutstore(GetOutOrderDetailRequest request)
|
||||
{
|
||||
//TODO<44><4F><EFBFBD><EFBFBD>
|
||||
try
|
||||
{
|
||||
return await _outstoreService.GoOutOutstoreSingle(request);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 300,
|
||||
Message = "<22><>ѯʧ<D1AF>ܣ<EFBFBD>" + ex.Message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>ȷ<EFBFBD>ϳ<EFBFBD><CFB3><EFBFBD>
|
||||
/// </summary>
|
||||
|
@ -36,43 +36,6 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
return await _storeInfoService.addOrUpdateShelfInfo(request);
|
||||
}
|
||||
|
||||
[HttpPost("GenerateStoreInfo")]
|
||||
public async Task<ResponseCommon<object>> GenerateStoreInfo()
|
||||
{
|
||||
return await _storeInfoService.GenerateStoreInfo();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 模组管理
|
||||
[Route("getModules")]
|
||||
[HttpPost(Name = "getModules")]
|
||||
public async Task<ResponseBase> getModules(GetModulesRequest request)
|
||||
{
|
||||
return await _storeInfoService.GetModules(request);
|
||||
}
|
||||
|
||||
[Route("disableOrEnableModule")]
|
||||
[HttpPost(Name = "disableOrEnableModule")]
|
||||
public async Task<ResponseBase> disableOrEnableModule(DisableOrEnableModuleRequest request)
|
||||
{
|
||||
return await _storeInfoService.disableOrEnableModule(request);
|
||||
}
|
||||
|
||||
[Route("queryModuleVoltage")]
|
||||
[HttpPost(Name = "queryModuleVoltage")]
|
||||
public async Task<ResponseBase> queryModuleVoltage(QueryModuleVoltageRequest request)
|
||||
{
|
||||
return await _storeInfoService.queryModuleVoltage(request);
|
||||
}
|
||||
|
||||
|
||||
[Route("calibrationSetOffset")]
|
||||
[HttpPost(Name = "calibrationSetOffset")]
|
||||
public async Task<ResponseBase> calibrationSetOffset(CalibrationSetOffsetRequest request)
|
||||
{
|
||||
return await _storeInfoService.calibrationSetOffset(request);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 库位管理
|
||||
@ -82,20 +45,6 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
return await _storeInfoService.GetStores(request);
|
||||
}
|
||||
|
||||
[Route("disableOrEnableStore")]
|
||||
[HttpPost(Name = "disableOrEnableStore")]
|
||||
public async Task<ResponseBase> disableOrEnableStore(DisableOrEnableStoreRequest request)
|
||||
{
|
||||
return await _storeInfoService.disableOrEnableStore(request);
|
||||
}
|
||||
|
||||
[Route("getDisablePercent")]
|
||||
[HttpPost(Name = "getDisablePercent")]
|
||||
public async Task<ResponseBase> getDisablePercent(DisableOrEnableStoreRequest request)
|
||||
{
|
||||
return await _storeInfoService.getDisablePercent();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,6 @@ namespace WebApi
|
||||
builder.Services.AddScoped<IWarningService, WarningService>();
|
||||
builder.Services.AddScoped<IInOutRecordService, InOutRecordService>();
|
||||
builder.Services.AddScoped<IUploadService, UploadService>();
|
||||
builder.Services.AddScoped<ISingleLightService, SingleLightService>();
|
||||
|
||||
//<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>();
|
||||
|
@ -19,14 +19,7 @@ namespace 智慧物流软件系统
|
||||
{
|
||||
base.OnStartup(e);
|
||||
|
||||
if (LocalFile.Config.IsMx)
|
||||
{
|
||||
MainWindow = new MXMainWindow();
|
||||
}
|
||||
else
|
||||
{
|
||||
MainWindow = new MainWindow1();
|
||||
}
|
||||
MainWindow.ShowDialog();
|
||||
|
||||
}
|
||||
|
@ -1,358 +0,0 @@
|
||||
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();
|
||||
}
|
||||
|
||||
public static object flag { get; set; } = new object();
|
||||
#region Property
|
||||
private OutOrderModel selectedOutOrder;
|
||||
public OutOrderModel SelectedOutOrder
|
||||
{
|
||||
get { return selectedOutOrder; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedOutOrder, value);
|
||||
|
||||
if (selectedOutOrder != null && selectedOutOrder.OrderNumber != SelectedOutOrderNumber)
|
||||
{
|
||||
SelectedOutOrderNumber = selectedOutOrder.OrderNumber;
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else if (selectedOutOrder != null && selectedOutOrder.OrderNumber == SelectedOutOrderNumber)
|
||||
{
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
SendedPan = dataGridItemSource.Where(t => t.IsSended).Count();
|
||||
TotalPan = dataGridItemSource.Count();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Thread.Sleep(500);
|
||||
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.Topmost = true;
|
||||
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("已成功开始发料!");
|
||||
RefreshOutOrderList(SelectedOutOrderNumber);
|
||||
}
|
||||
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("已成功取消发料!");
|
||||
RefreshOutOrderList(SelectedOutOrderNumber);
|
||||
}
|
||||
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 = "")
|
||||
{
|
||||
lock (flag)
|
||||
{
|
||||
Logs.Write($"【RefreshOutOrderList1】OrderNumber{OrderNumber}", LogsType.Info);
|
||||
if (string.IsNullOrEmpty(OrderNumber) && !string.IsNullOrEmpty(SelectedOutOrderNumber))
|
||||
{
|
||||
OrderNumber = SelectedOutOrderNumber;
|
||||
Logs.Write($"【RefreshOutOrderList2】OrderNumber{OrderNumber}", LogsType.Info);
|
||||
}
|
||||
#region 调用接口获取发料单
|
||||
try
|
||||
{
|
||||
var body = new GetOutOrderListByStatusRequest()
|
||||
{
|
||||
IsMXPD = false,
|
||||
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))
|
||||
{
|
||||
if (selectedOutOrder == null)
|
||||
{
|
||||
SelectedOutOrder = OutOrderList?.Where(t => t.OrderNumber == OrderNumber).FirstOrDefault();
|
||||
}
|
||||
Logs.Write($"【RefreshOutOrderList3】SelectedOutOrder{SelectedOutOrder?.OrderNumber}", LogsType.Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (selectedOutOrder == null)
|
||||
SelectedOutOrder = OutOrderList?.FirstOrDefault();
|
||||
Logs.Write($"【RefreshOutOrderList3】SelectedOutOrder{SelectedOutOrder?.OrderNumber}", LogsType.Info);
|
||||
}
|
||||
}
|
||||
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Warning(ex.Message);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public void RefreshDataGridItemSource()
|
||||
{
|
||||
lock (flag)
|
||||
{
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Logs.Write("【RefreshDataGridItemSource】选择的单据为空无法进行查询", LogsType.Info);
|
||||
SelectedOutOrder = OutOrderList?.FirstOrDefault();
|
||||
return;
|
||||
}
|
||||
}
|
||||
#region 调用接口获取出库单物料明细
|
||||
Task.Run(() =>
|
||||
{
|
||||
Logs.Write($"【RefreshDataGridItemSource】{SelectedOutOrder?.OrderNumber}", LogsType.Info);
|
||||
|
||||
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", true);
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
if (Result.Data.Count > 0)
|
||||
{
|
||||
var list = Result.Data.OrderBy(t => t.IsSended).ToList();
|
||||
Logs.Write($"【RefreshDataGridItemSource】Result.Data.Count > 0{SelectedOutOrder?.OrderNumber}", LogsType.Info);
|
||||
//App.Current.Dispatcher.Invoke(() =>
|
||||
//{
|
||||
DataGridItemSource = new ObservableCollection<OutOrderMatDetailModel>(list);
|
||||
//});
|
||||
OrderStatus = Result.Message;
|
||||
if (OrderStatus == OutOrderStatus.全部发料.ToString())
|
||||
{
|
||||
//全部发料就默认所有货架结束了这个单子
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logs.Write("【RefreshDataGridItemSource】Result.Data.Count <= 0,清空明细", LogsType.Info);
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
});
|
||||
Growl.Warning("该单据未查询到发料明细!");
|
||||
}
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,218 +0,0 @@
|
||||
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))
|
||||
{
|
||||
var content = $"MES/WMS系统按先进先出推荐物料条码在此货架上不存在,请确认物料是否在其他货架(B区)上!或者确认是否是物料上架后丢失(复制物料条码后在[出入记录]功能中通过物料SN查询确认是否丢失,如果确认是此货架上丢失,重新上架再次进行出库操作),具体条码如下:\r\n{string.Join(",\r\n", matSns)}";
|
||||
//MessageBox.Show($"未查询到领料明细!所推荐物料在此货架上不存在,请确认是否在其他货架上!或者是否已经丢失?(复制物料条码后在[出入记录]功能中即可查询)\r\n{string.Join(",\r\n", matSns)}");
|
||||
TipView.Show(content, "提示", true);
|
||||
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推荐物料明细为空!请确认该单据是否已发或咨询MES系统相关负责人!");
|
||||
DataGridItemSource = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("未查询到领料明细!请求MES接口失败!请确认该单据是否已发或咨询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
|
||||
}
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
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
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,429 +0,0 @@
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using MiniExcelLibs;
|
||||
using Newtonsoft.Json;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using TouchSocket.Core;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||
using WCS.Model.ApiModel.OutStore;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using 智慧物流软件系统.Api;
|
||||
using 智慧物流软件系统.ViewModel;
|
||||
|
||||
namespace 智慧物流软件系统.ViewModel
|
||||
{
|
||||
public class MXPDViewModel : BindableBase
|
||||
{
|
||||
public MXPDViewModel()
|
||||
{
|
||||
RefreshOutOrderList();
|
||||
}
|
||||
|
||||
#region Property
|
||||
private OutOrderModel selectedOutOrder;
|
||||
public OutOrderModel SelectedOutOrder
|
||||
{
|
||||
get { return selectedOutOrder; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedOutOrder, value);
|
||||
if (selectedOutOrder != null)
|
||||
{
|
||||
SelectedOutOrderNumber = selectedOutOrder.OrderNumber;
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string selectedOutOrderNumber;
|
||||
public string SelectedOutOrderNumber
|
||||
{
|
||||
get => selectedOutOrderNumber;
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedOutOrderNumber, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ObservableCollection<OutOrderModel> outOrderList;
|
||||
public ObservableCollection<OutOrderModel> OutOrderList
|
||||
{
|
||||
get => outOrderList;
|
||||
set
|
||||
{
|
||||
SetProperty(ref outOrderList, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<OutOrderMatDetailModel> dataGridItemSource;
|
||||
public ObservableCollection<OutOrderMatDetailModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
RefreshCount();
|
||||
}
|
||||
}
|
||||
|
||||
//单据总盘数
|
||||
private int totalPan;
|
||||
public int TotalPan
|
||||
{
|
||||
get => totalPan; set
|
||||
{
|
||||
SetProperty(ref totalPan, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int sendedPan;
|
||||
public int SendedPan
|
||||
{
|
||||
get => sendedPan; set
|
||||
{
|
||||
SetProperty(ref sendedPan, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int totalCount;
|
||||
public int TotalCount
|
||||
{
|
||||
get => totalCount;
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
|
||||
private string orderStatus;
|
||||
public string OrderStatus
|
||||
{
|
||||
get { return orderStatus; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref orderStatus, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshCount()
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
SendedPan = dataGridItemSource.Where(t => t.IsSended).Count();
|
||||
TotalPan = dataGridItemSource.Count();
|
||||
TotalCount = dataGridItemSource.Sum(t => t.MatQty);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private string matCode;
|
||||
public string MatCode
|
||||
{
|
||||
get => matCode;
|
||||
set { SetProperty(ref matCode, value); }
|
||||
}
|
||||
|
||||
private string wareHouseCode;
|
||||
public string WareHouseCode
|
||||
{
|
||||
get => wareHouseCode;
|
||||
set { SetProperty(ref wareHouseCode, value); }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnOutOrderCommand { get => new DelegateCommand(BtnOutOrder); }
|
||||
public void BtnOutOrder()
|
||||
{
|
||||
var window = new MXOutOrderView();
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnStartCommand { get => new DelegateCommand(BtnStart); }
|
||||
public void BtnStart()
|
||||
{
|
||||
try
|
||||
{
|
||||
//判断是否选择单据
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未选择单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口开始出库
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goInOutstore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Warning("已成功开始盘点!");
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnPauseCommand { get => new DelegateCommand(BtnPause); }
|
||||
public void BtnPause()
|
||||
{
|
||||
try
|
||||
{
|
||||
//判断是否选择单据
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未选择单据!");
|
||||
return;
|
||||
}
|
||||
#region 调用接口结束出库
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goOutOutstore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Warning("已成功结束盘点!");
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("操作失败:调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnQueryCommand { get => new DelegateCommand(BtnQuery); }
|
||||
public void BtnQuery()
|
||||
{
|
||||
try
|
||||
{
|
||||
//请求WMS获取物料明细
|
||||
var request = new ElectronicSiloPushRequest()
|
||||
{
|
||||
materialCode = MatCode,
|
||||
warehouseCode = WareHouseCode
|
||||
};
|
||||
var requeststr = JsonConvert.SerializeObject(request);
|
||||
var result = ApiHelp.MXGetDataFromHttp<List<ElectronicSiloPushDto>>(requeststr, "http://192.168.2.23:9213/integrate/inOut/electronicSiloPush", "POST", true);
|
||||
if (result != null && (result.code == 200) && result.data != null && result.data.Count() > 0)
|
||||
{
|
||||
//通过返回的物料明细查询当前库存中有的数据
|
||||
var matSns = result.data.Select(t => t.materialBar).ToList();
|
||||
//调用 比对库存数据 获取库存中有的数据
|
||||
#region 调用接口 比对库存数据 获取库存中有的数据
|
||||
try
|
||||
{
|
||||
var body = new CompareMatInventoryDetailRequest()
|
||||
{
|
||||
MatSns = matSns,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/compareMatInventoryDetail", body, "POST", true);
|
||||
|
||||
//查询到物料信息
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null && Result.Data.Lists.Count != 0)
|
||||
{
|
||||
var count = Result.Data.Lists.Count;
|
||||
//是否生成盘点单 实际上是出库单
|
||||
var dialogResult = HandyControl.Controls.MessageBox.Show($"共查询到有{count}盘物料,是否生成盘点单?", "提示", MessageBoxButton.YesNo);
|
||||
if (dialogResult == MessageBoxResult.Yes)
|
||||
{
|
||||
#region 调用接口保存出库单据
|
||||
var body1 = new SysOutOrderByMatSnRequest()
|
||||
{
|
||||
IsMXPD = true,
|
||||
OrderType = "出库",
|
||||
OrderSource = "WCS前端",
|
||||
SnList = Result.Data.Lists.Select(t => t.MatSN).ToList(),
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser
|
||||
};
|
||||
var Result1 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatSn", body1, "POST");
|
||||
if (Result1 != null && Result1.Code == 200)
|
||||
{
|
||||
//出库单据保存成功 刷新左侧出库单列表
|
||||
MXPDView.viewModel.RefreshOutOrderList(Result1.Message.ToString());
|
||||
Growl.Success("盘点单据保存成功,请点击【开始盘点】进行盘点下架!");
|
||||
}
|
||||
else if (Result1 != null)
|
||||
{
|
||||
Growl.Warning(Result1.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
else if (Result != null && Result.Code == 200 && (Result.Data == null || Result.Data.Lists == null || Result.Data.Lists.Count == 0))
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show($"未查询到需要盘点的明细!所推荐物料在此货架上不存在,请确认是否在其他货架上!\r\n{string.Join(",\r\n", matSns)}");
|
||||
DataGridItemSource = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show($"未查询到需要盘点的明细!请重试!");
|
||||
DataGridItemSource = null;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show($"未查询到需要盘点的明细!请重试!");
|
||||
DataGridItemSource = null;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("获取WMS系统库存数据失败!" + result?.message);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
//dia.Close();
|
||||
//dia.Collapse();
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshOutOrderList(string OrderNumber = "")
|
||||
{
|
||||
#region 调用接口获取发料单
|
||||
try
|
||||
{
|
||||
var body = new GetOutOrderListByStatusRequest()
|
||||
{
|
||||
OrderExeStatus = new List<OutOrderExeStatus>() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 },
|
||||
IsMXPD = true,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<OutOrderModel>>(LocalFile.Config.ApiIpHost + "outstore/getOutOrderListByStatus", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
OutOrderList = new ObservableCollection<OutOrderModel>(Result.Data.Lists);
|
||||
if (!string.IsNullOrEmpty(OrderNumber))
|
||||
{
|
||||
SelectedOutOrder = OutOrderList.Where(t => t.OrderNumber == OrderNumber).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Warning(ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public void RefreshDataGridItemSource()
|
||||
{
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
//选择的单据为空无法进行查询
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取出库单物料明细
|
||||
Task.Run(() =>
|
||||
{
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<OutOrderMatDetailModel>>>(LocalFile.Config.ApiIpHost + "outStore/getOutOrderMatDetail", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
if (Result.Data.Count > 0)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<OutOrderMatDetailModel>(Result.Data);
|
||||
OrderStatus = Result.Message;
|
||||
}
|
||||
else
|
||||
{
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
});
|
||||
Growl.Warning("该单据未查询到发料明细!");
|
||||
}
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,325 +0,0 @@
|
||||
using HandyControl.Controls;
|
||||
using MiniExcelLibs;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using 智慧物流软件系统.Views.Controls;
|
||||
using 智慧物流软件系统.Api;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.Home;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using WCS.Model.ApiModel;
|
||||
using Newtonsoft.Json.Bson;
|
||||
using System.Windows;
|
||||
|
||||
namespace 智慧物流软件系统.ViewModel
|
||||
{
|
||||
public class ModuleInfoViewModel : BindableBase
|
||||
{
|
||||
public ModuleInfoViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#region Property
|
||||
private List<ModuleInfoModel> dataGridItemSource;
|
||||
public List<ModuleInfoModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ModuleInfoModel selectedataGridItem;
|
||||
public ModuleInfoModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedataGridItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string shelfCode;
|
||||
public string ShelfCode
|
||||
{
|
||||
get { return shelfCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref shelfCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string moduleCode;
|
||||
|
||||
public string ModuleCode
|
||||
{
|
||||
get => moduleCode;
|
||||
set { SetProperty(ref moduleCode, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||
public void BtnReset()
|
||||
{
|
||||
ModuleCode = string.Empty;
|
||||
ShelfCode = string.Empty;
|
||||
}
|
||||
|
||||
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearchReset); }
|
||||
public void BtnSearchReset()
|
||||
{
|
||||
BtnSearch(true);
|
||||
}
|
||||
|
||||
public void BtnSearch(bool IsPageReset = true)
|
||||
{
|
||||
if (CurrentPage == 0 || IsPageReset)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取数据
|
||||
var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
var body = new GetModulesRequest()
|
||||
{
|
||||
ShelfCode = ShelfCode,
|
||||
ModuleCode = ModuleCode,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = PageSize,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<ModuleInfoModel>>(LocalFile.Config.ApiIpHost + "storeInfo/getModules", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
{
|
||||
DataGridItemSource = Result.Data.Lists;
|
||||
MaxPage = Result.Data.MaxPage;
|
||||
TotalCount = Result.Data.TotalCount;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
dia.Close();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||
public void BtnDelete()
|
||||
{
|
||||
//查询勾选的第一个数据
|
||||
var shelfInfo = DataGridItemSource?.Where(t => t.IsSelected == true).FirstOrDefault();
|
||||
if (shelfInfo == null)
|
||||
{
|
||||
Growl.Warning("请选择需要删除的数据!");
|
||||
}
|
||||
else
|
||||
{
|
||||
var body = new AddShelfInfoRequest<ShelfInfoModel>()
|
||||
{
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
//ShelfInfo = shelfInfo,
|
||||
AddOrUpdate = AddOrUpdate.Delete
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase<object>>(LocalFile.Config.ApiIpHost + "storeInfo/addOrUpdateShelfInfo", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Success("删除成功!");
|
||||
CurrentPage = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Error($"{Result?.Message?.ToString()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand DisableCommand { get => new DelegateCommand<ModuleInfoModel>(Disable); }
|
||||
public void Disable(ModuleInfoModel module)
|
||||
{
|
||||
if (module.IsEnable != true)
|
||||
{
|
||||
Growl.Warning("库位未被启用!");
|
||||
return;
|
||||
}
|
||||
var result = HandyControl.Controls.MessageBox.Show("模组禁用会影响正常流程,请确认是否屏蔽?"
|
||||
, "提示", MessageBoxButton.YesNo);
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
#region 调用接口 禁用
|
||||
try
|
||||
{
|
||||
var body = new DisableOrEnableModuleRequest()
|
||||
{
|
||||
ModuleId = module.Id,
|
||||
ModuleCode = module.ModuleCode,
|
||||
DisableOrEnable = DisableOrEnableEnum.Disable,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/disableOrEnableModule", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Success("禁用成功");
|
||||
BtnSearch();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("操作失败:请重试!");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("操作失败:" + ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand EnableCommand { get => new DelegateCommand<ModuleInfoModel>(Enable); }
|
||||
public void Enable(ModuleInfoModel module)
|
||||
{
|
||||
if (module.IsEnable == true)
|
||||
{
|
||||
Growl.Warning("库位未被禁用!");
|
||||
return;
|
||||
}
|
||||
#region 调用接口 临时禁用库位 删除库存数据
|
||||
try
|
||||
{
|
||||
var body = new DisableOrEnableModuleRequest()
|
||||
{
|
||||
ModuleId = module.Id,
|
||||
ModuleCode = module.ModuleCode,
|
||||
DisableOrEnable = DisableOrEnableEnum.Enable,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/disableOrEnableModule", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Success("操作成功!");
|
||||
BtnSearch();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("操作失败:请重试!");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("操作失败:" + ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PageOperation 分页操作
|
||||
private int currentPage;
|
||||
public int CurrentPage
|
||||
{
|
||||
get { return currentPage; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref currentPage, value);
|
||||
BtnSearch(false);
|
||||
}
|
||||
}
|
||||
|
||||
private int maxPage;
|
||||
public int MaxPage
|
||||
{
|
||||
get { return maxPage; }
|
||||
set { SetProperty(ref maxPage, value); }
|
||||
}
|
||||
|
||||
//总数量
|
||||
private int totalCount;
|
||||
public int TotalCount
|
||||
{
|
||||
get { return totalCount; }
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set
|
||||
{
|
||||
SetProperty(ref pageSize, value);
|
||||
BtnSearch(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
CurrentPage = 1;
|
||||
}
|
||||
|
||||
public ICommand BtnPrePageCommand { get => new DelegateCommand(BtnPrePage); }
|
||||
public void BtnPrePage()
|
||||
{
|
||||
if (CurrentPage > 1)
|
||||
{
|
||||
CurrentPage--;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnNextPageCommand { get => new DelegateCommand(BtnNextPage); }
|
||||
public void BtnNextPage()
|
||||
{
|
||||
if (CurrentPage < MaxPage)
|
||||
{
|
||||
CurrentPage++;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnLastPageCommand { get => new DelegateCommand(BtnLastPage); }
|
||||
public void BtnLastPage()
|
||||
{
|
||||
if (CurrentPage != MaxPage)
|
||||
{
|
||||
CurrentPage = MaxPage;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -1,339 +0,0 @@
|
||||
using HandyControl.Controls;
|
||||
using MiniExcelLibs;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using 智慧物流软件系统.Views.Controls;
|
||||
using 智慧物流软件系统.Api;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.Home;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using WCS.Model.ApiModel;
|
||||
using Newtonsoft.Json.Bson;
|
||||
using System.Windows;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace 智慧物流软件系统.ViewModel
|
||||
{
|
||||
public class StoreInfoViewModel : BindableBase
|
||||
{
|
||||
public StoreInfoViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#region Property
|
||||
private List<StoreInfoModel> dataGridItemSource;
|
||||
public List<StoreInfoModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
private StoreInfoModel selectedataGridItem;
|
||||
public StoreInfoModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedataGridItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string shelfCode;
|
||||
public string ShelfCode
|
||||
{
|
||||
get { return shelfCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref shelfCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string moduleCode;
|
||||
public string ModuleCode
|
||||
{
|
||||
get => moduleCode;
|
||||
set { SetProperty(ref moduleCode, value); }
|
||||
}
|
||||
|
||||
private string storeCode;
|
||||
public string StoreCode
|
||||
{
|
||||
get => storeCode;
|
||||
set { SetProperty(ref storeCode, value); }
|
||||
}
|
||||
|
||||
private string currentMatSN;
|
||||
public string CurrentMatSN
|
||||
{
|
||||
get => currentMatSN;
|
||||
set { SetProperty(ref currentMatSN, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||
public void BtnReset()
|
||||
{
|
||||
ShelfCode = string.Empty;
|
||||
ModuleCode = string.Empty;
|
||||
StoreCode = string.Empty;
|
||||
CurrentMatSN = string.Empty;
|
||||
}
|
||||
|
||||
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearchReset); }
|
||||
public void BtnSearchReset()
|
||||
{
|
||||
BtnSearch(true);
|
||||
}
|
||||
|
||||
public void BtnSearch(bool IsPageReset = true)
|
||||
{
|
||||
if (CurrentPage == 0 || IsPageReset)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取数据
|
||||
var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
var body = new GetStoresRequest()
|
||||
{
|
||||
ShelfCode = ShelfCode,
|
||||
ModuleCode = ModuleCode,
|
||||
StoreCode = StoreCode,
|
||||
CurrentMatSN = CurrentMatSN,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = PageSize,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<StoreInfoModel>>(LocalFile.Config.ApiIpHost + "storeInfo/getStores", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
{
|
||||
DataGridItemSource = Result.Data.Lists;
|
||||
MaxPage = Result.Data.MaxPage;
|
||||
TotalCount = Result.Data.TotalCount;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
dia.Close();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public ICommand DisableCommand { get => new DelegateCommand<StoreInfoModel>(Disable); }
|
||||
public void Disable(StoreInfoModel store)
|
||||
{
|
||||
var result = HandyControl.Controls.MessageBox.Show("库位屏蔽仅用于临时屏蔽硬件损坏识别的未扫描上架!\r\n" +
|
||||
"操作时会删除对应库位的数据,需要保证对应库位物料已取出。\r\n" +
|
||||
"请确认是否进行操作?"
|
||||
, "提示", MessageBoxButton.YesNo);
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
#region 调用接口 临时禁用库位 删除库存数据
|
||||
try
|
||||
{
|
||||
var body = new DisableOrEnableStoreRequest()
|
||||
{
|
||||
StoreId = store.Id,
|
||||
SroreCode = store.StoreCode,
|
||||
DisableOrEnable = DisableOrEnableEnum.Disable,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/disableOrEnableStore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Success("禁用成功");
|
||||
BtnSearch();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("操作失败:请重试!");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("操作失败:" + ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand EnableCommand { get => new DelegateCommand<StoreInfoModel>(Enable); }
|
||||
public void Enable(StoreInfoModel store)
|
||||
{
|
||||
if (store.CurrentMatSn != "禁用")
|
||||
{
|
||||
Growl.Warning("库位未被禁用!");
|
||||
return;
|
||||
}
|
||||
#region 调用接口 临时禁用库位 删除库存数据
|
||||
try
|
||||
{
|
||||
var body = new DisableOrEnableStoreRequest()
|
||||
{
|
||||
StoreId = store.Id,
|
||||
SroreCode = store.StoreCode,
|
||||
DisableOrEnable = DisableOrEnableEnum.Enable,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/disableOrEnableStore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Success("操作成功!");
|
||||
BtnSearch();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("操作失败:请重试!");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("操作失败:" + ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnDisablePercentCommand { get => new DelegateCommand(DisablePercent); }
|
||||
public void DisablePercent()
|
||||
{
|
||||
#region 调用接口 获取屏蔽率
|
||||
try
|
||||
{
|
||||
var body = new DisableOrEnableStoreRequest()
|
||||
{
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/getDisablePercent", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show(Result.Data.ToString());
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("操作失败:请重试!");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("操作失败:" + ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PageOperation 分页操作
|
||||
private int currentPage;
|
||||
public int CurrentPage
|
||||
{
|
||||
get { return currentPage; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref currentPage, value);
|
||||
BtnSearch(false);
|
||||
}
|
||||
}
|
||||
|
||||
private int maxPage;
|
||||
public int MaxPage
|
||||
{
|
||||
get { return maxPage; }
|
||||
set { SetProperty(ref maxPage, value); }
|
||||
}
|
||||
|
||||
//总数量
|
||||
private int totalCount;
|
||||
public int TotalCount
|
||||
{
|
||||
get { return totalCount; }
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set
|
||||
{
|
||||
SetProperty(ref pageSize, value);
|
||||
BtnSearch(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
CurrentPage = 1;
|
||||
}
|
||||
|
||||
public ICommand BtnPrePageCommand { get => new DelegateCommand(BtnPrePage); }
|
||||
public void BtnPrePage()
|
||||
{
|
||||
if (CurrentPage > 1)
|
||||
{
|
||||
CurrentPage--;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnNextPageCommand { get => new DelegateCommand(BtnNextPage); }
|
||||
public void BtnNextPage()
|
||||
{
|
||||
if (CurrentPage < MaxPage)
|
||||
{
|
||||
CurrentPage++;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnLastPageCommand { get => new DelegateCommand(BtnLastPage); }
|
||||
public void BtnLastPage()
|
||||
{
|
||||
if (CurrentPage != MaxPage)
|
||||
{
|
||||
CurrentPage = MaxPage;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,315 +0,0 @@
|
||||
<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">PDA盘点单</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">PDA盘点</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:MXPDView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.库存查询},Converter={StaticResource AuthVisConverter}}">
|
||||
<TabItem.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" 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 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>
|
||||
</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>
|
@ -1,57 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,206 +0,0 @@
|
||||
<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.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListViewItemBaseStyle}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="ListBoxItem.IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="CadetBlue"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="ListBoxItem.IsSelected" Value="true" />
|
||||
<Condition Property="Selector.IsSelectionActive" Value="false" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" Value="CadetBlue"/>
|
||||
</MultiTrigger>
|
||||
<DataTrigger Binding="{Binding IsOuting}" Value="True">
|
||||
<Setter Property="Foreground" Value="Red" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsOuting}" Value="False">
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
</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="12*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<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="Green" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityConverter}}"></Ellipse>
|
||||
<Ellipse Width="20" Height="20" Fill="Gray" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityReConverter}}"></Ellipse>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="已取料" Binding="{Binding IsSended,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||
<DataGridTextColumn 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="Left" VerticalAlignment="Top" Grid.Column="0">
|
||||
<Rectangle Width="12" Height="12" Fill="Red"></Rectangle>
|
||||
<TextBlock Text="列表中红色字体表示单据正在发料" FontSize="14"></TextBlock>
|
||||
</StackPanel>
|
||||
<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>
|
@ -1,69 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
<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>
|
@ -1,158 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
<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>
|
@ -1,157 +0,0 @@
|
||||
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-9A-Za-z]+$"))
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,235 +0,0 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="智慧物流软件系统.MXPDView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:converter="clr-namespace:智慧物流软件系统"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="737" d:DesignWidth="1192">
|
||||
<Border Margin="0" Background="LightGray" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.8*"></RowDefinition>
|
||||
<RowDefinition Height="9*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Margin="0" Background="AliceBlue" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="料 号 :" FontSize="20" ></TextBlock>
|
||||
<TextBox Grid.Column="1" Text="{Binding MatCode}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="20" MinWidth="160" ></TextBox>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="仓库代码:" FontSize="20" ></TextBlock>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding WareHouseCode}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="20" MinWidth="160" ></TextBox>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Row="1" Grid.Column="2" MinHeight="45" FontSize="28" Content="获取明细" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnQueryCommand}">
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Row="1" Grid.Column="4" MinHeight="45" FontSize="28" Content="开始盘点" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnStartCommand}"
|
||||
>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Row="1" Grid.Column="5" MinHeight="45" FontSize="28" Content="结束盘点" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnPauseCommand}">
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="0" Background="LightGray" Padding="0">
|
||||
<Border Margin="1" CornerRadius="3" Background="AliceBlue" Padding="0">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<StackPanel Grid.Column="2" VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<TextBlock FontSize="26" Text="当前盘点单:">
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="26" Text="{Binding SelectedPickBillNumber}">
|
||||
</TextBlock>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--</TabItem>-->
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" Margin="0" Background="AliceBlue" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="8*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="6*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="12*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="盘点单列表" MouseDown="TextBlock_MouseDown" FontWeight="DemiBold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center"></TextBlock>
|
||||
<Border CornerRadius="3" Margin="1" Grid.Row="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Visible">
|
||||
<ListView FontSize="18" ItemsSource="{Binding OutOrderList}" SelectedItem="{Binding SelectedOutOrder,Mode=TwoWay}" PreviewMouseWheel="ListView_PreviewMouseWheel">
|
||||
<ListView.View>
|
||||
|
||||
<GridView AllowsColumnReorder="False">
|
||||
<GridView.ColumnHeaderContainerStyle>
|
||||
<Style TargetType="{x:Type GridViewColumnHeader}">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</Style>
|
||||
</GridView.ColumnHeaderContainerStyle>
|
||||
<GridViewColumn DisplayMemberBinding="{Binding OrderNumber}"/>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<Border CornerRadius="3" Margin="1" Grid.Row="0" Grid.Column="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="12*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" >
|
||||
<TextBlock Text="当前盘点单:" FontSize="24">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding SelectedPickBillNumber}" FontSize="24">
|
||||
</TextBlock>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid Grid.Row="2"
|
||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="40"
|
||||
AutoGenerateColumns="False" FontSize="15">
|
||||
<DataGrid.Resources>
|
||||
<converter:WorkItemBackgroundConverter x:Key="converter"/>
|
||||
</DataGrid.Resources>
|
||||
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="{Binding Path=IsSend, Converter={StaticResource converter}}"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header="" CanUserResize="False" Width="50">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<Ellipse Width="20" Height="20" Fill="Green" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityConverter}}"></Ellipse>
|
||||
<Ellipse Width="20" Height="20" Fill="Gray" Visibility="{Binding IsSended,Converter={StaticResource Boolean2VisibilityReConverter}}"></Ellipse>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="已取料" Binding="{Binding IsSended,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" MaxWidth="300" Header="规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="False" Header="最小包装条码" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid Grid.Row="2" Grid.ColumnSpan="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="5 0 1 0" VerticalAlignment="Top" Width="Auto" Height="40">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="8.5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="4*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0">
|
||||
<TextBlock Text=" 当前状态:" FontSize="24">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding OrderStatus,FallbackValue=未知}" Foreground="red" FontSize="24">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
|
||||
<TextBlock Text="物料总数量:" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding TotalCount,FallbackValue=0}" FontSize="20">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2">
|
||||
<TextBlock Text="总盘数:" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock Text=" 取料进度:" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding SendedPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="/" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<!--<TextBlock Text=" 未出盘数:" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding UnSendedPan}" VerticalAlignment="Bottom" FontSize="20">
|
||||
</TextBlock>-->
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
@ -1,59 +0,0 @@
|
||||
using Ping9719.WpfEx;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Text.RegularExpressions;
|
||||
using 智慧物流软件系统.ViewModel;
|
||||
|
||||
namespace 智慧物流软件系统
|
||||
{
|
||||
public partial class MXPDView : UserControlBase
|
||||
{
|
||||
public static MXPDViewModel viewModel { get; set; } = new MXPDViewModel();
|
||||
public MXPDView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataGrid datagrid = sender as DataGrid;
|
||||
datagrid.UnselectAllCells();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
viewModel.RefreshOutOrderList(viewModel.SelectedOutOrderNumber);
|
||||
}
|
||||
private void ListView_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
if (!e.Handled)
|
||||
{
|
||||
e.Handled = true;
|
||||
// 激发一个鼠标滚轮事件,冒泡给外层ListView接收到
|
||||
var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
|
||||
eventArg.RoutedEvent = UIElement.MouseWheelEvent;
|
||||
eventArg.Source = sender;
|
||||
var parent = ((Control)sender).Parent as UIElement;
|
||||
parent.RaiseEvent(eventArg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -184,24 +184,10 @@
|
||||
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>
|
||||
|
@ -294,24 +294,12 @@
|
||||
<View:InOutRecordView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
|
||||
<TabItem Header="货架管理" Height="{Binding TabItemHeight}">
|
||||
<TabItem Header="货架管理"
|
||||
Height="{Binding TabItemHeight}">
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:ShelfInfoView />
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
<TabItem Header="模组管理" Height="{Binding TabItemHeight}">
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:ModuleInfoView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
<TabItem Header="库位管理" Height="{Binding TabItemHeight}">
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:StoreInfoView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="物料维护" Height="{Binding TabItemHeight}">
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:MatBaseInfoView/>
|
||||
|
@ -1,168 +0,0 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="智慧物流软件系统.ModuleInfoView"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="737" d:DesignWidth="1192" LoadedVisibleFirst="LoadedVisible">
|
||||
<Border Margin="0" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Margin="0" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="货架编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding ShelfCode}"></TextBox>
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="模组编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="3"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding ModuleCode}"></TextBox>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="9" MinHeight="40" FontSize="18" Content=" 搜索" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnSearchCommand}">
|
||||
</Button>
|
||||
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="10" MinHeight="40" FontSize="18" Content=" 重置" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnResetCommand}">
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="9*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DataGrid
|
||||
Grid.Row="1"
|
||||
SelectedItem="{Binding SelectedataGridItem}"
|
||||
Name="dataGrid"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
SelectionChanged="dataGrid_SelectionChanged"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" FontSize="13">
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu Name="dgmenu1" StaysOpen="true">
|
||||
<MenuItem Header="查询当前标定值/电压值" Click="MenuItem_Click"/>
|
||||
<MenuItem Header="标定+设置偏移量" Click="CalibrationOffset_Click"/>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="货架编码" Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="模组编码" Binding="{Binding ModuleCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="板ID" Binding="{Binding BoardId}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单板灯数量" Binding="{Binding LightCount}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="TCP连接信息" Binding="{Binding CleintIp}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="R" Binding="{Binding R}"></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 BigShelfCode}"></DataGridTextColumn>
|
||||
<DataGridTemplateColumn CanUserResize="False" Width="auto">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsAdmin,Converter={StaticResource Boolean2BooleanReConverter}}">
|
||||
<Button Style="{StaticResource ButtonWarning}" Margin="0,0,5,0" IsEnabled="True" Content="禁用" Width="60" Command="{Binding DataContext.DisableCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }" />
|
||||
<Button Style="{StaticResource ButtonDanger}" Margin="0,0,0,0" IsEnabled="True" Content="启用" Width="60" Command="{Binding DataContext.EnableCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top" Width="Auto" MinHeight="26">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="条记录 "></TextBlock>
|
||||
|
||||
|
||||
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="0" Name="btnFirst" Content="首页" Foreground="Black" FontSize="14"
|
||||
Command="{Binding BtnFirstPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="1" Name="btnPrev" Content="上一页" FontSize="14"
|
||||
Command="{Binding BtnPrePageCommand}"/>
|
||||
<TextBox BorderBrush="Transparent" Grid.Column="2" FontSize="14" MinWidth="50" HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="IBeam" IsEnabled="False"
|
||||
Text ="{Binding CurrentPage}" TextAlignment="Center"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Name="btnNext" Content="下一页" FontSize="14"
|
||||
Command="{Binding BtnNextPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="4" Name="btnLast" Content="末页" FontSize="14"
|
||||
Command="{Binding BtnLastPageCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
@ -1,141 +0,0 @@
|
||||
using HandyControl.Controls;
|
||||
using Ping9719.WpfEx;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
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 WCS.Model;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
using 智慧物流软件系统.Api;
|
||||
using 智慧物流软件系统.ViewModel;
|
||||
using 智慧物流软件系统.Views.Controls;
|
||||
|
||||
namespace 智慧物流软件系统
|
||||
{
|
||||
public partial class ModuleInfoView : UserControlBase
|
||||
{
|
||||
public ModuleInfoViewModel viewModel { get; set; } = new ModuleInfoViewModel();
|
||||
public ModuleInfoView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 更新选中项的状态
|
||||
if (dataGrid.SelectedCells.Count > 0 && viewModel.SelectedataGridItem != null)
|
||||
{
|
||||
viewModel.SelectedataGridItem.IsSelected = !viewModel.SelectedataGridItem.IsSelected;
|
||||
//dataGrid.UnselectAllCells(); // 取消选中所有单元格
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("SelectionChanged event handler failed: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//先获取选中的模组
|
||||
var module = viewModel.SelectedataGridItem;
|
||||
#region 调用接口 发送指令进行查询
|
||||
try
|
||||
{
|
||||
var body = new QueryModuleVoltageRequest()
|
||||
{
|
||||
MouduleIds = new List<int>() { module.Id },
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/queryModuleVoltage", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Success("操作成功:可以进行查询!");
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Success(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("操作失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
private void CalibrationOffset_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//获取选中得模组
|
||||
var module = viewModel.SelectedataGridItem;
|
||||
#region 弹出输入账号密码的窗口 输入偏移量的功能
|
||||
var window = new CalibrationWindow(module.BoardId,module.Id,module.ModuleCode);
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.Topmost = true;
|
||||
window.ShowDialog();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
@ -1,188 +0,0 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="智慧物流软件系统.StoreInfoView"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="737" d:DesignWidth="1192" LoadedVisibleFirst="LoadedVisible">
|
||||
<Border Margin="0" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.4*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2.5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2.5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="货架编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding ShelfCode}"></TextBox>
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="模组编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="3"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding ModuleCode}"></TextBox>
|
||||
<TextBlock Grid.Column="4"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="库位编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding StoreCode}"></TextBox>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="当前物料:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="1" Grid.Row="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding CurrentMatSN}"></TextBox>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="12"
|
||||
Grid.Column="8" MinHeight="40" FontSize="18" Content=" 搜索" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnSearchCommand}">
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="12"
|
||||
Grid.Column="9" MinHeight="40" FontSize="18" Content=" 重置" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnResetCommand}">
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="12"
|
||||
Grid.Column="8" Grid.Row="1" MinHeight="30" FontSize="18" Content=" 屏蔽率" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnDisablePercentCommand}">
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="9*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DataGrid Grid.Row="1"
|
||||
SelectedItem="{Binding SelectedataGridItem}"
|
||||
Name="dataGrid"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
SelectionChanged="dataGrid_SelectionChanged"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" FontSize="13">
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu Name="dgmenu1" StaysOpen="true">
|
||||
<MenuItem Header="查询历史电压" Click="MenuItem_Click"/>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="货架编码" Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="模组编码" Binding="{Binding ModuleCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="库位编码" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn IsReadOnly="True" Header="PCB板ID" Binding="{Binding BoardId}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="储位号" Binding="{Binding LightNumber}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn IsReadOnly="True" Header="电压标准值" Binding="{Binding StandardVoltage}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="电压偏移值" Binding="{Binding OffsetVoltage}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="当前电压" Binding="{Binding CurrentVoltage}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="当前物料" Binding="{Binding CurrentMatSn}"></DataGridTextColumn>
|
||||
<DataGridTemplateColumn CanUserResize="False" Width="auto">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsAdmin,Converter={StaticResource Boolean2BooleanReConverter}}">
|
||||
<Button Style="{StaticResource ButtonWarning}" Margin="0,0,5,0" IsEnabled="True" Content="禁用" Width="60" Command="{Binding DataContext.DisableCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }" />
|
||||
<Button Style="{StaticResource ButtonDanger}" Margin="0,0,0,0" IsEnabled="True" Content="启用" Width="60" Command="{Binding DataContext.EnableCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top" Width="Auto" MinHeight="26">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="条记录 "></TextBlock>
|
||||
|
||||
|
||||
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="0" Name="btnFirst" Content="首页" Foreground="Black" FontSize="14"
|
||||
Command="{Binding BtnFirstPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="1" Name="btnPrev" Content="上一页" FontSize="14"
|
||||
Command="{Binding BtnPrePageCommand}"/>
|
||||
<TextBox BorderBrush="Transparent" Grid.Column="2" FontSize="14" MinWidth="50" HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="IBeam" IsEnabled="False"
|
||||
Text ="{Binding CurrentPage}" TextAlignment="Center"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Name="btnNext" Content="下一页" FontSize="14"
|
||||
Command="{Binding BtnNextPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="4" Name="btnLast" Content="末页" FontSize="14"
|
||||
Command="{Binding BtnLastPageCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
@ -1,139 +0,0 @@
|
||||
using HandyControl.Controls;
|
||||
using Ping9719.WpfEx;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
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 WCS.Model.ApiModel.StoreInfo;
|
||||
using WCS.Model;
|
||||
using 智慧物流软件系统.ViewModel;
|
||||
using 智慧物流软件系统.Api;
|
||||
|
||||
namespace 智慧物流软件系统
|
||||
{
|
||||
public partial class StoreInfoView : UserControlBase
|
||||
{
|
||||
public StoreInfoViewModel viewModel { get; set; } = new StoreInfoViewModel();
|
||||
public StoreInfoView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 更新选中项的状态
|
||||
if (dataGrid.SelectedCells.Count > 0 && viewModel.SelectedataGridItem != null)
|
||||
{
|
||||
viewModel.SelectedataGridItem.IsSelected = !viewModel.SelectedataGridItem.IsSelected;
|
||||
//dataGrid.UnselectAllCells(); // 取消选中所有单元格
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Debug.WriteLine("SelectionChanged event handler failed: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//先获取选中的模组
|
||||
var storeInfo = viewModel.SelectedataGridItem;
|
||||
#region 调用接口 发送指令进行查询
|
||||
try
|
||||
{
|
||||
var body = new QueryStoreInfoHistoryVoltageRequest()
|
||||
{
|
||||
StoreIds = new List<int>() { storeInfo.Id },
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<StoreInfoHistoryVoltageModel>>>(LocalFile.Config.ApiIpHost + "storeInfo/queryStoreInfoHistoryVoltage", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
if (Result.Data == null || Result.Data.Count == 0)
|
||||
{
|
||||
Growl.Success("查询成功!该库位没有历史电压值数据!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Success("查询成功!请查看弹窗内数据!");
|
||||
var window = new StoreInfoHistoryVoltageWindow(Result.Data, storeInfo.StoreCode);
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Success(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Warning("查询失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
@ -100,16 +100,19 @@ namespace 智慧物流软件系统
|
||||
{
|
||||
case WarningTypeEnum.通知刷新出库:
|
||||
if (LocalFile.Config.IsMx)
|
||||
MXOutInventoryView.viewModel.RefreshDataGridItemSource();
|
||||
;
|
||||
//MXOutInventoryView.viewModel.RefreshDataGridItemSource();
|
||||
else
|
||||
OutVentoryView.viewModel.RefreshDataGridItemSource();
|
||||
client.Send(e.DataFrame.ToText());
|
||||
break;
|
||||
case WarningTypeEnum.通知刷新出库单列表:
|
||||
if (LocalFile.Config.IsMx)
|
||||
MXOutInventoryView.viewModel.RefreshOutOrderList(MXOutInventoryView.viewModel.SelectedOutOrderNumber);
|
||||
;
|
||||
//MXOutInventoryView.viewModel.RefreshOutOrderList(MXOutInventoryView.viewModel.SelectedOutOrderNumber);
|
||||
else
|
||||
OutVentoryView.viewModel.RefreshOutOrderList(MXOutInventoryView.viewModel.SelectedOutOrderNumber);
|
||||
;
|
||||
//OutVentoryView.viewModel.RefreshOutOrderList(MXOutInventoryView.viewModel.SelectedOutOrderNumber);
|
||||
client.Send(e.DataFrame.ToText());
|
||||
break;
|
||||
case WarningTypeEnum.通知刷新盘点:
|
||||
@ -117,7 +120,8 @@ namespace 智慧物流软件系统
|
||||
client.Send(e.DataFrame.ToText());
|
||||
break;
|
||||
case WarningTypeEnum.通知刷新盟讯盘点:
|
||||
MXPDView.viewModel.RefreshDataGridItemSource();
|
||||
;
|
||||
//MXPDView.viewModel.RefreshDataGridItemSource();
|
||||
client.Send(e.DataFrame.ToText());
|
||||
break;
|
||||
case WarningTypeEnum.恢复正常:
|
||||
|
Reference in New Issue
Block a user