xiazhengtongxue
8 天以前 cbfc5ac3c45eff75e912ba6aeaad83533a1a4296
fix: 修复机器人任务信息等bug
已添加3个文件
已修改8个文件
526 ■■■■ 文件已修改
Code/WCS/WIDESEAWCS_Client/src/extension/taskinfo/robotTask.js 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/router/viewGird.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/views/Index.vue 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/views/quartzJob/deviceInfo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/views/quartzJob/deviceProtocolDetail.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/views/quartzJob/dispatchInfo.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/views/system/Sys_Log.vue 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/robotTask.vue 262 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/RobotTaskController.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_AGV.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/extension/taskinfo/robotTask.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
// è¯¥æ‰©å±•文件用于任务历史页面的业务扩展。
// æ–¹æ³•目的:统一预留列表查询、保存前后和弹窗打开时的扩展入口,保持与项目内 task é¡µé¢ä¸€è‡´çš„æ‰©å±•点。
// å‚数含义:由框架按生命周期传入,包含查询参数、表单数据、行数据等上下文。
// è¿”回值说明:返回 true ä»£è¡¨ç»§ç»­é»˜è®¤è¡Œä¸ºï¼Œè¿”回 false ä»£è¡¨ä¸­æ–­é»˜è®¤è¡Œä¸ºã€‚
// å¼‚常处理说明:当前未引入外部调用;若后续新增接口调用,需在方法内补充 try-catch å¹¶è®°å½•关键业务参数。
let extension = {
  components: {
    gridHeader: "",
    gridBody: "",
    gridFooter: "",
    modelHeader: "",
    modelBody: "",
    modelFooter: "",
  },
  tableAction: "",
  buttons: { view: [], box: [], detail: [] },
  methods: {
    // æ–¹æ³•目的:页面初始化时执行自定义逻辑。
    // å‚数:无。
    // è¿”回值:无。
    onInit() {},
    // æ–¹æ³•目的:页面初始化完成后执行自定义逻辑。
    // å‚数:无。
    // è¿”回值:无。
    onInited() {},
    // æ–¹æ³•目的:查询前处理查询条件。
    // å‚数:param æŸ¥è¯¢å‚数对象。
    // è¿”回值:true ç»§ç»­æŸ¥è¯¢ï¼Œfalse ç»ˆæ­¢æŸ¥è¯¢ã€‚
    searchBefore(param) {
      return true;
    },
    // æ–¹æ³•目的:查询后处理返回结果。
    // å‚数:result åŽç«¯è¿”回数据。
    // è¿”回值:true ç»§ç»­æ¸²æŸ“,false ç»ˆæ­¢åŽç»­å¤„理。
    searchAfter(result) {
      return true;
    },
    // æ–¹æ³•目的:新增前校验或补充提交字段。
    // å‚数:formData è¡¨å•提交对象。
    // è¿”回值:true ç»§ç»­æäº¤ï¼Œfalse ç»ˆæ­¢æäº¤ã€‚
    addBefore(formData) {
      return true;
    },
    // æ–¹æ³•目的:编辑前校验或补充提交字段。
    // å‚数:formData è¡¨å•提交对象。
    // è¿”回值:true ç»§ç»­æäº¤ï¼Œfalse ç»ˆæ­¢æäº¤ã€‚
    updateBefore(formData) {
      return true;
    },
    // æ–¹æ³•目的:点击行时扩展处理。
    // å‚数:row è¡Œæ•°æ®ï¼Œcolumn åˆ—配置,event åŽŸå§‹äº‹ä»¶ã€‚
    // è¿”回值:无。
    rowClick({ row, column, event }) {},
    // æ–¹æ³•目的:编辑弹窗打开后执行扩展逻辑。
    // å‚数:row å½“前行数据。
    // è¿”回值:无。
    modelOpenAfter(row) {},
  },
};
export default extension;
Code/WCS/WIDESEAWCS_Client/src/router/viewGird.js
@@ -63,6 +63,10 @@
    path: '/scheduler',
    name: 'scheduler',
    component: () => import('@/views/quartzJob/scheduler.vue')
  },{
    path: '/robotTask',
    name: 'robotTask',
    component: () => import('@/views/taskinfo/robotTask.vue')
  },
  {
    path: '/task',
Code/WCS/WIDESEAWCS_Client/src/views/Index.vue
@@ -501,26 +501,26 @@
      }, 0);
      const defaultMenus = [
        {
          id: maxId + 1001,
          name: "租户管理",
          url: "/Sys_Tenant",
          parentId: 0,
          icon: "el-icon-office-building",
          enable: 1,
          tableName: "Sys_Tenant",
          permission: ["Search", "Add", "Update", "Delete"],
        },
        {
          id: maxId + 1002,
          name: "任务历史",
          url: "/taskHty",
          parentId: 0,
          icon: "el-icon-time",
          enable: 1,
          tableName: "taskHty",
          permission: ["Search", "Export"],
        },
        // {
        //   id: maxId + 1001,
        //   name: "租户管理",
        //   url: "/Sys_Tenant",
        //   parentId: 0,
        //   icon: "el-icon-office-building",
        //   enable: 1,
        //   tableName: "Sys_Tenant",
        //   permission: ["Search", "Add", "Update", "Delete"],
        // },
        // {
        //   id: maxId + 1002,
        //   name: "任务历史",
        //   url: "/taskHty",
        //   parentId: 0,
        //   icon: "el-icon-time",
        //   enable: 1,
        //   tableName: "taskHty",
        //   permission: ["Search", "Export"],
        // },
        {
          id: maxId + 1003,
          name: "调度控制",
Code/WCS/WIDESEAWCS_Client/src/views/quartzJob/deviceInfo.vue
@@ -129,7 +129,7 @@
        field: "deviceCode",
        title: "设备编号",
        type: "string",
        width: 90,
        width: 120,
        align: "left",
      },
      {
Code/WCS/WIDESEAWCS_Client/src/views/quartzJob/deviceProtocolDetail.vue
@@ -116,7 +116,7 @@
        field: "deviceType",
        title: "设备类型",
        type: "string",
        width: 180,
        width: 120,
        align: "left",
        bind: { key: "deviceType", data: [] },
      },
Code/WCS/WIDESEAWCS_Client/src/views/quartzJob/dispatchInfo.vue
@@ -142,14 +142,14 @@
        field: "name",
        title: "任务名称",
        type: "string",
        width: 90,
        width: 120,
        align: "left",
      },
      {
        field: "jobGroup",
        title: "任务分组",
        type: "string",
        width: 180,
        width: 120,
        align: "left",
        bind: { key: "deviceType", data: [] },
      },
@@ -164,7 +164,7 @@
        field: "className",
        title: "任务所在类",
        type: "int",
        width: 200,
        width: 220,
        align: "left",
      },
      {
Code/WCS/WIDESEAWCS_Client/src/views/system/Sys_Log.vue
@@ -45,36 +45,36 @@
    const searchFormOptions = ref([
      [
        { title: "请求地址", field: "url", type: "like" },
        { title: "用户IP", field: "userIP", type: "like" },
        { title: "服务器IP", field: "serviceIP", type: "like" },
        { title: "请求参数", field: "requestParam", type: "like" },
        { title: "响应参数", field: "responseParam", type: "like" },
      ],
      [
        { title: "开始时间", field: "beginDate", type: "datetime" },
        {
          dataKey: "restatus",
          data: [],
          title: "响应状态",
          field: "success",
          type: "selectList",
        },
        {
          dataKey: "roles",
          data: [],
          title: "角色ID",
          field: "role_Id",
          type: "select",
        },
        // {
        //   dataKey: "restatus",
        //   data: [],
        //   title: "响应状态",
        //   field: "success",
        //   type: "selectList",
        // },
        // {
        //   dataKey: "roles",
        //   data: [],
        //   title: "角色ID",
        //   field: "role_Id",
        //   type: "select",
        // },
      ],
      [
        {
          dataKey: "log",
          data: [],
          title: "日志类型",
          field: "logType",
          colSize: 12,
          type: "checkbox",
        },
      ],
      // [
      //   {
      //     dataKey: "log",
      //     data: [],
      //     title: "日志类型",
      //     field: "logType",
      //     colSize: 12,
      //     type: "checkbox",
      //   },
      // ],
    ]);
    const columns = ref([
      {
@@ -91,7 +91,7 @@
        field: "beginDate",
        title: "开始时间",
        type: "datetime",
        width: 140,
        width: 120,
        align: "left",
        sortable: true,
      },
@@ -99,51 +99,51 @@
        field: "userName",
        title: "用户名称",
        type: "string",
        width: 90,
        width: 60,
        align: "left",
      },
      {
        field: "url",
        title: "请求地址",
        type: "string",
        width: 110,
        width: 150,
        align: "left",
      },
      {
        field: "logType",
        title: "日志类型",
        type: "string",
        bind: { key: "log", data: [] },
        width: 80,
        align: "left",
      },
      {
        field: "success",
        title: "响应状态",
        type: "int",
        bind: { key: "restatus", data: [] },
        width: 80,
        align: "left",
      },
      // {
      //   field: "logType",
      //   title: "日志类型",
      //   type: "string",
      //   bind: { key: "log", data: [] },
      //   width: 80,
      //   align: "left",
      // },
      // {
      //   field: "success",
      //   title: "响应状态",
      //   type: "int",
      //   bind: { key: "restatus", data: [] },
      //   width: 80,
      //   align: "left",
      // },
      {
        field: "elapsedTime",
        title: "时长",
        type: "int",
        width: 60,
        width: 50,
        align: "left",
      },
      {
        field: "requestParameter",
        field: "requestParam",
        title: "请求参数",
        type: "string",
        width: 70,
        width: 120,
        align: "left",
      },
      {
        field: "responseParameter",
        field: "responseParam",
        title: "响应参数",
        type: "string",
        width: 70,
        width: 120,
        align: "left",
      },
      {
Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/robotTask.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,262 @@
<template>
  <view-grid
    ref="grid"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  </view-grid>
</template>
<script>
import extend from "@/extension/taskinfo/robotTask.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
  setup() {
    const table = ref({
      key: "robotTaskId",           // ä¸»é”®å­—段名
      footer: "Foots",
      cnName: "机器人任务信息",      // ä¸­æ–‡åç§°
      name: "robotTask",            // è¡¨å
      url: "/robotTask/",           // API路径
      sortName: "createDate",       // é»˜è®¤æŽ’序字段
    });
    // ç¼–辑表单字段(初始为空,根据实际编辑需求配置)
    const editFormFields = ref({});
    const editFormOptions = ref([]);
    // æœç´¢è¡¨å•字段
    const searchFormFields = ref({
      robotTaskNum: "",
      robotRoadway: "",
      robotTaskType: "",
      robotTaskState: "",
      robotSourceAddress: "",
      robotTargetAddress: "",
      creater: "",
      createDate: "",
    });
    // æœç´¢è¡¨å•配置
    const searchFormOptions = ref([
      [
        { title: "任务编号", field: "robotTaskNum", type: "int" },
        { title: "巷道", field: "robotRoadway", type: "like" },
        {
          title: "任务类型",
          field: "robotTaskType",
          type: "selectList",
          dataKey: "taskType",
          data: [],
        },
        {
          title: "任务状态",
          field: "robotTaskState",
          type: "selectList",
          dataKey: "taskState",
          data: [],
        },
      ],
      [
        { title: "来源地址", field: "robotSourceAddress", type: "like" },
        { title: "目标地址", field: "robotTargetAddress", type: "like" },
        { title: "创建人", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
    ]);
    // åˆ—配置
    const columns = ref([
      {
        field: "robotTaskId",
        title: "任务ID",
        type: "int",
        width: 90,
        hidden: true,        // éšè—ä¸»é”®
        readonly: true,
        require: true,
        align: "left",
      },
      {
        field: "robotTaskNum",
        title: "任务编号",
        type: "int",
        width: 100,
        align: "left",
        sortable: true,      // å¯æŽ’序
      },
      {
        field: "robotRoadway",
        title: "巷道",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "robotTaskType",
        title: "任务类型",
        type: "int",
        width: 100,
        align: "left",
        bind: { key: "taskType", data: [] },
      },
      {
        field: "robotTaskState",
        title: "任务状态",
        type: "int",
        width: 120,
        align: "left",
        bind: { key: "taskState", data: [] },
      },
      {
        field: "robotTaskTotalNum",
        title: "任务总数",
        type: "int",
        width: 90,
        align: "left",
      },
      {
        field: "robotSourceAddress",
        title: "来源地址",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "robotTargetAddress",
        title: "目标地址",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "robotSourceAddressLineCode",
        title: "来源线代码",
        type: "string",
        width: 130,
        align: "left",
      },
      {
        field: "robotTargetAddressLineCode",
        title: "目标线代码",
        type: "string",
        width: 130,
        align: "left",
        hidden: true,
      },
      {
        field: "robotSourceAddressPalletCode",
        title: "来源托盘代码",
        type: "string",
        width: 130,
        align: "left",
        hidden: true,
      },
      {
        field: "robotTargetAddressPalletCode",
        title: "目标托盘代码",
        type: "string",
        width: 130,
        align: "left",
        hidden: true,
      },
      {
        field: "robotExceptionMessage",
        title: "异常信息",
        type: "string",
        width: 200,
        align: "left",
        hidden: true,
        overflow: "ellipsis",
      },
      {
        field: "robotGrade",
        title: "优先级",
        type: "int",
        width: 80,
        align: "left",
        bind: {
          key: "robotGrade",
          data: [
            { id: 1, name: "低" },
            { id: 2, name: "普通" },
            { id: 3, name: "高" },
            { id: 4, name: "紧急" },
          ],
        },
      },
      {
        field: "robotDispatchertime",
        title: "调度时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "robotremark",
        title: "备注",
        type: "string",
        width: 150,
        align: "left",
        hidden: true,
      },
      {
        field: "creater",
        title: "创建人",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "createDate",
        title: "创建时间",
        type: "datetime",
        width: 160,
        align: "left",
        sortable: true,
      },
      {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "modifyDate",
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
    ]);
    // è¯¦æƒ…弹窗配置(如需查看详情功能)
    const detail = ref({
      cnName: "机器人任务详情",
      table: "robotTask",
      key: "robotTaskId",
      sortName: "CreateDate",
      columns: columns.value.filter(col => !col.hidden), // ä½¿ç”¨éžéšè—å­—段
    });
    return {
      table,
      extend,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
    };
  },
});
</script>
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
@@ -267,6 +267,28 @@
                            }
                            #endregion
                            #region RobotTaskTypeEnum
                            {
                                Type type = typeof(RobotTaskTypeEnum);
                                List<int> enums = Enum.GetValues(typeof(RobotTaskTypeEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(RobotTaskTypeEnum).GetField(((RobotTaskTypeEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
                                        data.Add(new { key = item.ToString(), value = description.Description });
                                    }
                                    else
                                    {
                                        data.Add(new { key = item.ToString(), value = item.ToString() });
                                    }
                                    index++;
                                }
                            }
                            #endregion
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/RobotTaskController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_ISystemServices;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_Server.Controllers.Task
{
    [Route("api/robotTask")]
    [ApiController]
    public class RobotTaskController : ApiBaseController<IRobotTaskService, Dt_RobotTask>
    {
        public RobotTaskController(IRobotTaskService service) : base(service)
        {
        }
    }
}
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_AGV.cs
@@ -299,6 +299,8 @@
            if (stockInfo != null)
                return response.Error($"当前托盘{dto.TrayNumber}已经入库了");
            // åˆ›å»ºåº“存明细
            task.TaskType = (int)TaskInboundTypeEnum.Inbound;
            task.TaskStatus = (int)TaskInStatusEnum.InNew;
            task.CurrentAddress = task.SourceAddress;