From e3d3726cbe035893db98c078bd1389e224b40806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B6=E5=9D=A4?= <997828819@qq.com> Date: Wed, 15 May 2024 18:49:11 +0800 Subject: [PATCH] 1 --- WCS.BLL/HardWare/SingleLightShelf.cs | 1 + WCS.BLL/Manager/ShelfManager.cs | 7 + WCS.BLL/Services/IService/IInstoreService.cs | 1 + WCS.BLL/Services/IService/IOutstoreService.cs | 2 + WCS.BLL/Services/Service/InstoreService.cs | 120 +++++++++++++++++- WCS.BLL/Services/Service/OutstoreService.cs | 92 ++++++++++++++ WCS.BLL/Tool/Helper.cs | 85 +++++++++++++ WCS.Model/ApiModel/Home/ShelfTypeModel.cs | 2 +- .../InStore/QueryByMatSnRequestSingle.cs | 27 ++++ .../GetOutOrderDetailRequestSingle.cs | 11 ++ WCS.Model/ApiModel/ResponseBase.cs | 32 +++++ WCS.WebApi/Controllers/InstoreController.cs | 6 +- WCS.WebApi/Controllers/OutstoreController.cs | 4 +- 货架标准上位机/ScannerManager.cs | 2 +- 货架标准上位机/ViewModels/HomeViewModel.cs | 52 ++++---- .../ViewModels/InOutRecordViewModel.cs | 2 +- .../ViewModels/MatInventoryDetailViewModel.cs | 2 +- .../Views/Windows/UserLoginView.xaml.cs | 68 +++++----- 18 files changed, 446 insertions(+), 70 deletions(-) create mode 100644 WCS.BLL/Tool/Helper.cs create mode 100644 WCS.Model/ApiModel/InStore/QueryByMatSnRequestSingle.cs create mode 100644 WCS.Model/ApiModel/OutStore/GetOutOrderDetailRequestSingle.cs diff --git a/WCS.BLL/HardWare/SingleLightShelf.cs b/WCS.BLL/HardWare/SingleLightShelf.cs index 98589cb..e09ab83 100644 --- a/WCS.BLL/HardWare/SingleLightShelf.cs +++ b/WCS.BLL/HardWare/SingleLightShelf.cs @@ -34,6 +34,7 @@ namespace WCS.BLL.HardWare public void GoInInstore(string IPAdress) { //找到对应的灯 亮灯 + } public void GoInOutstore(List MatDetails, OutOrder outOrder) diff --git a/WCS.BLL/Manager/ShelfManager.cs b/WCS.BLL/Manager/ShelfManager.cs index dd2207e..1126322 100644 --- a/WCS.BLL/Manager/ShelfManager.cs +++ b/WCS.BLL/Manager/ShelfManager.cs @@ -45,6 +45,13 @@ namespace WCS.BLL.Manager ShelfCode = shelfInDb.ShelfCode, GroupName = shelfInDb.GroupName, }; + case 3: + return new SmartShelf(shelfInDb) + { + ShelfId = shelfInDb.Id, + ShelfCode = shelfInDb.ShelfCode, + GroupName = shelfInDb.GroupName, + }; default: return null; } diff --git a/WCS.BLL/Services/IService/IInstoreService.cs b/WCS.BLL/Services/IService/IInstoreService.cs index 8b83646..c049df2 100644 --- a/WCS.BLL/Services/IService/IInstoreService.cs +++ b/WCS.BLL/Services/IService/IInstoreService.cs @@ -14,5 +14,6 @@ namespace WCS.BLL.Services.IService public Task queryByMatSn(QueryByMatSnRequest request); public Task queryByMatSnOut(QueryByMatSnRequest request); public Task queryInstoreStatus(QueryByMatSnRequest request); + public Task queryInstoreStatusSingle(QueryByMatSnRequestSingle request); } } diff --git a/WCS.BLL/Services/IService/IOutstoreService.cs b/WCS.BLL/Services/IService/IOutstoreService.cs index c8ca3c8..bcff720 100644 --- a/WCS.BLL/Services/IService/IOutstoreService.cs +++ b/WCS.BLL/Services/IService/IOutstoreService.cs @@ -23,6 +23,8 @@ namespace WCS.BLL.Services.IService public Task GoInOutstore(GetOutOrderDetailRequest request); + public Task GoInOutstoreSingle(GetOutOrderDetailRequest request); + public Task GoOutOutstore(GetOutOrderDetailRequest request); } } diff --git a/WCS.BLL/Services/Service/InstoreService.cs b/WCS.BLL/Services/Service/InstoreService.cs index b568d89..61f3c2d 100644 --- a/WCS.BLL/Services/Service/InstoreService.cs +++ b/WCS.BLL/Services/Service/InstoreService.cs @@ -1,4 +1,7 @@ -using System.Text.RegularExpressions; +using OracleInternal.SqlAndPlsqlParser.LocalParsing; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.InteropServices; +using System.Text.RegularExpressions; using WCS.BLL.Config; using WCS.BLL.DbModels; using WCS.BLL.HardWare; @@ -7,6 +10,7 @@ using WCS.BLL.Services.IService; using WCS.BLL.Tool; using WCS.BLL.Tool.Api.ApiModel; using WCS.DAL.Db; +using WCS.DAL.DbModels; using WCS.Model; namespace WCS.BLL.Services.Service @@ -372,5 +376,119 @@ namespace WCS.BLL.Services.Service } }; } + + public async Task queryInstoreStatusSingle(QueryByMatSnRequestSingle request) + { + //获取货架 + //var shelf = ShelfManager.Shelves.Where(t => t.ShelfCode == request.ShelfCode).FirstOrDefault(); + //if (shelf == null)//货架不存在 + //{ + // return new ResponseCommon() + // { + // Code = 201, + // Message = $"货架[{request.ShelfCode}]不存在!", + // }; + //} + List MI = DbHelp.db.Queryable().Where(it => it.ModuleCode == request.ShelfCode).ToList(); + if (MI.Count == 0) + { + return new ResponseCommonSingle() + { + Code = 201, + Message = $"货架[{request.ShelfCode}]不存在!", + }; + } + ResponseCommonSingle rcs = new ResponseCommonSingle(); + rcs.Data = new List(); + + string sendIP = MI[0].CleintIp; //单灯IP + int PCBId = MI[0].BoardId; //单灯PCB板ID + + List SI = DbHelp.db.Queryable().Where(it => it.ModuleCode == request.ShelfCode).ToList(); + + List si = DbHelp.db.Queryable().Where(it => it.ShelfCode == MI[0].ShelfCode).ToList(); + int warnLightID = si[0].LightId; + + foreach (QueryByMatSnRequestSingle.MatSnListDetail matSnListDetail in request.MatSnList) + { + Detail detail = new Detail(); + try + { + InventoryDetail inventoryDetail = new InventoryDetail(); + inventoryDetail.MatSN = matSnListDetail.MatSn; + inventoryDetail.MatCode = matSnListDetail.MatCode; + inventoryDetail.MatName = matSnListDetail.MatName; + inventoryDetail.MatSpec = matSnListDetail.MatSpec; + inventoryDetail.MatBatch = matSnListDetail.MatBatch; + inventoryDetail.MatQty = matSnListDetail.MatQty; + inventoryDetail.MatCustomer = matSnListDetail.MatCustomer; + inventoryDetail.MatSupplier = matSnListDetail.MatSupplier; + inventoryDetail.StoreCode = request.ShelfCode; + inventoryDetail.StoreId = SI[0].Id; + + int count = DbHelp.db.Insertable(inventoryDetail).ExecuteCommand(); + + InOutRecord ior = new InOutRecord(); + ior.MatSN = matSnListDetail.MatSn; + ior.MatCode = matSnListDetail.MatCode; + ior.MatName = matSnListDetail.MatName; + ior.MatSpec = matSnListDetail.MatSpec; + ior.MatBatch = matSnListDetail.MatBatch; + ior.MatQty = matSnListDetail.MatQty; + ior.MatCustomer = matSnListDetail.MatCustomer; + ior.MatSupplier = matSnListDetail.MatSupplier; + ior.StoreCode = request.ShelfCode; + ior.StoreId = SI[0].Id; + ior.Direction = 0; + ior.OperateTime = DateTime.Now; + ior.OperateUser = request.UserName; + int count1 = DbHelp.db.Insertable(ior).ExecuteCommand(); + + detail.matsn = matSnListDetail.MatSn; + detail.result = "入库成功"; + rcs.Data.Add(detail); + } + catch (Exception ee) + { + detail.matsn = matSnListDetail.MatSn; + detail.result = "入库失败"; + detail.reason = ee.Message; + rcs.Data.Add(detail); + } + } + //亮灯 + TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(sendIP); + byte[] data1 = new byte[8]; + data1[0] = 0xff; + data1[1] = 0x02; + data1[2] = 0x00; + data1[3] = 0x0a; + data1[4] = (byte)warnLightID; + data1[5] = 0x03; + data1[6] = 0x02; + data1[7] = 0x02; + byte[] senddata1 = Tool.Helper.Crc16(data1,data1.Length,false); + tCPClient.Send(senddata1); //报警灯短亮一次 + + byte[] data2 = new byte[8]; + data2[0] = 0xff; + data2[1] = 0x01; + data2[2] = 0x00; + data2[3] = 0x0a; + data2[4] = 0x01; + data2[5] = (byte)PCBId; + data2[6] = 0x03; + data2[7] = 0x02; + byte[] senddata2 = Tool.Helper.Crc16(data2, data2.Length, false); + tCPClient.Send(senddata2); //库位灯短亮一次 + + return new ResponseCommonSingle() + { + Code = 200, + Message = $"入库成功!", + Data = rcs.Data, + }; + + } } } diff --git a/WCS.BLL/Services/Service/OutstoreService.cs b/WCS.BLL/Services/Service/OutstoreService.cs index 37c1674..c0c9488 100644 --- a/WCS.BLL/Services/Service/OutstoreService.cs +++ b/WCS.BLL/Services/Service/OutstoreService.cs @@ -499,6 +499,98 @@ namespace WCS.BLL.Services.Service throw ex; } } + + public async Task GoInOutstoreSingle(GetOutOrderDetailRequest request) + { + try + { + //获取出库单 + var order = await DbHelp.db.Queryable() + .WhereIF(request.OrderId != 0, t => t.Id == request.OrderId) + .WhereIF(!string.IsNullOrEmpty(request.OrderNumber), t => t.OrderNumber == request.OrderNumber) + .FirstAsync(); + if (order == null) + { + return new ResponseCommon() + { + Code = 201, + Message = $"不存在对应的出库单据{request.OrderNumber}!", + Data = null + }; + } + + + //如果是按物料编码出库 需要计算物料明细、并进行物料锁定 + if (order.SyncType == SyncTypeEnum.ByMatCode) + { + var result = CaculateOutOrderMatDetails(order, request.UserName); + if (result.Code != 200) + { + return result; + } + } + + //获取需要出库的物料明细 + var outOrderMatDetails = DbHelp.db.Queryable() + .Where(t => t.OrderId == order.Id) + .Where(t => t.IsSended == false) + .Includes(t => t.StoreInfo) + .ToList(); + if (outOrderMatDetails == null || outOrderMatDetails.Count == 0) + { + return new ResponseCommon() + { + Code = 201, + Message = $"出库单据{request.OrderNumber}物料已全部完成出库!", + Data = null + }; + } + + if (request.IsStart)//&& order.OutOrderExeStatus != OutOrderExeStatus.发料完成 + { + order.OutOrderExeStatus = OutOrderExeStatus.开始发料; + DbHelp.db.Updateable(order).ExecuteCommand(); + } + //返回需求明细 + //获取出库需求 + List outorderdetal = DbHelp.db.Queryable() + .WhereIF(request.OrderId != 0, t => t.OrderId == request.OrderId) + .WhereIF(!string.IsNullOrEmpty(request.OrderNumber), t => t.OrderNumber == request.OrderNumber) + .ToList(); + + OutResponseCommonSingle orcs = new OutResponseCommonSingle(); + orcs.Data = new List(); + foreach (OutOrderDetail outdetail in outorderdetal) + { + OutDetail od = new OutDetail(); + od.OrderId = outdetail.OrderId; + od.OrderNumber= outdetail.OrderNumber; + od.MatCode=outdetail.MatCode; + od.MatBatch=outdetail.MatBatch; + od.ReqQty = outdetail.ReqQty; + od.CreateTime = outdetail.CreateTime; + od.CreateUser = outdetail.CreateUser; + od.MatName = outdetail.MatName; + od.OutQty = outdetail.OutQty; + od.LightColor = ""; + orcs.Data.Add(od); + } + + //返回 + return new OutResponseCommonSingle() + { + Code = 200, + Message = "Success", + Data = orcs.Data + }; + } + catch (Exception ex) + { + await GoOutOutstore(request); + throw ex; + } + } + //计算、加锁 private ResponseBase CaculateOutOrderMatDetails(OutOrder order, string createUser = "") { diff --git a/WCS.BLL/Tool/Helper.cs b/WCS.BLL/Tool/Helper.cs new file mode 100644 index 0000000..7e9a81b --- /dev/null +++ b/WCS.BLL/Tool/Helper.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +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 data = new List() { }; + 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(); + } + } +} diff --git a/WCS.Model/ApiModel/Home/ShelfTypeModel.cs b/WCS.Model/ApiModel/Home/ShelfTypeModel.cs index ff453fa..e329cc3 100644 --- a/WCS.Model/ApiModel/Home/ShelfTypeModel.cs +++ b/WCS.Model/ApiModel/Home/ShelfTypeModel.cs @@ -4,7 +4,7 @@ using System.Text; namespace WCS.Model.ApiModel.Home { - public class ShelfTypeModel() + public class ShelfTypeModel { public int Id { get; set; } public string ShelfTypeName { get; set; } diff --git a/WCS.Model/ApiModel/InStore/QueryByMatSnRequestSingle.cs b/WCS.Model/ApiModel/InStore/QueryByMatSnRequestSingle.cs new file mode 100644 index 0000000..f7c86a0 --- /dev/null +++ b/WCS.Model/ApiModel/InStore/QueryByMatSnRequestSingle.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WCS.Model +{ + public class QueryByMatSnRequestSingle: RequestBase + { + public List MatSnList { get; set; } + public string ShelfCode { get; set; } = string.Empty; + public string IpAddress { get; set; } = string.Empty; + + public bool IsSingleLightIn { get; set; } = false; + + public class MatSnListDetail + { + public string MatSn { get; set; } + public string MatCode { get; set; } + public string MatName { get; set; } + public string MatSpec { get; set; } + public string MatBatch { get; set; } + public int MatQty { get; set; } + public string MatCustomer { get; set; } + public string MatSupplier { get; set; } + } + } +} diff --git a/WCS.Model/ApiModel/OutStore/GetOutOrderDetailRequestSingle.cs b/WCS.Model/ApiModel/OutStore/GetOutOrderDetailRequestSingle.cs new file mode 100644 index 0000000..68d2108 --- /dev/null +++ b/WCS.Model/ApiModel/OutStore/GetOutOrderDetailRequestSingle.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WCS.Model.ApiModel.OutStore +{ + public class GetOutOrderDetailRequestSingle:RequestBase + { + + } +} diff --git a/WCS.Model/ApiModel/ResponseBase.cs b/WCS.Model/ApiModel/ResponseBase.cs index c23ee40..f38828f 100644 --- a/WCS.Model/ApiModel/ResponseBase.cs +++ b/WCS.Model/ApiModel/ResponseBase.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using WCS.BLL.DbModels; namespace WCS.Model { @@ -27,4 +28,35 @@ namespace WCS.Model { public T Data { get; set; } } + + public class ResponseCommonSingle : ResponseBase + { + public List Data { get; set; } + } + + public class Detail + { + public string matsn { get; set; } + public string result { get; set; } + public string reason { get; set; } + } + + public class OutResponseCommonSingle : ResponseBase + { + public List Data { get; set; } + } + + public class OutDetail + { + public int OrderId { get; set; } + public string OrderNumber { get; set; } + public string MatCode { get; set; } + public string MatBatch { get; set; } + public int ReqQty { get; set; } + public DateTime CreateTime { get; set; } + public string CreateUser { get; set; } + public string MatName { get; set; } + public int OutQty { get; set; } + public string LightColor { get; set; } + } } diff --git a/WCS.WebApi/Controllers/InstoreController.cs b/WCS.WebApi/Controllers/InstoreController.cs index fd2a56a..d8aa60d 100644 --- a/WCS.WebApi/Controllers/InstoreController.cs +++ b/WCS.WebApi/Controllers/InstoreController.cs @@ -135,13 +135,13 @@ namespace WebApi.Controllers /// /// [Route("singleLightCommitInstore")] - [HttpPost(Name = "queryInstoreStatus")] - public async Task singleLightCommitInstore(QueryByMatSnRequest request) + [HttpPost(Name = "singleLightCommitInstore")] + public async Task singleLightCommitInstore(QueryByMatSnRequestSingle request) { //TODO: ƻύ try { - return await _instoreService.queryInstoreStatus(request); + return await _instoreService.queryInstoreStatusSingle(request); //ShelfManager. // } diff --git a/WCS.WebApi/Controllers/OutstoreController.cs b/WCS.WebApi/Controllers/OutstoreController.cs index 18df91a..d370fe7 100644 --- a/WCS.WebApi/Controllers/OutstoreController.cs +++ b/WCS.WebApi/Controllers/OutstoreController.cs @@ -225,10 +225,10 @@ namespace WebApi.Controllers [HttpPost(Name = "singleLightGoInOutstore")] public async Task singleLightGoInOutstore(GetOutOrderDetailRequest request) { - //TODO + //TODO: try { - return await _outstoreService.GoInOutstore(request); + return await _outstoreService.GoInOutstoreSingle(request); } catch (Exception ex) { diff --git a/货架标准上位机/ScannerManager.cs b/货架标准上位机/ScannerManager.cs index e1a700f..c46ab88 100644 --- a/货架标准上位机/ScannerManager.cs +++ b/货架标准上位机/ScannerManager.cs @@ -61,7 +61,7 @@ namespace 货架标准上位机 } } - public class Scanner() + public class Scanner { public SerialPortClient SerialPortClient { get; set; } diff --git a/货架标准上位机/ViewModels/HomeViewModel.cs b/货架标准上位机/ViewModels/HomeViewModel.cs index 12908d9..f8b90ea 100644 --- a/货架标准上位机/ViewModels/HomeViewModel.cs +++ b/货架标准上位机/ViewModels/HomeViewModel.cs @@ -49,34 +49,34 @@ namespace 货架标准上位机.ViewModel public async void AddUserControl() { //var dia = Dialog.Show(new TextDialog()); - try - { - var body = new GetShelfStatusRequest() - { - UserName = "xxx", - DeviceType = "WCS前端", - GroupNames = LocalFile.Config.GroupName, + //try + //{ + // var body = new GetShelfStatusRequest() + // { + // UserName = "xxx", + // DeviceType = "WCS前端", + // GroupNames = LocalFile.Config.GroupName, - }; - var Result = await ApiHelp.Post([LocalFile.Config.ApiIpHost, "home/getShelfStatus"], body); - if (Result != null && Result.Data?.Count > 0) - { - wrapPanel.Children.Clear(); - Result.Data.ForEach(t => - { - var shelf = new ShelfStatusControl(t.ShelfCode, t.CurentMode, t.GroupName); - wrapPanel.Children.Add(shelf); - }); - } - } - catch (Exception ex) - { + // }; + // var Result = await ApiHelp.Post([LocalFile.Config.ApiIpHost, "home/getShelfStatus"], body); + // if (Result != null && Result.Data?.Count > 0) + // { + // wrapPanel.Children.Clear(); + // Result.Data.ForEach(t => + // { + // var shelf = new ShelfStatusControl(t.ShelfCode, t.CurentMode, t.GroupName); + // wrapPanel.Children.Add(shelf); + // }); + // } + //} + //catch (Exception ex) + //{ - } - finally - { - //dia.Close(); - } + //} + //finally + //{ + // //dia.Close(); + //} } #endregion diff --git a/货架标准上位机/ViewModels/InOutRecordViewModel.cs b/货架标准上位机/ViewModels/InOutRecordViewModel.cs index 138ebae..8c7beb8 100644 --- a/货架标准上位机/ViewModels/InOutRecordViewModel.cs +++ b/货架标准上位机/ViewModels/InOutRecordViewModel.cs @@ -108,7 +108,7 @@ namespace 货架标准上位机.ViewModel } Items.CanNotify = true; } - public class DataModel() + public class DataModel { public string MatCode { get; set; } } diff --git a/货架标准上位机/ViewModels/MatInventoryDetailViewModel.cs b/货架标准上位机/ViewModels/MatInventoryDetailViewModel.cs index b17b2d9..3e41cc2 100644 --- a/货架标准上位机/ViewModels/MatInventoryDetailViewModel.cs +++ b/货架标准上位机/ViewModels/MatInventoryDetailViewModel.cs @@ -120,7 +120,7 @@ namespace 货架标准上位机.ViewModel } Items.CanNotify = true; } - public class DataModel() + public class DataModel { public string MatCode { get; set; } } diff --git a/货架标准上位机/Views/Windows/UserLoginView.xaml.cs b/货架标准上位机/Views/Windows/UserLoginView.xaml.cs index f8c5671..ee64eea 100644 --- a/货架标准上位机/Views/Windows/UserLoginView.xaml.cs +++ b/货架标准上位机/Views/Windows/UserLoginView.xaml.cs @@ -128,43 +128,43 @@ namespace 货架标准上位机 /// public static void NotLogin() { - try - { - var body = new GetUsersRequest() - { - UserName = "admin", - DeviceType = "WCS前端", - Info = "123", - }; - var Result = ApiHelp.Post>>([LocalFile.Config.ApiIpHost, "user/getUsers"], body).Result; - if (Result != null && Result.Data.Any()) - { - UserInfoView.viewModel.User = Result.Data.First(); - } + //try + //{ + // var body = new GetUsersRequest() + // { + // UserName = "admin", + // DeviceType = "WCS前端", + // Info = "123", + // }; + // var Result = ApiHelp.Post>>([LocalFile.Config.ApiIpHost, "user/getUsers"], body).Result; + // if (Result != null && Result.Data.Any()) + // { + // UserInfoView.viewModel.User = Result.Data.First(); + // } - var bodyRole = new GetUsersRequest() - { - UserName = "admin", - DeviceType = "WCS前端", - Info = "123", + // var bodyRole = new GetUsersRequest() + // { + // UserName = "admin", + // DeviceType = "WCS前端", + // Info = "123", - }; - var ResultRole = ApiHelp.Post>>([LocalFile.Config.ApiIpHost, "user/getRoles"], body).Result; - if (ResultRole != null && ResultRole.Data.Any()) - { - UserInfoView.viewModel.Roles = ResultRole.Data; - } + // }; + // var ResultRole = ApiHelp.Post>>([LocalFile.Config.ApiIpHost, "user/getRoles"], body).Result; + // if (ResultRole != null && ResultRole.Data.Any()) + // { + // UserInfoView.viewModel.Roles = ResultRole.Data; + // } - UserInfoView.viewModel.IsLogin = true; - } - catch (Exception ex) - { - Growl.Error("加载数据失败:" + ex.Message); - } - finally - { - //dia.Close(); - } + // UserInfoView.viewModel.IsLogin = true; + //} + //catch (Exception ex) + //{ + // Growl.Error("加载数据失败:" + ex.Message); + //} + //finally + //{ + // //dia.Close(); + //} } //接口获取User对象