| | |
| | | /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 |
| | |
| | | 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/'; |
| | |
| | | <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> |
| | |
| | | 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 }); |
| | | } |
| | |
| | | }) |
| | | }) |
| | | </script> |
| | | <style scoped> |
| | | |
| | | </style> |
| | | <style scoped></style> |
| | |
| | | const devices = reactive([]); |
| | | const num = reactive([]) |
| | | onMounted(() => { |
| | | eventBus.on('stackerData', eventData => { |
| | | eventBus.on('locationData', eventData => { |
| | | // console.log(eventData) |
| | | |
| | | console.log(eventData) |
| | |
| | | } |
| | | }) |
| | | 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 }); |
| | | } |
| | |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_IProcessRepository; |
| | | using WIDESEAWCS_ISystemServices; |
| | | using WIDESEAWCS_ITaskInfo_HtyRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | { |
| | | 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; |
| | |
| | | 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; |
| | |
| | | _cacheService = cacheService; |
| | | _noticeService = noticeService; |
| | | _deviceInfoRepository = deviceInfoRepository; |
| | | _task_HtyRepository = task_HtyRepository; |
| | | } |
| | | |
| | | public async Task Execute(IJobExecutionContext context) |
| | |
| | | using HslCommunication; |
| | | using Mapster; |
| | | using Newtonsoft.Json; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | |
| | | 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; |
| | |
| | | childDeviceCode, |
| | | commandAfter = command, |
| | | }; |
| | | _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj }); |
| | | _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj }); |
| | | |
| | | #endregion 调用事件总线通知前端 |
| | | } |
| | |
| | | //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); |
| | |
| | | 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}"); |
| | | |
| | |
| | | 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) |
| | | { |
| | |
| | | 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) |
| | |
| | | //------------------------------------------------------------------------------ |
| | | // <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> |
| | | //------------------------------------------------------------------------------ |
| | | |