Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
44467d3213 | |||
62fba9343d | |||
664b7bfc1b | |||
ff59990f10 | |||
ddf94cdcf0 | |||
5441648d49 | |||
549a45dcf0 | |||
f8fe33c32b |
@ -124,6 +124,11 @@ namespace WCS.BLL.HardWare
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void Reset();
|
public void Reset();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 板子与货架状态不一致的复位(未响应的复位)
|
||||||
|
/// </summary>
|
||||||
|
public void NoResponseReset();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货架自检
|
/// 货架自检
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -95,6 +95,11 @@ namespace WCS.BLL.HardWare
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void NoResponseReset()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetCurrentMode(Mode mode)
|
public void SetCurrentMode(Mode mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -694,6 +694,18 @@ namespace WCS.BLL.HardWare
|
|||||||
WarningManager.SendWarning(warningModel);
|
WarningManager.SendWarning(warningModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var currentOutStoreMatSns = CurrentOutStoreMatSNs.ToList();
|
||||||
|
//Task.Run(() =>
|
||||||
|
//{
|
||||||
|
// var matDetails = DbHelp.db.Queryable<InventoryDetail>()
|
||||||
|
// .Where(t => currentOutStoreMatSns.Contains(t.MatSN))
|
||||||
|
// .Where(t => t.IsLocked)
|
||||||
|
// .ToList();
|
||||||
|
// matDetails.ForEach(t => t.IsLocked = false);
|
||||||
|
// DbHelp.db.Updateable(matDetails).ExecuteCommand();
|
||||||
|
//});
|
||||||
|
|
||||||
|
|
||||||
CurrentOutStoreMatSNs.Clear();
|
CurrentOutStoreMatSNs.Clear();
|
||||||
WarningLight.CloseLight(TcpCleint);
|
WarningLight.CloseLight(TcpCleint);
|
||||||
SetCurrentMode(Mode.待机模式);
|
SetCurrentMode(Mode.待机模式);
|
||||||
@ -911,6 +923,31 @@ namespace WCS.BLL.HardWare
|
|||||||
SetCurrentMode(Mode.待机模式);
|
SetCurrentMode(Mode.待机模式);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 板子与货架状态不一致的复位(未响应的复位)
|
||||||
|
/// </summary>
|
||||||
|
public void NoResponseReset()
|
||||||
|
{
|
||||||
|
//不是待机模式不发送指令
|
||||||
|
if (CurrentMode != Mode.待机模式)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//获取状态不一致的板子
|
||||||
|
var modules = Modules.Where(t => t.IsEnable && t.CurrentMode != Mode.待机模式)
|
||||||
|
.ToList();
|
||||||
|
if (modules != null && modules.Count > 0)
|
||||||
|
{
|
||||||
|
modules.ForEach(t =>
|
||||||
|
{
|
||||||
|
//复位状态不一致的板子
|
||||||
|
Logs.Write($"复位模组【{t.ModuleCode}({t.CurrentMode})】发送指令成功!");
|
||||||
|
t.Reset(TcpCleint);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void QueryVoltage(int moduleId)
|
public void QueryVoltage(int moduleId)
|
||||||
{
|
{
|
||||||
var moudle = Modules.Where(t => t.ModuleId == moduleId).First();
|
var moudle = Modules.Where(t => t.ModuleId == moduleId).First();
|
||||||
|
@ -18,105 +18,105 @@ namespace WCS.BLL.Manager
|
|||||||
{
|
{
|
||||||
public static void InitBackgroundThread()
|
public static void InitBackgroundThread()
|
||||||
{
|
{
|
||||||
#region 定时任务:回传Mes入库出库
|
//#region 定时任务:回传Mes入库出库
|
||||||
Task.Run(() =>
|
//Task.Run(() =>
|
||||||
{
|
//{
|
||||||
while (true)
|
// while (true)
|
||||||
{
|
// {
|
||||||
//每5秒同步一次
|
// //每5秒同步一次
|
||||||
Thread.Sleep(5000);
|
// Thread.Sleep(5000);
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
var records = DbHelp.db.Queryable<InOutRecord>()
|
// var records = DbHelp.db.Queryable<InOutRecord>()
|
||||||
.Where(t => t.OperateTime > DateTime.Now.AddDays(-3)) //只查询回传三天内数据
|
// .Where(t => t.OperateTime > DateTime.Now.AddDays(-3)) //只查询回传三天内数据
|
||||||
.Where(t => t.IsUpload == false)
|
// .Where(t => t.IsUpload == false)
|
||||||
.Includes(t => t.StoreInfo)
|
// .Includes(t => t.StoreInfo)
|
||||||
.OrderBy(t => t.Id)
|
// .OrderBy(t => t.Id)
|
||||||
.ToList();
|
// .ToList();
|
||||||
//入库记录上传
|
// //入库记录上传
|
||||||
var inventoryDetails = records.Where(t => t.Direction == DirectionEnum.入库)
|
// var inventoryDetails = records.Where(t => t.Direction == DirectionEnum.入库)
|
||||||
.WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName)
|
// .WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName)
|
||||||
.ToList();
|
// .ToList();
|
||||||
if (inventoryDetails != null && inventoryDetails.Count > 0)
|
// if (inventoryDetails != null && inventoryDetails.Count > 0)
|
||||||
{
|
// {
|
||||||
for (int i = 0; i < inventoryDetails.Count; i++)
|
// for (int i = 0; i < inventoryDetails.Count; i++)
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
//请求WMS上传入库记录
|
// //请求WMS上传入库记录
|
||||||
var data = new InputStockInRequest
|
// var data = new InputStockInRequest
|
||||||
{
|
// {
|
||||||
materialBar = inventoryDetails[i].MatSN,
|
// materialBar = inventoryDetails[i].MatSN,
|
||||||
shelfCode = inventoryDetails[i].BigShelfCode,
|
// shelfCode = inventoryDetails[i].BigShelfCode,
|
||||||
shelfX = "R" + inventoryDetails[i].R,
|
// shelfX = "R" + inventoryDetails[i].R,
|
||||||
shelfY = "C" + inventoryDetails[i].C,
|
// shelfY = "C" + inventoryDetails[i].C,
|
||||||
shelfZ = inventoryDetails[i].Wei,
|
// shelfZ = inventoryDetails[i].Wei,
|
||||||
inUser = inventoryDetails[i].OperateUser,
|
// inUser = inventoryDetails[i].OperateUser,
|
||||||
inTime = inventoryDetails[i].OperateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
// inTime = inventoryDetails[i].OperateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
};
|
// };
|
||||||
Guid guid = Guid.NewGuid();
|
// Guid guid = Guid.NewGuid();
|
||||||
var result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.InputStockInStr, data, "POST", true);
|
// var result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.InputStockInStr, data, "POST", true);
|
||||||
if (result != null && (result.Code == 200))
|
// if (result != null && (result.Code == 200))
|
||||||
{
|
// {
|
||||||
//上传成功 更改上传状态
|
// //上传成功 更改上传状态
|
||||||
inventoryDetails[i].IsUpload = true;
|
// inventoryDetails[i].IsUpload = true;
|
||||||
DbHelp.db.Updateable(inventoryDetails[i]).ExecuteCommand();
|
// DbHelp.db.Updateable(inventoryDetails[i]).ExecuteCommand();
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
catch (Exception ex)
|
// catch (Exception ex)
|
||||||
{
|
// {
|
||||||
|
|
||||||
}
|
// }
|
||||||
Thread.Sleep(200);
|
// Thread.Sleep(200);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
//出库记录上传
|
// //出库记录上传
|
||||||
var outRecord = records.Where(t => t.Direction == DirectionEnum.出库)
|
// var outRecord = records.Where(t => t.Direction == DirectionEnum.出库)
|
||||||
.Where(t => !string.IsNullOrEmpty(t.OrderNumber))
|
// .Where(t => !string.IsNullOrEmpty(t.OrderNumber))
|
||||||
.WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName)
|
// .WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName)
|
||||||
.ToList();
|
// .ToList();
|
||||||
if (outRecord != null && outRecord.Count > 0)
|
// if (outRecord != null && outRecord.Count > 0)
|
||||||
{
|
// {
|
||||||
for (int i = 0; i < outRecord.Count; i++)
|
// for (int i = 0; i < outRecord.Count; i++)
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
var retString = string.Empty;
|
// var retString = string.Empty;
|
||||||
|
|
||||||
var data = new BunkerOutRequest()
|
// var data = new BunkerOutRequest()
|
||||||
{
|
// {
|
||||||
materialBar = outRecord[i].MatSN,
|
// materialBar = outRecord[i].MatSN,
|
||||||
outType = 0,
|
// outType = 0,
|
||||||
pickBillNumber = outRecord[i].OrderNumber,
|
// pickBillNumber = outRecord[i].OrderNumber,
|
||||||
qty = outRecord[i].MatQty,
|
// qty = outRecord[i].MatQty,
|
||||||
};
|
// };
|
||||||
var result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.BunkerOutStr, data, "POST", true);
|
// var result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.BunkerOutStr, data, "POST", true);
|
||||||
//请求成功
|
// //请求成功
|
||||||
if (result != null && result.Code == 200)
|
// if (result != null && result.Code == 200)
|
||||||
{
|
// {
|
||||||
//上传成功 更改上传状态
|
// //上传成功 更改上传状态
|
||||||
outRecord[i].IsUpload = true;
|
// outRecord[i].IsUpload = true;
|
||||||
DbHelp.db.Updateable(outRecord[i]).ExecuteCommand();
|
// DbHelp.db.Updateable(outRecord[i]).ExecuteCommand();
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
catch (Exception ex)
|
// catch (Exception ex)
|
||||||
{
|
// {
|
||||||
|
|
||||||
}
|
// }
|
||||||
Thread.Sleep(200);
|
// Thread.Sleep(200);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
catch (Exception ex)
|
// catch (Exception ex)
|
||||||
{
|
// {
|
||||||
Logs.Write("【定时任务】上传异常:" + ex.Message);
|
// Logs.Write("【定时任务】上传异常:" + ex.Message);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
//});
|
||||||
#endregion
|
//#endregion
|
||||||
|
|
||||||
#region 定时任务:超时退出 出库、入库、盘点模式
|
#region 定时任务:超时退出 出库、入库、盘点模式
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
@ -169,97 +169,97 @@ namespace WCS.BLL.Manager
|
|||||||
});
|
});
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 定时任务:海康未扫物料码的物料更新数据
|
//#region 定时任务:海康未扫物料码的物料更新数据
|
||||||
Task.Run(() =>
|
//Task.Run(() =>
|
||||||
{
|
//{
|
||||||
while (true)
|
// while (true)
|
||||||
{
|
// {
|
||||||
//间隔20秒同步一次
|
// //间隔20秒同步一次
|
||||||
Thread.Sleep(20000);
|
// Thread.Sleep(20000);
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
var inventoryDetails = DbHelp.db.Queryable<InventoryDetail>()
|
// var inventoryDetails = DbHelp.db.Queryable<InventoryDetail>()
|
||||||
.Where(t => t.MatName == "暂时未知")
|
// .Where(t => t.MatName == "暂时未知")
|
||||||
.Where(t => t.InstoreTime > DateTime.Now.AddDays(-3))
|
// .Where(t => t.InstoreTime > DateTime.Now.AddDays(-3))
|
||||||
.ToList();
|
// .ToList();
|
||||||
if (inventoryDetails != null && inventoryDetails.Count > 0)
|
// if (inventoryDetails != null && inventoryDetails.Count > 0)
|
||||||
{
|
// {
|
||||||
for (int i = 0; i < inventoryDetails.Count; i++)
|
// for (int i = 0; i < inventoryDetails.Count; i++)
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
//请求WMS获取物料的信息
|
// //请求WMS获取物料的信息
|
||||||
var request = new QueryBybarRequest()
|
// var request = new QueryBybarRequest()
|
||||||
{
|
// {
|
||||||
materialBar = inventoryDetails[i].MatSN
|
// materialBar = inventoryDetails[i].MatSN
|
||||||
};
|
// };
|
||||||
var result = ApiHelp.GetDataFromHttp<QueryBybarResponse>(LocalFile.Config.QueryBybar, request, "POST", true);
|
// var result = ApiHelp.GetDataFromHttp<QueryBybarResponse>(LocalFile.Config.QueryBybar, request, "POST", true);
|
||||||
if (result != null && (result.code == 200) && result.data != null && result.data.Count() > 0)
|
// if (result != null && (result.code == 200) && result.data != null && result.data.Count() > 0)
|
||||||
{
|
// {
|
||||||
//查询成功 更改数值
|
// //查询成功 更改数值
|
||||||
var instoreDto = result.data.FirstOrDefault();
|
// var instoreDto = result.data.FirstOrDefault();
|
||||||
inventoryDetails[i].MatCode = instoreDto.materialCode;
|
// inventoryDetails[i].MatCode = instoreDto.materialCode;
|
||||||
inventoryDetails[i].MatName = instoreDto.materialName;
|
// inventoryDetails[i].MatName = instoreDto.materialName;
|
||||||
inventoryDetails[i].MatBatch = instoreDto.batchNo;
|
// inventoryDetails[i].MatBatch = instoreDto.batchNo;
|
||||||
inventoryDetails[i].MatSpec = instoreDto.materialSpec;
|
// inventoryDetails[i].MatSpec = instoreDto.materialSpec;
|
||||||
inventoryDetails[i].MatQty = (int)instoreDto.materialQty;
|
// inventoryDetails[i].MatQty = (int)instoreDto.materialQty;
|
||||||
DbHelp.db.Updateable(inventoryDetails[i]).ExecuteCommand();
|
// DbHelp.db.Updateable(inventoryDetails[i]).ExecuteCommand();
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
catch (Exception ex)
|
// catch (Exception ex)
|
||||||
{
|
// {
|
||||||
|
|
||||||
}
|
// }
|
||||||
Thread.Sleep(500);
|
// Thread.Sleep(500);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
catch (Exception ex)
|
// catch (Exception ex)
|
||||||
{
|
// {
|
||||||
Logs.Write("【定时任务】更新海康物料信息异常:" + ex.Message);
|
// Logs.Write("【定时任务】更新海康物料信息异常:" + ex.Message);
|
||||||
}
|
// }
|
||||||
|
|
||||||
Thread.Sleep(3000);
|
// Thread.Sleep(3000);
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
var inventoryDetails = DbHelp.db.Queryable<InventoryDetail>()
|
// var inventoryDetails = DbHelp.db.Queryable<InventoryDetail>()
|
||||||
.Where(t => t.WarehouseCode == null)
|
// .Where(t => t.WarehouseCode == null)
|
||||||
.Where(t => t.InstoreTime > DateTime.Now.AddDays(-30))
|
// .Where(t => t.InstoreTime > DateTime.Now.AddDays(-30))
|
||||||
.ToList();
|
// .ToList();
|
||||||
if (inventoryDetails != null && inventoryDetails.Count > 0)
|
// if (inventoryDetails != null && inventoryDetails.Count > 0)
|
||||||
{
|
// {
|
||||||
for (int i = 0; i < inventoryDetails.Count; i++)
|
// for (int i = 0; i < inventoryDetails.Count; i++)
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
var url = $"http://192.168.2.23:9213/integrate/hkwsInventoryDetail/selectMaterialBar?materialBar={inventoryDetails[i].MatSN}";
|
// var url = $"http://192.168.2.23:9213/integrate/hkwsInventoryDetail/selectMaterialBar?materialBar={inventoryDetails[i].MatSN}";
|
||||||
var result = ApiHelp.GetDataFromHttp<SelectMaterialBarResponse>(url, null, "POST", false);
|
// var result = ApiHelp.GetDataFromHttp<SelectMaterialBarResponse>(url, null, "POST", false);
|
||||||
if (result != null && result.code == 200 && result.data != null && !string.IsNullOrEmpty(result.data.warehouseCode))
|
// if (result != null && result.code == 200 && result.data != null && !string.IsNullOrEmpty(result.data.warehouseCode))
|
||||||
{
|
// {
|
||||||
//查询成功 更改数值
|
// //查询成功 更改数值
|
||||||
inventoryDetails[i].WarehouseCode = result.data.warehouseCode;
|
// inventoryDetails[i].WarehouseCode = result.data.warehouseCode;
|
||||||
DbHelp.db.Updateable(inventoryDetails[i]).ExecuteCommand();
|
// DbHelp.db.Updateable(inventoryDetails[i]).ExecuteCommand();
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
catch (Exception ex)
|
// catch (Exception ex)
|
||||||
{
|
// {
|
||||||
Logs.Write("【定时任务】更新仓库代码异常:" + ex.Message);
|
// Logs.Write("【定时任务】更新仓库代码异常:" + ex.Message);
|
||||||
}
|
// }
|
||||||
Thread.Sleep(500);
|
// Thread.Sleep(500);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
catch (Exception ex)
|
// catch (Exception ex)
|
||||||
{
|
// {
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
//});
|
||||||
#endregion
|
//#endregion
|
||||||
|
|
||||||
#region 定时任务:监测警示灯关灯机制
|
#region 定时任务:监测警示灯关灯机制
|
||||||
//判断灯颜色和模式是否对应
|
//判断灯颜色和模式是否对应
|
||||||
|
@ -198,11 +198,11 @@ namespace WCS.BLL.Services.Service
|
|||||||
#region 保存数据
|
#region 保存数据
|
||||||
|
|
||||||
//锁库存
|
//锁库存
|
||||||
inventoryDetails.ForEach(t =>
|
//inventoryDetails.ForEach(t =>
|
||||||
{
|
//{
|
||||||
t.IsLocked = true;
|
// t.IsLocked = true;
|
||||||
});
|
//});
|
||||||
var lockTask = DbHelp.db.Updateable(inventoryDetails).ExecuteCommandAsync();
|
//var lockTask = DbHelp.db.Updateable(inventoryDetails).ExecuteCommandAsync();
|
||||||
|
|
||||||
//保存数据
|
//保存数据
|
||||||
var order = new OutOrder()
|
var order = new OutOrder()
|
||||||
@ -239,7 +239,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
await DbHelp.db.Insertable(orderMatDetail).ExecuteCommandAsync();
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
await lockTask;
|
//await lockTask;
|
||||||
await Task.WhenAll(matDetailTasks);
|
await Task.WhenAll(matDetailTasks);
|
||||||
|
|
||||||
await DbHelp.db.CommitTranAsync();
|
await DbHelp.db.CommitTranAsync();
|
||||||
@ -476,8 +476,9 @@ namespace WCS.BLL.Services.Service
|
|||||||
//直接查询
|
//直接查询
|
||||||
var recordsQueryable = DbHelp.db.Queryable<OutOrder>()
|
var recordsQueryable = DbHelp.db.Queryable<OutOrder>()
|
||||||
.Where(t => request.OrderExeStatus.Contains(t.OutOrderExeStatus))
|
.Where(t => request.OrderExeStatus.Contains(t.OutOrderExeStatus))
|
||||||
|
.Where(t => t.CreateTime > DateTime.Now.AddDays(-2))
|
||||||
.WhereIF(request.IsMXPD != null, t => t.IsMXPD == request.IsMXPD)
|
.WhereIF(request.IsMXPD != null, t => t.IsMXPD == request.IsMXPD)
|
||||||
.WhereIF(LocalFile.Config.IsMx, t => t.CreateTime > DateTime.Now.AddDays(-3))
|
//.WhereIF(LocalFile.Config.IsMx, t => t.CreateTime > DateTime.Now.AddDays(-3))
|
||||||
.WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName);
|
.WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName);
|
||||||
|
|
||||||
var totalCount = await recordsQueryable.CountAsync();
|
var totalCount = await recordsQueryable.CountAsync();
|
||||||
@ -1071,7 +1072,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
});
|
});
|
||||||
outOrderDetail.ReqQty = 0;
|
outOrderDetail.ReqQty = 0;
|
||||||
|
|
||||||
matInventoryDetails[i].IsLocked = true;
|
//matInventoryDetails[i].IsLocked = true;
|
||||||
DbHelp.db.Updateable(matInventoryDetails[i]).ExecuteCommand();
|
DbHelp.db.Updateable(matInventoryDetails[i]).ExecuteCommand();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1098,7 +1099,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
CreateUser = createUser,
|
CreateUser = createUser,
|
||||||
});
|
});
|
||||||
|
|
||||||
matInventoryDetails[i].IsLocked = true;
|
//matInventoryDetails[i].IsLocked = true;
|
||||||
DbHelp.db.Updateable(matInventoryDetails[i]).ExecuteCommand();
|
DbHelp.db.Updateable(matInventoryDetails[i]).ExecuteCommand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,6 +239,42 @@ namespace WCS.WebApi.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重置货架的状态 使其回到待机模式
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Route("noResponseReset")]
|
||||||
|
[HttpPost(Name = "noResponseReset")]
|
||||||
|
public async Task<ResponseBase> noResponseReset(RequestBase request)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var shelfs = new List<IShelfBase>();
|
||||||
|
shelfs = ShelfManager.Shelves
|
||||||
|
.Where(t => t.CurrentMode == Mode.待机模式)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
foreach (var shelf in shelfs)
|
||||||
|
{
|
||||||
|
shelf.NoResponseReset();
|
||||||
|
}
|
||||||
|
return new ResponseBase()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = "success",
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new ResponseBase()
|
||||||
|
{
|
||||||
|
Code = 300,
|
||||||
|
Message = ex.Message,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -223,6 +223,53 @@ namespace WCS.WebApi.Controllers
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Route("updateClientIp")]
|
||||||
|
[HttpPost(Name = "updateClientIp")]
|
||||||
|
public async Task<ResponseBase> updateClientIp(RequestBase request)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (request.UserName != "aaa")
|
||||||
|
{
|
||||||
|
return new ResponseBase()
|
||||||
|
{
|
||||||
|
Code = 300,
|
||||||
|
Message = "用户名不对头!修改货架的IP。"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取货架 此组后端管的货架
|
||||||
|
var shelfInfos = DbHelp.db.Queryable<ShelfInfo>()
|
||||||
|
.Where(t => t.ClientIp.Contains(".225."))
|
||||||
|
.ToList();
|
||||||
|
shelfInfos.ForEach(t => t.ClientIp = t.ClientIp.Replace(".225.", ".210."));
|
||||||
|
|
||||||
|
|
||||||
|
var moduleInfos = DbHelp.db.Queryable<ModuleInfo>()
|
||||||
|
.Where(t => t.CleintIp.Contains(".225."))
|
||||||
|
.ToList();
|
||||||
|
moduleInfos.ForEach(t => t.CleintIp = t.CleintIp.Replace(".225.", ".210."));
|
||||||
|
|
||||||
|
DbHelp.db.Updateable(moduleInfos).UpdateColumns(t => new { t.CleintIp }).ExecuteCommand();
|
||||||
|
DbHelp.db.Updateable(shelfInfos).UpdateColumns(t => new { t.ClientIp }).ExecuteCommand();
|
||||||
|
|
||||||
|
return new ResponseBase()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = "更新库位成功"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new ResponseBase()
|
||||||
|
{
|
||||||
|
Code = 300,
|
||||||
|
Message = ex.Message
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,9 @@ namespace WebApi
|
|||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ط<EFBFBD><D8B7>߳<EFBFBD>
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ط<EFBFBD><D8B7>߳<EFBFBD>
|
||||||
WarningManager.StartWarningMessageThread();
|
WarningManager.StartWarningMessageThread();
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>Ӳ<EFBFBD><D3B2>״̬<D7B4>߳<EFBFBD> <20><>ʱ<EFBFBD>˳<EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD>عصƵȻ<C6B5><C8BB><EFBFBD>
|
||||||
|
MXBackgroundThread.InitBackgroundThread();
|
||||||
|
|
||||||
//<2F><>Ѷ<EFBFBD><D1B6>˾<EFBFBD><CBBE>̨<EFBFBD>߳<EFBFBD>
|
//<2F><>Ѷ<EFBFBD><D1B6>˾<EFBFBD><CBBE>̨<EFBFBD>߳<EFBFBD>
|
||||||
if (LocalFile.Config.IsMx)
|
if (LocalFile.Config.IsMx)
|
||||||
{
|
{
|
||||||
|
16
WCS.WebApi/data/jsconfig.json
Normal file
16
WCS.WebApi/data/jsconfig.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"ModuleCodePatterns": null,
|
||||||
|
"IsSameMatCodeOut": true,
|
||||||
|
"DataDbPath": "Server=192.168.2.2; Database=EdgeDB; uid = sa; pwd = 8ik,9ol.; Trusted_Connection = False;",
|
||||||
|
"LogDbPath": "Server=192.168.2.2; Database=EdgeDB; uid = sa; pwd = 8ik,9ol.; Trusted_Connection = False;",
|
||||||
|
"AuthDbPath": "Server=192.168.2.2; Database=EdgeDB; uid = sa; pwd = 8ik,9ol.; Trusted_Connection = False;",
|
||||||
|
"IsAccessWMS": true,
|
||||||
|
"WMSUrl": null,
|
||||||
|
"IsResetDBOrTable": false,
|
||||||
|
"InstoreTimeOut": 5000,
|
||||||
|
"IsMx": true,
|
||||||
|
"InputStockInStr": "http://192.168.2.23:9289/integrate/instock/inputStockIn",
|
||||||
|
"BunkerOutStr": "http://192.168.2.23:9289/integrate/inOut/bunkerOut",
|
||||||
|
"QueryBybar": "http://192.168.2.23:9213/integrate/instock/queryBybar",
|
||||||
|
"GroupName": "CC"
|
||||||
|
}
|
@ -61,6 +61,37 @@ namespace 智能仓储WCS管理系统.ViewModel
|
|||||||
Growl.Error("打开文件夹失败。");
|
Growl.Error("打开文件夹失败。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICommand NoResponseResetCommand { get => new DelegateCommand(NoResponseReset); }
|
||||||
|
/// <summary>
|
||||||
|
/// 打开用户
|
||||||
|
/// </summary>
|
||||||
|
public void NoResponseReset()
|
||||||
|
{
|
||||||
|
var result = HandyControl.Controls.MessageBox.Show("此功能用于“未成功退出入库、出库”等异常提示\r\n建议所有货架都处于待机模式时使用,继续复位请点击[确定]", "提示", MessageBoxButton.OKCancel);
|
||||||
|
if (result == MessageBoxResult.Cancel)
|
||||||
|
return;
|
||||||
|
#region 调用接口 请求重置所有货架的状态
|
||||||
|
var body = new RequestBase()
|
||||||
|
{
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseBase>(LocalFile.Config.ApiIpHost + "home/noResponseReset", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
Growl.Warning("已给状态不一致的板子发送复位指令,建议点击第一个按钮[货架状态初始化]重置所有货架状态!");
|
||||||
|
}
|
||||||
|
else if (Result != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("调用接口失败!");
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeviceReadModel : BindableBase
|
public class DeviceReadModel : BindableBase
|
||||||
|
@ -6,10 +6,12 @@ using System.Collections.ObjectModel;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using WCS.BLL.DbModels;
|
using WCS.BLL.DbModels;
|
||||||
using WCS.Model;
|
using WCS.Model;
|
||||||
|
using WCS.Model.ApiModel.Home;
|
||||||
using WCS.Model.ApiModel.MatBaseInfo;
|
using WCS.Model.ApiModel.MatBaseInfo;
|
||||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||||
using 智能仓储WCS管理系统.Api;
|
using 智能仓储WCS管理系统.Api;
|
||||||
@ -19,6 +21,46 @@ namespace 智能仓储WCS管理系统.ViewModels
|
|||||||
public class OutInventoryImportDucumentViewModel : BindableBase
|
public class OutInventoryImportDucumentViewModel : BindableBase
|
||||||
{
|
{
|
||||||
#region Property
|
#region Property
|
||||||
|
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;
|
||||||
|
SelectedShelfTypeItem = Result.Data.Lists.First();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private ShelfTypeModel selectedShelfTypeItem;
|
||||||
|
public ShelfTypeModel SelectedShelfTypeItem
|
||||||
|
{
|
||||||
|
get { return selectedShelfTypeItem; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref selectedShelfTypeItem, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private ObservableCollection<MatInventorySummaryModel> dataGridItemSource;
|
private ObservableCollection<MatInventorySummaryModel> dataGridItemSource;
|
||||||
public ObservableCollection<MatInventorySummaryModel> DataGridItemSource
|
public ObservableCollection<MatInventorySummaryModel> DataGridItemSource
|
||||||
{
|
{
|
||||||
@ -49,9 +91,10 @@ namespace 智能仓储WCS管理系统.ViewModels
|
|||||||
#region 选择文件保存路径
|
#region 选择文件保存路径
|
||||||
Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog();
|
Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog();
|
||||||
sfd.Filter = ".xlsx文件(*.xlsx)|*.xlsx";
|
sfd.Filter = ".xlsx文件(*.xlsx)|*.xlsx";
|
||||||
sfd.FileName = "出库导入模板";
|
sfd.FileName = "出库单据导入模板";
|
||||||
sfd.Title = "请选择文件保存地址";
|
sfd.Title = "请选择文件保存地址";
|
||||||
sfd.OverwritePrompt = true;
|
sfd.OverwritePrompt = true;
|
||||||
|
|
||||||
if (sfd.ShowDialog() != true)
|
if (sfd.ShowDialog() != true)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -65,6 +108,8 @@ namespace 智能仓储WCS管理系统.ViewModels
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
File.Copy(sourceFile, destinationFile, true); // true表示如果目标文件存在,则覆盖它
|
File.Copy(sourceFile, destinationFile, true); // true表示如果目标文件存在,则覆盖它
|
||||||
|
// 设置文件的最后写入时间为当前时间
|
||||||
|
File.SetLastWriteTime(destinationFile, DateTime.Now);
|
||||||
Growl.Success("文件下载成功!");
|
Growl.Success("文件下载成功!");
|
||||||
}
|
}
|
||||||
catch (IOException ioEx)
|
catch (IOException ioEx)
|
||||||
@ -174,6 +219,8 @@ namespace 智能仓储WCS管理系统.ViewModels
|
|||||||
{
|
{
|
||||||
var body = new SysOutOrderByMatCodeRequest()
|
var body = new SysOutOrderByMatCodeRequest()
|
||||||
{
|
{
|
||||||
|
ShelfTypeId = SelectedShelfTypeItem.Id,
|
||||||
|
ShelfTypeName = SelectedShelfTypeItem.ShelfTypeName,
|
||||||
OrderType = "出库",
|
OrderType = "出库",
|
||||||
OrderSource = "WCS前端",
|
OrderSource = "WCS前端",
|
||||||
ItemList = DataGridItemSource.Select(t => new MatCodeItemList()
|
ItemList = DataGridItemSource.Select(t => new MatCodeItemList()
|
||||||
|
@ -18,6 +18,11 @@
|
|||||||
<Button Margin="5,3" Padding="30,0" Name="resetShelf" Content="货架状态初始化" Command="{Binding ResetAllShelfCommand}"></Button>
|
<Button Margin="5,3" Padding="30,0" Name="resetShelf" Content="货架状态初始化" Command="{Binding ResetAllShelfCommand}"></Button>
|
||||||
|
|
||||||
<Button Margin="5,3" Padding="30,0" Content="打开打印模板路径" Command="{Binding BarcodePrintTemplateCommand}"></Button>
|
<Button Margin="5,3" Padding="30,0" Content="打开打印模板路径" Command="{Binding BarcodePrintTemplateCommand}"></Button>
|
||||||
|
|
||||||
|
<Button Margin="5,3"
|
||||||
|
Padding="30,0"
|
||||||
|
Content="未成功退出模式的模组复位"
|
||||||
|
Command="{Binding NoResponseResetCommand}"></Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<Border Background="AliceBlue" Padding="0">
|
<Border Background="AliceBlue" Padding="0">
|
||||||
<Grid >
|
<Grid >
|
||||||
<StackPanel Margin="3" Orientation="Horizontal">
|
<StackPanel Margin="3" Orientation="Horizontal">
|
||||||
<StackPanel Margin="3" Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
|
<StackPanel Margin="3" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
|
||||||
<TextBlock VerticalAlignment="Center"
|
<TextBlock VerticalAlignment="Center"
|
||||||
Text="货架类型:" FontSize="22" >
|
Text="货架类型:" FontSize="22" >
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
Height="500" Width="850" WindowStyle="None" Background="{x:Null}" BorderThickness="0" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
|
Height="500" Width="850" WindowStyle="None" Loaded="Window_Loaded" Background="{x:Null}" BorderThickness="0" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
|
||||||
<hc:Window.Resources>
|
<hc:Window.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
|
<Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
|
||||||
@ -34,6 +34,19 @@
|
|||||||
<Border Background="AliceBlue" Padding="0">
|
<Border Background="AliceBlue" Padding="0">
|
||||||
<Grid >
|
<Grid >
|
||||||
<StackPanel Margin="3" Orientation="Horizontal">
|
<StackPanel Margin="3" Orientation="Horizontal">
|
||||||
|
<StackPanel Margin="3" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
|
||||||
|
<TextBlock VerticalAlignment="Center"
|
||||||
|
Text="货架类型:" FontSize="22" >
|
||||||
|
</TextBlock>
|
||||||
|
<ComboBox
|
||||||
|
IsEnabled="{Binding ShelfTypeIsEnabled}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DisplayMemberPath="ShelfTypeName"
|
||||||
|
ItemsSource="{Binding ShelfTypeItems}"
|
||||||
|
SelectedItem="{Binding SelectedShelfTypeItem}"
|
||||||
|
FontSize="22"
|
||||||
|
IsEditable="False"/>
|
||||||
|
</StackPanel>
|
||||||
<Button MinHeight="40" FontSize="18" Margin="3"
|
<Button MinHeight="40" FontSize="18" Margin="3"
|
||||||
Content="导入" FontFamily="{StaticResource IconFont}"
|
Content="导入" FontFamily="{StaticResource IconFont}"
|
||||||
Foreground="WhiteSmoke"
|
Foreground="WhiteSmoke"
|
||||||
|
@ -59,5 +59,10 @@ namespace 智能仓储WCS管理系统
|
|||||||
this.DialogResult = false;
|
this.DialogResult = false;
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
viewModel.InitShelfTypeItems();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,9 @@
|
|||||||
<None Update="Excel\出库单据导入模板.xlsx">
|
<None Update="Excel\出库单据导入模板.xlsx">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="Excel\出库导入模板.xlsx">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Update="Excel\物料管理导入模板.xlsx">
|
<None Update="Excel\物料管理导入模板.xlsx">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
Reference in New Issue
Block a user