1.出库界面展示当前正在进行出库的单据
2.后台退出了入库模式 通知前台扫码枪退出入库 3.对接盟讯公司登录Mes接口 4.接口记录增加本地日志排查问题
This commit is contained in:
@ -98,6 +98,12 @@ namespace WCS.BLL.DbModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
public int RowNumber { get; set; }
|
public int RowNumber { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回当前是否正在进行出库
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public bool IsOuting { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -291,6 +291,21 @@ namespace WCS.BLL.HardWare
|
|||||||
}
|
}
|
||||||
//报警灯熄灭
|
//报警灯熄灭
|
||||||
WarningLight.CloseLight(TcpCleint);
|
WarningLight.CloseLight(TcpCleint);
|
||||||
|
//通知前台货架已结束入库
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
var warningModel = new WebSocketMessageModel()
|
||||||
|
{
|
||||||
|
IsWarning = false,
|
||||||
|
WarningType = WarningTypeEnum.通知前台结束入库,
|
||||||
|
StoreId = 0,
|
||||||
|
StoreCode = "",
|
||||||
|
ShelfCode = ShelfCode,
|
||||||
|
ShelfId = ShelfId,
|
||||||
|
ClientIp = WebSocketIpAddress,
|
||||||
|
};
|
||||||
|
WarningManager.SendWarning(warningModel);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GoInOutstore(List<OutOrderMatDetail> MatDetails, OutOrder outOrder)
|
public void GoInOutstore(List<OutOrderMatDetail> MatDetails, OutOrder outOrder)
|
||||||
|
@ -145,8 +145,8 @@ namespace WCS.BLL.Manager
|
|||||||
.ToList();
|
.ToList();
|
||||||
foreach (var shelf in outStoreShelf)
|
foreach (var shelf in outStoreShelf)
|
||||||
{
|
{
|
||||||
|
Logs.Write($"【定时任务:定时退出模式】货架【{shelf.ShelfCode}】超时(5min)未退出出库模式,系统后台自动退出!出库单[{shelf.OrderNumber}]");
|
||||||
shelf.GoOutOutstore();
|
shelf.GoOutOutstore();
|
||||||
Logs.Write($"【定时任务:定时退出模式】货架【{shelf.ShelfCode}】超时(5min)未退出出库模式,系统后台自动退出!");
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -156,14 +156,14 @@ namespace WCS.BLL.Manager
|
|||||||
.ToList();
|
.ToList();
|
||||||
foreach (var shelf in stockTakingShelf)
|
foreach (var shelf in stockTakingShelf)
|
||||||
{
|
{
|
||||||
|
Logs.Write($"【定时任务:定时退出模式】货架【{shelf.ShelfCode}】超时(5min)未退出盘点模式,系统后台自动退出!盘点单[{shelf.OrderNumber}]");
|
||||||
shelf.GoOutStocktaking();
|
shelf.GoOutStocktaking();
|
||||||
Logs.Write($"【定时任务:定时退出模式】货架【{shelf.ShelfCode}】超时(5min)未退出盘点模式,系统后台自动退出!");
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logs.Write("【定时任务:定时退出模式】" + e.Message,LogsType.Info);
|
Logs.Write("【定时任务:定时退出模式】" + e.Message, LogsType.Info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -286,7 +286,7 @@ namespace WCS.BLL.Manager
|
|||||||
Logs.Write($"【定时任务】:监测警示灯关灯机制,关【{shelf.ShelfCode}】灯发送指令成功!");
|
Logs.Write($"【定时任务】:监测警示灯关灯机制,关【{shelf.ShelfCode}】灯发送指令成功!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logs.Write($"【定时任务】:监测警示灯关灯机制,关【{shelf.ShelfCode}】灯发生异常" + ex.Message);
|
Logs.Write($"【定时任务】:监测警示灯关灯机制,关【{shelf.ShelfCode}】灯发生异常" + ex.Message);
|
||||||
}
|
}
|
||||||
|
@ -474,23 +474,30 @@ namespace WCS.BLL.Services.Service
|
|||||||
var recordsQueryable = DbHelp.db.Queryable<OutOrder>()
|
var recordsQueryable = DbHelp.db.Queryable<OutOrder>()
|
||||||
.Where(t => request.OrderExeStatus.Contains(t.OutOrderExeStatus))
|
.Where(t => request.OrderExeStatus.Contains(t.OutOrderExeStatus))
|
||||||
.WhereIF(request.IsMXPD != null, t => t.IsMXPD == request.IsMXPD)
|
.WhereIF(request.IsMXPD != null, t => t.IsMXPD == request.IsMXPD)
|
||||||
.WhereIF(LocalFile.Config.IsMx, t => t.CreateTime > DateTime.Now.AddDays(-3));
|
.WhereIF(LocalFile.Config.IsMx, t => t.CreateTime > DateTime.Now.AddDays(-3))
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName);
|
||||||
|
|
||||||
var totalCount = await recordsQueryable.CountAsync();
|
var totalCount = await recordsQueryable.CountAsync();
|
||||||
var records = await recordsQueryable
|
var records = await recordsQueryable
|
||||||
.OrderByDescending(t => t.CreateTime)
|
.OrderByDescending(t => t.CreateTime)
|
||||||
//.Take(request.PageSize)
|
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
//获取后台当前正在进行出库的订单 将出库状态反馈给前端
|
||||||
|
var outingOrderNumbers = ShelfManager.Shelves
|
||||||
|
.Where(t => t.CurrentMode == HardWare.Mode.出库模式).Select(t => t.OrderNumber)
|
||||||
|
.ToList();
|
||||||
|
foreach (var record in records)
|
||||||
|
{
|
||||||
|
if (outingOrderNumbers.Contains(record.OrderNumber))
|
||||||
|
record.IsOuting = true;
|
||||||
|
}
|
||||||
|
|
||||||
return new PageQueryResponse<OutOrder>()
|
return new PageQueryResponse<OutOrder>()
|
||||||
{
|
{
|
||||||
Code = 200,
|
Code = 200,
|
||||||
Message = $"success",
|
Message = $"success",
|
||||||
Data = new PageQueryResponseData<OutOrder>()
|
Data = new PageQueryResponseData<OutOrder>()
|
||||||
{
|
{
|
||||||
//TotalCount = totalCount,
|
|
||||||
//MaxPage = request.PageSize == 0 ? 0 : (int)Math.Ceiling((decimal)totalCount / request.PageSize),
|
|
||||||
//Count = records.Count,
|
|
||||||
Lists = records.ToList()
|
Lists = records.ToList()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -5,12 +5,16 @@ using System.Text;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TouchSocket.Core;
|
using TouchSocket.Core;
|
||||||
|
using WCS.BLL.Config;
|
||||||
|
using WCS.BLL.DbModels;
|
||||||
using WCS.BLL.Manager;
|
using WCS.BLL.Manager;
|
||||||
using WCS.BLL.Services.IService;
|
using WCS.BLL.Services.IService;
|
||||||
|
using WCS.BLL.Tool;
|
||||||
using WCS.DAL;
|
using WCS.DAL;
|
||||||
using WCS.DAL.Db.AuthDb;
|
using WCS.DAL.Db.AuthDb;
|
||||||
using WCS.Model;
|
using WCS.Model;
|
||||||
using WCS.Model.ApiModel;
|
using WCS.Model.ApiModel;
|
||||||
|
using WCS.Model.ApiModel.MXBackgroundThread;
|
||||||
using WCS.Model.ApiModel.User;
|
using WCS.Model.ApiModel.User;
|
||||||
|
|
||||||
namespace WCS.BLL.Services.Service
|
namespace WCS.BLL.Services.Service
|
||||||
@ -394,15 +398,67 @@ namespace WCS.BLL.Services.Service
|
|||||||
}
|
}
|
||||||
else//登录模式需要校验密码
|
else//登录模式需要校验密码
|
||||||
{
|
{
|
||||||
user = await AuthDbHelp.db.Queryable<UserBase>()
|
#region 盟讯公司登录接入系统接口
|
||||||
.Where(t => t.LoginName == request.UserName)
|
if (LocalFile.Config.IsMx)
|
||||||
.FirstAsync();
|
{
|
||||||
|
#region 调用接口 接入盟讯公司登录
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var body = new
|
||||||
|
{
|
||||||
|
uername = request.UserName,
|
||||||
|
password = request.PassWord,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttpShortTime<MXResponse>("http://192.168.2.23:9213/integrate/login/queryGenerLogin", body, "POST", true);
|
||||||
|
//账号密码验证成功
|
||||||
|
if (Result != null && Result.code == 200)
|
||||||
|
{
|
||||||
|
//判断系统中是否有对应用户
|
||||||
|
user = await AuthDbHelp.db.Queryable<UserBase>()
|
||||||
|
.Where(t => t.LoginName == request.UserName)
|
||||||
|
.FirstAsync();
|
||||||
|
//Mes登录成功后wcs这边也添加一个用户
|
||||||
|
if (user == null)
|
||||||
|
{
|
||||||
|
user = new UserBase()
|
||||||
|
{
|
||||||
|
LoginName = request.UserName,
|
||||||
|
Password = request.PassWord,
|
||||||
|
RoleIds = new List<int>() { 2 },
|
||||||
|
IsAdmin = false,
|
||||||
|
Time = DateTime.Now,
|
||||||
|
};
|
||||||
|
await AuthDbHelp.db.Insertable(user).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
else if (user.Password != request.PassWord)
|
||||||
|
{
|
||||||
|
user.Password = request.PassWord;
|
||||||
|
await AuthDbHelp.db.Updateable(user).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//账号密码验证失败
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
if (user == null)
|
||||||
|
user = await AuthDbHelp.db.Queryable<UserBase>()
|
||||||
|
.Where(t => t.LoginName == request.UserName)
|
||||||
|
.FirstAsync();
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
return new ResponseCommon<UserBase>()
|
return new ResponseCommon<UserBase>()
|
||||||
{
|
{
|
||||||
Code = 201,
|
Code = 201,
|
||||||
Message = $"登录失败:用户名[{request.UserName}]不存在!",
|
Message = $"登录失败:用户名[{request.UserName}]不存在或密码输入错误!",
|
||||||
Data = null
|
Data = null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -312,5 +312,47 @@ namespace WCS.BLL.Tool
|
|||||||
return default(T);
|
return default(T);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static T GetDataFromHttpShortTime<T>(string url, object dataObj, string httpMethod, bool isSaveLog = false)
|
||||||
|
{
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
var data = dataObj == null ? string.Empty : JsonConvert.SerializeObject(dataObj);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (isSaveLog)
|
||||||
|
Logs.Write($"【{guid}】开始请求调用接口 url:{url} 请求方式:{httpMethod} 数据:{data}", LogsType.Api);
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
request.Method = httpMethod;
|
||||||
|
request.ContentType = "application/json";
|
||||||
|
request.Timeout = 2000;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(data))
|
||||||
|
{
|
||||||
|
string strContent = data; //参数data
|
||||||
|
using (StreamWriter dataStream = new StreamWriter(request.GetRequestStream()))
|
||||||
|
{
|
||||||
|
dataStream.Write(strContent);
|
||||||
|
dataStream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
string encoding = response.ContentEncoding;
|
||||||
|
if (encoding == null || encoding.Length < 1)
|
||||||
|
{
|
||||||
|
encoding = "UTF-8"; //默认编码
|
||||||
|
}
|
||||||
|
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding));
|
||||||
|
string retString = reader.ReadToEnd();
|
||||||
|
if (isSaveLog)
|
||||||
|
Logs.Write($"【{guid}】请求调用接口结束 返回数据为{retString}", LogsType.Api);
|
||||||
|
return JsonConvert.DeserializeObject<T>(retString);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logs.Write($"【{guid}】请求调用遇到异常 异常信息为{ex.Message}");
|
||||||
|
return default(T);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
13
WCS.Model/ApiModel/MXBackgroundThread/mesLoginRequest.cs
Normal file
13
WCS.Model/ApiModel/MXBackgroundThread/mesLoginRequest.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.MXBackgroundThread
|
||||||
|
{
|
||||||
|
public class MXResponse
|
||||||
|
{
|
||||||
|
public int code { get; set; }
|
||||||
|
public string msg { get; set; }
|
||||||
|
public object data { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -34,6 +34,7 @@ namespace WCS.Model.ApiModel.OutStore
|
|||||||
}
|
}
|
||||||
public bool isSelected;
|
public bool isSelected;
|
||||||
public int RowNumber { get; set; }
|
public int RowNumber { get; set; }
|
||||||
|
public bool IsOuting { get; set; }
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
protected virtual void OnPropertyChanged(string propertyName)
|
protected virtual void OnPropertyChanged(string propertyName)
|
||||||
|
@ -21,6 +21,10 @@ namespace WCS.Model.WebSocketModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ClientIp { get; set; }
|
public string ClientIp { get; set; }
|
||||||
public DateTime LastSendTime { get; set; }
|
public DateTime LastSendTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 消息创建时间 跟消息时效性有关
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; } = DateTime.Now;
|
||||||
public bool ClientIsReceived { get; set; }
|
public bool ClientIsReceived { get; set; }
|
||||||
|
|
||||||
//恢复正常需要消除的报警guid
|
//恢复正常需要消除的报警guid
|
||||||
@ -57,5 +61,6 @@ namespace WCS.Model.WebSocketModel
|
|||||||
通知刷新出库 = 51,
|
通知刷新出库 = 51,
|
||||||
通知刷新盘点 = 52,
|
通知刷新盘点 = 52,
|
||||||
通知刷新盟讯盘点 = 53,
|
通知刷新盟讯盘点 = 53,
|
||||||
|
通知前台结束入库 = 54,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,28 +72,45 @@ namespace WCS.WebApi.Controllers
|
|||||||
|
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
var guid = Guid.NewGuid();
|
||||||
//TO DO如何将记日志的 和不记日志的分开 解耦
|
//TO DO如何将记日志的 和不记日志的分开 解耦
|
||||||
if (!context.Request.Path.ToString().Contains("getInterfaceRecord"))
|
if (!context.Request.Path.ToString().Contains("getInterfaceRecord"))
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Logs.Write($"[记录接口日志]{guid},开始记录{context.Request.Path.ToString()}", LogsType.Api);
|
||||||
var logRecord = new SystemApiLogRecord()
|
var logRecord = new SystemApiLogRecord()
|
||||||
{
|
{
|
||||||
DeviceIp = context?.Connection?.RemoteIpAddress?.ToString(),
|
DeviceIp = context?.Connection?.RemoteIpAddress?.ToString(),
|
||||||
RequestUrl = context.Request.Path,
|
RequestUrl = context.Request?.Path,
|
||||||
RequestBody = requestBody,
|
RequestBody = requestBody,
|
||||||
QueryString = context.Request.QueryString.ToString(),
|
QueryString = context.Request?.QueryString.ToString(),
|
||||||
IsResponse = true,
|
IsResponse = true,
|
||||||
ResponseJson = responseBody,
|
ResponseJson = responseBody,
|
||||||
RequestTime = requestTime,
|
RequestTime = requestTime,
|
||||||
ResponseTime = DateTime.Now,
|
ResponseTime = DateTime.Now,
|
||||||
ExecutionTime = stopwatch.ElapsedMilliseconds
|
ExecutionTime = stopwatch.ElapsedMilliseconds
|
||||||
};
|
};
|
||||||
await DbHelp.dbLog.Insertable(logRecord).ExecuteCommandAsync();
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DbHelp.dbLog.Insertable(logRecord).ExecuteCommand();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logs.Write($"[记录接口日志]{guid}保存数据失败!发生异常:" + ex.Message, LogsType.Api);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
//TO DO txt记录失败的日志和响应实体
|
Logs.Write($"[记录接口日志]{guid}失败!发生异常:" + e.Message, LogsType.Api);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Logs.Write($"[记录接口日志]{guid},不记录getInterfaceRecord", LogsType.Api);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ namespace WebApi
|
|||||||
{
|
{
|
||||||
MXBackgroundThread.InitBackgroundThread();
|
MXBackgroundThread.InitBackgroundThread();
|
||||||
var str = string.Empty;
|
var str = string.Empty;
|
||||||
//MXBackgroundThread.SendDingDingMsg("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>", new List<string> { "104379" }, ref str);
|
MXBackgroundThread.SendDingDingMsg("<22><>̨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>", new List<string> { "104379" }, ref str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,6 +71,8 @@ namespace 货架标准上位机
|
|||||||
/// 是否在入库模式中
|
/// 是否在入库模式中
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsInstoreMode { get; set; }
|
public bool IsInstoreMode { get; set; }
|
||||||
|
|
||||||
|
public DateTime IsInstoreModeTime { get; set; } = DateTime.MinValue;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 串口号
|
/// 串口号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -184,6 +184,7 @@ namespace 货架标准上位机.ViewModel
|
|||||||
{
|
{
|
||||||
Logs.Write($"扫码模组{scanner.TempCode},进入入库模式成功!", LogsType.Scanner);
|
Logs.Write($"扫码模组{scanner.TempCode},进入入库模式成功!", LogsType.Scanner);
|
||||||
scanner.IsInstoreMode = true;
|
scanner.IsInstoreMode = true;
|
||||||
|
scanner.IsInstoreModeTime = DateTime.Now;
|
||||||
scanner.ShelfCode = Result.Data.ShelfCode;
|
scanner.ShelfCode = Result.Data.ShelfCode;
|
||||||
scanner.ModulesStr = Result.Data.ModulesStr;
|
scanner.ModulesStr = Result.Data.ModulesStr;
|
||||||
|
|
||||||
@ -233,7 +234,6 @@ namespace 货架标准上位机.ViewModel
|
|||||||
scanner.IsInstoreMode = false;
|
scanner.IsInstoreMode = false;
|
||||||
scanner.ShelfCode = string.Empty;
|
scanner.ShelfCode = string.Empty;
|
||||||
scanner.ModulesStr = string.Empty;
|
scanner.ModulesStr = string.Empty;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -159,7 +159,7 @@ namespace 货架标准上位机.ViewModel
|
|||||||
if (Result != null && Result.Code == 200)
|
if (Result != null && Result.Code == 200)
|
||||||
{
|
{
|
||||||
Growl.Warning("已成功开始出库!");
|
Growl.Warning("已成功开始出库!");
|
||||||
RefreshDataGridItemSource();
|
RefreshOutOrderList(SelectedOutOrderNumber);
|
||||||
}
|
}
|
||||||
else if (Result != null)
|
else if (Result != null)
|
||||||
{
|
{
|
||||||
@ -203,7 +203,8 @@ namespace 货架标准上位机.ViewModel
|
|||||||
if (Result != null && Result.Code == 200)
|
if (Result != null && Result.Code == 200)
|
||||||
{
|
{
|
||||||
Growl.Warning("已成功结束出库!");
|
Growl.Warning("已成功结束出库!");
|
||||||
RefreshDataGridItemSource();
|
RefreshOutOrderList(SelectedOutOrderNumber);
|
||||||
|
//RefreshDataGridItemSource();
|
||||||
}
|
}
|
||||||
else if (Result != null)
|
else if (Result != null)
|
||||||
{
|
{
|
||||||
|
@ -52,8 +52,8 @@
|
|||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</Border>
|
</Border>
|
||||||
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
|
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<TextBlock Margin="5" FontWeight="Bold" FontSize="24" Text="停止入库扫码"></TextBlock>
|
<TextBlock Margin="5" FontWeight="Bold" FontSize="24" Text="停止入库码"></TextBlock>
|
||||||
<Image Margin="5" Width="120" Height="120" Source="/Resources/goOutInstore.png"></Image>
|
<Image Margin="5" Width="125" Height="125" Source="/Resources/goOutInstore.png"></Image>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<!--<GroupBox Grid.Column="1" Header="停止入库码" Padding="10">-->
|
<!--<GroupBox Grid.Column="1" Header="停止入库码" Padding="10">-->
|
||||||
<!--<Border Background="{DynamicResource RegionBrush}" CornerRadius="4">-->
|
<!--<Border Background="{DynamicResource RegionBrush}" CornerRadius="4">-->
|
||||||
|
@ -94,7 +94,6 @@
|
|||||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Visible">
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Visible">
|
||||||
<ListView FontSize="18" ItemsSource="{Binding OutOrderList}" SelectedItem="{Binding SelectedOutOrder,Mode=TwoWay}" PreviewMouseWheel="ListView_PreviewMouseWheel">
|
<ListView FontSize="18" ItemsSource="{Binding OutOrderList}" SelectedItem="{Binding SelectedOutOrder,Mode=TwoWay}" PreviewMouseWheel="ListView_PreviewMouseWheel">
|
||||||
<ListView.View>
|
<ListView.View>
|
||||||
|
|
||||||
<GridView AllowsColumnReorder="False">
|
<GridView AllowsColumnReorder="False">
|
||||||
<GridView.ColumnHeaderContainerStyle>
|
<GridView.ColumnHeaderContainerStyle>
|
||||||
<Style TargetType="{x:Type GridViewColumnHeader}">
|
<Style TargetType="{x:Type GridViewColumnHeader}">
|
||||||
@ -104,6 +103,30 @@
|
|||||||
<GridViewColumn DisplayMemberBinding="{Binding OrderNumber}"/>
|
<GridViewColumn DisplayMemberBinding="{Binding OrderNumber}"/>
|
||||||
</GridView>
|
</GridView>
|
||||||
</ListView.View>
|
</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="Background" Value="Green"/>-->
|
||||||
|
<Setter Property="Foreground" Value="Red" />
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding IsOuting}" Value="False">
|
||||||
|
<!--<Setter Property="Background" Value="White"/>-->
|
||||||
|
<Setter Property="Foreground" Value="Black" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</ListView.ItemContainerStyle>
|
||||||
</ListView>
|
</ListView>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</Border>
|
</Border>
|
||||||
@ -112,17 +135,9 @@
|
|||||||
<Border CornerRadius="3" Margin="1" Grid.Row="0" Grid.Column="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
<Border CornerRadius="3" Margin="1" Grid.Row="0" Grid.Column="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<!--<RowDefinition Height="1*"></RowDefinition>-->
|
|
||||||
<RowDefinition Height="12*"></RowDefinition>
|
<RowDefinition Height="12*"></RowDefinition>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!--<StackPanel VerticalAlignment="Center" Orientation="Horizontal" >
|
|
||||||
<TextBlock FontSize="24">
|
|
||||||
</TextBlock>
|
|
||||||
<TextBlock Text="{Binding SelectedOutOrderNumber}" FontSize="24">
|
|
||||||
</TextBlock>
|
|
||||||
</StackPanel>-->
|
|
||||||
|
|
||||||
<DataGrid Grid.Row="0"
|
<DataGrid Grid.Row="0"
|
||||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||||
ItemsSource="{Binding DataGridItemSource}"
|
ItemsSource="{Binding DataGridItemSource}"
|
||||||
@ -164,6 +179,10 @@
|
|||||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||||
</Grid.ColumnDefinitions>
|
</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">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
|
||||||
<TextBlock Text="当前状态:" FontSize="22">
|
<TextBlock Text="当前状态:" FontSize="22">
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
@ -55,11 +55,12 @@ namespace 货架标准上位机
|
|||||||
HandyControl.Controls.MessageBox.Warning("请输入账号!", "提示");
|
HandyControl.Controls.MessageBox.Warning("请输入账号!", "提示");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(pass))
|
if (!LocalFile.Config.IsMx)
|
||||||
{
|
if (string.IsNullOrEmpty(pass))
|
||||||
HandyControl.Controls.MessageBox.Warning("请输入密码!", "提示");
|
{
|
||||||
return;
|
HandyControl.Controls.MessageBox.Warning("请输入密码!", "提示");
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -73,9 +74,11 @@ namespace 货架标准上位机
|
|||||||
PassWord = pass,
|
PassWord = pass,
|
||||||
IsNoLogin = false,
|
IsNoLogin = false,
|
||||||
};
|
};
|
||||||
|
if (LocalFile.Config.IsMx)
|
||||||
|
body.IsNoLogin = true;
|
||||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "user/userLogin",
|
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "user/userLogin",
|
||||||
body, "POST");
|
body, "POST");
|
||||||
if (Result!= null && Result.Code != 200)
|
if (Result != null && Result.Code != 200)
|
||||||
{
|
{
|
||||||
HandyControl.Controls.MessageBox.Warning(Result.Message, "提示");
|
HandyControl.Controls.MessageBox.Warning(Result.Message, "提示");
|
||||||
return;
|
return;
|
||||||
|
@ -13,6 +13,7 @@ using TouchSocket.Core;
|
|||||||
using TouchSocket.Http.WebSockets;
|
using TouchSocket.Http.WebSockets;
|
||||||
using TouchSocket.Sockets;
|
using TouchSocket.Sockets;
|
||||||
using WCS.Model.WebSocketModel;
|
using WCS.Model.WebSocketModel;
|
||||||
|
using 货架标准上位机.Views.Controls;
|
||||||
|
|
||||||
namespace 货架标准上位机
|
namespace 货架标准上位机
|
||||||
{
|
{
|
||||||
@ -41,8 +42,8 @@ namespace 货架标准上位机
|
|||||||
//自定义实现心跳和重连
|
//自定义实现心跳和重连
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
await Task.Delay(4000);
|
await Task.Delay(4000);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -53,7 +54,7 @@ namespace 货架标准上位机
|
|||||||
WebSocket.client.TryConnect();
|
WebSocket.client.TryConnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -121,6 +122,18 @@ namespace 货架标准上位机
|
|||||||
TextBoxLog.AddLog(warning.WarningMessage, "InstoreLog", DateTime.Now);
|
TextBoxLog.AddLog(warning.WarningMessage, "InstoreLog", DateTime.Now);
|
||||||
client.Send(e.DataFrame.ToText());
|
client.Send(e.DataFrame.ToText());
|
||||||
break;
|
break;
|
||||||
|
case WarningTypeEnum.通知前台结束入库:
|
||||||
|
var scanner = ScannerManager.Scanners.Where(t => t.IsInstoreMode && t.ShelfCode == warning.ShelfCode && t.IsInstoreModeTime < warning.CreateTime)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (scanner != null)
|
||||||
|
{
|
||||||
|
scanner.IsInstoreMode = false;
|
||||||
|
scanner.ShelfCode = string.Empty;
|
||||||
|
scanner.ModulesStr = string.Empty;
|
||||||
|
|
||||||
|
scanner.ScannerDisplayControl.RefreshValues(string.Empty, string.Empty);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
//连接不上加:SslMode=none;
|
//连接不上加:SslMode=none;
|
||||||
"MySql": "server=localhost;Database=db1;Uid=root;Pwd=123456;Convert Zero Datetime=True",
|
"MySql": "server=localhost;Database=db1;Uid=root;Pwd=123456;Convert Zero Datetime=True",
|
||||||
//货架服务器的IP和端口号
|
//货架服务器的IP和端口号
|
||||||
"ApiIpHost": "http://127.0.0.1:8888/",
|
"ApiIpHost": "http://192.168.9.183:8888/",
|
||||||
//WebSocket的地址
|
//WebSocket的地址
|
||||||
"WebSocketUrl": "ws://127.0.0.1:7789/ws",
|
"WebSocketUrl": "ws://192.168.9.183:7789/ws",
|
||||||
//货架分区
|
//货架分区
|
||||||
"GroupName": [ "C0"],
|
"GroupName": [ "C0"],
|
||||||
//设备类型 可以配置为每个电脑不一样
|
//设备类型 可以配置为每个电脑不一样
|
||||||
|
Reference in New Issue
Block a user