客户端任务查询页面
This commit is contained in:
@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WCS.DAL.DbModels;
|
||||
using WCS.Model.ApiModel.AGV;
|
||||
|
||||
namespace WCS.BLL.DbModels
|
||||
{
|
||||
@ -61,7 +62,7 @@ namespace WCS.BLL.DbModels
|
||||
/// 货架码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "shelf_Code", Length = 64, IsNullable = true, ColumnDescription = "AGV编号")]
|
||||
public string ShlefCode { get; set; } = string.Empty;
|
||||
public string ShelfCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// AGV编号
|
||||
@ -81,6 +82,18 @@ namespace WCS.BLL.DbModels
|
||||
[SugarColumn(ColumnName = "create_time", IsNullable = true, ColumnDescription = "任务创建时间")]
|
||||
public DateTime? CreateTime { get; set; } = DateTime.Now;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 最后更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "modify_time", IsNullable = true, ColumnDescription = "最后更新时间")]
|
||||
public DateTime? ModifyTime { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 任务状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "task_status", IsNullable = true, ColumnDescription = "任务状态")]
|
||||
public TaskStatusEnum TaskStatus { get; set; } = TaskStatusEnum.已创建;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@ -95,14 +108,4 @@ namespace WCS.BLL.DbModels
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public bool IsSelected { get; set; }
|
||||
}
|
||||
|
||||
//1-已创建,2-正在执行,5-取消完成,9-已结束, 10-被打断
|
||||
public enum TaskStatusEnum
|
||||
{
|
||||
已创建 = 1,
|
||||
正在执行 = 2,
|
||||
取消完成 = 5,
|
||||
已结束 = 9,
|
||||
被打断 = 10,
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,19 @@ namespace WCS.DAL.DbModels
|
||||
[SugarColumn(ColumnName = "rcs_store_code", Length = 64, IsNullable = true, ColumnDescription = "RCS库位编号")]
|
||||
public string RcsStoreCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// X坐标
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "X", IsNullable = true, DefaultValue = "0", ColumnDescription = "X坐标")]
|
||||
public decimal X { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Y坐标
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Y", IsNullable = true, DefaultValue = "0", ColumnDescription = "Y坐标")]
|
||||
public decimal Y { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 可放置货架类型
|
||||
/// </summary>
|
||||
|
@ -13,10 +13,11 @@ namespace WCS.BLL.Manager
|
||||
//AGV动作相关
|
||||
public static class AGVManager
|
||||
{
|
||||
public static object lockFlag = new object();
|
||||
/// <summary>
|
||||
/// 产生AGV点到点搬运任务
|
||||
/// </summary>
|
||||
public static AGVResponseModel GenAgvSchedulingTask(LocationInfo startLocation,LocationInfo endLocation,string shelfCode,string createUser)
|
||||
public static AGVResponseModel GenAgvSchedulingTask(LocationInfo startLocation, LocationInfo endLocation, string shelfCode, string createUser)
|
||||
{
|
||||
var url = @"http://192.168.18.150:8181/rcms/services/rest/hikRpcService/genAgvSchedulingTask";
|
||||
var startPositionCodePathItem = new PositionCodePathItem()
|
||||
@ -32,18 +33,21 @@ namespace WCS.BLL.Manager
|
||||
positionCodePathItems.Add(startPositionCodePathItem);
|
||||
positionCodePathItems.Add((endPositionCodePathItem));
|
||||
|
||||
//任务只允许一个一个发送
|
||||
lock (lockFlag)
|
||||
{
|
||||
var body = new AGVRequestModel()
|
||||
{
|
||||
positionCodePath = positionCodePathItems,
|
||||
};
|
||||
|
||||
var response = ApiHelp.GetDataFromHttp<AGVResponseModel>(url,body,"POST",true);
|
||||
var response = ApiHelp.GetDataFromHttp<AGVResponseModel>(url, body, "POST", true);
|
||||
if (response.code == "0" && response.message == "成功")
|
||||
{
|
||||
//生成任务数据
|
||||
var task = new AgvTask()
|
||||
{
|
||||
ShlefCode = shelfCode,
|
||||
ShelfCode = shelfCode,
|
||||
RequestCode = body.reqCode,
|
||||
TaskCode = body.taskCode,
|
||||
TaskType = "GenAgvSchedulingTask",
|
||||
@ -59,9 +63,6 @@ namespace WCS.BLL.Manager
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
public class AGVResult
|
||||
{
|
||||
public bool IsSuccess { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
111
WCS.Model/ApiModel/AGV/AGVTaskModel.cs
Normal file
111
WCS.Model/ApiModel/AGV/AGVTaskModel.cs
Normal file
@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
|
||||
namespace WCS.Model.ApiModel.AGV
|
||||
{
|
||||
public class AGVTaskModel : INotifyPropertyChanged
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 主键 自增Id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
#region 任务属性
|
||||
/// <summary>
|
||||
/// 请求码
|
||||
/// </summary>
|
||||
public string RequestCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务码
|
||||
/// </summary>
|
||||
public string TaskCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务类型
|
||||
/// </summary>
|
||||
public string TaskType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 起点位置ID
|
||||
/// </summary>
|
||||
public int StratLocationId { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 起点位置编码
|
||||
/// </summary>
|
||||
public string StartLocationCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 终点位置ID
|
||||
/// </summary>
|
||||
public int EndLocationId { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 终点位置编码
|
||||
/// </summary>
|
||||
public string EndLocationCode { get; set; } = string.Empty;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货架码
|
||||
/// </summary>
|
||||
public string ShelfCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// AGV编号
|
||||
/// </summary>
|
||||
public string AgvCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 任务发起人
|
||||
/// </summary>
|
||||
public string? CreateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; } = DateTime.Now;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 最后更新时间
|
||||
/// </summary>
|
||||
public DateTime? ModifyTime { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 任务状态
|
||||
/// </summary>
|
||||
public TaskStatusEnum TaskStatus { get; set; } = TaskStatusEnum.已创建;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int RowNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否选择
|
||||
/// </summary>
|
||||
public bool IsSelected
|
||||
{
|
||||
get { return isSelected; }
|
||||
set
|
||||
{
|
||||
isSelected = value;
|
||||
OnPropertyChanged(nameof(IsSelected));
|
||||
}
|
||||
}
|
||||
public bool isSelected;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
protected virtual void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
29
WCS.Model/ApiModel/AGV/GetAGVTasksRequest.cs
Normal file
29
WCS.Model/ApiModel/AGV/GetAGVTasksRequest.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WCS.Model.ApiModel.AGV
|
||||
{
|
||||
public class GetAGVTasksRequest : PageQueryRequestBase
|
||||
{
|
||||
public string ShelfCode { get; set; } = string.Empty;
|
||||
|
||||
public string CreateUser { get; set; } = string.Empty;
|
||||
|
||||
public string StartLocationCode { get; set; } = string.Empty;
|
||||
|
||||
public string EndLocationCode { get; set; } = string.Empty;
|
||||
|
||||
public TaskStatusEnum? TaskStatus { get; set; } = null;
|
||||
}
|
||||
|
||||
//1-已创建,2-正在执行,5-取消完成,9-已结束, 10-被打断
|
||||
public enum TaskStatusEnum
|
||||
{
|
||||
已创建 = 1,
|
||||
正在执行 = 2,
|
||||
取消完成 = 5,
|
||||
已结束 = 9,
|
||||
被打断 = 10,
|
||||
}
|
||||
}
|
@ -56,7 +56,7 @@ namespace WCS.WebApi.Controllers
|
||||
}
|
||||
|
||||
//判断并更新数据
|
||||
var shelf = await DbHelp.db.Queryable<ShelfInfo>().Where(t => t.ShelfCode == request.podCode || t.ShelfCode == task.ShlefCode)
|
||||
var shelf = await DbHelp.db.Queryable<ShelfInfo>().Where(t => t.ShelfCode == request.podCode || t.ShelfCode == task.ShelfCode)
|
||||
.FirstAsync();
|
||||
if (shelf != null && request.method == "outbin")
|
||||
{
|
||||
@ -67,6 +67,9 @@ namespace WCS.WebApi.Controllers
|
||||
|
||||
if (shelf != null && request.method == "end")
|
||||
{
|
||||
task.TaskStatus = TaskStatusEnum.已结束;
|
||||
DbHelp.db.Updateable(task).ExecuteCommand();
|
||||
|
||||
shelf.CurrentLocationId = shelf.DestinationLocationId;
|
||||
shelf.CurrentLocaiotnCode = shelf.DestinationLocaiotnCode;
|
||||
shelf.DestinationLocationId = 0;
|
||||
|
85
WCS.WebApi/Controllers/AgvTaskController.cs
Normal file
85
WCS.WebApi/Controllers/AgvTaskController.cs
Normal file
@ -0,0 +1,85 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using SqlSugar;
|
||||
using WCS.BLL;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.BLL.HardWare;
|
||||
using WCS.BLL.Manager;
|
||||
using WCS.BLL.Services.IService;
|
||||
using WCS.BLL.Services.Service;
|
||||
using WCS.DAL.Db;
|
||||
using WCS.DAL.DbModels;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.AGV;
|
||||
using WCS.Model.ApiModel.Home;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
using Mode = WCS.BLL.HardWare.Mode;
|
||||
|
||||
namespace WCS.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 主页面的接口
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class AgvTaskController : ControllerBase
|
||||
{
|
||||
|
||||
public AgvTaskController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// agv任务回调
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Route("getAGVTasks")]
|
||||
[HttpPost(Name = "getAGVTasks")]
|
||||
public async Task<PageQueryResponse<AgvTask>> getAGVTasks(GetAGVTasksRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var recordsQueryable = DbHelp.db.Queryable<AgvTask>()
|
||||
.WhereIF(string.IsNullOrEmpty(request.ShelfCode), t => t.ShelfCode.Contains(request.ShelfCode))
|
||||
.WhereIF(string.IsNullOrEmpty(request.CreateUser), t => t.CreateUser.Contains(request.CreateUser))
|
||||
.WhereIF(string.IsNullOrEmpty(request.StartLocationCode), t => t.StartLocationCode.Contains(request.StartLocationCode))
|
||||
.WhereIF(string.IsNullOrEmpty(request.EndLocationCode), t => t.StartLocationCode.Contains(request.EndLocationCode))
|
||||
.WhereIF(request.TaskStatus !=null, t => t.TaskStatus == request.TaskStatus);
|
||||
|
||||
var totalCount = await recordsQueryable.CountAsync();
|
||||
var records = await recordsQueryable
|
||||
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
|
||||
.ToListAsync();
|
||||
//生成序号
|
||||
for (int i = 0; i < records.Count; i++)
|
||||
{
|
||||
records[i].RowNumber = (request.PageNumber - 1) * request.PageSize + i + 1;
|
||||
}
|
||||
return new PageQueryResponse<AgvTask>()
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"success",
|
||||
Data = new PageQueryResponseData<AgvTask>()
|
||||
{
|
||||
TotalCount = totalCount,
|
||||
MaxPage = request.PageSize == 0 ? 0 : (int)Math.Ceiling((decimal)totalCount / request.PageSize),
|
||||
Count = records.Count,
|
||||
Lists = records.ToList()
|
||||
}
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new PageQueryResponse<AgvTask>()
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"操作失败:{ex.Message}",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -12,6 +12,8 @@ using WCS.Model.ApiModel;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using System.Collections.ObjectModel;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using System.Security.AccessControl;
|
||||
using WCS.Model.ApiModel.AGV;
|
||||
|
||||
namespace 智慧物流软件系统.ViewModel
|
||||
{
|
||||
@ -21,19 +23,19 @@ namespace 智慧物流软件系统.ViewModel
|
||||
public AGVTaskViewModel()
|
||||
{
|
||||
//初始化下拉列表框
|
||||
StocktakingStatuses.Add("全部");
|
||||
var statuses = Enum.GetValues(typeof(StocktakingStatusEnum))
|
||||
.Cast<StocktakingStatusEnum>()
|
||||
TaskStatus.Add("全部");
|
||||
var statuses = Enum.GetValues(typeof(TaskStatusEnum))
|
||||
.Cast<TaskStatusEnum>()
|
||||
.ToList();
|
||||
foreach (var status in statuses)
|
||||
{
|
||||
StocktakingStatuses.Add(status.ToString());
|
||||
TaskStatus.Add(status.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
#region Property
|
||||
private ObservableCollection<MatDetailStocktakingInfoModel> dataGridItemSource;
|
||||
public ObservableCollection<MatDetailStocktakingInfoModel> DataGridItemSource
|
||||
private ObservableCollection<AGVTaskModel> dataGridItemSource;
|
||||
public ObservableCollection<AGVTaskModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
@ -42,8 +44,8 @@ namespace 智慧物流软件系统.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public MatDetailStocktakingInfoModel selectedataGridItem;
|
||||
public MatDetailStocktakingInfoModel SelectedataGridItem
|
||||
public AGVTaskModel selectedataGridItem;
|
||||
public AGVTaskModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
@ -53,49 +55,62 @@ namespace 智慧物流软件系统.ViewModel
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// 货架编码
|
||||
/// </summary>
|
||||
private string matCode;
|
||||
public string MatCode
|
||||
private string shelfCode;
|
||||
public string ShelfCode
|
||||
{
|
||||
get { return matCode; }
|
||||
get { return shelfCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matCode, value);
|
||||
SetProperty(ref shelfCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// 任务创建人
|
||||
/// </summary>
|
||||
private string matName;
|
||||
public string MatName
|
||||
private string createUser;
|
||||
public string CreateUser
|
||||
{
|
||||
get { return matName; }
|
||||
get { return createUser; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matName, value);
|
||||
SetProperty(ref createUser, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 盘点人
|
||||
/// 起点
|
||||
/// </summary>
|
||||
private string stocktakingUser;
|
||||
public string StocktakingUser
|
||||
private string startLocationCode;
|
||||
public string StartLocationCode
|
||||
{
|
||||
get { return stocktakingUser; }
|
||||
get { return startLocationCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref stocktakingUser, value);
|
||||
SetProperty(ref startLocationCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 盘点状态列表
|
||||
/// 终点
|
||||
/// </summary>
|
||||
private string endLocationCode;
|
||||
public string EndLocationCode
|
||||
{
|
||||
get { return endLocationCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref endLocationCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 结束位置
|
||||
/// </summary>
|
||||
private List<string> stocktakingStatuses = new List<string>();
|
||||
public List<string> StocktakingStatuses
|
||||
public List<string> TaskStatus
|
||||
{
|
||||
get { return stocktakingStatuses; }
|
||||
set
|
||||
@ -104,26 +119,28 @@ namespace 智慧物流软件系统.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private string selectedStocktakingStatus;
|
||||
public string SelectedStocktakingStatus
|
||||
private string selectedTaskStatus;
|
||||
public string SelectedTaskStatus
|
||||
{
|
||||
get { return selectedStocktakingStatus; }
|
||||
get { return selectedTaskStatus; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedStocktakingStatus, value);
|
||||
SetProperty(ref selectedTaskStatus, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||
public void BtnReset()
|
||||
{
|
||||
MatCode = string.Empty;
|
||||
MatName = string.Empty;
|
||||
StocktakingUser = string.Empty;
|
||||
SelectedStocktakingStatus = StocktakingStatuses.Where(t => t.Contains("未提交")).First();
|
||||
ShelfCode = string.Empty;
|
||||
CreateUser = string.Empty;
|
||||
|
||||
StartLocationCode = string.Empty;
|
||||
EndLocationCode = string.Empty;
|
||||
|
||||
SelectedTaskStatus = TaskStatus.Where(t => t.Contains("正在执行")).First();
|
||||
}
|
||||
|
||||
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearchReset); }
|
||||
@ -138,17 +155,20 @@ namespace 智慧物流软件系统.ViewModel
|
||||
CurrentPage = 1;
|
||||
return;
|
||||
}
|
||||
var isSelected = Enum.TryParse<StocktakingStatusEnum>(SelectedStocktakingStatus, out StocktakingStatusEnum status);
|
||||
|
||||
var isSelected = Enum.TryParse<TaskStatusEnum>(SelectedTaskStatus, out TaskStatusEnum status);
|
||||
#region 调用接口获取数据
|
||||
var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
var body = new GetStocktakingInfosRequest()
|
||||
var body = new GetAGVTasksRequest()
|
||||
{
|
||||
MatCode = MatCode,
|
||||
MatName = MatName,
|
||||
StocktakingUser = StocktakingUser,
|
||||
StocktakingStatus = isSelected ? status : null,
|
||||
ShelfCode = ShelfCode,
|
||||
StartLocationCode = StartLocationCode,
|
||||
EndLocationCode = EndLocationCode,
|
||||
CreateUser = CreateUser,
|
||||
|
||||
TaskStatus = isSelected ? status : null,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
@ -156,10 +176,10 @@ namespace 智慧物流软件系统.ViewModel
|
||||
PageSize = PageSize,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatDetailStocktakingInfoModel>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/getStocktakingInfos", body, "POST");
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<AGVTaskModel>>(LocalFile.Config.ApiIpHost + "AgvTask/getAGVTasks", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<MatDetailStocktakingInfoModel>(Result.Data.Lists);
|
||||
DataGridItemSource = new ObservableCollection<AGVTaskModel>(Result.Data.Lists);
|
||||
MaxPage = Result.Data.MaxPage;
|
||||
TotalCount = Result.Data.TotalCount;
|
||||
}
|
||||
@ -224,39 +244,39 @@ namespace 智慧物流软件系统.ViewModel
|
||||
public ICommand BtnEditCommand { get => new DelegateCommand(BtnEdit); }
|
||||
public async void BtnEdit()
|
||||
{
|
||||
//查询勾选的第一个数据
|
||||
var matDetailStocktakingInfo = DataGridItemSource?.Where(t => t.IsSelected == true).FirstOrDefault();
|
||||
if (matDetailStocktakingInfo == null)
|
||||
{
|
||||
Growl.Warning("请选择需要修改的数据!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
var updateView = new MatDetailStocktakingInfoUpdateView("修改盘点数据", matDetailStocktakingInfo);
|
||||
updateView.ShowDialog();
|
||||
if (updateView.DialogResult == true)
|
||||
{
|
||||
matDetailStocktakingInfo = updateView.matDetailStocktakingInfo;
|
||||
var body = new UpdateStocktakingInfoRequest()
|
||||
{
|
||||
MatDetailStocktakingInfoId = matDetailStocktakingInfo.Id,
|
||||
StocktakingQty = matDetailStocktakingInfo.StocktakingQty,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase<object>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/updateStocktakingInfos", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
Growl.Success("修改成功!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Error($"{Result?.Message?.ToString()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
////查询勾选的第一个数据
|
||||
//var matDetailStocktakingInfo = DataGridItemSource?.Where(t => t.IsSelected == true).FirstOrDefault();
|
||||
//if (matDetailStocktakingInfo == null)
|
||||
//{
|
||||
// Growl.Warning("请选择需要修改的数据!");
|
||||
// return;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// var updateView = new MatDetailStocktakingInfoUpdateView("修改盘点数据", matDetailStocktakingInfo);
|
||||
// updateView.ShowDialog();
|
||||
// if (updateView.DialogResult == true)
|
||||
// {
|
||||
// matDetailStocktakingInfo = updateView.matDetailStocktakingInfo;
|
||||
// var body = new UpdateStocktakingInfoRequest()
|
||||
// {
|
||||
// MatDetailStocktakingInfoId = matDetailStocktakingInfo.Id,
|
||||
// StocktakingQty = matDetailStocktakingInfo.StocktakingQty,
|
||||
// UserName = LocalStatic.CurrentUser,
|
||||
// DeviceType = LocalFile.Config.DeviceType,
|
||||
// };
|
||||
// var Result = ApiHelp.GetDataFromHttp<ResponseBase<object>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/updateStocktakingInfos", body, "POST");
|
||||
// if (Result != null && Result.Code == 200)
|
||||
// {
|
||||
// CurrentPage = 1;
|
||||
// Growl.Success("修改成功!");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Growl.Error($"{Result?.Message?.ToString()}");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -15,8 +15,8 @@
|
||||
Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
<RowDefinition Height="2*"></RowDefinition>
|
||||
<RowDefinition Height="12*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0"
|
||||
Margin="5 5 5 0"
|
||||
@ -25,42 +25,64 @@
|
||||
Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2.2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.8*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.8*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Text="盘点状态:"
|
||||
FontSize="18"></TextBlock>
|
||||
<ComboBox Grid.Column="3"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
ItemsSource="{Binding StocktakingStatuses}"
|
||||
SelectedValue="{Binding SelectedStocktakingStatus}">
|
||||
</ComboBox>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Text="物料编码:"
|
||||
Text="货架编码:"
|
||||
FontSize="18"></TextBlock>
|
||||
<TextBox Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
Text="{Binding MatCode}"></TextBox>
|
||||
Text="{Binding ShelfCode}"></TextBox>
|
||||
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Text="创建人:"
|
||||
FontSize="18"></TextBlock>
|
||||
<TextBox Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
Text="{Binding CreateUser}"
|
||||
></TextBox>
|
||||
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Text="任务状态:"
|
||||
FontSize="18"></TextBlock>
|
||||
<ComboBox Grid.Column="3"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
ItemsSource="{Binding TaskStatus}"
|
||||
SelectedValue="{Binding SelectedTaskStatus}">
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Grid.Column="4"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
@ -71,7 +93,8 @@
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
Text="{Binding StartPoint}"></TextBox>
|
||||
Text="{Binding StartLocationCode}"></TextBox>
|
||||
|
||||
<TextBlock Grid.Column="6"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
@ -83,7 +106,7 @@
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
Text="{Binding EndPoint}"></TextBox>
|
||||
Text="{Binding EndLocationCode}"></TextBox>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}"
|
||||
hc:BorderElement.CornerRadius="15"
|
||||
@ -119,23 +142,16 @@
|
||||
<Button MinHeight="40"
|
||||
FontSize="18"
|
||||
Margin="5"
|
||||
Content="提 交"
|
||||
Content="重新下发"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Foreground="WhiteSmoke"
|
||||
Background="HotPink"
|
||||
Background="Green"
|
||||
Command="{Binding BtnCommitCommand}"></Button>
|
||||
|
||||
<Button MinHeight="40"
|
||||
FontSize="18"
|
||||
Margin="5"
|
||||
Content="修 改"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Foreground="WhiteSmoke"
|
||||
Background="CadetBlue"
|
||||
Command="{Binding BtnEditCommand}"></Button>
|
||||
<Button MinHeight="40"
|
||||
FontSize="18"
|
||||
Margin="5"
|
||||
Content="删 除"
|
||||
Content="取 消"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Foreground="WhiteSmoke"
|
||||
Command="{Binding BtnDeleteCommand}"
|
||||
@ -173,31 +189,27 @@
|
||||
<DataGridTextColumn IsReadOnly="True"
|
||||
Header="序号"
|
||||
Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料编码"
|
||||
Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料名称"
|
||||
MaxWidth="150"
|
||||
Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料规格"
|
||||
MaxWidth="150"
|
||||
Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="货架编号"
|
||||
<DataGridTextColumn Header="任务单号"
|
||||
Binding="{Binding TaskCode}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="任务状态"
|
||||
Binding="{Binding TaskStatus}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True"
|
||||
Header="最后更新时间"
|
||||
Binding="{Binding ModifyTime ,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="货架编码"
|
||||
Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="货架区域"
|
||||
Binding="{Binding ShelfArea}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="原数量"
|
||||
Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="盘点数量"
|
||||
Binding="{Binding StocktakingQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="起点"
|
||||
Binding="{Binding StartLocationCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="终点"
|
||||
Binding="{Binding EndLocationCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True"
|
||||
Header="盘点人"
|
||||
Binding="{Binding StocktakingUser}"></DataGridTextColumn>
|
||||
Header="创建人"
|
||||
Binding="{Binding CreateUser}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True"
|
||||
Header="盘点时间"
|
||||
Binding="{Binding StocktakingTime ,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True"
|
||||
Header="盘点状态"
|
||||
Binding="{Binding StocktakingStatus}"></DataGridTextColumn>
|
||||
Header="创建时间"
|
||||
Binding="{Binding CreateTime ,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Grid Grid.Row="2">
|
||||
@ -316,94 +328,6 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Border Grid.Row="1" Margin="3" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="8*"></RowDefinition>
|
||||
<RowDefinition Height="0.7*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnExportCommand}"
|
||||
Content=" 导 出" FontFamily="{StaticResource IconFont}"
|
||||
Style="{StaticResource ButtonWarning}" Background="DarkOrange">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False"
|
||||
FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="接口地址" Binding="{Binding RequestUrl}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="设备IP" Binding="{Binding DeviceIp}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="请求参数" Binding="{Binding RequestBody}" MaxWidth="100"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="QueryString" Binding="{Binding QueryString}" MaxWidth="100"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="请求时间" Binding="{Binding RequestTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="返回参数" Binding="{Binding ResponseJson}" MaxWidth="100"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="返回时间" Binding="{Binding ResponseTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="耗时(ms)" Binding="{Binding ExecutionTime}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top" Width="Auto" MinHeight="26">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="0" Name="btnFirst" Content="首页" Foreground="Black" FontSize="14"
|
||||
Command="{Binding BtnFirstPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="1" Name="btnPrev" Content="上一页" FontSize="14"
|
||||
Command="{Binding BtnPrePageCommand}"/>
|
||||
<TextBox BorderBrush="Transparent" Grid.Column="2" FontSize="14" MinWidth="50" HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="IBeam" IsEnabled="False"
|
||||
Text ="{Binding CurrentPage}" TextAlignment="Center"
|
||||
|
||||
/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Name="btnNext" Content="下一页" FontSize="14"
|
||||
Command="{Binding BtnNextPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="4" Name="btnLast" Content="末页" FontSize="14"
|
||||
Command="{Binding BtnLastPageCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>-->
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
||||
|
@ -18,7 +18,7 @@ namespace 智慧物流软件系统
|
||||
{
|
||||
public partial class AGVTaskView : UserControlBase
|
||||
{
|
||||
public MatDetailStocktakingInfoViewModel viewModel { get; set; } = new MatDetailStocktakingInfoViewModel();
|
||||
public AGVTaskViewModel viewModel { get; set; } = new AGVTaskViewModel();
|
||||
public AGVTaskView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
Reference in New Issue
Block a user