肖洋
2025-01-04 a07e4702be045efa9b04b49a561463875dd28e0a
更新配置文件和事件总线逻辑,修复任务处理逻辑
已修改11个文件
292 ■■■■■ 文件已修改
.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Client/src/api/http.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Client/src/views/Devicestatus/Craftlibrary/AgingLibrary.vue 200 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Client/src/views/Devicestatus/Craftlibrary/Volume.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Client/src/views/Devicestatus/Craftlibrary/roomtemperature.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/RequestInTaskAsync.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -1595,3 +1595,4 @@
/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile.pubxml
*.targets
Code Management/WCS/WIDESEAWCS_Client/src/api/http.js
@@ -12,8 +12,8 @@
let loadingInstance;
let loadingStatus = false;
if (process.env.NODE_ENV == 'development') {
     axios.defaults.baseURL = 'http://127.0.0.1:9291/';
    //axios.defaults.baseURL = 'http://192.168.5.251:9291/';
    //  axios.defaults.baseURL = 'http://127.0.0.1:9291/';
    axios.defaults.baseURL = 'http://192.168.20.251:9291/';
}
else if (process.env.NODE_ENV == 'debug') {
    axios.defaults.baseURL = 'http://127.0.0.1:8098/';
Code Management/WCS/WIDESEAWCS_Client/src/views/Devicestatus/Craftlibrary/AgingLibrary.vue
@@ -1,102 +1,102 @@
<template>
  <el-row>
     <el-col :span="3">
       <device-stacker v-for="stacker in Stackers" :key="stacker.deviceName" :Stacker="stacker"></device-stacker>
     </el-col>
     <el-col :span="21">
       <device-line v-for="device in devices" :key="device.deviceName" :device="device" />
     </el-col>
   </el-row>
 </template>
 <script setup>
 import { onMounted, reactive, toRefs } from "vue";
 import eventBus from "@/uitils/eventBus";
 import DeviceLine from "@/components/DeviceLine.vue";
 import DeviceStacker from "@/components/DeviceStacker.vue";
 // 堆垛机
 const Stackers = reactive([]);
 // 设备列表(修改重复设备名称)
 const devices = reactive([]);
 const intToBitArrayFromBinaryString = (num, numBits) => {
   let binaryString = num.toString(2).padStart(numBits, '0');
   return Array.from({ length: numBits }, (_, index) => binaryString[index] === '1');
 };
 // 监听设备数据变化
 onMounted(() => {
   eventBus.on('locationData', eventData => {
     console.log(eventData)
     if (eventData.deviceName === "陈化入库输送线"||eventData.deviceName === "陈化入库输送线") {
       if (devices.length <= 0) {
         devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode });
       }
       else {
         const device = devices.find(c => c.childDeviceCode == eventData.childDeviceCode)
         if (device) {
           const number = eventData.data.commandWrite.writeInteractiveSignal;
           const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8)
           eventData.data.writeInteractiveSignal = writeInteractiveSignal;
           device.data = eventData.data
         }
         else {
           const number = eventData.data.commandWrite.writeInteractiveSignal;
           const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8)
           eventData.data.writeInteractiveSignal = writeInteractiveSignal;
           devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode });
         }
       }
     }
   });
   eventBus.on('stackerData', eventData => {
     if (eventData.deviceName == "陈化1号堆垛机"||eventData.deviceName == "陈化2号堆垛机") {
       if (Stackers.length == 0) {
         Stackers.push({ deviceName: eventData.deviceName, data: eventData.data });
       }
       else {
         const Stacker = Stackers.find(c => c.deviceName == eventData.deviceName);
         if (Stacker) {
           Stacker.data = eventData.data
         }
         else {
           Stackers.push({ deviceName: eventData.deviceName, data: eventData.data });
         }
       }
     }
   })
 });
 </script>
 <style scoped>
 .Stackerbox {
   width: 220px;
   float: left;
 }
 .Linebox {
   width: 500px;
   float: left;
 }
 .box1 {
   float: left;
 }
 .card-body {
   text-align: center;
   border-radius: 6%;
 }
 .Stacker {
   background-color: burlywood;
 }
 .lis {
   float: left;
   width: 233px;
 }
 </style>
    <el-col :span="3">
      <device-stacker v-for="stacker in Stackers" :key="stacker.deviceName" :Stacker="stacker"></device-stacker>
    </el-col>
    <el-col :span="21">
      <device-line v-for="device in devices" :key="device.deviceName" :device="device" />
    </el-col>
  </el-row>
</template>
<script setup>
import { onMounted, reactive, toRefs } from "vue";
import eventBus from "@/uitils/eventBus";
import DeviceLine from "@/components/DeviceLine.vue";
import DeviceStacker from "@/components/DeviceStacker.vue";
// 堆垛机
const Stackers = reactive([]);
// 设备列表(修改重复设备名称)
const devices = reactive([]);
const intToBitArrayFromBinaryString = (num, numBits) => {
  let binaryString = num.toString(2).padStart(numBits, '0');
  return Array.from({ length: numBits }, (_, index) => binaryString[index] === '1');
};
// 监听设备数据变化
onMounted(() => {
  eventBus.on('locationData', eventData => {
    console.log(eventData)
    if (eventData.deviceName === "陈化入库输送线" || eventData.deviceName === "陈化入库输送线") {
      if (devices.length <= 0) {
        devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode });
      }
      else {
        const device = devices.find(c => c.childDeviceCode == eventData.childDeviceCode)
        if (device) {
          const number = eventData.data.commandWrite.writeInteractiveSignal;
          const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8)
          eventData.data.writeInteractiveSignal = writeInteractiveSignal;
          device.data = eventData.data
        }
        else {
          const number = eventData.data.commandWrite.writeInteractiveSignal;
          const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8)
          eventData.data.writeInteractiveSignal = writeInteractiveSignal;
          devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode });
        }
      }
    }
  });
  eventBus.on('stackerData', eventData => {
    if (eventData.deviceName.indexOf("陈化") != -1) {
      if (Stackers.length == 0) {
        Stackers.push({ deviceName: eventData.deviceName, data: eventData.data });
      }
      else {
        const Stacker = Stackers.find(c => c.deviceName == eventData.deviceName);
        if (Stacker) {
          Stacker.data = eventData.data
        }
        else {
          Stackers.push({ deviceName: eventData.deviceName, data: eventData.data });
        }
      }
    }
  })
});
</script>
<style scoped>
.Stackerbox {
  width: 220px;
  float: left;
}
.Linebox {
  width: 500px;
  float: left;
}
.box1 {
  float: left;
}
.card-body {
  text-align: center;
  border-radius: 6%;
}
.Stacker {
  background-color: burlywood;
}
.lis {
  float: left;
  width: 233px;
}
</style>
Code Management/WCS/WIDESEAWCS_Client/src/views/Devicestatus/Craftlibrary/Volume.vue
@@ -15,28 +15,30 @@
import DeviceStacker from "@/components/DeviceStacker.vue";
// 堆垛机
const Stackers = reactive([]);
var  i=0;
var i = 0;
// 设备列表(修改重复设备名称)
const devices = reactive([]);
const num = reactive([])
onMounted(() => {
  eventBus.on('stackerData', eventData => {
    if (eventData.deviceName === "分容3线入库输送线"||eventData.deviceName === "分容出库输送线") {
    if (devices.length <= 0) {
  eventBus.on('locationData', eventData => {
    if (eventData.deviceName === "分容3线入库输送线" || eventData.deviceName === "分容出库输送线") {
      if (devices.length <= 0) {
        devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.data.childDeviceCode });
      }
      else {
        const device = devices.find(c => c.childDeviceCode == eventData.data.childDeviceCode)
        if(device){
        if (device) {
          device.data = eventData.data
        }else{
        } else {
          devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.data.childDeviceCode });
        }
      }
    }
  })
  eventBus.on('stackerData', eventData => {
    if (eventData.deviceName == "分容3号堆垛机"||eventData.deviceName == "分容2号堆垛机") {
    // if (eventData.deviceName == "分容3号堆垛机"||eventData.deviceName == "分容2号堆垛机") {
    console.log(eventData.deviceName)
    if (eventData.deviceName.indexOf("分容") != -1) {
      if (Stackers.length == 0) {
        Stackers.push({ deviceName: eventData.deviceName, data: eventData.data });
      }
@@ -53,6 +55,4 @@
  })
})
</script>
<style scoped>
</style>
<style scoped></style>
Code Management/WCS/WIDESEAWCS_Client/src/views/Devicestatus/Craftlibrary/roomtemperature.vue
@@ -20,7 +20,7 @@
const devices = reactive([]);
const num = reactive([])
onMounted(() => {
  eventBus.on('stackerData', eventData => {
  eventBus.on('locationData', eventData => {
    // console.log(eventData)
   
      console.log(eventData)
@@ -41,7 +41,7 @@
    }
  })
  eventBus.on('stackerData', eventData => {
    if (eventData.deviceName == "常温1号堆垛机"||eventData.deviceName == "常温2号堆垛机"||eventData.deviceName == "常温3号堆垛机"||eventData.deviceName == "常温4号堆垛机") {
    if (eventData.deviceName.indexOf("常温")) {
      if (Stackers.length == 0) {
        Stackers.push({ deviceName: eventData.deviceName, data: eventData.data });
      }
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -16,6 +16,7 @@
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IProcessRepository;
using WIDESEAWCS_ISystemServices;
using WIDESEAWCS_ITaskInfo_HtyRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
@@ -35,6 +36,7 @@
    {
        private readonly ITaskService _taskService;
        private readonly ITaskRepository _taskRepository;
        private readonly ITask_HtyRepository _task_HtyRepository;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly IRouterService _routerService;
        private readonly IPlatFormRepository _platFormRepository;
@@ -50,7 +52,7 @@
        private static List<int>? userIds;
        public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService, IDeviceInfoRepository deviceInfoRepository)
        public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService, IDeviceInfoRepository deviceInfoRepository,ITask_HtyRepository task_HtyRepository)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
@@ -64,6 +66,7 @@
            _cacheService = cacheService;
            _noticeService = noticeService;
            _deviceInfoRepository = deviceInfoRepository;
            _task_HtyRepository = task_HtyRepository;
        }
        public async Task Execute(IJobExecutionContext context)
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
@@ -1,4 +1,5 @@
using HslCommunication;
using Mapster;
using Newtonsoft.Json;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -215,6 +216,20 @@
                        ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{task.TaskNum}】,托盘条码:【{task.PalletCode}】已到达【{childDeviceCode}】请求扫码入库(实盘),下一目标地址【{1000}】");
                        ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                    }
                    else if(task.TargetAddress == "1020-1")
                    {
                        var next = task.NextAddress;
                        var taskCommand = MapTaskCommand(task, command);
                        task.NextAddress = next;
                        ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】请求扫码入库(实盘),下一目标地址【{taskCommand.TargetAddress}】");
                        conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                        var taskHty = task.Adapt<Dt_Task_Hty>();
                        _task_HtyRepository.AddData(taskHty);
                        _taskService.DeleteData(task);
                    }
                    else
                    {
                        var next = task.NextAddress;
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -163,7 +163,7 @@
                            childDeviceCode,
                            commandAfter = command,
                        };
                        _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
                        _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
                        #endregion 调用事件总线通知前端
                    }
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -283,7 +283,7 @@
        //task.CurrentAddress = task.NextAddress;
        //task.NextAddress = task.TargetAddress;
        _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery,task.TaskNum);
        _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum);
        LogFactory.GetLog("任务完成").Info(true, "更新库存状态与任务状态");
        return (location, task);
@@ -359,7 +359,7 @@
        try
        {
            // 更新货位和库存信息
           (DtStockInfo updateStock, DtLocationInfo locationInForm, DtLocationInfo locationInfoTo) = UpdateStockLocation(stock, task);
            (DtStockInfo updateStock, DtLocationInfo locationInForm, DtLocationInfo locationInfoTo) = UpdateStockLocation(stock, task);
            var taskHty = CreateHistoricalTask(task);
            LogFactory.GetLog("任务完成").InfoFormat(true, "移库任务完成", $"货位地址:{task.TargetAddress},修改后库存数据:{JsonConvert.SerializeObject(updateStock)},原先货位数据:{locationInForm}");
@@ -994,17 +994,27 @@
                    return content.Error(result.MOMMessage);
            }
            // 处理异常电芯情况
            var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
            if (serialNosError.Count > 0)
            if (result.SerialNos.Count <= 0)
            {
                return await HandleErrorCells(input, area, serialNosError);
                return await RequestTrayInTaskAsync(input);
            }
            else
            {
            var boxing = CreateBoxingInfo(result, input.PalletCode);
            if (boxing == null) return content.Error("组盘失败");
            return await ProcessBasedOnProcessCode(boxing, area, input, result);
                // 处理异常电芯情况
                var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
                if (serialNosError.Count > 0)
                {
                    return await HandleErrorCells(input, area, serialNosError);
                }
                var boxing = CreateBoxingInfo(result, input.PalletCode);
                if (boxing == null) return content.Error("组盘失败");
                return await ProcessBasedOnProcessCode(boxing, area, input, result);
            }
        }
        catch (Exception err)
        {
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/RequestInTaskAsync.cs
@@ -101,7 +101,11 @@
        if (!content.Status) return content.Error("工艺申请失败");
        var resultProcessApply = JsonConvert.DeserializeObject<ResultProcessApply>(content.Data.ToString());
        if (!resultProcessApply.Success) return content.Error("工艺申请失败");
        if (!resultProcessApply.Success)
        {
            return await HandleErrorCells(input, area);
            //return content.Error("工艺申请失败");
        }
        var number = resultProcessApply.ProcessInfo.Where(x => x.ProcessCode.Contains(boxing.ProcessCode)).FirstOrDefault().Number.ToInt32();
        foreach (var item in resultProcessApply.ProcessInfo)
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs
@@ -1,10 +1,9 @@
//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行时版本:4.0.30319.42000
//     This code was generated by a tool.
//
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------