fix:永丰售后修复BUG,
1,物料库存获取不到ERP:重新调整触发查询逻辑 2,工序变更导致物料无法出库:配置旧工序 3,测试出库订单ERP推送,任务下发
This commit is contained in:
1 parent
b2a9a38f38
commit
c76e7bb681
69 files changed
+5510
-157
No files matched your search
@@ -0,0 +1,79 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web.Models.Agv;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
/// <summary>
|
||||
/// AGV 任务日志列表(只读:状态变更 + 报文留痕,来源 AgvTaskLog 表)
|
||||
/// </summary>
|
||||
public partial class AgvTaskLogListVM : BasePagedListVM<AgvTaskLog_View, AgvTaskLogSearcher>
|
||||
{
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("AgvTaskLog", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "agv", dialogWidth: 900),
|
||||
};
|
||||
}
|
||||
|
||||
protected override IEnumerable<IGridColumn<AgvTaskLog_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<AgvTaskLog_View>>
|
||||
{
|
||||
this.MakeGridHeader(x => x.TaskNo).SetWidth(170),
|
||||
this.MakeGridHeader(x => x.OrderId).SetWidth(170),
|
||||
this.MakeGridHeader(x => x.FromStatus).SetWidth(90),
|
||||
this.MakeGridHeader(x => x.ToStatus).SetWidth(90),
|
||||
this.MakeGridHeader(x => x.Event).SetWidth(110),
|
||||
this.MakeGridHeader(x => x.Direction).SetWidth(80),
|
||||
this.MakeGridHeader(x => x.EventTime).SetWidth(150),
|
||||
this.MakeGridHeader(x => x.DurationMs).SetWidth(90),
|
||||
this.MakeGridHeader(x => x.Operator).SetWidth(90),
|
||||
this.MakeGridHeader(x => x.RequestJson).SetWidth(180),
|
||||
this.MakeGridHeader(x => x.ResponseJson).SetWidth(180),
|
||||
this.MakeGridHeader(x => x.Remark),
|
||||
this.MakeGridHeader(x => x.CreateTime).SetWidth(150),
|
||||
this.MakeGridHeaderAction(width: 100)
|
||||
};
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<AgvTaskLog_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<AgvTaskLog>()
|
||||
.CheckContain(Searcher.TaskNo, x => x.TaskNo)
|
||||
.CheckEqual(Searcher.Direction, x => x.Direction)
|
||||
.CheckContain(Searcher.Event, x => x.Event)
|
||||
.CheckContain(Searcher.RequestJson, x => x.RequestJson)
|
||||
.CheckContain(Searcher.ResponseJson, x => x.ResponseJson)
|
||||
.Select(x => new AgvTaskLog_View
|
||||
{
|
||||
ID = x.ID,
|
||||
TaskNo = x.TaskNo,
|
||||
OrderId = x.OrderId,
|
||||
FromStatus = x.FromStatus,
|
||||
ToStatus = x.ToStatus,
|
||||
Event = x.Event,
|
||||
Direction = x.Direction,
|
||||
EventTime = x.EventTime,
|
||||
DurationMs = x.DurationMs,
|
||||
Operator = x.Operator,
|
||||
RequestJson = x.RequestJson,
|
||||
ResponseJson = x.ResponseJson,
|
||||
Remark = x.Remark,
|
||||
CreateTime = x.CreateTime
|
||||
})
|
||||
.OrderByDescending(x => x.CreateTime);
|
||||
return query;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 任务日志列表行视图
|
||||
/// </summary>
|
||||
public class AgvTaskLog_View : AgvTaskLog
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
/// <summary>
|
||||
/// AGV 任务日志搜索条件(只读日志页)
|
||||
/// </summary>
|
||||
public partial class AgvTaskLogSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "AGV.TaskNo")]
|
||||
public string TaskNo { get; set; }
|
||||
|
||||
[Display(Name = "AGV.Direction")]
|
||||
public string Direction { get; set; }
|
||||
|
||||
[Display(Name = "AGV.Event")]
|
||||
public string Event { get; set; }
|
||||
|
||||
/// <summary>请求体(模糊查询)</summary>
|
||||
[Display(Name = "AGV.RequestJson")]
|
||||
public string RequestJson { get; set; }
|
||||
|
||||
/// <summary>响应体(模糊查询)</summary>
|
||||
[Display(Name = "AGV.ResponseJson")]
|
||||
public string ResponseJson { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using HHWMS.Web.Models.Agv;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
/// <summary>
|
||||
/// AGV 任务日志详情(查看请求/响应报文)
|
||||
/// </summary>
|
||||
public partial class AgvTaskLogVM : BaseCRUDVM<AgvTaskLog>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web.Models.Agv;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
/// <summary>
|
||||
/// AGV 任务场景配置列表(方案 5.6:映射上游任务类型 → AGV 场景)
|
||||
/// </summary>
|
||||
public partial class AgvTaskSceneConfigListVM : BasePagedListVM<AgvTaskSceneConfig_View, AgvTaskSceneConfigSearcher>
|
||||
{
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("AgvTaskSceneConfig", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"], "agv", dialogWidth: 800),
|
||||
this.MakeStandardAction("AgvTaskSceneConfig", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "agv", dialogWidth: 800),
|
||||
this.MakeStandardAction("AgvTaskSceneConfig", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "agv", dialogWidth: 800),
|
||||
this.MakeStandardAction("AgvTaskSceneConfig", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "agv", dialogWidth: 800),
|
||||
};
|
||||
}
|
||||
|
||||
protected override IEnumerable<IGridColumn<AgvTaskSceneConfig_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<AgvTaskSceneConfig_View>>
|
||||
{
|
||||
this.MakeGridHeader(x => x.SourceTaskType).SetWidth(150),
|
||||
this.MakeGridHeader(x => x.AgvTaskType).SetWidth(130),
|
||||
this.MakeGridHeader(x => x.SceneId).SetWidth(150),
|
||||
this.MakeGridHeader(x => x.SceneName).SetWidth(180),
|
||||
this.MakeGridHeader(x => x.BinTaskLoad).SetWidth(100),
|
||||
this.MakeGridHeader(x => x.BinTaskUnload).SetWidth(100),
|
||||
this.MakeGridHeader(x => x.Remark),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<AgvTaskSceneConfig_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<AgvTaskSceneConfig>()
|
||||
.CheckContain(Searcher.SourceTaskType, x => x.SourceTaskType)
|
||||
.CheckEqual(Searcher.AgvTaskType, x => x.AgvTaskType)
|
||||
.CheckContain(Searcher.SceneId, x => x.SceneId)
|
||||
.Select(x => new AgvTaskSceneConfig_View
|
||||
{
|
||||
ID = x.ID,
|
||||
SourceTaskType = x.SourceTaskType,
|
||||
AgvTaskType = x.AgvTaskType,
|
||||
SceneId = x.SceneId,
|
||||
SceneName = x.SceneName,
|
||||
BinTaskLoad = x.BinTaskLoad,
|
||||
BinTaskUnload = x.BinTaskUnload,
|
||||
Remark = x.Remark
|
||||
})
|
||||
.OrderByDescending(x => x.ID);
|
||||
return query;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 场景配置列表行视图
|
||||
/// </summary>
|
||||
public class AgvTaskSceneConfig_View : AgvTaskSceneConfig
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using HHWMS.Web.Models;
|
||||
using HHWMS.Web.Models.Agv;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
/// <summary>
|
||||
/// AGV 任务场景配置搜索条件
|
||||
/// </summary>
|
||||
public partial class AgvTaskSceneConfigSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "AGV.SourceTaskType")]
|
||||
public string SourceTaskType { get; set; }
|
||||
|
||||
[Display(Name = "AGV.AgvTaskType")]
|
||||
public AgvTaskTypeEnum? AgvTaskType { get; set; }
|
||||
|
||||
[Display(Name = "AGV.SceneId")]
|
||||
public string SceneId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using HHWMS.Web.Models.Agv;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
/// <summary>
|
||||
/// AGV 任务场景配置表单
|
||||
/// </summary>
|
||||
public partial class AgvTaskSceneConfigVM : BaseCRUDVM<AgvTaskSceneConfig>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web.Models;
|
||||
using HHWMS.Web.Models.Agv;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
/// <summary>
|
||||
/// AGV 平库任务列表(WTM 标准 ListVM,供 wt:searchpanel + wt:grid 渲染,风格与场景配置/日志页统一)
|
||||
/// 操作列按任务状态渲染 下发/取消/重试完成 行内按钮,点击调用 Index 页全局 JS(axios 调后端接口后刷新 grid)
|
||||
/// </summary>
|
||||
public partial class AgvTaskListVM : BasePagedListVM<AgvTask_View, AgvTaskSearcher>
|
||||
{
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
// 工具栏「下发任务」按钮:Dialog 打开 Create 表单页(功能与原页面弹窗一致,仅行内显示关闭)
|
||||
this.MakeStandardAction("AgvTask", GridActionStandardTypesEnum.Create, "下发任务", "agv", dialogWidth: 800).SetShowInRow(false)
|
||||
};
|
||||
}
|
||||
|
||||
protected override IEnumerable<IGridColumn<AgvTask_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<AgvTask_View>>
|
||||
{
|
||||
this.MakeGridHeader(x => x.TaskNo).SetWidth(170),
|
||||
// 任务场景列:关联 AgvTaskSceneConfig 取场景名称,便于人工识别业务类型
|
||||
this.MakeGridHeader(x => x.SceneName).SetWidth(110),
|
||||
this.MakeGridHeader(x => x.AgvStatusName).SetWidth(100),
|
||||
this.MakeGridHeader(x => x.FromLocation).SetWidth(110),
|
||||
this.MakeGridHeader(x => x.ToLocation).SetWidth(110),
|
||||
this.MakeGridHeader(x => x.ContainerCode).SetWidth(160),
|
||||
this.MakeGridHeader(x => x.SourceSystem).SetWidth(100),
|
||||
this.MakeGridHeader(x => x.ErrorMsg).SetWidth(200),
|
||||
this.MakeGridHeader(x => x.CreateTime).SetWidth(160),
|
||||
// 操作列:按状态渲染文字链接(新建/异常→下发;新建/已下发/执行中→取消;完成联动失败→重试完成)
|
||||
// 还原为最初始的纯 <a> 文字链接(仅 href + onclick 两个属性),链接间隔 5px 由页面 CSS 控制
|
||||
this.MakeGridHeader(x => x.Operation).SetWidth(120).SetFormat((a, b) =>
|
||||
{
|
||||
var st = (int)(a.AgvStatus ?? 0);
|
||||
var btns = new List<string>();
|
||||
if (st == 0 || st == 90)
|
||||
{
|
||||
btns.Add($"<a href=\"javascript:void(0)\" onclick=\"agvDispatch('{a.TaskNo}')\">下发</a>");
|
||||
}
|
||||
if (st == 0 || st == 5 || st == 10)
|
||||
{
|
||||
btns.Add($"<a href=\"javascript:void(0)\" onclick=\"agvCancel('{a.TaskNo}')\">取消</a>");
|
||||
}
|
||||
if (st == 99)
|
||||
{
|
||||
btns.Add($"<a href=\"javascript:void(0)\" onclick=\"agvRetryFinish('{a.TaskNo}')\">重试完成</a>");
|
||||
}
|
||||
if (btns.Count == 0)
|
||||
{
|
||||
return "-";
|
||||
}
|
||||
return string.Join("", btns);
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<AgvTask_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<AgvTask>()
|
||||
.CheckContain(Searcher.TaskNo, x => x.TaskNo)
|
||||
.CheckContain(Searcher.FromLocation, x => x.FromLocation)
|
||||
.CheckContain(Searcher.ToLocation, x => x.ToLocation)
|
||||
.CheckContain(Searcher.ContainerCode, x => x.ContainerCode)
|
||||
.CheckEqual(Searcher.SourceSystem, x => x.SourceSystem)
|
||||
.CheckEqual(Searcher.AgvStatus, x => x.AgvStatus)
|
||||
.Select(x => new AgvTask_View
|
||||
{
|
||||
ID = x.ID,
|
||||
TaskNo = x.TaskNo,
|
||||
AgvStatus = x.AgvStatus,
|
||||
// 状态中文名(枚举成员名即中文:新建/已下发/执行中/异常/取消/完成联动失败/完成)
|
||||
AgvStatusName = x.AgvStatus == null ? "" : x.AgvStatus.ToString(),
|
||||
// 任务场景名:按 AgvTaskType 关联场景配置表(AgvTask 仅存枚举,未配置则留空)
|
||||
SceneName = x.AgvTaskType == null ? "" :
|
||||
DC.Set<AgvTaskSceneConfig>()
|
||||
.Where(c => c.AgvTaskType == x.AgvTaskType)
|
||||
.Select(c => c.SceneName)
|
||||
.FirstOrDefault() ?? "",
|
||||
FromLocation = x.FromLocation,
|
||||
ToLocation = x.ToLocation,
|
||||
ContainerCode = x.ContainerCode,
|
||||
SourceSystem = x.SourceSystem,
|
||||
ErrorMsg = x.ErrorMsg,
|
||||
CreateTime = x.CreateTime
|
||||
})
|
||||
.OrderByDescending(x => x.CreateTime);
|
||||
return query;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AGV 任务列表行视图(SceneName 任务场景名 + AgvStatusName 中文状态 + Operation 虚拟操作列)
|
||||
/// </summary>
|
||||
public class AgvTask_View : AgvTask
|
||||
{
|
||||
/// <summary>任务场景名(由 AgvTaskSceneConfig 按 AgvTaskType 映射)</summary>
|
||||
[Display(Name = "任务场景")]
|
||||
public string SceneName { get; set; }
|
||||
|
||||
/// <summary>状态中文名(新建/已下发/执行中/异常/取消/完成联动失败/完成)</summary>
|
||||
[Display(Name = "AGV.AgvStatus")]
|
||||
public string AgvStatusName { get; set; }
|
||||
|
||||
/// <summary>操作列(SetFormat 服务端渲染行内按钮)</summary>
|
||||
[Display(Name = "操作")]
|
||||
public string Operation { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
/// <summary>
|
||||
/// AGV 平库任务搜索条件(任务列表页:任务号/起终点/容器模糊,来源/状态精确)
|
||||
/// </summary>
|
||||
public partial class AgvTaskSearcher : BaseSearcher
|
||||
{
|
||||
/// <summary>来源系统下拉选项(WMS / THIRD_PARTY)</summary>
|
||||
public List<ComboSelectListItem> AllSourceSystems { get; set; }
|
||||
|
||||
[Display(Name = "AGV.TaskNo")]
|
||||
public string TaskNo { get; set; }
|
||||
|
||||
[Display(Name = "AGV.FromLocation")]
|
||||
public string FromLocation { get; set; }
|
||||
|
||||
[Display(Name = "AGV.ToLocation")]
|
||||
public string ToLocation { get; set; }
|
||||
|
||||
[Display(Name = "AGV.ContainerCode")]
|
||||
public string ContainerCode { get; set; }
|
||||
|
||||
[Display(Name = "AGV.SourceSystem")]
|
||||
public string SourceSystem { get; set; }
|
||||
|
||||
[Display(Name = "AGV.AgvStatus")]
|
||||
public AgvTaskStatusEnum? AgvStatus { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
// 来源系统固定枚举下拉
|
||||
AllSourceSystems = new List<ComboSelectListItem>
|
||||
{
|
||||
new ComboSelectListItem { Value = "WMS", Text = "WMS" },
|
||||
new ComboSelectListItem { Value = "THIRD_PARTY", Text = "THIRD_PARTY" }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user