1.库位禁用和启用、模组禁用启用
2.退出出库先解锁 后发指令
This commit is contained in:
@ -32,19 +32,33 @@ namespace WCS.BLL.Services.IService
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询货架列表
|
/// 查询模组列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Task<PageQueryResponse<ModuleInfo>> GetModules(GetModulesRequest request);
|
public Task<PageQueryResponse<ModuleInfo>> GetModules(GetModulesRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 禁用或启用模组
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<ResponseCommon> disableOrEnableModule(DisableOrEnableModuleRequest request);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询货架列表
|
/// 查询库位列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Task<PageQueryResponse<StoreInfo>> GetStores(GetStoresRequest request);
|
public Task<PageQueryResponse<StoreInfo>> GetStores(GetStoresRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 禁用或启用库位
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<ResponseCommon> disableOrEnableStore(DisableOrEnableStoreRequest request);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,8 @@ namespace WCS.BLL.Services.Service
|
|||||||
var recordsQueryable = DbHelp.db.Queryable<OutOrder>()
|
var recordsQueryable = DbHelp.db.Queryable<OutOrder>()
|
||||||
.WhereIF(!string.IsNullOrEmpty(request.OrderNumber), t => t.OrderNumber.Contains(request.OrderNumber))
|
.WhereIF(!string.IsNullOrEmpty(request.OrderNumber), t => t.OrderNumber.Contains(request.OrderNumber))
|
||||||
.WhereIF(!string.IsNullOrEmpty(request.OrderSource), t => t.OrderSource.Contains(request.OrderSource))
|
.WhereIF(!string.IsNullOrEmpty(request.OrderSource), t => t.OrderSource.Contains(request.OrderSource))
|
||||||
.WhereIF(!string.IsNullOrEmpty(request.OrderType), t => t.OrderType.Contains(request.OrderType));
|
.WhereIF(!string.IsNullOrEmpty(request.OrderType), t => t.OrderType.Contains(request.OrderType))
|
||||||
|
.WhereIF(request.ShelfTypeId != 0, t => t.ShelfTypeId == request.ShelfTypeId);
|
||||||
|
|
||||||
var totalCount = await recordsQueryable.CountAsync();
|
var totalCount = await recordsQueryable.CountAsync();
|
||||||
var records = await recordsQueryable
|
var records = await recordsQueryable
|
||||||
@ -859,6 +860,10 @@ namespace WCS.BLL.Services.Service
|
|||||||
DbHelp.db.Updateable(order).ExecuteCommand();
|
DbHelp.db.Updateable(order).ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//解锁物料 删除物料明细
|
||||||
|
if (order.SyncType == SyncTypeEnum.ByMatCode)
|
||||||
|
CancelOutOrderMatDetails(order);
|
||||||
|
|
||||||
//找到正在出对应出库单的货架
|
//找到正在出对应出库单的货架
|
||||||
var shelves = ShelfManager.Shelves.Where(t => t.OrderNumber == request.OrderNumber)
|
var shelves = ShelfManager.Shelves.Where(t => t.OrderNumber == request.OrderNumber)
|
||||||
.Where(t => t.CurrentMode == HardWare.Mode.出库模式)
|
.Where(t => t.CurrentMode == HardWare.Mode.出库模式)
|
||||||
@ -874,15 +879,15 @@ namespace WCS.BLL.Services.Service
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//退出出库模式
|
//退出出库模式
|
||||||
shelves.ForEach(t =>
|
shelves.ForEach(t =>
|
||||||
{
|
{
|
||||||
t.GoOutOutstore();
|
t.GoOutOutstore();
|
||||||
});
|
});
|
||||||
|
|
||||||
//解锁物料 删除物料明细
|
|
||||||
if (order.SyncType == SyncTypeEnum.ByMatCode)
|
|
||||||
CancelOutOrderMatDetails(order);
|
|
||||||
|
|
||||||
return new ResponseCommon()
|
return new ResponseCommon()
|
||||||
{
|
{
|
||||||
|
@ -12,6 +12,7 @@ using WCS.DAL.Db;
|
|||||||
using WCS.DAL.DbModels;
|
using WCS.DAL.DbModels;
|
||||||
using WCS.Model;
|
using WCS.Model;
|
||||||
using WCS.Model.ApiModel;
|
using WCS.Model.ApiModel;
|
||||||
|
using WCS.Model.ApiModel.InOutRecord;
|
||||||
using WCS.Model.ApiModel.StoreInfo;
|
using WCS.Model.ApiModel.StoreInfo;
|
||||||
using WCS.Model.ApiModel.User;
|
using WCS.Model.ApiModel.User;
|
||||||
|
|
||||||
@ -308,6 +309,58 @@ namespace WCS.BLL.Services.Service
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 禁用或启用模组
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<ResponseCommon> disableOrEnableModule(DisableOrEnableModuleRequest request)
|
||||||
|
{
|
||||||
|
//找到库位
|
||||||
|
var moduleInfo = await DbHelp.db.Queryable<ModuleInfo>()
|
||||||
|
.Where(t => t.Id == request.ModuleId)
|
||||||
|
.FirstAsync();
|
||||||
|
//库位不存在
|
||||||
|
if (moduleInfo == null)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"操作失败:模组{request.ModuleCode}不存在!"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DbHelp.db.BeginTran();
|
||||||
|
//禁用需要删除当前库存数据
|
||||||
|
if (request.DisableOrEnable == DisableOrEnableEnum.Disable)
|
||||||
|
{
|
||||||
|
moduleInfo.IsEnable = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
moduleInfo.IsEnable = true;
|
||||||
|
}
|
||||||
|
DbHelp.db.Updateable(moduleInfo).ExecuteCommand();
|
||||||
|
DbHelp.db.CommitTran();
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = $"Success"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DbHelp.db.RollbackTran();
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 300,
|
||||||
|
Message = $"操作失败:异常{ex.Message}!"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 库位管理
|
#region 库位管理
|
||||||
@ -352,6 +405,85 @@ namespace WCS.BLL.Services.Service
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<ResponseCommon> disableOrEnableStore(DisableOrEnableStoreRequest request)
|
||||||
|
{
|
||||||
|
//找到库位
|
||||||
|
var storeInfo = await DbHelp.db.Queryable<StoreInfo>()
|
||||||
|
.Where(t => t.Id == request.StoreId)
|
||||||
|
.FirstAsync();
|
||||||
|
//库位不存在
|
||||||
|
if (storeInfo == null)
|
||||||
|
{
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 201,
|
||||||
|
Message = $"操作失败:库位{request.SroreCode}不存在!"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DbHelp.db.BeginTran();
|
||||||
|
//禁用需要删除当前库存数据
|
||||||
|
if (request.DisableOrEnable == DisableOrEnableEnum.Disable)
|
||||||
|
{
|
||||||
|
//库位
|
||||||
|
storeInfo.CurrentMatSn = "禁用";
|
||||||
|
//库存数据处理
|
||||||
|
var inventorys = DbHelp.db.Queryable<InventoryDetail>()
|
||||||
|
.Where(t => t.StoreId == storeInfo.Id)
|
||||||
|
.ToList();
|
||||||
|
if (inventorys != null && inventorys.Count > 0)
|
||||||
|
{
|
||||||
|
//删除并进行出入库记录
|
||||||
|
foreach (var inventory in inventorys)
|
||||||
|
{
|
||||||
|
var inOutRecord = new InOutRecord()
|
||||||
|
{
|
||||||
|
StoreCode = storeInfo.StoreCode,
|
||||||
|
StoreId = storeInfo.Id,
|
||||||
|
StoreInfo = storeInfo,
|
||||||
|
|
||||||
|
MatSN = inventory.MatSN,
|
||||||
|
MatCode = inventory.MatCode,
|
||||||
|
MatName = inventory.MatName,
|
||||||
|
MatSpec = inventory.MatSpec,
|
||||||
|
MatBatch = inventory.MatBatch,
|
||||||
|
MatQty = inventory.MatQty,
|
||||||
|
MatCustomer = inventory.MatCustomer,
|
||||||
|
MatSupplier = inventory.MatSupplier,
|
||||||
|
|
||||||
|
OperateUser = request.UserName + "(禁用库位)",
|
||||||
|
Direction = DirectionEnum.丢失,
|
||||||
|
};
|
||||||
|
DbHelp.db.Insertable(inOutRecord).ExecuteCommand();
|
||||||
|
DbHelp.db.Deleteable(inventory).ExecuteCommand();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
storeInfo.CurrentMatSn = string.Empty;
|
||||||
|
}
|
||||||
|
DbHelp.db.Updateable(storeInfo).ExecuteCommand();
|
||||||
|
DbHelp.db.CommitTran();
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = $"Success"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DbHelp.db.RollbackTran();
|
||||||
|
return new ResponseCommon()
|
||||||
|
{
|
||||||
|
Code = 300,
|
||||||
|
Message = $"操作失败:异常{ex.Message}!"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,5 +13,7 @@ namespace WCS.Model
|
|||||||
public string OrderSource { get; set; }
|
public string OrderSource { get; set; }
|
||||||
|
|
||||||
public string OrderType { get; set; }
|
public string OrderType { get; set; }
|
||||||
|
|
||||||
|
public int ShelfTypeId { get; set; } = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
15
WCS.Model/ApiModel/StoreInfo/DisableOrEnableModuleRequest.cs
Normal file
15
WCS.Model/ApiModel/StoreInfo/DisableOrEnableModuleRequest.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.StoreInfo
|
||||||
|
{
|
||||||
|
public class DisableOrEnableModuleRequest : RequestBase
|
||||||
|
{
|
||||||
|
public int ModuleId { get; set; }
|
||||||
|
|
||||||
|
public string ModuleCode { get; set; }
|
||||||
|
|
||||||
|
public DisableOrEnableEnum DisableOrEnable { get; set; }
|
||||||
|
}
|
||||||
|
}
|
22
WCS.Model/ApiModel/StoreInfo/DisableOrEnableStoreRequest.cs
Normal file
22
WCS.Model/ApiModel/StoreInfo/DisableOrEnableStoreRequest.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WCS.Model.ApiModel.StoreInfo
|
||||||
|
{
|
||||||
|
public class DisableOrEnableStoreRequest : RequestBase
|
||||||
|
{
|
||||||
|
public int StoreId { get; set; }
|
||||||
|
|
||||||
|
public string SroreCode { get; set; }
|
||||||
|
|
||||||
|
public DisableOrEnableEnum DisableOrEnable { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum DisableOrEnableEnum
|
||||||
|
{
|
||||||
|
Disable = 0,
|
||||||
|
Enable = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -47,7 +47,7 @@ namespace WCS.WebApi.Controllers
|
|||||||
string directoryPath = Path.Combine(Directory.GetCurrentDirectory(), $"Files");
|
string directoryPath = Path.Combine(Directory.GetCurrentDirectory(), $"Files");
|
||||||
|
|
||||||
// 获取目录下的所有文件信息
|
// 获取目录下的所有文件信息
|
||||||
FileInfo[] files = Directory.GetFiles(directoryPath, "*.app")
|
FileInfo[] files = Directory.GetFiles(directoryPath, "*.APK")
|
||||||
.Select(file => new FileInfo(file))
|
.Select(file => new FileInfo(file))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
|
@ -52,6 +52,13 @@ namespace WCS.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
return await _storeInfoService.GetModules(request);
|
return await _storeInfoService.GetModules(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Route("disableOrEnableModule")]
|
||||||
|
[HttpPost(Name = "disableOrEnableModule")]
|
||||||
|
public async Task<ResponseBase> disableOrEnableModule(DisableOrEnableModuleRequest request)
|
||||||
|
{
|
||||||
|
return await _storeInfoService.disableOrEnableModule(request);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 库位管理
|
#region 库位管理
|
||||||
@ -61,6 +68,13 @@ namespace WCS.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
return await _storeInfoService.GetStores(request);
|
return await _storeInfoService.GetStores(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Route("disableOrEnableStore")]
|
||||||
|
[HttpPost(Name = "disableOrEnableStore")]
|
||||||
|
public async Task<ResponseBase> disableOrEnableStore(DisableOrEnableStoreRequest request)
|
||||||
|
{
|
||||||
|
return await _storeInfoService.disableOrEnableStore(request);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ using WCS.Model.ApiModel.MatBaseInfo;
|
|||||||
using WCS.Model.ApiModel.User;
|
using WCS.Model.ApiModel.User;
|
||||||
using WCS.Model.ApiModel;
|
using WCS.Model.ApiModel;
|
||||||
using Newtonsoft.Json.Bson;
|
using Newtonsoft.Json.Bson;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace 货架标准上位机.ViewModel
|
namespace 货架标准上位机.ViewModel
|
||||||
{
|
{
|
||||||
@ -75,7 +76,7 @@ namespace 货架标准上位机.ViewModel
|
|||||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||||
public void BtnReset()
|
public void BtnReset()
|
||||||
{
|
{
|
||||||
ModuleCode = string.Empty;
|
ModuleCode = string.Empty;
|
||||||
ShelfCode = string.Empty;
|
ShelfCode = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,6 +154,97 @@ namespace 货架标准上位机.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICommand DisableCommand { get => new DelegateCommand<ModuleInfoModel>(Disable); }
|
||||||
|
public void Disable(ModuleInfoModel module)
|
||||||
|
{
|
||||||
|
if (module.IsEnable != true)
|
||||||
|
{
|
||||||
|
Growl.Warning("库位未被启用!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var result = HandyControl.Controls.MessageBox.Show("模组禁用会影响正常流程,请确认是否屏蔽?"
|
||||||
|
, "提示", MessageBoxButton.YesNo);
|
||||||
|
if (result == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
#region 调用接口 禁用
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var body = new DisableOrEnableModuleRequest()
|
||||||
|
{
|
||||||
|
ModuleId = module.Id,
|
||||||
|
ModuleCode = module.ModuleCode,
|
||||||
|
DisableOrEnable = DisableOrEnableEnum.Disable,
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/disableOrEnableModule", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
Growl.Success("禁用成功");
|
||||||
|
BtnSearch();
|
||||||
|
}
|
||||||
|
else if (Result != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("操作失败:请重试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Growl.Error("操作失败:" + ex.Message);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand EnableCommand { get => new DelegateCommand<ModuleInfoModel>(Enable); }
|
||||||
|
public void Enable(ModuleInfoModel module)
|
||||||
|
{
|
||||||
|
if (module.IsEnable == true)
|
||||||
|
{
|
||||||
|
Growl.Warning("库位未被禁用!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#region 调用接口 临时禁用库位 删除库存数据
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var body = new DisableOrEnableModuleRequest()
|
||||||
|
{
|
||||||
|
ModuleId = module.Id,
|
||||||
|
ModuleCode = module.ModuleCode,
|
||||||
|
DisableOrEnable = DisableOrEnableEnum.Enable,
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/disableOrEnableModule", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
Growl.Success("操作成功!");
|
||||||
|
BtnSearch();
|
||||||
|
}
|
||||||
|
else if (Result != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("操作失败:请重试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Growl.Error("操作失败:" + ex.Message);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PageOperation 分页操作
|
#region PageOperation 分页操作
|
||||||
|
@ -19,6 +19,8 @@ using WCS.Model.ApiModel.MatBaseInfo;
|
|||||||
using WCS.Model.ApiModel.User;
|
using WCS.Model.ApiModel.User;
|
||||||
using WCS.Model.ApiModel;
|
using WCS.Model.ApiModel;
|
||||||
using Newtonsoft.Json.Bson;
|
using Newtonsoft.Json.Bson;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
namespace 货架标准上位机.ViewModel
|
namespace 货架标准上位机.ViewModel
|
||||||
{
|
{
|
||||||
@ -140,6 +142,94 @@ namespace 货架标准上位机.ViewModel
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICommand DisableCommand { get => new DelegateCommand<StoreInfoModel>(Disable); }
|
||||||
|
public void Disable(StoreInfoModel store)
|
||||||
|
{
|
||||||
|
var result = HandyControl.Controls.MessageBox.Show("库位屏蔽仅用于临时屏蔽硬件损坏识别的未扫描上架!\r\n" +
|
||||||
|
"操作时会删除对应库位的数据,需要保证对应库位物料已取出。\r\n" +
|
||||||
|
"请确认是否进行操作?"
|
||||||
|
, "提示", MessageBoxButton.YesNo);
|
||||||
|
if (result == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
#region 调用接口 临时禁用库位 删除库存数据
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var body = new DisableOrEnableStoreRequest()
|
||||||
|
{
|
||||||
|
StoreId = store.Id,
|
||||||
|
SroreCode = store.StoreCode,
|
||||||
|
DisableOrEnable = DisableOrEnableEnum.Disable,
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/disableOrEnableStore", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
Growl.Success("禁用成功");
|
||||||
|
BtnSearch();
|
||||||
|
}
|
||||||
|
else if (Result != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("操作失败:请重试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Growl.Error("操作失败:" + ex.Message);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand EnableCommand { get => new DelegateCommand<StoreInfoModel>(Enable); }
|
||||||
|
public void Enable(StoreInfoModel store)
|
||||||
|
{
|
||||||
|
if (store.CurrentMatSn != "禁用")
|
||||||
|
{
|
||||||
|
Growl.Warning("库位未被禁用!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#region 调用接口 临时禁用库位 删除库存数据
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var body = new DisableOrEnableStoreRequest()
|
||||||
|
{
|
||||||
|
StoreId = store.Id,
|
||||||
|
SroreCode = store.StoreCode,
|
||||||
|
DisableOrEnable = DisableOrEnableEnum.Enable,
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "storeInfo/disableOrEnableStore", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
Growl.Success("操作成功!");
|
||||||
|
BtnSearch();
|
||||||
|
}
|
||||||
|
else if (Result != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("操作失败:请重试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Growl.Error("操作失败:" + ex.Message);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PageOperation 分页操作
|
#region PageOperation 分页操作
|
||||||
|
@ -1,20 +1,6 @@
|
|||||||
using 货架标准上位机.ViewModel;
|
using 货架标准上位机.ViewModel;
|
||||||
using Ping9719.WpfEx;
|
using Ping9719.WpfEx;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace 货架标准上位机
|
namespace 货架标准上位机
|
||||||
{
|
{
|
||||||
|
@ -241,16 +241,16 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
<TabControl Margin="5" Style="{StaticResource TabControlBaseStyle.MouseOver}">
|
<TabControl Margin="5" Style="{StaticResource TabControlBaseStyle.MouseOver}">
|
||||||
<TabItem Header="用户管理" >
|
|
||||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
|
||||||
<View:UserView Margin="0,5"/>
|
|
||||||
</hc:TransitioningContentControl>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="角色管理">
|
<TabItem Header="角色管理">
|
||||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
<View:RoleView Margin="0,5"/>
|
<View:RoleView Margin="0,5"/>
|
||||||
</hc:TransitioningContentControl>
|
</hc:TransitioningContentControl>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem Header="用户管理" >
|
||||||
|
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||||
|
<View:UserView Margin="0,5"/>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
|
@ -84,14 +84,23 @@
|
|||||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="货架编码" Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="货架编码" Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="模组编码" Binding="{Binding ModuleCode}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="模组编码" Binding="{Binding ModuleCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="板ID" Binding="{Binding BoardId}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="PCB板ID" Binding="{Binding BoardId}"></DataGridTextColumn>
|
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="单板灯数量" Binding="{Binding LightCount}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="单板灯数量" Binding="{Binding LightCount}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="TCP连接信息" Binding="{Binding CleintIp}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="TCP连接信息" Binding="{Binding CleintIp}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="R" Binding="{Binding R}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="R" Binding="{Binding R}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="C" Binding="{Binding C}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="C" Binding="{Binding C}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="是否启用" Binding="{Binding IsEnable,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="是否启用" Binding="{Binding IsEnable,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="绑定后货架编码" Binding="{Binding BindShelfCode}"></DataGridTextColumn>
|
<DataGridTextColumn IsReadOnly="True" Header="绑定后货架编码" Binding="{Binding BindShelfCode}"></DataGridTextColumn>
|
||||||
|
<DataGridTemplateColumn CanUserResize="False" Width="auto">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsAdmin,Converter={StaticResource Boolean2BooleanReConverter}}">
|
||||||
|
<Button Style="{StaticResource ButtonWarning}" Margin="0,0,5,0" IsEnabled="True" Content="禁用" Width="60" Command="{Binding DataContext.DisableCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }" />
|
||||||
|
<Button Style="{StaticResource ButtonDanger}" Margin="0,0,0,0" IsEnabled="True" Content="启用" Width="60" Command="{Binding DataContext.EnableCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
<Border Margin="0" Background="AliceBlue" CornerRadius="3" Padding="0">
|
<Border Margin="0" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1.3*"></RowDefinition>
|
<RowDefinition Height="1.4*"></RowDefinition>
|
||||||
<RowDefinition Height="10*"></RowDefinition>
|
<RowDefinition Height="10*"></RowDefinition>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Border Grid.Row="0" Margin="0" Background="AliceBlue" CornerRadius="5" Padding="0">
|
<Border Grid.Row="0" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||||
@ -58,12 +58,12 @@
|
|||||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||||
FontSize="18" MinWidth="90" Text="{Binding CurrentMatSN}"></TextBox>
|
FontSize="18" MinWidth="90" Text="{Binding CurrentMatSN}"></TextBox>
|
||||||
|
|
||||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="12"
|
||||||
Grid.Column="8" MinHeight="40" FontSize="18" Content=" 搜索" FontFamily="{StaticResource IconFont}"
|
Grid.Column="8" MinHeight="40" FontSize="18" Content=" 搜索" FontFamily="{StaticResource IconFont}"
|
||||||
Command="{Binding BtnSearchCommand}">
|
Command="{Binding BtnSearchCommand}">
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
|
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="12"
|
||||||
Grid.Column="9" MinHeight="40" FontSize="18" Content=" 重置" FontFamily="{StaticResource IconFont}"
|
Grid.Column="9" MinHeight="40" FontSize="18" Content=" 重置" FontFamily="{StaticResource IconFont}"
|
||||||
Command="{Binding BtnResetCommand}">
|
Command="{Binding BtnResetCommand}">
|
||||||
</Button>
|
</Button>
|
||||||
@ -102,8 +102,8 @@
|
|||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsAdmin,Converter={StaticResource Boolean2BooleanReConverter}}">
|
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsAdmin,Converter={StaticResource Boolean2BooleanReConverter}}">
|
||||||
<Button Style="{StaticResource ButtonWarning}" Margin="0,0,5,0" IsEnabled="True" Content="禁用" Width="60" Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }" />
|
<Button Style="{StaticResource ButtonWarning}" Margin="0,0,5,0" IsEnabled="True" Content="禁用" Width="60" Command="{Binding DataContext.DisableCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }" />
|
||||||
<Button Style="{StaticResource ButtonDanger}" Margin="0,0,0,0" IsEnabled="True" Content="启用" Width="60" Command="{Binding DataContext.DelCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }"/>
|
<Button Style="{StaticResource ButtonDanger}" Margin="0,0,0,0" IsEnabled="True" Content="启用" Width="60" Command="{Binding DataContext.EnableCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//连接不上加:SslMode=none;
|
//连接不上加:SslMode=none;
|
||||||
"MySql": "server=localhost;Database=db1;Uid=root;Pwd=123456;Convert Zero Datetime=True",
|
"MySql": "server=localhost;Database=db1;Uid=root;Pwd=123456;Convert Zero Datetime=True",
|
||||||
//货架服务器的IP和端口号
|
//货架服务器的IP和端口号
|
||||||
"ApiIpHost": "http://localhost:8888/",
|
"ApiIpHost": "http://127.0.0.1:8888/",
|
||||||
//WebSocket的地址
|
//WebSocket的地址
|
||||||
"WebSocketUrl": "ws://127.0.0.1:7789/ws",
|
"WebSocketUrl": "ws://127.0.0.1:7789/ws",
|
||||||
//货架分区
|
//货架分区
|
||||||
|
Reference in New Issue
Block a user