| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.rawglassstation.service.RawGlassStorageStationService; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author wangfei |
| | |
| | | |
| | | @Resource private RawGlassStorageTaskService rawGlassStorageTaskService; |
| | | |
| | | @Resource private RawGlassStorageDetailsService rawGlassStorageDetailsService; |
| | | |
| | | @Scheduled(fixedDelay = 2000) |
| | | public void sendRawGlassMessage() { |
| | | log.info("发送任务信息和架子信息"); |
| | |
| | | List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.listRawGlassTask(); |
| | | jsonObject.append("rawStationDetailsList", rawStationDetailsList); |
| | | jsonObject.append("tasks", tasks); |
| | | log.info("获取到的工位详情及任务信息为:{}", jsonObject); |
| | | // log.info("获取到的工位详情及任务信息为:{}", jsonObject); |
| | | |
| | | List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("rawGlass"); |
| | | if (CollectionUtil.isNotEmpty(sendwServer)) { |
| | | if (sendwServer.get(0).session.isOpen()) { |
| | | log.info("已发送"); |
| | | sendwServer.get(0).sendMessage(String.valueOf(jsonObject)); |
| | | } |
| | | sendwServer.stream().forEach(e->{ |
| | | e.sendMessage(String.valueOf(jsonObject)); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** todo:入库任务:吊装位有玻璃,先去工位表查询空格子,生成入库任务从吊装位到目标格子 */ |
| | | // @Scheduled(fixedDelay = 1000) |
| | | // public void sendRawGlassMessage() { |
| | | //// List<RawGlassStorageDetails> rawGlassStorageDetailsList = rawGlassStorageDetailsService.List(new RawGlassStorageDetails()) |
| | | // Wrapper<RawGlassStorageDetails> queryWrapper = null; |
| | | // List<RawGlassStorageDetails> detailsList = rawGlassStorageDetailsService.list(null); |
| | | // queryWrapper.eq(RawGlassStorageDetails::getState, 100); |
| | | // if(detailsList.size() >0){ |
| | | // //查找格子表details空格子 |
| | | // List<String> slotIds = detailsList.stream() |
| | | // .map(RawGlassStorageDetails::getSlotId) |
| | | // .collect(Collectors.toList()); |
| | | // list(new LambdaQueryWrapper<RawGlassStorageTask>() |
| | | // .in(CollectionUtil.isNotEmpty(request.getState()), RawGlassStorageTask::getState, request.getState()) |
| | | // .in(CollectionUtil.isNotEmpty(request.getSlotId()), RawGlassStorageTask::getSlotId, request.getSlotId()) |
| | | // .orderByDesc(RawGlassStorageTask::getCreateTime)); |
| | | // }if(slotIds.size()>0){ |
| | | // //生成入库任务 |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | |
| | | |
| | | /** todo:出库任务:1、点出库,立马生成出片任务 2、点出库修改工位详情内的状态为待出库,定时任务扫描生成出库任务 */ |
| | | |