diff --git a/WCS.BLL/Services/Service/GenerateService.cs b/WCS.BLL/Services/Service/GenerateService.cs index fb2ee2e..1679891 100644 --- a/WCS.BLL/Services/Service/GenerateService.cs +++ b/WCS.BLL/Services/Service/GenerateService.cs @@ -60,7 +60,7 @@ namespace WCS.BLL.Services.Service try { DbHelp.db.BeginTran(); - var startNumber = matBaseInfo.SerialNumber++; + var startNumber = ++matBaseInfo.SerialNumber; var matInfoList = new List(); for (var i = 0; i < request.TotalCount; i++) { diff --git a/WCS.BLL/Services/Service/InstoreService.cs b/WCS.BLL/Services/Service/InstoreService.cs index 3c52b77..8ad2cc5 100644 --- a/WCS.BLL/Services/Service/InstoreService.cs +++ b/WCS.BLL/Services/Service/InstoreService.cs @@ -354,6 +354,7 @@ namespace WCS.BLL.Services.Service Message = $"Success", Data = new MatInfo() { + Id = inventory.Id, MatSn = inventory.MatSN, MatCode = inventory.MatCode, MatName = inventory.MatName, @@ -483,6 +484,7 @@ namespace WCS.BLL.Services.Service 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(); @@ -500,6 +502,7 @@ namespace WCS.BLL.Services.Service 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; diff --git a/WCS.BLL/Services/Service/OutstoreService.cs b/WCS.BLL/Services/Service/OutstoreService.cs index cea40ba..a8250a3 100644 --- a/WCS.BLL/Services/Service/OutstoreService.cs +++ b/WCS.BLL/Services/Service/OutstoreService.cs @@ -108,6 +108,7 @@ namespace WCS.BLL.Services.Service ShelfTypeId = request.ShelfTypeId, ShelfTypeName = request.ShelfTypeName, SyncType = SyncTypeEnum.ByMatCode, + GroupName = LocalFile.Config.GroupName, CreateUser = request.UserName, }; order.Id = await DbHelp.db.Insertable(order).ExecuteReturnIdentityAsync(); @@ -211,6 +212,7 @@ namespace WCS.BLL.Services.Service OrderType = request.OrderType, SyncType = SyncTypeEnum.ByMatSn, CreateUser = request.UserName, + GroupName = LocalFile.Config.GroupName, }; order.Id = await DbHelp.db.Insertable(order).ExecuteReturnIdentityAsync(); @@ -1425,6 +1427,8 @@ namespace WCS.BLL.Services.Service inOutRecord.Direction = DirectionEnum.出库; inOutRecord.OperateUser = request.UserName; inOutRecord.OperateTime = DateTime.Now; + inOutRecord.GroupName = invetoryDetail.GroupName; + //保存出库记录 int count = DbHelp.db.Insertable(inOutRecord).ExecuteCommand(); //删除库存 diff --git a/WCS.BLL/Tool/Helper.cs b/WCS.BLL/Tool/Helper.cs index 65984bb..2e5ed08 100644 --- a/WCS.BLL/Tool/Helper.cs +++ b/WCS.BLL/Tool/Helper.cs @@ -186,21 +186,19 @@ namespace WCS.BLL.Tool color = 0x00; break; } - byte[] data1 = new byte[8 + 3 * 6]; + byte[] data1 = new byte[5 + 3 * 6]; data1[0] = 0xff; - data1[1] = 0x02; + data1[1] = 0x01; data1[2] = 0x00; - data1[3] = 0x0a; - for (int i = 0; i < 7;i++) + data1[3] = (byte)(data1.Length + 2); + data1[4] = 0x06; + for (int i = 0; i < 6; i++) { - data1[4 + i * 3] = (byte)(lightid + i); - data1[5 + i * 3] = (byte)status; - data1[6 + i * 3] = color; + data1[5 + i * 3] = (byte)(lightid + i); + data1[6 + i * 3] = (byte)status; + data1[7 + i * 3] = color; } - //data1[4] = (byte)lightid; - //data1[5] = (byte)status; - //data1[6] = color; - data1[25] = (byte)beestatus; + byte[] data2 = Crc16(data1, data1.Length, true); return data2; } @@ -224,26 +222,20 @@ namespace WCS.BLL.Tool //入库警示灯短亮(绿色),蜂鸣器鸣叫一次 public static byte[] InstoreWarnLight(int lightid) { - byte[] data1 = new byte[8]; - byte[] data1 = new byte[8 + 3 * 6]; + byte[] data1 = new byte[5 + 3 * 7]; data1[0] = 0xff; - data1[1] = 0x02; + data1[1] = 0x01; data1[2] = 0x00; - data1[3] = 0x0a; - data1[4] = (byte)lightid; - data1[5] = 0x03; - data1[6] = 0x02; + data1[3] = (byte)(data1.Length + 2); + data1[4] = 0x07; + //7就是带的有蜂鸣器 for (int i = 0; i < 7; i++) { - data1[4 + i * 3] = (byte)(lightid + i); - data1[5 + i * 3] = 0x03; - data1[6 + i * 3] = 0x02; + data1[5 + i * 3] = (byte)(lightid + i); + data1[6 + i * 3] = 0x03; + data1[7 + i * 3] = 0x02; } - //data1[4] = (byte)lightid; - //data1[5] = 0x03; - //data1[6] = 0x02; - //data1[7] = 0x02; - data1[7] = 0x00; + byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, true); return senddata1; } diff --git a/WCS.Model/ApiModel/OutStore/OutOrderModel.cs b/WCS.Model/ApiModel/OutStore/OutOrderModel.cs index 393eea9..dd74665 100644 --- a/WCS.Model/ApiModel/OutStore/OutOrderModel.cs +++ b/WCS.Model/ApiModel/OutStore/OutOrderModel.cs @@ -22,6 +22,8 @@ namespace WCS.Model.ApiModel.OutStore public DateTime CreateTime { get; set; } + public string ShelfTypeName { get; set; } + public string CreateUser { get; set; } public bool IsSelected { diff --git a/WCS.WebApi/Controllers/InstoreController.cs b/WCS.WebApi/Controllers/InstoreController.cs index 426889a..40aa9bb 100644 --- a/WCS.WebApi/Controllers/InstoreController.cs +++ b/WCS.WebApi/Controllers/InstoreController.cs @@ -143,8 +143,8 @@ namespace WebApi.Controllers //TODO: ƻύ try { - var aa = Helper.Query(); - var bb = Helper.SetId(); + //var aa = Helper.Query(); + //var bb = Helper.SetId(); return await _instoreService.queryInstoreStatusSingle(request); //ShelfManager. // diff --git a/WCS.WebApi/Controllers/RequestResponseLoggingMiddleware.cs b/WCS.WebApi/Controllers/RequestResponseLoggingMiddleware.cs index 6024b66..fde668d 100644 --- a/WCS.WebApi/Controllers/RequestResponseLoggingMiddleware.cs +++ b/WCS.WebApi/Controllers/RequestResponseLoggingMiddleware.cs @@ -74,7 +74,7 @@ namespace WCS.WebApi.Controllers { var guid = Guid.NewGuid(); //TO DO如何将记日志的 和不记日志的分开 解耦 - if (!context.Request.Path.ToString().Contains("getInterfaceRecord")) + if (!context.Request.Path.ToString().Contains("getInterfaceRecord") && !context.Request.Path.ToString().Contains("getShelfStatus")) { try { diff --git a/WCS.WebApi/Program.cs b/WCS.WebApi/Program.cs index 114e893..df70181 100644 --- a/WCS.WebApi/Program.cs +++ b/WCS.WebApi/Program.cs @@ -20,9 +20,6 @@ namespace WebApi { public static void Main(string[] args) { -<<<<<<< HEAD - WebSoceketManager.InitWebSocket(); -======= try { //ʼwebsocket @@ -30,7 +27,7 @@ namespace WebApi //ʼݿ DbInit.InitDb(); ->>>>>>> 7f35077c07959e9571515ee1a1f88123f9e20bd5 + //ʼļ LocalFile.SaveConfig(); @@ -90,10 +87,10 @@ namespace WebApi app.MapControllers(); app.Run("http://0.0.0.0:8888");//0.0.0.0ʾipv4 } - catch (Exception ex) - { + catch (Exception ex) + { Console.WriteLine(ex.Message); - } + } } } } diff --git a/货架标准上位机/Models/JsConfig.cs b/货架标准上位机/Models/JsConfig.cs index e13e763..55da86b 100644 --- a/货架标准上位机/Models/JsConfig.cs +++ b/货架标准上位机/Models/JsConfig.cs @@ -46,6 +46,9 @@ namespace 货架标准上位机 /// public int ScannerTimeOut { get; set; } + public string ModuleCodePattern { get; set; } + + #region 盟讯公司配置 public bool IsMx { get; set; } /// diff --git a/货架标准上位机/ViewModels/InInventoryViewModel.cs b/货架标准上位机/ViewModels/InInventoryViewModel.cs index a428ee5..2adcf26 100644 --- a/货架标准上位机/ViewModels/InInventoryViewModel.cs +++ b/货架标准上位机/ViewModels/InInventoryViewModel.cs @@ -85,7 +85,9 @@ namespace 货架标准上位机.ViewModel { //TO DO 配置项进行配置正则表达式 //数据处理 - string ModuleCodePattern = "^[ABCD][0-9]{2}-R[0-9]{1,2}C[0-9]{1,2}$"; + //获取配置文件的正则表达式 + var configModuleCodePattern = LocalFile.Config.ModuleCodePattern; + string ModuleCodePattern = string.IsNullOrEmpty(configModuleCodePattern) ? "^[ABCD][0-9]{2}-R[0-9]{1,2}C[0-9]{1,2}$" : configModuleCodePattern; var isModuleCode = Regex.IsMatch(scanner.TempCode, ModuleCodePattern); if (isModuleCode) { diff --git a/货架标准上位机/Views/OutInventoryDocumentView.xaml b/货架标准上位机/Views/OutInventoryDocumentView.xaml index 21bf438..6f0d538 100644 --- a/货架标准上位机/Views/OutInventoryDocumentView.xaml +++ b/货架标准上位机/Views/OutInventoryDocumentView.xaml @@ -117,6 +117,7 @@ + diff --git a/货架标准上位机/data/jsconfig.json b/货架标准上位机/data/jsconfig.json index de00b3b..dead891 100644 --- a/货架标准上位机/data/jsconfig.json +++ b/货架标准上位机/data/jsconfig.json @@ -2,11 +2,11 @@ //连接不上加:SslMode=none; "MySql": "server=localhost;Database=db1;Uid=root;Pwd=123456;Convert Zero Datetime=True", //货架服务器的IP和端口号 - "ApiIpHost": "http://192.168.9.183:8888/", + "ApiIpHost": "http://127.0.0.1:8888/", //WebSocket的地址 - "WebSocketUrl": "ws://192.168.9.183:7789/ws", + "WebSocketUrl": "ws://127.0.0.1:7789/ws", //货架分区 - "GroupName": [ "C0"], + "GroupName": [ "C0" ], //设备类型 可以配置为每个电脑不一样 "DeviceType": "WCS前端", //货架类型的是否开机自检 @@ -16,7 +16,7 @@ //串口扫码枪延时 "ScannerTimeOut": 2000, //盟讯公司配置-是否是盟讯 - "IsMX": true, + "IsMX": false, //盟讯公司配置-获取要料单 "GetPickOrderUrl": "http://192.168.2.23:9289/integrate/inOut/missPickListR", //盟讯公司配置-获取要料明细接口 diff --git a/货架标准上位机/data/操作说明书.docx b/货架标准上位机/data/操作说明书.docx index e39d291..2e94b71 100644 Binary files a/货架标准上位机/data/操作说明书.docx and b/货架标准上位机/data/操作说明书.docx differ diff --git a/货架标准上位机/货架标准上位机.csproj b/货架标准上位机/货架标准上位机.csproj index f57b1f3..bb2b9af 100644 --- a/货架标准上位机/货架标准上位机.csproj +++ b/货架标准上位机/货架标准上位机.csproj @@ -90,6 +90,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest