diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/agvTask/mapper/AgvTaskMapper.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/agvTask/mapper/AgvTaskMapper.java index b1ac7ac..35e450a 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/agvTask/mapper/AgvTaskMapper.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/agvTask/mapper/AgvTaskMapper.java @@ -77,6 +77,22 @@ public interface AgvTaskMapper extends BaseMapper { @Select(value = "select * from data_agv_task where business_detail_id = #{businessId} and type='INBOUND' and agv_vendor = 'TES' ") AgvTask queryByBusinessId(@Param("businessId") Long businessId); + /** + * 根据入库工作站查询任务数 + * + * @param workStation 工作站 + */ + @Select(value = "select count(id) from data_agv_task where start_code = #{workStation} and type='INBOUND' and status in (1,2,3) and agv_vendor = 'TES' ") + Integer queryInCountByAgv(@Param("workStation") String workStation); + + /** + * 根据工作站查询任务数 + * + * @param workStation 工作站 + */ + @Select(value = "select count(id) from data_agv_task where end_code = #{workStation} and type='OUTBOUND' and status in (1,2,3) and agv_vendor = 'TES' ") + Integer queryOutCountByAgv(@Param("workStation") String workStation); + /** * 每个出库工作站和任务数 */ diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/agvTask/service/impl/AgvTaskServiceImpl.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/agvTask/service/impl/AgvTaskServiceImpl.java index 4291d6d..7c92385 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/agvTask/service/impl/AgvTaskServiceImpl.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/agvTask/service/impl/AgvTaskServiceImpl.java @@ -19,7 +19,6 @@ import org.cpte.modules.receive.mapper.AsnMapper; import org.jeecg.common.system.vo.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.transaction.annotation.Transactional; diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/controller/ConveyorLineController.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/controller/ConveyorLineController.java index c4be604..208b427 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/controller/ConveyorLineController.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/controller/ConveyorLineController.java @@ -1,15 +1,11 @@ package org.cpte.modules.conveyorLine.controller; -import com.alibaba.fastjson.JSONObject; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.cpte.modules.conveyorLine.request.ScanTrayRequest; import org.cpte.modules.conveyorLine.service.IConveyorLineService; -import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.TesResult; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.config.shiro.IgnoreAuth; @@ -52,10 +48,4 @@ public class ConveyorLineController { } } - @Operation(summary = "输送线-大屏显示") - @GetMapping(value = "/showConveyorLine") - public Result showConveyorLine(@RequestParam(name = "conveyorLine") String conveyorLine) { - return Result.OK(iConveyorLineService.showConveyorLine(conveyorLine)); - } - } diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/IConveyorLineService.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/IConveyorLineService.java index 753355f..6681f7f 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/IConveyorLineService.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/IConveyorLineService.java @@ -1,6 +1,7 @@ package org.cpte.modules.conveyorLine.service; import com.alibaba.fastjson.JSONObject; +import org.cpte.modules.agvTask.entity.AgvTask; import org.cpte.modules.base.entity.Point; import org.cpte.modules.base.entity.Stock; import org.cpte.modules.conveyorLine.request.ScanTrayRequest; @@ -20,8 +21,8 @@ public interface IConveyorLineService { /** * 显示 输送线大屏显示 * - * @param conveyorLine conveyorLine + * @param agvTask 任务 */ - JSONObject showConveyorLine(String conveyorLine); + JSONObject showConveyorLine(AgvTask agvTask); } diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/impl/IConveyorLineServiceImpl.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/impl/IConveyorLineServiceImpl.java index 7dac4ce..0a966fa 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/impl/IConveyorLineServiceImpl.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/impl/IConveyorLineServiceImpl.java @@ -1,13 +1,12 @@ package org.cpte.modules.conveyorLine.service.impl; import com.alibaba.fastjson.JSONObject; +import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.cpte.modules.agvTask.entity.AgvTask; import org.cpte.modules.agvTask.mapper.AgvTaskMapper; -import org.cpte.modules.base.entity.Area; -import org.cpte.modules.base.mapper.AreaMapper; import org.cpte.modules.constant.enums.*; import org.cpte.modules.conveyorLine.request.ScanTrayRequest; import org.cpte.modules.conveyorLine.service.IConveyorLineService; @@ -15,15 +14,12 @@ import org.cpte.modules.conveyorLine.service.processor.ScanTrayProcessor; import org.cpte.modules.conveyorLine.vo.ScanTrayData; import org.cpte.modules.receive.entity.Asn; import org.cpte.modules.receive.mapper.AsnMapper; -import org.cpte.modules.shipping.entity.Task; -import org.cpte.modules.shipping.mapper.TaskMapper; import org.cpte.modules.utils.RedisDistributedLockUtil; -import org.jeecg.common.util.RedisUtil; +import org.jeecg.modules.message.websocket.WebSocket; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.time.LocalDate; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -35,22 +31,17 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { @Autowired private AsnMapper asnMapper; - @Autowired - private AreaMapper areaMapper; - @Autowired private AgvTaskMapper agvTaskMapper; @Autowired private ScanTrayProcessor scanTrayProcessor; - @Autowired - private RedisUtil redisUtil; - @Autowired private RedisDistributedLockUtil redissonLock; - private static final String CONVEYOR_LINE_KEY = "CONVEYOR_LINE_KEY"; + @Resource + private WebSocket webSocket; @Override public void scanTray(ScanTrayRequest scanTrayRequest) { @@ -62,6 +53,9 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { throw new RuntimeException("扫描处理中,请稍后重试"); } scanTrayProcessor.scanTray(scanTrayRequest); + + //推送输送线数据 + sendConveyorLineData(scanTrayRequest); } catch (Exception e) { log.error("扫描托盘异常", e); throw e; @@ -87,55 +81,75 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { asn.setResMessage(scanTrayRequest.getContent().getSignal().getErrorReason().toString()); asnMapper.updateById(asn); + + //推送输送线数据 + sendConveyorLineData(scanTrayRequest); + } + + /** + * 推送输送线数据 + */ + private void sendConveyorLineData(ScanTrayRequest scanTrayRequest) { + String stockCode = scanTrayRequest.getContent().getSignal().getBarCode(); + String workStation = scanTrayRequest.getContent().getStationCode(); + List errorMsg = scanTrayRequest.getContent().getSignal().getErrorReason(); + String description = ""; + if (CollectionUtils.isEmpty(errorMsg)) { + description = "托盘检测成功"; + } else { + description = scanTrayRequest.getContent().getSignal().getErrorReason().toString(); + } + + JSONObject conveyorLineData = new JSONObject(); + conveyorLineData.put("stockCode", stockCode); + conveyorLineData.put("izAll", "整托"); + conveyorLineData.put("taskType", BusinessTypeEnum.INBOUND.getDesc()); + conveyorLineData.put("endCode", workStation); + conveyorLineData.put("description", description); + + JSONObject conveyorLineMsg = new JSONObject(); + conveyorLineMsg.put("cmd", "conveyorLineData"); + conveyorLineMsg.put("data", conveyorLineData); + webSocket.pushMessage(workStation, conveyorLineMsg.toJSONString()); + + + Integer totalTasks = agvTaskMapper.queryInCountByAgv(scanTrayRequest.getContent().getStationCode()); + JSONObject conveyorLineCountMsg = new JSONObject(); + conveyorLineCountMsg.put("cmd", "conveyorLineCount"); + conveyorLineCountMsg.put("totalTasks", totalTasks); + webSocket.pushMessage(workStation, conveyorLineCountMsg.toJSONString()); } @Override - public JSONObject showConveyorLine(String conveyorLine) { + public JSONObject showConveyorLine(AgvTask agvTask) { JSONObject jsonObject = initJsonObject(); - jsonObject.put("endCode", conveyorLine); - - //工作站 - Area area = areaMapper.queryByPointCode(conveyorLine); - if (area == null) { - return jsonObject; - } - - // 设置任务类型 - String taskType = BusinessTypeEnum.OUTBOUND.getDesc(); - if (AreaTypeEnum.RK_DOCK.getValue().equals(area.getAreaCode())) { - taskType = BusinessTypeEnum.INBOUND.getDesc(); - } - jsonObject.put("taskType", taskType); - - //获取工作站的最新任务 - AgvTask agvTask = agvTaskMapper.queryByLastEndCode(conveyorLine); if (agvTask == null) { - jsonObject.put("description", "无出库任务"); - if (AreaTypeEnum.RK_DOCK.getValue().equals(area.getAreaCode())) { - jsonObject.put("description", "无入库任务"); - } + jsonObject.put("description", "无任务"); return jsonObject; } + String workStation = ""; + String taskType = ""; + if (BusinessTypeEnum.INBOUND.getValue().equals(agvTask.getType())) { + taskType = BusinessTypeEnum.INBOUND.getDesc(); + workStation = agvTask.getStartCode(); + } else if(BusinessTypeEnum.OUTBOUND.getValue().equals(agvTask.getType())){ + workStation = agvTask.getEndCode(); + taskType = BusinessTypeEnum.OUTBOUND.getDesc(); + } + + jsonObject.put("endCode", workStation); + jsonObject.put("taskType", taskType); + // 设置公共字段 setCommonFields(jsonObject, agvTask); // 根据区域类型处理不同逻辑 - if (AreaTypeEnum.RK_DOCK.getValue().equals(area.getAreaCode())) { + if (BusinessTypeEnum.INBOUND.getValue().equals(agvTask.getType())) { handleInboundTask(jsonObject, agvTask); - if (AgvStatusEnum.COMPLETED.getValue().equals(agvTask.getStatus())) { - Object dateObj = redisUtil.get(CONVEYOR_LINE_KEY); - if (dateObj != null) { - String description = "工作站无入库任务"; - return cleanJsonObject(conveyorLine, description); - } else { - redisUtil.set(CONVEYOR_LINE_KEY, agvTask.getId()); - } - } - } else { + } else if(BusinessTypeEnum.OUTBOUND.getValue().equals(agvTask.getType())){ handleOutboundTask(jsonObject, agvTask); } - return jsonObject; } @@ -152,16 +166,6 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { return jsonObject; } - private JSONObject cleanJsonObject(String conveyorLine, String description) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("stockCode", ""); - jsonObject.put("taskType", ""); - jsonObject.put("endCode", conveyorLine); - jsonObject.put("izAll", ""); - jsonObject.put("description", description); - return jsonObject; - } - /** * 设置公共字段 */ @@ -179,10 +183,6 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { jsonObject.put("description", description); } - private void updateAgvTaskId(AgvTask agvTask) { - redisUtil.set(CONVEYOR_LINE_KEY, agvTask.getId()); - } - /** * 根据状态获取入库描述 */ @@ -191,7 +191,7 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { Map statusDescriptionMap = new HashMap<>(); statusDescriptionMap.put(AgvStatusEnum.CREATED.getValue(), - "托盘异常:" + agvTask.getResMessage()); + "任务异常:" + agvTask.getResMessage()); statusDescriptionMap.put(AgvStatusEnum.EXECUTING.getValue(), "托盘检测成功,入库中"); statusDescriptionMap.put(AgvStatusEnum.COMPLETED.getValue(), @@ -199,11 +199,6 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { statusDescriptionMap.put(AgvStatusEnum.CANCELLED.getValue(), "托盘入库已取消或已失败,人工确认"); - //成功更新缓存 - if (AgvStatusEnum.COMPLETED.getValue().equals(agvTask.getStatus())) { - updateAgvTaskId(agvTask); - } - return statusDescriptionMap.getOrDefault(agvTask.getStatus(), "【" + carrierCode + "】托盘状态未知"); } @@ -215,9 +210,10 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { String stockCode = agvTask.getCarrierCode(); String izAll = agvTask.getIzAll() == 1 ? "拆托" : "整托"; - String description = izAll.equals("拆托") + /*String description = izAll.equals("拆托") ? "请人工将托盘叉走,避免任务拥堵" - : "请等待AGV将托盘叉走"; + : "请等待AGV将托盘叉走";*/ + String description = "请人工将托盘叉走,避免任务拥堵!"; jsonObject.put("description", description); } diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/dashboard/controller/DashBoardController.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/dashboard/controller/DashBoardController.java index 8c82444..f4aaea4 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/dashboard/controller/DashBoardController.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/dashboard/controller/DashBoardController.java @@ -2,34 +2,17 @@ package org.cpte.modules.dashboard.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.cpte.modules.agvTask.entity.AgvTask; import org.cpte.modules.agvTask.mapper.AgvTaskMapper; -import org.cpte.modules.agvTask.service.IAgvTaskService; -import org.cpte.modules.base.entity.Item; -import org.cpte.modules.base.mapper.ItemMapper; -import org.cpte.modules.base.service.IItemService; import org.cpte.modules.dashboard.vo.OutAndInData; import org.cpte.modules.dashboard.vo.WorkstationTask; import org.cpte.modules.inventory.mapper.InventoryMapper; -import org.cpte.modules.receive.mapper.AsnDetailMapper; import org.cpte.modules.receive.mapper.ReceiveRecordMapper; import org.cpte.modules.shipping.mapper.TaskMapper; import org.jeecg.common.api.vo.Result; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.jeecg.common.system.base.controller.JeecgController; -import org.jeecg.common.system.query.QueryGenerator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; import java.math.BigDecimal; import java.math.RoundingMode; @@ -59,9 +42,6 @@ public class DashBoardController { @Autowired private AgvTaskMapper agvTaskMapper; - @Autowired - private IItemService itemService; - @GetMapping("/getChartCardList") public Result getChartCardList() { JSONArray jsonArray = new JSONArray(); diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/quartz/job/TesAgvJob.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/quartz/job/TesAgvJob.java index 8b18d27..af73c5a 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/quartz/job/TesAgvJob.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/quartz/job/TesAgvJob.java @@ -1,5 +1,7 @@ package org.cpte.modules.quartz.job; +import com.alibaba.fastjson.JSONObject; +import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -8,15 +10,19 @@ import org.cpte.modules.agvTask.mapper.AgvTaskMapper; import org.cpte.modules.constant.GeneralConstant; import org.cpte.modules.constant.enums.AgvStatusEnum; import org.cpte.modules.constant.enums.AgvVendorEnum; +import org.cpte.modules.constant.enums.BusinessTypeEnum; import org.cpte.modules.shipping.service.ITaskService; import org.cpte.modules.tesAgv.service.ITesAgvService; import org.cpte.modules.utils.RedisDistributedLockUtil; +import org.jeecg.modules.message.websocket.WebSocket; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; @Slf4j public class TesAgvJob implements Job { @@ -33,6 +39,9 @@ public class TesAgvJob implements Job { @Autowired private RedisDistributedLockUtil redissonLock; + @Resource + private WebSocket webSocket; + @Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { @@ -74,6 +83,9 @@ public class TesAgvJob implements Job { for (AgvTask agvTask : agvTaskList) { sendTesAgvTask(agvTask); } + + //4.推送输送线大屏数据 + sendConveyorLineData(agvTaskList); } /** @@ -82,4 +94,38 @@ public class TesAgvJob implements Job { private void sendTesAgvTask(AgvTask agvTask) { tesAgvService.sendTesAgvTask(GeneralConstant.TES_POD_TASK, tesAgvService.generateTesAgvTaskJson(agvTask), agvTask); } + + private void sendConveyorLineData(List agvTasks){ + //入库任务 + List inTasks = agvTasks.stream().filter(agvTask -> BusinessTypeEnum.INBOUND.getValue().equals(agvTask.getType())).toList(); + + //入库任务根据startCode分组只需要获取startCode信息 + List inWorkStation = inTasks.stream().collect(Collectors.groupingBy(AgvTask::getStartCode)).keySet().stream().toList(); + if(CollectionUtils.isNotEmpty(inWorkStation)){ + for (String station : inWorkStation){ + Integer totalTasks = agvTaskMapper.queryInCountByAgv(station); + sendConveyorLineData(station, totalTasks); + } + } + + //出库任务 + List outTasks = agvTasks.stream().filter(agvTask -> BusinessTypeEnum.OUTBOUND.getValue().equals(agvTask.getType())).toList(); + + //出库任务根据endCode分组只需要获取endCode信息 + List outWorkStation = outTasks.stream().collect(Collectors.groupingBy(AgvTask::getEndCode)).keySet().stream().toList(); + if(CollectionUtils.isNotEmpty(outWorkStation)){ + for (String station : outWorkStation){ + Integer totalTasks = agvTaskMapper.queryOutCountByAgv(station); + sendConveyorLineData(station, totalTasks); + } + } + + } + private void sendConveyorLineData(String workStation, Integer totalTasks) { + JSONObject conveyorLineCountMsg = new JSONObject(); + conveyorLineCountMsg.put("cmd", "conveyorLineCount"); + conveyorLineCountMsg.put("totalTasks", totalTasks); + webSocket.pushMessage(workStation, conveyorLineCountMsg.toJSONString()); + } + } diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/tesAgv/service/impl/ITesAgvServiceImpl.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/tesAgv/service/impl/ITesAgvServiceImpl.java index 69d0e9a..db03f65 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/tesAgv/service/impl/ITesAgvServiceImpl.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/tesAgv/service/impl/ITesAgvServiceImpl.java @@ -3,6 +3,7 @@ package org.cpte.modules.tesAgv.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -16,6 +17,7 @@ import org.cpte.modules.constant.enums.AgvStatusEnum; import org.cpte.modules.constant.enums.AgvVendorEnum; import org.cpte.modules.constant.enums.BusinessTypeEnum; import org.cpte.modules.constant.enums.CommonStatusEnum; +import org.cpte.modules.conveyorLine.service.IConveyorLineService; import org.cpte.modules.inventory.mapper.InventoryMapper; import org.cpte.modules.inventory.service.IInventoryService; import org.cpte.modules.receive.entity.AsnDetail; @@ -32,6 +34,7 @@ import org.cpte.modules.tesAgv.service.ITesAgvService; import org.cpte.modules.utils.HttpPostUtil; import org.jeecg.common.util.RestUtil; import org.jeecg.common.util.UUIDGenerator; +import org.jeecg.modules.message.websocket.WebSocket; import org.jeecg.modules.openapi.mapper.OpenApiMapper; import org.jeecg.modules.system.mapper.SysDictMapper; import org.springframework.beans.factory.annotation.Autowired; @@ -77,6 +80,12 @@ public class ITesAgvServiceImpl implements ITesAgvService { @Autowired private IInventoryService inventoryService; + @Autowired + private IConveyorLineService iConveyorLineService; + + @Resource + private WebSocket webSocket; + @Override public String generateTesAgvTaskJson(AgvTask agvTask) { NewMovePodTaskRequest newMovePodTaskRequest = new NewMovePodTaskRequest(); @@ -356,6 +365,29 @@ public class ITesAgvServiceImpl implements ITesAgvService { agvTask.setStatus(AgvStatusEnum.COMPLETED.getValue()); agvTask.setEndTime(new Date()); agvTaskMapper.updateById(agvTask); + + if (BusinessTypeEnum.INBOUND.getValue().equals(agvTask.getType())) { + //推送输送线大屏显示数据 + Integer totalTasks = agvTaskMapper.queryInCountByAgv(agvTask.getStartCode()); + sendConveyorLineData(agvTask.getStartCode(), agvTask, totalTasks); + } else if (BusinessTypeEnum.OUTBOUND.getValue().equals(agvTask.getType())) { + //推送输送线大屏显示数据 + Integer totalTasks = agvTaskMapper.queryOutCountByAgv(agvTask.getEndCode()); + sendConveyorLineData(agvTask.getEndCode(), agvTask, totalTasks); + } + } + + private void sendConveyorLineData(String workStation, AgvTask agvTask, Integer totalTasks) { + JSONObject conveyorLineData = iConveyorLineService.showConveyorLine(agvTask); + JSONObject conveyorLineMsg = new JSONObject(); + conveyorLineMsg.put("cmd", "conveyorLineData"); + conveyorLineMsg.put("data", conveyorLineData); + webSocket.pushMessage(workStation, conveyorLineMsg.toJSONString()); + + JSONObject conveyorLineCountMsg = new JSONObject(); + conveyorLineCountMsg.put("cmd", "conveyorLineCount"); + conveyorLineCountMsg.put("totalTasks", totalTasks); + webSocket.pushMessage(workStation, conveyorLineCountMsg.toJSONString()); } /**