1
huangxiaoqiang
20 小时以前 2d2d6bf8565f5b89fc9ee054bf6e62f9592f8673
1
已修改6个文件
已添加1个文件
165 ■■■■■ 文件已修改
项目代码/WCS/WIDESEAWCS_Client/config/buttons.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Client/src/extension/taskinfo/extend/HandInbound.vue 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Client/config/buttons.js
@@ -136,7 +136,16 @@
    onClick: function () {
        this.export();
    }
}
},
{
    name: "手 åЍ æ¬ è¿",
    // icon: 'el-icon-plus',
    value: 'HandInbound',
    type: 'success',
    onClick: function () {
    }
},
]
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Client/src/extension/taskinfo/extend/HandInbound.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,86 @@
<template>
  <vol-box v-model="show" title="手动入库" :width="900" :height="600">
    <template #content>
      <el-form ref="form" :model="form" label-width="90px">
        <el-form-item label="搬运区域" prop="Area">
          <el-select v-model="form.Area" placeholder="请选择搬运区域">
            <el-option label="区域一" value="1" />
            <el-option label="区域二" value="2" />
            <el-option label="区域三" value="3" />
            <el-option label="区域四" value="4" />
          </el-select>
        </el-form-item>
        <el-form-item label="起点">
          <el-input type="text" v-model="form.SourceAddress"></el-input>
        </el-form-item>
        <el-form-item label="终点">
          <el-input type="text" v-model="form.TargetAddress"></el-input>
        </el-form-item>
      </el-form>
    </template>
    <template #footer>
      <div>
        <el-button type="danger" size="small" plain @click="submit">
          <i class="el-icon-check">搬运</i>
        </el-button>
        <el-button size="small" type="primary" plain @click="() => {
            this.show = false;
          }
          ">
          <i class="el-icon-close">关闭</i>
        </el-button>
      </div>
    </template>
  </vol-box>
</template>
<script>
import VolBox from "@/components/basic/VolBox.vue";
export default {
  components: {
    "vol-box": VolBox,
  },
  data() {
    return {
      form:{
        Area:"",
        SourceAddress:"",
        TargetAddress:"",
      },
      show: false,
    };
  },
  methods: {
    open() {
      this.show = true;
    },
    submit() {
      this.$emit("parentCall", ($vue) => {
        if (
          !this.form.TargetAddress ||
          !this.form.Area ||
          !this.form.SourceAddress||
          this.form.Area==""||
          this.form.SourceAddress==""||
          this.form.TargetAddress==""
        ) {
          this.$message.error("参数错误");
          return;
        }
        this.http.post("api/Task/AddTask", this.form, "").then((x) => {
          if (!x.status) {
            this.$message.error(x.message);
          } else {
            this.$Message.success("新建入库任务");
            // $vue.success("成功.");
            this.show = false;
            this.form='';
            $vue.refresh();
          }
        });
      });
    },
  },
};
</script>
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js
@@ -1,10 +1,11 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import gridBody from './extend/taskExecuteDetail.vue'
import gridHeader from "./extend/HandInbound.vue"
let extension = {
    components: {
        //查询界面扩展组件
        gridHeader: '',
        gridHeader: gridHeader,
        gridBody: gridBody,
        gridFooter: '',
        //新建、编辑弹出框扩展组件
@@ -42,6 +43,14 @@
                    this.$refs.gridBody.open(row);
                }
            });
            var btnHandInbound = this.buttons.find(x => x.value == "HandInbound");
            if (btnHandInbound != null) {
              btnHandInbound.onClick = () => {
                this.$refs.gridHeader.open();
                this.refresh();
              }
            }
        },
        onInited() {
            //框架初始化配置后
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -26,7 +26,7 @@
        /// <summary>
        /// å··é“号
        /// </summary>
        public string RoadWay { get; set; }
        public string Area { get; set; }
        /// <summary>
        /// ä»»åŠ¡ç±»åž‹
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -55,7 +55,9 @@
        /// <param name="taskDTOs">WMS任务对象集合</param>
        /// <returns>返回处理结果</returns>
        WebResponseContent ReceiveWMSTask([NotNull] List<Dt_Task> taskDTOs);
        WebResponseContent AddTask(WMSTaskDTO WMSDTO);
        /// <summary>
        /// æ ¹æ®è®¾å¤‡ç¼–号、当前地址查询输送线未执行的任务
        /// </summary>
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
@@ -25,6 +25,11 @@
        {
            return Service.ReceiveWMSTask(taskDTOs);
        }
        [HttpPost, HttpGet, Route("AddTask"), AllowAnonymous]
        public WebResponseContent AddTask([FromBody] WMSTaskDTO WMSDTO)
        {
            return Service.AddTask(WMSDTO);
        }
        [HttpPost, HttpGet, Route("UpdateTaskExceptionMessage")]
        public WebResponseContent UpdateTaskExceptionMessage(int taskNum, string message)
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -46,11 +46,15 @@
using WIDESEAWCS_Core.Utilities;
using WIDESEAWCS_DTO.Enum;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_TaskInfoRepository;
using static Microsoft.IO.RecyclableMemoryStreamManager;
namespace WIDESEAWCS_TaskInfoService
@@ -62,6 +66,7 @@
        private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository;
        private readonly ITask_HtyService _task_HtyService;
        private readonly IMapper _mapper;
        private readonly IDt_StationManagerRepository _stationManagerRepository;
        private Dictionary<string, OrderByType> _taskOrderBy = new()
@@ -77,13 +82,14 @@
        public List<int> TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList();
        public List<int> AGVTaskTypes => typeof(AGVTaskTypeEnum).GetEnumIndexList();
        public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IMapper mapper, ITask_HtyService task_HtyService) : base(BaseDal)
        public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IMapper mapper, ITask_HtyService task_HtyService, IDt_StationManagerRepository stationManagerRepository) : base(BaseDal)
        {
            _routerService = routerService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskExecuteDetailRepository = taskExecuteDetailRepository;
            _task_HtyService = task_HtyService;
            _mapper = mapper;
            _stationManagerRepository = stationManagerRepository;
        }
        /// <summary>
@@ -117,6 +123,44 @@
            return content;
        }
        public WebResponseContent AddTask(WMSTaskDTO WMSDTO)
        {
            var SourceAddress= _stationManagerRepository.QueryFirst(x=>x.stationCode == WMSDTO.SourceAddress&&x.stationArea==int.Parse( WMSDTO.Area));
            var TargetAddress = _stationManagerRepository.QueryFirst(x=>x.stationCode == WMSDTO.TargetAddress && x.stationArea == int.Parse(WMSDTO.Area));
            if(SourceAddress == null || TargetAddress == null)
            {
                return WebResponseContent.Instance.Error($"未找到起点或终点站台信息,起点:【{WMSDTO.SourceAddress}】,终点:【{WMSDTO.TargetAddress}】");
            }
            if (QueryConveyorLineTask(SourceAddress.stationName) != null)
            {
                return WebResponseContent.Instance.Error($"起点:【{WMSDTO.SourceAddress}】存在任务"); ;
            }
            if (QueryConveyorLineTask(TargetAddress.stationName) != null)
            {
                return WebResponseContent.Instance.Error($"终点:【{WMSDTO.TargetAddress}】存在任务"); ;
            }
            Dt_Task taskDTO = new Dt_Task()
            {
                TaskNum = BaseDal.GetTaskNo().Result,
                Grade = 1,
                Roadway = SourceAddress.stationArea.ToString(),
                SourceAddress = SourceAddress.stationName,
                CurrentAddress = SourceAddress.stationName,
                TargetAddress = TargetAddress.stationName,
                NextAddress = TargetAddress.stationName,
                TaskState = (int)AGVTaskStatusEnum.AGVNew,
                TaskType = (int)AGVTaskTypeEnum.AGVCarry,
                AGVName = SourceAddress.stationArea switch
                {
                    1 => "AGV01",
                    4 => "AGV03",
                    _ => "AGV02",
                }
            };
            ReceiveWMSTask(new List<Dt_Task> { taskDTO });
            return WebResponseContent.Instance.OK("任务添加成功");
        }
        /// <summary>
        /// æŸ¥æ‰¾è¯¥ç«™å°æ˜¯å¦æœ‰ä»»åŠ¡
        /// </summary>