From a7a06157d81e4b4c4cffc5e88e152d39db9707d0 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期三, 21 五月 2025 09:07:54 +0800 Subject: [PATCH] #容器管理 --- rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java index be29dcb..b697fc6 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.vincent.rsf.framework.common.Cools; import com.vincent.rsf.framework.common.R; @@ -258,17 +259,20 @@ if (!basStation.getUseStatus().equals("O")){ throw new CoolException("绔欑偣鐘舵�佷笉涓虹┖闂�"); } - Object parse = JSONArray.parse(basStation.getContainerType()); - List<BasContainer> containers = basContainerService.list( - new LambdaQueryWrapper<BasContainer>() - .in(BasContainer::getContainerType, parse) - ); - boolean matches = containers.stream() - .map(BasContainer::getCodeType) - .anyMatch(codeType -> barcode.matches(codeType)); - if (!matches) { - throw new CoolException("鏉$爜涓庣珯鐐逛笉鍖归厤"); + if (!Cools.isEmpty(basStation.getContainerType())){ + List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class); + List<BasContainer> containers = basContainerService.list( + new LambdaQueryWrapper<BasContainer>() + .in(BasContainer::getContainerType, longs1) + ); + boolean matches = containers.stream() + .map(BasContainer::getCodeType) + .anyMatch(codeType -> barcode.matches(codeType)); + if (!matches) { + throw new CoolException("鏉$爜涓庣珯鐐逛笉鍖归厤"); + } } + return basStation; } } -- Gitblit v1.9.1