1
This commit is contained in:
@ -34,6 +34,7 @@ namespace WCS.BLL.HardWare
|
|||||||
public void GoInInstore(string IPAdress)
|
public void GoInInstore(string IPAdress)
|
||||||
{
|
{
|
||||||
//找到对应的灯 亮灯
|
//找到对应的灯 亮灯
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GoInOutstore(List<OutOrderMatDetail> MatDetails, OutOrder outOrder)
|
public void GoInOutstore(List<OutOrderMatDetail> MatDetails, OutOrder outOrder)
|
||||||
|
@ -45,6 +45,13 @@ namespace WCS.BLL.Manager
|
|||||||
ShelfCode = shelfInDb.ShelfCode,
|
ShelfCode = shelfInDb.ShelfCode,
|
||||||
GroupName = shelfInDb.GroupName,
|
GroupName = shelfInDb.GroupName,
|
||||||
};
|
};
|
||||||
|
case 3:
|
||||||
|
return new SmartShelf(shelfInDb)
|
||||||
|
{
|
||||||
|
ShelfId = shelfInDb.Id,
|
||||||
|
ShelfCode = shelfInDb.ShelfCode,
|
||||||
|
GroupName = shelfInDb.GroupName,
|
||||||
|
};
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -14,5 +14,6 @@ namespace WCS.BLL.Services.IService
|
|||||||
public Task<ResponseBase> queryByMatSn(QueryByMatSnRequest request);
|
public Task<ResponseBase> queryByMatSn(QueryByMatSnRequest request);
|
||||||
public Task<ResponseBase> queryByMatSnOut(QueryByMatSnRequest request);
|
public Task<ResponseBase> queryByMatSnOut(QueryByMatSnRequest request);
|
||||||
public Task<ResponseBase> queryInstoreStatus(QueryByMatSnRequest request);
|
public Task<ResponseBase> queryInstoreStatus(QueryByMatSnRequest request);
|
||||||
|
public Task<ResponseBase> queryInstoreStatusSingle(QueryByMatSnRequestSingle request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@ namespace WCS.BLL.Services.IService
|
|||||||
|
|
||||||
public Task<ResponseBase> GoInOutstore(GetOutOrderDetailRequest request);
|
public Task<ResponseBase> GoInOutstore(GetOutOrderDetailRequest request);
|
||||||
|
|
||||||
|
public Task<ResponseBase> GoInOutstoreSingle(GetOutOrderDetailRequest request);
|
||||||
|
|
||||||
public Task<ResponseBase> GoOutOutstore(GetOutOrderDetailRequest request);
|
public Task<ResponseBase> GoOutOutstore(GetOutOrderDetailRequest request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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.Config;
|
||||||
using WCS.BLL.DbModels;
|
using WCS.BLL.DbModels;
|
||||||
using WCS.BLL.HardWare;
|
using WCS.BLL.HardWare;
|
||||||
@ -7,6 +10,7 @@ using WCS.BLL.Services.IService;
|
|||||||
using WCS.BLL.Tool;
|
using WCS.BLL.Tool;
|
||||||
using WCS.BLL.Tool.Api.ApiModel;
|
using WCS.BLL.Tool.Api.ApiModel;
|
||||||
using WCS.DAL.Db;
|
using WCS.DAL.Db;
|
||||||
|
using WCS.DAL.DbModels;
|
||||||
using WCS.Model;
|
using WCS.Model;
|
||||||
|
|
||||||
namespace WCS.BLL.Services.Service
|
namespace WCS.BLL.Services.Service
|
||||||
@ -372,5 +376,119 @@ namespace WCS.BLL.Services.Service
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<ResponseBase> 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<ModuleInfo> MI = DbHelp.db.Queryable<ModuleInfo>().Where(it => it.ModuleCode == request.ShelfCode).ToList();
|
||||||
|
if (MI.Count == 0)
|
||||||
|
{
|
||||||
|
return new ResponseCommonSingle()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"货架[{request.ShelfCode}]不存在!",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
ResponseCommonSingle rcs = new ResponseCommonSingle();
|
||||||
|
rcs.Data = new List<Detail>();
|
||||||
|
|
||||||
|
string sendIP = MI[0].CleintIp; //单灯IP
|
||||||
|
int PCBId = MI[0].BoardId; //单灯PCB板ID
|
||||||
|
|
||||||
|
List<StoreInfo> SI = DbHelp.db.Queryable<StoreInfo>().Where(it => it.ModuleCode == request.ShelfCode).ToList();
|
||||||
|
|
||||||
|
List<ShelfInfo> si = DbHelp.db.Queryable<ShelfInfo>().Where(it => it.ShelfCode == MI[0].ShelfCode).ToList();
|
||||||
|
int warnLightID = si[0].LightId;
|
||||||
|
|
||||||
|
foreach (QueryByMatSnRequestSingle.MatSnListDetail matSnListDetail in request.MatSnList)
|
||||||
|
{
|
||||||
|
Detail detail = new Detail();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
InventoryDetail inventoryDetail = new InventoryDetail();
|
||||||
|
inventoryDetail.MatSN = matSnListDetail.MatSn;
|
||||||
|
inventoryDetail.MatCode = matSnListDetail.MatCode;
|
||||||
|
inventoryDetail.MatName = matSnListDetail.MatName;
|
||||||
|
inventoryDetail.MatSpec = matSnListDetail.MatSpec;
|
||||||
|
inventoryDetail.MatBatch = matSnListDetail.MatBatch;
|
||||||
|
inventoryDetail.MatQty = matSnListDetail.MatQty;
|
||||||
|
inventoryDetail.MatCustomer = matSnListDetail.MatCustomer;
|
||||||
|
inventoryDetail.MatSupplier = matSnListDetail.MatSupplier;
|
||||||
|
inventoryDetail.StoreCode = request.ShelfCode;
|
||||||
|
inventoryDetail.StoreId = SI[0].Id;
|
||||||
|
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -499,6 +499,98 @@ namespace WCS.BLL.Services.Service
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<ResponseBase> GoInOutstoreSingle(GetOutOrderDetailRequest request)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//获取出库单
|
||||||
|
var order = await DbHelp.db.Queryable<OutOrder>()
|
||||||
|
.WhereIF(request.OrderId != 0, t => t.Id == request.OrderId)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(request.OrderNumber), t => t.OrderNumber == request.OrderNumber)
|
||||||
|
.FirstAsync();
|
||||||
|
if (order == null)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"不存在对应的出库单据{request.OrderNumber}!",
|
||||||
|
Data = null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//如果是按物料编码出库 需要计算物料明细、并进行物料锁定
|
||||||
|
if (order.SyncType == SyncTypeEnum.ByMatCode)
|
||||||
|
{
|
||||||
|
var result = CaculateOutOrderMatDetails(order, request.UserName);
|
||||||
|
if (result.Code != 200)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取需要出库的物料明细
|
||||||
|
var outOrderMatDetails = DbHelp.db.Queryable<OutOrderMatDetail>()
|
||||||
|
.Where(t => t.OrderId == order.Id)
|
||||||
|
.Where(t => t.IsSended == false)
|
||||||
|
.Includes(t => t.StoreInfo)
|
||||||
|
.ToList();
|
||||||
|
if (outOrderMatDetails == null || outOrderMatDetails.Count == 0)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"出库单据{request.OrderNumber}物料已全部完成出库!",
|
||||||
|
Data = null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request.IsStart)//&& order.OutOrderExeStatus != OutOrderExeStatus.发料完成
|
||||||
|
{
|
||||||
|
order.OutOrderExeStatus = OutOrderExeStatus.开始发料;
|
||||||
|
DbHelp.db.Updateable(order).ExecuteCommand();
|
||||||
|
}
|
||||||
|
//返回需求明细
|
||||||
|
//获取出库需求
|
||||||
|
List<OutOrderDetail> outorderdetal = DbHelp.db.Queryable<OutOrderDetail>()
|
||||||
|
.WhereIF(request.OrderId != 0, t => t.OrderId == request.OrderId)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(request.OrderNumber), t => t.OrderNumber == request.OrderNumber)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
OutResponseCommonSingle orcs = new OutResponseCommonSingle();
|
||||||
|
orcs.Data = new List<OutDetail>();
|
||||||
|
foreach (OutOrderDetail outdetail in outorderdetal)
|
||||||
|
{
|
||||||
|
OutDetail od = new OutDetail();
|
||||||
|
od.OrderId = outdetail.OrderId;
|
||||||
|
od.OrderNumber= outdetail.OrderNumber;
|
||||||
|
od.MatCode=outdetail.MatCode;
|
||||||
|
od.MatBatch=outdetail.MatBatch;
|
||||||
|
od.ReqQty = outdetail.ReqQty;
|
||||||
|
od.CreateTime = outdetail.CreateTime;
|
||||||
|
od.CreateUser = outdetail.CreateUser;
|
||||||
|
od.MatName = outdetail.MatName;
|
||||||
|
od.OutQty = outdetail.OutQty;
|
||||||
|
od.LightColor = "";
|
||||||
|
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 = "")
|
private ResponseBase CaculateOutOrderMatDetails(OutOrder order, string createUser = "")
|
||||||
{
|
{
|
||||||
|
85
WCS.BLL/Tool/Helper.cs
Normal file
85
WCS.BLL/Tool/Helper.cs
Normal file
@ -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<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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@ using System.Text;
|
|||||||
|
|
||||||
namespace WCS.Model.ApiModel.Home
|
namespace WCS.Model.ApiModel.Home
|
||||||
{
|
{
|
||||||
public class ShelfTypeModel()
|
public class ShelfTypeModel
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string ShelfTypeName { get; set; }
|
public string ShelfTypeName { get; set; }
|
||||||
|
27
WCS.Model/ApiModel/InStore/QueryByMatSnRequestSingle.cs
Normal file
27
WCS.Model/ApiModel/InStore/QueryByMatSnRequestSingle.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model
|
||||||
|
{
|
||||||
|
public class QueryByMatSnRequestSingle: RequestBase
|
||||||
|
{
|
||||||
|
public List<MatSnListDetail> 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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.OutStore
|
||||||
|
{
|
||||||
|
public class GetOutOrderDetailRequestSingle:RequestBase
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using WCS.BLL.DbModels;
|
||||||
|
|
||||||
namespace WCS.Model
|
namespace WCS.Model
|
||||||
{
|
{
|
||||||
@ -27,4 +28,35 @@ namespace WCS.Model
|
|||||||
{
|
{
|
||||||
public T Data { get; set; }
|
public T Data { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ResponseCommonSingle : ResponseBase
|
||||||
|
{
|
||||||
|
public List<Detail> 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<OutDetail> 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; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,13 +135,13 @@ namespace WebApi.Controllers
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Route("singleLightCommitInstore")]
|
[Route("singleLightCommitInstore")]
|
||||||
[HttpPost(Name = "queryInstoreStatus")]
|
[HttpPost(Name = "singleLightCommitInstore")]
|
||||||
public async Task<ResponseBase> singleLightCommitInstore(QueryByMatSnRequest request)
|
public async Task<ResponseBase> singleLightCommitInstore(QueryByMatSnRequestSingle request)
|
||||||
{
|
{
|
||||||
//TODO:<3A><><EFBFBD><EFBFBD> <20><><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>
|
//TODO:<3A><><EFBFBD><EFBFBD> <20><><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return await _instoreService.queryInstoreStatus(request);
|
return await _instoreService.queryInstoreStatusSingle(request);
|
||||||
//ShelfManager.
|
//ShelfManager.
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
@ -225,10 +225,10 @@ namespace WebApi.Controllers
|
|||||||
[HttpPost(Name = "singleLightGoInOutstore")]
|
[HttpPost(Name = "singleLightGoInOutstore")]
|
||||||
public async Task<ResponseBase> singleLightGoInOutstore(GetOutOrderDetailRequest request)
|
public async Task<ResponseBase> singleLightGoInOutstore(GetOutOrderDetailRequest request)
|
||||||
{
|
{
|
||||||
//TODO<44><4F><EFBFBD><EFBFBD>
|
//TODO:<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return await _outstoreService.GoInOutstore(request);
|
return await _outstoreService.GoInOutstoreSingle(request);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -61,7 +61,7 @@ namespace 货架标准上位机
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Scanner()
|
public class Scanner
|
||||||
{
|
{
|
||||||
public SerialPortClient SerialPortClient { get; set; }
|
public SerialPortClient SerialPortClient { get; set; }
|
||||||
|
|
||||||
|
@ -49,34 +49,34 @@ namespace 货架标准上位机.ViewModel
|
|||||||
public async void AddUserControl()
|
public async void AddUserControl()
|
||||||
{
|
{
|
||||||
//var dia = Dialog.Show(new TextDialog());
|
//var dia = Dialog.Show(new TextDialog());
|
||||||
try
|
//try
|
||||||
{
|
//{
|
||||||
var body = new GetShelfStatusRequest()
|
// var body = new GetShelfStatusRequest()
|
||||||
{
|
// {
|
||||||
UserName = "xxx",
|
// UserName = "xxx",
|
||||||
DeviceType = "WCS前端",
|
// DeviceType = "WCS前端",
|
||||||
GroupNames = LocalFile.Config.GroupName,
|
// GroupNames = LocalFile.Config.GroupName,
|
||||||
|
|
||||||
};
|
// };
|
||||||
var Result = await ApiHelp.Post<GetShelfStatusResponse>([LocalFile.Config.ApiIpHost, "home/getShelfStatus"], body);
|
// var Result = await ApiHelp.Post<GetShelfStatusResponse>([LocalFile.Config.ApiIpHost, "home/getShelfStatus"], body);
|
||||||
if (Result != null && Result.Data?.Count > 0)
|
// if (Result != null && Result.Data?.Count > 0)
|
||||||
{
|
// {
|
||||||
wrapPanel.Children.Clear();
|
// wrapPanel.Children.Clear();
|
||||||
Result.Data.ForEach(t =>
|
// Result.Data.ForEach(t =>
|
||||||
{
|
// {
|
||||||
var shelf = new ShelfStatusControl(t.ShelfCode, t.CurentMode, t.GroupName);
|
// var shelf = new ShelfStatusControl(t.ShelfCode, t.CurentMode, t.GroupName);
|
||||||
wrapPanel.Children.Add(shelf);
|
// wrapPanel.Children.Add(shelf);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
catch (Exception ex)
|
//catch (Exception ex)
|
||||||
{
|
//{
|
||||||
|
|
||||||
}
|
//}
|
||||||
finally
|
//finally
|
||||||
{
|
//{
|
||||||
//dia.Close();
|
// //dia.Close();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ namespace 货架标准上位机.ViewModel
|
|||||||
}
|
}
|
||||||
Items.CanNotify = true;
|
Items.CanNotify = true;
|
||||||
}
|
}
|
||||||
public class DataModel()
|
public class DataModel
|
||||||
{
|
{
|
||||||
public string MatCode { get; set; }
|
public string MatCode { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ namespace 货架标准上位机.ViewModel
|
|||||||
}
|
}
|
||||||
Items.CanNotify = true;
|
Items.CanNotify = true;
|
||||||
}
|
}
|
||||||
public class DataModel()
|
public class DataModel
|
||||||
{
|
{
|
||||||
public string MatCode { get; set; }
|
public string MatCode { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -128,43 +128,43 @@ namespace 货架标准上位机
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static void NotLogin()
|
public static void NotLogin()
|
||||||
{
|
{
|
||||||
try
|
//try
|
||||||
{
|
//{
|
||||||
var body = new GetUsersRequest()
|
// var body = new GetUsersRequest()
|
||||||
{
|
// {
|
||||||
UserName = "admin",
|
// UserName = "admin",
|
||||||
DeviceType = "WCS前端",
|
// DeviceType = "WCS前端",
|
||||||
Info = "123",
|
// Info = "123",
|
||||||
};
|
// };
|
||||||
var Result = ApiHelp.Post<ResponseCommon<List<UserModel>>>([LocalFile.Config.ApiIpHost, "user/getUsers"], body).Result;
|
// var Result = ApiHelp.Post<ResponseCommon<List<UserModel>>>([LocalFile.Config.ApiIpHost, "user/getUsers"], body).Result;
|
||||||
if (Result != null && Result.Data.Any())
|
// if (Result != null && Result.Data.Any())
|
||||||
{
|
// {
|
||||||
UserInfoView.viewModel.User = Result.Data.First();
|
// UserInfoView.viewModel.User = Result.Data.First();
|
||||||
}
|
// }
|
||||||
|
|
||||||
var bodyRole = new GetUsersRequest()
|
// var bodyRole = new GetUsersRequest()
|
||||||
{
|
// {
|
||||||
UserName = "admin",
|
// UserName = "admin",
|
||||||
DeviceType = "WCS前端",
|
// DeviceType = "WCS前端",
|
||||||
Info = "123",
|
// Info = "123",
|
||||||
|
|
||||||
};
|
// };
|
||||||
var ResultRole = ApiHelp.Post<ResponseCommon<List<RoleModel>>>([LocalFile.Config.ApiIpHost, "user/getRoles"], body).Result;
|
// var ResultRole = ApiHelp.Post<ResponseCommon<List<RoleModel>>>([LocalFile.Config.ApiIpHost, "user/getRoles"], body).Result;
|
||||||
if (ResultRole != null && ResultRole.Data.Any())
|
// if (ResultRole != null && ResultRole.Data.Any())
|
||||||
{
|
// {
|
||||||
UserInfoView.viewModel.Roles = ResultRole.Data;
|
// UserInfoView.viewModel.Roles = ResultRole.Data;
|
||||||
}
|
// }
|
||||||
|
|
||||||
UserInfoView.viewModel.IsLogin = true;
|
// UserInfoView.viewModel.IsLogin = true;
|
||||||
}
|
//}
|
||||||
catch (Exception ex)
|
//catch (Exception ex)
|
||||||
{
|
//{
|
||||||
Growl.Error("加载数据失败:" + ex.Message);
|
// Growl.Error("加载数据失败:" + ex.Message);
|
||||||
}
|
//}
|
||||||
finally
|
//finally
|
||||||
{
|
//{
|
||||||
//dia.Close();
|
// //dia.Close();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
//接口获取User对象
|
//接口获取User对象
|
||||||
|
Reference in New Issue
Block a user