1.解决TCP添加失败问题

2.所有搜索记录倒叙排
3.优化:出入记录、库存记录增加货架类型分类查询
4.权限
5.优化下载app二维码
This commit is contained in:
hehaibing-1996
2024-07-02 09:05:21 +08:00
parent c9e25a1f85
commit adb0367a83
28 changed files with 785 additions and 101 deletions

View File

@ -22,6 +22,7 @@ namespace WCS.BLL.Manager
/// 货架类型的TCP连接管理 /// 货架类型的TCP连接管理
/// </summary> /// </summary>
public static List<TCPClient> TCPClients = new List<TCPClient>(); public static List<TCPClient> TCPClients = new List<TCPClient>();
public static void InitTcpClient() public static void InitTcpClient()
{ {
Logs.Write("【InitTcpClient】开始", LogsType.StartBoot); Logs.Write("【InitTcpClient】开始", LogsType.StartBoot);
@ -114,21 +115,26 @@ namespace WCS.BLL.Manager
if (TcpCleint.IsFirstConnected == false) if (TcpCleint.IsFirstConnected == false)
{ {
Logs.Write($"【InitTcpClient】{clientIpHost}完成首次连接", LogsType.StartBoot); Logs.Write($"【InitTcpClient】{clientIpHost}完成首次连接", LogsType.StartBoot);
//获取剩余未完成连接的tcp
var noFirstConnectedTcps = TCPClientManager.TCPClients.Where(t => t.IsFirstConnected == false)
.Select(t => t.RemoteIPHost)
.ToList();
Logs.Write($"【InitTcpClient】剩余未完成连接的TCP为{string.Join(";", noFirstConnectedTcps)}", LogsType.StartBoot);
Console.WriteLine($"【InitTcpClient】{clientIpHost}完成首次连接"); Console.WriteLine($"【InitTcpClient】{clientIpHost}完成首次连接");
InitStatus(TcpCleint); InitStatus(TcpCleint);
TcpCleint.IsFirstConnected = true; TcpCleint.IsFirstConnected = true;
//获取剩余未完成连接的tcp
var noFirstConnectedTcps = TCPClientManager.TCPClients.Where(t => t.IsFirstConnected == false)
.Select(t => t.RemoteIPHost)
.ToList();
Logs.Write($"【InitTcpClient】剩余未完成连接的TCP为{string.Join(";", noFirstConnectedTcps)}", LogsType.StartBoot);
} }
return EasyTask.CompletedTask; return EasyTask.CompletedTask;
}; };
TCPClients.Add(tcpCleint); lock(TCPClients)//避免添加失败的情况
{
TCPClients.Add(tcpCleint);
}
tcpCleint.Connect(); tcpCleint.Connect();
}); });
} }

View File

@ -35,7 +35,7 @@ namespace WCS.BLL.Services.Service
.WhereIF(!string.IsNullOrEmpty(request.MatSupplier), (id, si) => id.MatSpec.Contains(request.MatSupplier)) .WhereIF(!string.IsNullOrEmpty(request.MatSupplier), (id, si) => id.MatSpec.Contains(request.MatSupplier))
.WhereIF(!string.IsNullOrEmpty(request.MatCustomer), (id, si) => id.MatSpec.Contains(request.MatCustomer)) .WhereIF(!string.IsNullOrEmpty(request.MatCustomer), (id, si) => id.MatSpec.Contains(request.MatCustomer))
.WhereIF(request.Direction != null, (id, si) => id.Direction == request.Direction) .WhereIF(request.Direction != null, (id, si) => id.Direction == request.Direction)
.WhereIF(request.ShelfTypeId != 0, (id, si) => si.ShelfTypeId == request.ShelfTypeId)
.WhereIF(request.StoreId != 0, (id, si) => id.StoreId == request.StoreId) .WhereIF(request.StoreId != 0, (id, si) => id.StoreId == request.StoreId)
.WhereIF(!string.IsNullOrEmpty(request.StoreCode), (id, si) => id.StoreCode.Contains(request.StoreCode)) .WhereIF(!string.IsNullOrEmpty(request.StoreCode), (id, si) => id.StoreCode.Contains(request.StoreCode))
@ -43,6 +43,7 @@ namespace WCS.BLL.Services.Service
var totalCount = await recordsQueryable.CountAsync(); var totalCount = await recordsQueryable.CountAsync();
var records = await recordsQueryable var records = await recordsQueryable
.OrderByDescending((id, si) => id.Id)
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize) .Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
.Select<InOutRecord>() .Select<InOutRecord>()
.ToListAsync(); .ToListAsync();
@ -89,12 +90,11 @@ namespace WCS.BLL.Services.Service
.WhereIF(!string.IsNullOrEmpty(request.MatSpec), (id, si) => id.MatSpec.Contains(request.MatSpec)) .WhereIF(!string.IsNullOrEmpty(request.MatSpec), (id, si) => id.MatSpec.Contains(request.MatSpec))
.WhereIF(!string.IsNullOrEmpty(request.MatSupplier), (id, si) => id.MatSpec.Contains(request.MatSupplier)) .WhereIF(!string.IsNullOrEmpty(request.MatSupplier), (id, si) => id.MatSpec.Contains(request.MatSupplier))
.WhereIF(!string.IsNullOrEmpty(request.MatCustomer), (id, si) => id.MatSpec.Contains(request.MatCustomer)) .WhereIF(!string.IsNullOrEmpty(request.MatCustomer), (id, si) => id.MatSpec.Contains(request.MatCustomer))
.WhereIF(request.StoreId != 0, (id, si) => id.StoreId == request.StoreId) .WhereIF(request.StoreId != 0, (id, si) => id.StoreId == request.StoreId)
.WhereIF(!string.IsNullOrEmpty(request.StoreCode), (id, si) => id.StoreCode.Contains(request.StoreCode)) .WhereIF(!string.IsNullOrEmpty(request.StoreCode), (id, si) => id.StoreCode.Contains(request.StoreCode))
; ;
var records = await recordsQueryable var records = await recordsQueryable
.OrderByDescending((id, si) => id.Id)
.Select<InOutRecord>() .Select<InOutRecord>()
.ToListAsync(); .ToListAsync();
//生成序号 //生成序号

View File

@ -40,6 +40,7 @@ namespace WCS.BLL.Services.Service
} }
var totalCount = await recordsQueryable.CountAsync(); var totalCount = await recordsQueryable.CountAsync();
var records = await recordsQueryable var records = await recordsQueryable
.OrderByDescending(t => t.Id)
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize) .Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
.ToListAsync(); .ToListAsync();
//生成序号 //生成序号
@ -94,7 +95,7 @@ namespace WCS.BLL.Services.Service
recordsQueryable = recordsQueryable.WhereIF(request.StartTime != null, t => request.StartTime <= t.ResponseTime); recordsQueryable = recordsQueryable.WhereIF(request.StartTime != null, t => request.StartTime <= t.ResponseTime);
recordsQueryable = recordsQueryable.WhereIF(request.StartTime != null, t => request.EndTime >= t.ResponseTime); recordsQueryable = recordsQueryable.WhereIF(request.StartTime != null, t => request.EndTime >= t.ResponseTime);
} }
var records = await recordsQueryable.ToListAsync(); var records = await recordsQueryable.OrderByDescending(t => t.Id).ToListAsync();
//生成序号 //生成序号
var index = 1; var index = 1;
records.ForEach(r => records.ForEach(r =>

View File

@ -40,6 +40,7 @@ namespace WCS.BLL.Services.Service
var totalCount = await recordsQueryable.CountAsync(); var totalCount = await recordsQueryable.CountAsync();
var records = await recordsQueryable var records = await recordsQueryable
.OrderByDescending(t => t.Id)
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize) .Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
.ToListAsync(); .ToListAsync();
//生成序号 //生成序号
@ -81,7 +82,7 @@ namespace WCS.BLL.Services.Service
.WhereIF(!string.IsNullOrEmpty(request.MatName), t => t.MatName.Contains(request.MatName)) .WhereIF(!string.IsNullOrEmpty(request.MatName), t => t.MatName.Contains(request.MatName))
.WhereIF(!string.IsNullOrEmpty(request.MatSpec), t => t.MatSpec.Contains(request.MatSpec)) .WhereIF(!string.IsNullOrEmpty(request.MatSpec), t => t.MatSpec.Contains(request.MatSpec))
.WhereIF(request.IsEnable != null, t => t.IsEnable == request.IsEnable.GetValueOrDefault()); .WhereIF(request.IsEnable != null, t => t.IsEnable == request.IsEnable.GetValueOrDefault());
var records = await recordsQueryable.ToListAsync(); var records = await recordsQueryable.OrderByDescending(t => t.Id).ToListAsync();
//生成序号 //生成序号
var index = 1; var index = 1;
records.ForEach(r => records.ForEach(r =>
@ -387,6 +388,7 @@ namespace WCS.BLL.Services.Service
matCodeList = await DbHelp.db.Queryable<MatBaseInfo>() matCodeList = await DbHelp.db.Queryable<MatBaseInfo>()
.Select(t => t.MatCode) .Select(t => t.MatCode)
.Distinct() .Distinct()
.OrderBy(t => t)
.ToListAsync(); .ToListAsync();
} }
else else
@ -394,6 +396,7 @@ namespace WCS.BLL.Services.Service
matCodeList = await DbHelp.db.Queryable<InventoryDetail>() matCodeList = await DbHelp.db.Queryable<InventoryDetail>()
.Select(t => t.MatCode) .Select(t => t.MatCode)
.Distinct() .Distinct()
.OrderBy(t => t)
.ToListAsync(); .ToListAsync();
} }
return new ResponseCommon<List<string>>() return new ResponseCommon<List<string>>()
@ -426,7 +429,7 @@ namespace WCS.BLL.Services.Service
.WhereIF(request.IsPrinted != null, t => t.IsPrinted == request.IsPrinted) .WhereIF(request.IsPrinted != null, t => t.IsPrinted == request.IsPrinted)
.WhereIF(!string.IsNullOrEmpty(request.MatSN), t => t.MatSn.Contains(request.MatSN)); .WhereIF(!string.IsNullOrEmpty(request.MatSN), t => t.MatSn.Contains(request.MatSN));
var totalCount = await recordsQueryable.CountAsync(); var totalCount = await recordsQueryable.CountAsync();
var records = await recordsQueryable var records = await recordsQueryable.OrderByDescending(t => t.Id)
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize) .Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
.ToListAsync(); .ToListAsync();
//生成序号 //生成序号

View File

@ -33,7 +33,7 @@ namespace WCS.BLL.Services.Service
.WhereIF(!string.IsNullOrEmpty(request.MatSpec), (id, si) => id.MatSpec.Contains(request.MatSpec)) .WhereIF(!string.IsNullOrEmpty(request.MatSpec), (id, si) => id.MatSpec.Contains(request.MatSpec))
.WhereIF(!string.IsNullOrEmpty(request.MatSupplier), (id, si) => id.MatSpec.Contains(request.MatSupplier)) .WhereIF(!string.IsNullOrEmpty(request.MatSupplier), (id, si) => id.MatSpec.Contains(request.MatSupplier))
.WhereIF(!string.IsNullOrEmpty(request.MatCustomer), (id, si) => id.MatSpec.Contains(request.MatCustomer)) .WhereIF(!string.IsNullOrEmpty(request.MatCustomer), (id, si) => id.MatSpec.Contains(request.MatCustomer))
.WhereIF(request.ShelfTypeId != 0, (id, si) => si.ShelfTypeId == request.ShelfTypeId)
.WhereIF(request.StoreId != 0, (id, si) => id.StoreId == request.StoreId) .WhereIF(request.StoreId != 0, (id, si) => id.StoreId == request.StoreId)
.WhereIF(!string.IsNullOrEmpty(request.StoreCode), (id, si) => id.StoreCode.Contains(request.StoreCode)) .WhereIF(!string.IsNullOrEmpty(request.StoreCode), (id, si) => id.StoreCode.Contains(request.StoreCode))
@ -42,6 +42,7 @@ namespace WCS.BLL.Services.Service
var totalCount = await recordsQueryable.CountAsync(); var totalCount = await recordsQueryable.CountAsync();
var records = await recordsQueryable var records = await recordsQueryable
.OrderByDescending((id, si) => id.Id)
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize) .Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
.Select<InventoryDetail>() .Select<InventoryDetail>()
.ToListAsync(); .ToListAsync();
@ -84,17 +85,18 @@ namespace WCS.BLL.Services.Service
.WhereIF(!string.IsNullOrEmpty(request.MatSN), (id, si) => id.MatSN.Contains(request.MatSN)) .WhereIF(!string.IsNullOrEmpty(request.MatSN), (id, si) => id.MatSN.Contains(request.MatSN))
.WhereIF(!string.IsNullOrEmpty(request.MatCode), (id, si) => id.MatCode.Contains(request.MatCode)) .WhereIF(!string.IsNullOrEmpty(request.MatCode), (id, si) => id.MatCode.Contains(request.MatCode))
.WhereIF(!string.IsNullOrEmpty(request.MatName), (id, si) => id.MatName.Contains(request.MatName)) .WhereIF(!string.IsNullOrEmpty(request.MatName), (id, si) => id.MatName.Contains(request.MatName))
.WhereIF(!string.IsNullOrEmpty(request.MatBatch), (id, si) => id.MatBatch.Contains(request.MatBatch)) .WhereIF(!string.IsNullOrEmpty(request.MatBatch), (id, si) => id.MatBatch.Contains(request.MatBatch))
.WhereIF(!string.IsNullOrEmpty(request.MatSpec), (id, si) => id.MatSpec.Contains(request.MatSpec)) .WhereIF(!string.IsNullOrEmpty(request.MatSpec), (id, si) => id.MatSpec.Contains(request.MatSpec))
.WhereIF(!string.IsNullOrEmpty(request.MatSupplier), (id, si) => id.MatSpec.Contains(request.MatSupplier)) .WhereIF(!string.IsNullOrEmpty(request.MatSupplier), (id, si) => id.MatSpec.Contains(request.MatSupplier))
.WhereIF(!string.IsNullOrEmpty(request.MatCustomer), (id, si) => id.MatSpec.Contains(request.MatCustomer)) .WhereIF(!string.IsNullOrEmpty(request.MatCustomer), (id, si) => id.MatSpec.Contains(request.MatCustomer))
.WhereIF(request.ShelfTypeId != 0, (id, si) => si.ShelfTypeId == request.ShelfTypeId)
.WhereIF(request.StoreId != 0, (id, si) => id.StoreId == request.StoreId) .WhereIF(request.StoreId != 0, (id, si) => id.StoreId == request.StoreId)
.WhereIF(!string.IsNullOrEmpty(request.StoreCode), (id, si) => id.StoreCode.Contains(request.StoreCode)) .WhereIF(!string.IsNullOrEmpty(request.StoreCode), (id, si) => id.StoreCode.Contains(request.StoreCode))
.WhereIF(!string.IsNullOrEmpty(request.ShelfCode), (id, si) => si.ShelfCode.Contains(request.ShelfCode)) .WhereIF(!string.IsNullOrEmpty(request.ShelfCode), (id, si) => si.ShelfCode.Contains(request.ShelfCode))
; ;
var records = await recordsQueryable var records = await recordsQueryable
.OrderByDescending((id, si) => id.Id)
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize) .Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
.Select<InventoryDetail>() .Select<InventoryDetail>()
.ToListAsync(); .ToListAsync();

View File

@ -88,6 +88,8 @@ namespace WCS.BLL.Services.Service
shelf.ShelfCheck(); shelf.ShelfCheck();
//Thread.Sleep(8);
Task.Run(() => Task.Run(() =>
{ {
var warningModel = new WebSocketMessageModel() var warningModel = new WebSocketMessageModel()
@ -100,11 +102,11 @@ namespace WCS.BLL.Services.Service
ShelfCode = shelf.ShelfCode, ShelfCode = shelf.ShelfCode,
ShelfId = shelf.ShelfId, ShelfId = shelf.ShelfId,
ClientIp = shelf.WebSocketIpAddress, ClientIp = shelf.WebSocketIpAddress,
WarningMessage = $"货架【{shelf.ShelfCode}】已完成自检" WarningMessage = $"货架【{shelf.ShelfCode}】自检命令发送完毕"
}; };
WarningManager.SendWarning(warningModel); WarningManager.SendWarning(warningModel);
}); });
Thread.Sleep(10); Thread.Sleep(8);
} }
}); });
} }

View File

@ -339,6 +339,7 @@ namespace WCS.BLL.Services.Service
var totalCount = await recordsQueryable.CountAsync(); var totalCount = await recordsQueryable.CountAsync();
var records = await recordsQueryable var records = await recordsQueryable
.OrderByDescending(t => t.Id)
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize) .Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
.Select<StockTakingOrder>() .Select<StockTakingOrder>()
.ToListAsync(); .ToListAsync();

409
WCS.BLL/Tool/Helper.cs.orig Normal file
View File

@ -0,0 +1,409 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace WCS.BLL.Tool
{
public class Helper
{
private static byte[] auchCRCHi = {0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,
0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40};
private static byte[] auchCRCLo = {0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, 0x07, 0xC7, 0x05, 0xC5, 0xC4,
0x04, 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E, 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09,
0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A, 0x1E, 0xDE, 0xDF, 0x1F, 0xDD,
0x1D, 0x1C, 0xDC, 0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3,
0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, 0xF2, 0x32, 0x36, 0xF6, 0xF7,
0x37, 0xF5, 0x35, 0x34, 0xF4, 0x3C, 0xFC, 0xFD, 0x3D, 0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A,
0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38, 0x28, 0xE8, 0xE9, 0x29, 0xEB, 0x2B, 0x2A, 0xEA, 0xEE,
0x2E, 0x2F, 0xEF, 0x2D, 0xED, 0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26,
0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60, 0x61, 0xA1, 0x63, 0xA3, 0xA2,
0x62, 0x66, 0xA6, 0xA7, 0x67, 0xA5, 0x65, 0x64, 0xA4, 0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F,
0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB, 0x69, 0xA9, 0xA8, 0x68, 0x78, 0xB8, 0xB9, 0x79, 0xBB,
0x7B, 0x7A, 0xBA, 0xBE, 0x7E, 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, 0x74, 0x75, 0xB5,
0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0, 0x50, 0x90, 0x91,
0x51, 0x93, 0x53, 0x52, 0x92, 0x96, 0x56, 0x57, 0x97, 0x55, 0x95, 0x94, 0x54, 0x9C, 0x5C,
0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E, 0x5A, 0x9A, 0x9B, 0x5B, 0x99, 0x59, 0x58, 0x98, 0x88,
0x48, 0x49, 0x89, 0x4B, 0x8B, 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C,
0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83, 0x41, 0x81, 0x80,
0x40};
public static byte[] Crc16(byte[] buffer, int DataLen, bool isHiLo = true)
{
byte uchCRCHi = 0xFF; /* CRC 的高字节初始化 */
byte uchCRCLo = 0xFF; /* CRC 的低字节初始化 */
byte uIndex = 0; /* CRC 查询表索引 */
ushort i = 0; /* buffer 数组下标 */
while (true) /* 完成整个报文缓冲区 */
{
if (DataLen == 0)
{
break;
}
else
{
DataLen--;
}
uIndex = (byte)(uchCRCLo ^ buffer[i++]);
uchCRCLo = (byte)(uchCRCHi ^ auchCRCHi[uIndex]);
uchCRCHi = auchCRCLo[uIndex];
}
List<byte> data = new List<byte>() { };
foreach (var item in buffer)
{
data.Add(item);
}
if (isHiLo)
{
data.Add(uchCRCHi);
data.Add(uchCRCLo);
}
else
{
data.Add(uchCRCLo);
data.Add(uchCRCHi);
}
return data.ToArray();
}
public static byte[] Query()
{
byte[] data2 = new byte[4];
data2[0] = 0xff;
data2[1] = 0x03;
data2[2] = 0x00;
data2[3] = 0x06;
byte[] senddata2 = Tool.Helper.Crc16(data2, data2.Length, true);
return senddata2;
}
public static byte[] SetId()
{
byte[] data2 = new byte[6];
data2[0] = 0xff;
data2[1] = 0x04;
data2[2] = 0x00;
data2[3] = 0x08;
data2[4] = 0x03;
data2[5] = 0x01;
byte[] senddata2 = Tool.Helper.Crc16(data2, data2.Length, true);
return senddata2;
}
//出库库位灯亮灯
public static byte[] OutstoreLight(List<int> board_id, string lightcolor, int status)
{
byte color = 0x00;
switch (lightcolor)
{
case "红":
color = 0x01;
break;
case "绿":
color = 0x02;
break;
case "黄":
color = 0x03;
break;
case "蓝":
color = 0x04;
break;
case "紫":
color = 0x05;
break;
case "青":
color = 0x06;
break;
case "白":
color = 0x07;
break;
case "无":
color = 0x00;
break;
}
byte[] data1 = new byte[3 * board_id.Count + 5];
data1[0] = 0xff;
data1[1] = 0x01;
byte[] length_base = BitConverter.GetBytes(data1.Length + 2);
data1[2] = length_base[1];
data1[3] = length_base[0];
data1[4] = (byte)board_id.Count;
for (int i = 0; i < board_id.Count; i++)
{
data1[5 + i * 3] = (byte)board_id[i];
data1[5 + i * 3 + 1] = (byte)status;
data1[5 + i * 3 + 2] = color;
}
byte[] data = Crc16(data1, data1.Length, true);
return data;
}
//出库警示灯亮灯
public static byte[] OutstoreWarnLight(int lightid, string lightcolor, int status, int beestatus)
{
byte color = 0x00;
switch (lightcolor)
{
case "红":
color = 0x01;
break;
case "绿":
color = 0x02;
break;
case "黄":
color = 0x03;
break;
case "蓝":
color = 0x04;
break;
case "紫":
color = 0x05;
break;
case "青":
color = 0x06;
break;
case "白":
color = 0x07;
break;
case "无":
color = 0x00;
break;
}
byte[] data1 = new byte[5 + 3 * 6];
data1[0] = 0xff;
data1[1] = 0x01;
data1[2] = 0x00;
data1[3] = (byte)(data1.Length + 2);
data1[4] = 0x06;
for (int i = 0; i < 6; i++)
{
data1[5 + i * 3] = (byte)(lightid + i);
data1[6 + i * 3] = (byte)status;
data1[7 + i * 3] = color;
}
byte[] data2 = Crc16(data1, data1.Length, true);
return data2;
}
//入库库位灯短亮(绿色)
public static byte[] InstoreLight(int board_id)
{
byte[] data2 = new byte[8];
data2[0] = 0xff;
data2[1] = 0x01;
data2[2] = 0x00;
data2[3] = 0x0a;
data2[4] = 0x01;
data2[5] = (byte)board_id;
data2[6] = 0x03;
data2[7] = 0x02;
byte[] senddata2 = Tool.Helper.Crc16(data2, data2.Length, true);
return senddata2;
}
//入库警示灯短亮(绿色),蜂鸣器鸣叫一次
public static byte[] InstoreWarnLight(int lightid)
{
byte[] data1 = new byte[5 + 3 * 7];
data1[0] = 0xff;
data1[1] = 0x01;
data1[2] = 0x00;
data1[3] = (byte)(data1.Length + 2);
data1[4] = 0x07;
//7就是带的有蜂鸣器
for (int i = 0; i < 7; i++)
{
data1[5 + i * 3] = (byte)(lightid + i);
data1[6 + i * 3] = 0x03;
data1[7 + i * 3] = 0x02;
}
byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, true);
return senddata1;
}
public static byte[] InstoreLightAndWarnLight(int board_id, int lightid)
{
byte[] data1 = new byte[8 + 3 * 7];
data1[0] = 0xff;
data1[1] = 0x01;
data1[2] = 0x00;
data1[3] = (byte)(data1.Length + 2);
data1[4] = 0x08;
//库位灯
data1[5] = (byte)board_id;
data1[6] = 0x03;
data1[7] = 0x02;
//7就是带的有蜂鸣器
for (int i = 0; i < 7; i++)
{
data1[8 + i * 3] = (byte)(lightid + i);
data1[9 + i * 3] = 0x03;
data1[10 + i * 3] = 0x02;
}
byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, true);
return senddata1;
}
//出库确认 蜂鸣器鸣叫一次
public static byte[] CommitOutstoreBee(int lightid)
{
byte[] data1 = new byte[5 + 3 * 1];
data1[0] = 0xff;
data1[1] = 0x01;
data1[2] = 0x00;
data1[3] = (byte)(data1.Length + 2);
data1[4] = 0x01;
data1[5] = (byte)(lightid + 6);
data1[6] = 0x03;
data1[7] = 0x02;
byte[] sendData = Tool.Helper.Crc16(data1, data1.Length, true);
return sendData;
}
/// <summary>
/// 库位灯常亮/关闭
/// </summary>
/// <param name="board_id"></param>
/// <param name="lightcolor"></param>
/// <param name="status">0X00 关闭 0X01 常亮 0X02 闪烁 0X03 短亮一次</param>
/// <returns></returns>
public static byte[] StoreLightOnOff(int board_id, string lightcolor, int status)
{
byte color = 0x00;
switch (lightcolor)
{
case "红":
color = 0x01;
break;
case "绿":
color = 0x02;
break;
case "黄":
color = 0x03;
break;
case "蓝":
color = 0x04;
break;
case "紫":
color = 0x05;
break;
case "青":
color = 0x06;
break;
case "白":
color = 0x07;
break;
case "无":
color = 0x00;
break;
}
byte[] data1 = new byte[3 + 5];
data1[0] = 0xff;
data1[1] = 0x01;
byte[] length_base = BitConverter.GetBytes(data1.Length + 2);
data1[2] = length_base[1];
data1[3] = length_base[0];
data1[4] = 0x01;
data1[5] = (byte)board_id;
data1[5 + 1] = (byte)status;
data1[5 + 2] = color;
byte[] data = Crc16(data1, data1.Length, true);
return data;
}
/// <summary>
/// 返回数据处理
/// </summary>
public static void ReturnDataProcess(TCPClient tcpClient, byte[] returnData)
{
if (returnData[0] == 0xFF && returnData[1] == 0x00 && returnData[3] == 0x08
&& returnData[4] == 0x01 && returnData[5] == 0x06)
{
var sendData = Query();
tcpClient.Send(sendData);
return;
}
}
<<<<<<< HEAD
=======
public static byte[] OutstoreWarnLight_1(int lightid, string lightcolor, int status, int beestatus)
{
byte color = 0x00;
switch (lightcolor)
{
case "红":
color = 0x01;
break;
case "绿":
color = 0x02;
break;
case "黄":
color = 0x03;
break;
case "蓝":
color = 0x04;
break;
case "紫":
color = 0x05;
break;
case "青":
color = 0x06;
break;
case "白":
color = 0x07;
break;
case "无":
color = 0x00;
break;
}
byte[] data1 = new byte[5 + 3 * 6];
data1[0] = 0xff;
data1[1] = 0x01;
data1[2] = 0x00;
data1[3] = (byte)(data1.Length + 2);
data1[4] = 0x06;
for (int i = 0; i < 6; i++)
{
data1[5 + i * 3] = (byte)(lightid + i);
data1[6 + i * 3] = (byte)status;
data1[7 + i * 3] = color;
}
//data1[5 + 3 * 7 - 3] = (byte)(lightid + 6);
//data1[5 + 3 * 7 - 2] =(byte)beestatus;
//data1[5 + 3 * 7 - 1] = 0x00;
byte[] data2 = Crc16(data1, data1.Length, true);
return data2;
}
>>>>>>> origin/master
}
}

View File

@ -1,4 +1,6 @@
using System.Collections.Concurrent; using System;
using System.Collections.Concurrent;
using System.ComponentModel.Design;
using System.Text; using System.Text;
using TouchSocket.Core; using TouchSocket.Core;
using TouchSocket.Sockets; using TouchSocket.Sockets;
@ -54,7 +56,7 @@ namespace WCS.BLL
/// 初始化配置连接 /// 初始化配置连接
/// </summary> /// </summary>
/// <param name="remoteIPHost"></param> /// <param name="remoteIPHost"></param>
public TCPClient(string remoteIPHost, string bindIPHost,string shelfTypeName) public TCPClient(string remoteIPHost, string bindIPHost, string shelfTypeName)
{ {
try try
{ {
@ -86,34 +88,60 @@ namespace WCS.BLL
var data = e.ByteBlock.Buffer.Take((int)e.ByteBlock.Length).ToArray(); var data = e.ByteBlock.Buffer.Take((int)e.ByteBlock.Length).ToArray();
Task.Run(() => Task.Run(() =>
{ {
Logs.Write($"【校验发送接收 开始】" + BitConverter.ToString(data), LogsType.InstructionResend); Logs.Write($"【校验发送接收 开始】{ShelfTypeName}" + BitConverter.ToString(data), LogsType.InstructionResend);
var len = data.Length; if (ShelfTypeName == "信息化货架")
for (int index = 0; index < data.Length - PreFixLength; index++)
{ {
//协议拆包 通过前缀校验是否为完整数据包 //协议拆包
var prefixInData = data.Skip(index).Take(PreFixLength); var len = data.Length;
var isEqual = prefixInData.SequenceEqual(Prefix); //灯控制统一返回的是 FF-00-00-0A-00-02-D7-B5
if (isEqual) if (len == 8)
{ {
var dataTemp = data.Skip(index).Take(PreFixLength + DataLength).ToArray(); if (data[4] == 0x00 && data[0] == 0xFF && data[1] == 0x00 && (data[4] == 0x01 && data[4] == 0x02))
if (dataTemp.Length < PreFixLength + DataLength)//拆包后不满足一条指令的长度
{ {
continue; //查询当前板子是否有待验证的指令
var message = new MessageDto();
var firstMessage = MessageList.Select(t => new { Id = t.Key ,Value = t.Value })
.OrderBy(t => t.Value.CreateTime)
.First();
if (firstMessage != null)
{
MessageList.TryRemove(firstMessage.Id, out message);
Logs.Write($"【信息化货架】以下指令已不重发:{BitConverter.ToString(firstMessage.Value.Message)}");
}
} }
//获取返回指令的板子ID
var boardId = (dataTemp[PreFixLength + 0] << 8) + dataTemp[PreFixLength + 1];
//查询当前板子是否有待验证的指令
var message = new MessageDto();
MessageList.TryGetValue(boardId, out message);
//功能位校验 功能位相同视为已响应指令 删除对应的指令
if (message?.Message[PreFixLength + 2] == dataTemp[PreFixLength + 2])
{
MessageList.TryRemove(boardId, out message);
}
index += (PreFixLength + DataLength - 2);//每次循环index会+1 所以这里-1
} }
} }
Logs.Write($"【校验发送接收 结束】" + BitConverter.ToString(data), LogsType.InstructionResend); //智能货架
else
{
var len = data.Length;
for (int index = 0; index < data.Length - PreFixLength; index++)
{
//协议拆包 通过前缀校验是否为完整数据包
var prefixInData = data.Skip(index).Take(PreFixLength);
var isEqual = prefixInData.SequenceEqual(Prefix);
if (isEqual)
{
var dataTemp = data.Skip(index).Take(PreFixLength + DataLength).ToArray();
if (dataTemp.Length < PreFixLength + DataLength)//拆包后不满足一条指令的长度
{
continue;
}
//获取返回指令的板子ID
var boardId = (dataTemp[PreFixLength + 0] << 8) + dataTemp[PreFixLength + 1];
//查询当前板子是否有待验证的指令
var message = new MessageDto();
MessageList.TryGetValue(boardId, out message);
//功能位校验 功能位相同视为已响应指令 删除对应的指令
if (message?.Message[PreFixLength + 2] == dataTemp[PreFixLength + 2])
{
MessageList.TryRemove(boardId, out message);
}
index += (PreFixLength + DataLength - 2);//每次循环index会+1 所以这里-1
}
}
}
Logs.Write($"【校验发送接收 结束】{ShelfTypeName}" + BitConverter.ToString(data), LogsType.InstructionResend);
}); });
return null; return null;
}; };
@ -207,6 +235,7 @@ namespace WCS.BLL
} }
catch (Exception ex) catch (Exception ex)
{ {
Logs.Write("【发送指令时发生异常】" + ex.Message , LogsType.Instructions);
//因异常断连时(网线已经被断了) 手动重连一次 //因异常断连时(网线已经被断了) 手动重连一次
if (ex is NotConnectedException) if (ex is NotConnectedException)
{ {
@ -249,6 +278,8 @@ namespace WCS.BLL
/// 最后一次发送时间 /// 最后一次发送时间
/// </summary> /// </summary>
public DateTime LastSendTime { get; set; } = DateTime.Now; public DateTime LastSendTime { get; set; } = DateTime.Now;
public DateTime CreateTime { get; set; } = DateTime.Now;
/// <summary> /// <summary>
/// 发送内容 /// 发送内容
/// </summary> /// </summary>

View File

@ -25,7 +25,7 @@ namespace WCS.Model.ApiModel.InOutRecord
#endregion #endregion
#region #region
public List<int> ShelfTypeId { get; set; } public int ShelfTypeId { get; set; }
public List<int> ShelfId { get; set; } public List<int> ShelfId { get; set; }
public int StoreId { get; set; } public int StoreId { get; set; }
public string StoreCode { get; set; } public string StoreCode { get; set; }

View File

@ -23,7 +23,7 @@ namespace WCS.Model.ApiModel.MatInventoryDetail
#endregion #endregion
#region #region
public List<int> ShelfTypeId { get; set; } public int ShelfTypeId { get; set; }
public List<int> ShelfId { get; set; } public List<int> ShelfId { get; set; }
public string ShelfCode { get; set; } public string ShelfCode { get; set; }
public int StoreId { get; set; } public int StoreId { get; set; }

View File

@ -0,0 +1,31 @@
using Microsoft.AspNetCore.Mvc;
using WCS.BLL.Services.IService;
using WCS.BLL.Services.Service;
using WCS.Model;
using WCS.Model.ApiModel;
using WCS.Model.ApiModel.Stocktaking;
using WCS.Model.ApiModel.User;
using WCS.Model.WebSocketModel;
namespace WCS.WebApi.Controllers
{
/// <summary>
/// 本地化Controller
/// </summary>
[ApiController]
[Route("[controller]")]
public class DIYController : ControllerBase
{
public DIYController()
{
}
[Route("getStockTakingOrders")]
[HttpPost(Name = "getStockTakingOrders")]
public async Task<ResponseBase> getStockTakingOrders(GetStockTakingOrdersRequest request)
{
return await _stockTakingService.getStockTakingOrders(request);
}
}
}

View File

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using NPOI.SS.Formula.Functions;
using SqlSugar; using SqlSugar;
using WCS.BLL.DbModels; using WCS.BLL.DbModels;
using WCS.BLL.HardWare; using WCS.BLL.HardWare;
@ -8,6 +9,7 @@ using WCS.BLL.Services.Service;
using WCS.DAL.Db; using WCS.DAL.Db;
using WCS.Model; using WCS.Model;
using WCS.Model.ApiModel.Home; using WCS.Model.ApiModel.Home;
using Mode = WCS.BLL.HardWare.Mode;
namespace WCS.WebApi.Controllers namespace WCS.WebApi.Controllers
{ {
@ -97,6 +99,65 @@ namespace WCS.WebApi.Controllers
} }
} }
[Route("getShelfStatusDetails")]
[HttpPost(Name = "getShelfStatusDetails")]
public async Task<ResponseBase> getShelfStatusDetails(GetShelfStatusRequest request)
{
try
{
var shelfs = ShelfManager.Shelves
.WhereIF(request.GroupNames?.Count > 0, t => request.GroupNames!.Contains(t.GroupName))
.ToList();
//直接返回当前内存中缓存的货架和状态
return new ResponseBase<object>()
{
Code = 200,
Message = "success",
Data = shelfs,
};
}
catch (Exception ex)
{
return new ResponseBase()
{
Code = 300,
Message = "获取失败:" + ex.Message,
};
}
}
[Route("getTCPClientsDetails")]
[HttpPost(Name = "getTCPClientsDetails")]
public async Task<ResponseBase> getTCPClientsDetails(GetShelfStatusRequest request)
{
try
{
var tcpClients = TCPClientManager.TCPClients.Select(t => new
{
RemoteIPHost = t.RemoteIPHost,
IsOnline = t.IsOnline,
IsFirstConnected = t.IsFirstConnected,
tcpClientIsNull = t.tcpClient == null,
tcpClientIsOnLine = t.tcpClient?.Online,
}).ToList();
//直接返回当前内存中缓存的货架和状态
return new ResponseBase<object>()
{
Code = 200,
Message = $"success连接数量{tcpClients.Count}",
Data = tcpClients,
};
}
catch (Exception ex)
{
return new ResponseBase()
{
Code = 300,
Message = "获取失败:" + ex.Message,
};
}
}
[Route("shelfCheckAll")] [Route("shelfCheckAll")]
[HttpPost(Name = "shelfCheckAll")] [HttpPost(Name = "shelfCheckAll")]

View File

@ -13,11 +13,21 @@ namespace 货架标准上位机
/// </summary> /// </summary>
public enum AuthEnum public enum AuthEnum
{ {
= 1000, //主页 = 1000,
= 2000, = 2000,
= 3000, = 3000,
= 4000, = 4000,
= 5000, = 5000,
= 6000,
= 7000,
= 8000,
= 9000,
= 10000,
= 11000,
= 12000,
= 13000,
= 14000,
= 15000,
} }
public class EnumTreeAttribute : Attribute public class EnumTreeAttribute : Attribute

View File

@ -29,6 +29,7 @@ using WCS.Model.ApiModel.Stocktaking;
using WCS.Model.ApiModel.InOutRecord; using WCS.Model.ApiModel.InOutRecord;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using static .ViewModel.InOutRecordViewModel; using static .ViewModel.InOutRecordViewModel;
using WCS.Model.ApiModel.Home;
namespace .ViewModel namespace .ViewModel
{ {
@ -36,7 +37,46 @@ namespace 货架标准上位机.ViewModel
{ {
public InOutRecordViewModel() public InOutRecordViewModel()
{ {
InitShelfTypeItems();
}
private List<ShelfTypeModel> shelfTypeItems;
public List<ShelfTypeModel> ShelfTypeItems
{
get { return shelfTypeItems; }
set
{
SetProperty(ref shelfTypeItems, value);
}
}
private ShelfTypeModel selectedShelfTypeItem;
public ShelfTypeModel SelectedShelfTypeItem
{
get { return selectedShelfTypeItem; }
set
{
SetProperty(ref selectedShelfTypeItem, value);
}
}
public void InitShelfTypeItems()
{
//调用接口更新!
Task.Run(() =>
{
var body = new RequestBase()
{
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
};
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<ShelfTypeModel>>(LocalFile.Config.ApiIpHost + "home/getShelfTypes", body, "POST");
if (Result != null && Result.Data != null && Result.Data.Lists.Count() > 0)
{
ShelfTypeItems = Result.Data.Lists;
}
});
} }
public void InitMatCode() public void InitMatCode()
@ -195,7 +235,7 @@ namespace 货架标准上位机.ViewModel
public class DirectionItem public class DirectionItem
{ {
public string Text { get; set; } public string Text { get; set; }
public object Value { get; set; } public object Value { get; set; }
public override string ToString() public override string ToString()
{ {
@ -240,6 +280,8 @@ namespace 货架标准上位机.ViewModel
StoreCode = StoreCode, StoreCode = StoreCode,
Direction = SelectedDirection, Direction = SelectedDirection,
ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
UserName = LocalStatic.CurrentUser, UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType, DeviceType = LocalFile.Config.DeviceType,
PageNumber = CurrentPage, PageNumber = CurrentPage,

View File

@ -275,6 +275,8 @@ namespace 货架标准上位机.ViewModel
//string secondField = Regex.Match(input, @"{[1-9][0]{2,5}[ ]{").Value; //string secondField = Regex.Match(input, @"{[1-9][0]{2,5}[ ]{").Value;
string secondField = Regex.Match(input, LocalFile.Config.RegexMatQty).Value; string secondField = Regex.Match(input, LocalFile.Config.RegexMatQty).Value;
MatQty = Convert.ToInt32(secondField.Replace("{", "").Replace(" ", "")); MatQty = Convert.ToInt32(secondField.Replace("{", "").Replace(" ", ""));
input = input.Replace(secondField, string.Empty);
} }
catch catch
{ {
@ -326,28 +328,35 @@ namespace 货架标准上位机.ViewModel
public void UpdateMatSN() public void UpdateMatSN()
{ {
if (MatSNs != null && totalPan > 1) try
{ {
MatSNs.Clear(); if (MatSNs != null && MatSNs.Count > 0 && totalPan >= 1)
for (int i = 0; i < TotalPan; i++)
{ {
var newMatSn = ChangelessCode + MatCode + ReservedCode + MatBatch + (MatBaseInfo.SerialNumber + i).ToString("000"); MatSNs.Clear();
MatSNs.Add(newMatSn); for (int i = 0; i < TotalPan; i++)
} {
var newMatSn = ChangelessCode + MatCode + ReservedCode + MatBatch + (MatBaseInfo.SerialNumber + i).ToString("000");
MatSNs.Add(newMatSn);
}
if (MatSNs == null || MatSNs.Count == 0) if (MatSNs == null || MatSNs.Count == 0)
{ {
MatSNsStr = string.Empty; MatSNsStr = string.Empty;
} }
else if (MatSNs.Count == 1) else if (MatSNs.Count == 1)
{ {
MatSNsStr = MatSNs[0].ToString(); MatSNsStr = MatSNs[0].ToString();
} }
else else
{ {
MatSNsStr = MatSNs[0].ToString() + "\r\n~" + MatSNs[MatSNs.Count - 1].ToString(); MatSNsStr = MatSNs[0].ToString() + "~\r\n" + MatSNs[MatSNs.Count - 1].ToString();
}
} }
} }
catch
{
}
} }
public void GenerateMatSN() public void GenerateMatSN()

View File

@ -26,6 +26,7 @@ using WCS.Model.ApiModel.MatBaseInfo;
using WCS.Model.ApiModel.MatInventoryDetail; using WCS.Model.ApiModel.MatInventoryDetail;
using HandyControl.Tools.Extension; using HandyControl.Tools.Extension;
using WCS.Model.ApiModel.Stocktaking; using WCS.Model.ApiModel.Stocktaking;
using WCS.Model.ApiModel.Home;
namespace .ViewModel namespace .ViewModel
{ {
@ -33,7 +34,7 @@ namespace 货架标准上位机.ViewModel
{ {
public MatInventoryDetailViewModel() public MatInventoryDetailViewModel()
{ {
InitShelfTypeItems();
} }
public void InitMatCode() public void InitMatCode()
@ -171,6 +172,44 @@ namespace 货架标准上位机.ViewModel
SetProperty(ref matSN, value); SetProperty(ref matSN, value);
} }
} }
private List<ShelfTypeModel> shelfTypeItems;
public List<ShelfTypeModel> ShelfTypeItems
{
get { return shelfTypeItems; }
set
{
SetProperty(ref shelfTypeItems, value);
}
}
public void InitShelfTypeItems()
{
//调用接口更新!
Task.Run(() =>
{
var body = new RequestBase()
{
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
};
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<ShelfTypeModel>>(LocalFile.Config.ApiIpHost + "home/getShelfTypes", body, "POST");
if (Result != null && Result.Data != null && Result.Data.Lists.Count() > 0)
{
ShelfTypeItems = Result.Data.Lists;
}
});
}
private ShelfTypeModel selectedShelfTypeItem;
public ShelfTypeModel SelectedShelfTypeItem
{
get { return selectedShelfTypeItem; }
set
{
SetProperty(ref selectedShelfTypeItem, value);
}
}
#endregion #endregion
#region Command #region Command
@ -208,6 +247,7 @@ namespace 货架标准上位机.ViewModel
MatCode = MatCode, MatCode = MatCode,
StoreCode = StoreCode, StoreCode = StoreCode,
ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
ShelfCode = ShelfCode, ShelfCode = ShelfCode,
UserName = LocalStatic.CurrentUser, UserName = LocalStatic.CurrentUser,

View File

@ -117,6 +117,8 @@ namespace 货架标准上位机.ViewModels
} }
var window = new OutInventoryAddMatView(SelectedShelfTypeItem.Id); var window = new OutInventoryAddMatView(SelectedShelfTypeItem.Id);
window.Owner = Application.Current.MainWindow; window.Owner = Application.Current.MainWindow;
window.Topmost = true;
var result = window.ShowDialog(); var result = window.ShowDialog();
if (result == true) if (result == true)
{ {

View File

@ -145,6 +145,7 @@ namespace 货架标准上位机.ViewModels
{ {
var window = new OutInventoryAddDucumentView(); var window = new OutInventoryAddDucumentView();
window.Owner = Application.Current.MainWindow; window.Owner = Application.Current.MainWindow;
window.Topmost = true;
var result = window.ShowDialog(); var result = window.ShowDialog();
if (result == true) if (result == true)
BtnSearch(true); BtnSearch(true);

View File

@ -10,6 +10,7 @@ using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.IO.Ports; using System.IO.Ports;
using System.Linq; using System.Linq;
using System.Net;
using System.Reflection.Emit; using System.Reflection.Emit;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -26,6 +27,20 @@ namespace 货架标准上位机.ViewModel
{ {
public class SetViewModel : BindableBase public class SetViewModel : BindableBase
{ {
public SetViewModel()
{
IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
IPList = host.AddressList
.Where(ipAddress => ipAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork && !IPAddress.IsLoopback(ipAddress))
.Select(t => t.ToString()).ToList();
if (IPList != null && IPList.Count > 0)
{
SelectedIP = IPList[0];
}
}
private List<int> SaveLoginCountData_ = new List<int> { 3, 5, 7, 10 }; private List<int> SaveLoginCountData_ = new List<int> { 3, 5, 7, 10 };
//记忆最大数量下拉框 //记忆最大数量下拉框
public List<int> SaveLoginCountData { get => SaveLoginCountData_; set { SetProperty(ref SaveLoginCountData_, value); } } public List<int> SaveLoginCountData { get => SaveLoginCountData_; set { SetProperty(ref SaveLoginCountData_, value); } }
@ -39,6 +54,22 @@ namespace 货架标准上位机.ViewModel
#region #region
private List<string> ipList;
public List<string> IPList
{
get => ipList;
set { SetProperty(ref ipList, value); }
}
private string selectedIP;
public string SelectedIP
{
get => selectedIP;
set { SetProperty(ref selectedIP, value); }
}
private List<string> scannerComList; private List<string> scannerComList;
public List<string> ScannerComList public List<string> ScannerComList
{ {
@ -238,7 +269,7 @@ namespace 货架标准上位机.ViewModel
if (Result != null && Result.Code == 200) if (Result != null && Result.Code == 200)
{ {
//拼凑url //拼凑url
var downLoadUrl = LocalFile.Config.ApiIpHost + $"fileDownload/downloadApp?fileName={Result.Data}"; var downLoadUrl = $"http://{SelectedIP}:8888/" + $"fileDownload/downloadApp?fileName={Result.Data}";
//生成二维码 //生成二维码
var qrCodeImage = GenerateQRCode(downLoadUrl); var qrCodeImage = GenerateQRCode(downLoadUrl);
//展示二维码 //展示二维码

View File

@ -45,7 +45,7 @@
SelectedItem="{Binding SelectedShelfTypeItem}" SelectedItem="{Binding SelectedShelfTypeItem}"
FontSize="18" FontSize="18"
Height="20" Height="20"
IsEditable="True"/> IsEditable="False"/>
<TextBlock Grid.Row="1" Grid.Column="0" Margin="5" <TextBlock Grid.Row="1" Grid.Column="0" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right"

View File

@ -87,7 +87,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.物料入库},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe681;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe681;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -99,7 +99,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<!--<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <!--<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.出库单据},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe67d;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe67d;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -110,8 +110,8 @@
<View:OutInventoryDocumentView/> <View:OutInventoryDocumentView/>
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem>--> </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 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> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe67d;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe67d;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -123,7 +123,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.盘点单据},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -135,7 +135,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </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 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> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -147,7 +147,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.物料盘点},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -159,7 +159,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.库存查询},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe63a;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe63a;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -171,7 +171,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.出入记录},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe60b;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe60b;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -183,7 +183,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.库位管理},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe63a;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe63a;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -233,7 +233,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem>--> </TabItem>-->
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.接口记录},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe600;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe600;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -245,7 +245,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" > <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.权限},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe63f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe63f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>

View File

@ -88,7 +88,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.物料入库},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe681;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe681;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -100,7 +100,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.出库单据},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe67d;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe67d;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -111,8 +111,8 @@
<View:OutInventoryDocumentView/> <View:OutInventoryDocumentView/>
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </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 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> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe67d;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe67d;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -124,7 +124,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.盘点单据},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -136,7 +136,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </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 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> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe65f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -148,7 +148,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.库存查询},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe63a;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe63a;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -160,7 +160,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.出入记录},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe60b;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe60b;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -172,7 +172,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.库位管理},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe63a;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe63a;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -198,7 +198,7 @@
</TabControl> </TabControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.物料维护},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe662;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe662;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -210,7 +210,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.物料明细},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe662;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe662;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -222,7 +222,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}"> <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.接口记录},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe600;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe600;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>
@ -234,7 +234,7 @@
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</TabItem> </TabItem>
<TabItem Padding="10,10,40,10" > <TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.权限},Converter={StaticResource AuthVisConverter}}">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xe63f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock> <TextBlock Text="&#xe63f;" FontSize="20" FontFamily="{StaticResource IconFont}"></TextBlock>

View File

@ -36,12 +36,11 @@
<TextBlock Grid.Row="0" Grid.Column="0" Margin="5" <TextBlock Grid.Row="0" Grid.Column="0" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right"
Text="货架类型:" FontSize="18" ></TextBlock> Text="货架类型:" FontSize="18" ></TextBlock>
<ComboBox Grid.Row="0" Grid.Column="1" <ComboBox Grid.Row="0" Grid.Column="1" IsEditable="False"
DisplayMemberPath="ShelfTypeName" DisplayMemberPath="ShelfTypeName"
ItemsSource="{Binding ShelfTypeItems}" ItemsSource="{Binding ShelfTypeItems}"
SelectedItem="{Binding SelectedShelfTypeItem}" SelectedItem="{Binding SelectedShelfTypeItem}"
FontSize="18" FontSize="18" />
IsEditable="True"/>
<TextBlock Grid.Row="0" Grid.Column="2" Margin="5" <TextBlock Grid.Row="0" Grid.Column="2" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right"

View File

@ -62,7 +62,10 @@
<GroupBox Header="App" Margin="5" Padding="5" Style="{StaticResource GroupBoxTab}" Background="{x:Null}"> <GroupBox Header="App" Margin="5" Padding="5" Style="{StaticResource GroupBoxTab}" Background="{x:Null}">
<StackPanel> <StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Button Margin="5" Command="{Binding AppQRCodeCommand}">下载二维码</Button> <ComboBox ItemsSource="{Binding IPList}" SelectedValue="{Binding SelectedIP}">
</ComboBox>
<Button Margin="5" Command="{Binding AppQRCodeCommand}">生成下载二维码</Button>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</GroupBox> </GroupBox>

View File

@ -89,7 +89,7 @@
Content="&#xec61;开始盘点" FontFamily="{StaticResource IconFont}" Background="CadetBlue" Foreground="White"> Content="&#xec61;开始盘点" FontFamily="{StaticResource IconFont}" Background="CadetBlue" Foreground="White">
</Button> </Button>
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnPauseCommand}" <Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnPauseCommand}"
Content="&#xe67e;暂停盘点" FontFamily="{StaticResource IconFont}" Background="CadetBlue" Foreground="White"> Content="&#xe67e;结束盘点" FontFamily="{StaticResource IconFont}" Background="CadetBlue" Foreground="White">
</Button> </Button>
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnCommitCommand}" <Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnCommitCommand}"

View File

@ -142,7 +142,7 @@ namespace 货架标准上位机
} }
break; break;
case WarningTypeEnum.: case WarningTypeEnum.:
TextBoxLog.AddLog(warning.WarningMessage, "selfCheck", DateTime.Now); TextBoxLog.AddLog(warning.WarningMessage, "selfCheck", warning.CreateTime);
client.Send(e.DataFrame.ToText()); client.Send(e.DataFrame.ToText());
break; break;
default: break; default: break;

View File

@ -103,7 +103,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="Resources\物料条码.btw"> <None Update="Resources\物料条码.btw">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>