1
1 天以前 6e695903059e82c1c376bf2926ffb8b209c0dc3e
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java
@@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class AgvServiceImpl implements AgvService {
@@ -83,15 +84,17 @@
        if (Cools.isEmpty(basStation)) {
            throw new CoolException("未找到接驳站点信息,请检查站点状态");
        }
        List<Long> ids = new ArrayList<>();
        ids.add(basStation.getArea());
        if (basStation.getIsCrossZone() == 1) {
            String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1);
            String[] parts = content.split(",");
            for (int i = 0; i < parts.length; i++) {
                ids.add(Long.parseLong(parts[i].trim()));
            }
        }
        List<Long> ids = basStation.getCrossZoneArea().stream()
                .map(Integer::longValue)
                .collect(Collectors.toList());
//        ids.add(basStation.getArea());
//        if (basStation.getIsCrossZone() == 1) {
//            String content = basStation.getCrossZoneArea().substring(1,.length() - 1);
//            String[] parts = content.split(",");
//            for (int i = 0; i < parts.length; i++) {
//                ids.add(Long.parseLong(parts[i].trim()));
//            }
//        }
        List<WarehouseAreas> warehouseAreasList = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>()
                .in(WarehouseAreas::getId, ids)
        );
@@ -144,8 +147,9 @@
        String targetLoc = LocManageUtil.getTargetLoc(Long.parseLong(area));
        taskService.generateAGVTasks(waitPakin, targetLoc, sta, deviceSite.getDeviceCode(),loginUserId);
        basStation.setUseStatus(LocStsType.LOC_STS_TYPE_R.type);
        if (!basStation.getType().equals(0)){
            basStation.setUseStatus(LocStsType.LOC_STS_TYPE_R.type);
        }
        if (!basStationService.updateById(basStation)) {
            throw new CoolException("更新站点状态失败");
        }
@@ -213,15 +217,17 @@
        if (Cools.isEmpty(waitPakinItems)) {
            throw new CoolException("数据错误,未找到组托明细");
        }
        List<Long> ids = new ArrayList<>();
        ids.add(basStation.getArea());
        if (basStation.getIsCrossZone() == 1) {
            String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1);
            String[] parts = content.split(",");
            for (int i = 0; i < parts.length; i++) {
                ids.add(Long.parseLong(parts[i].trim()));
            }
        }
        List<Long> ids = basStation.getCrossZoneArea().stream()
                .map(Integer::longValue)
                .collect(Collectors.toList());
//        ids.add(basStation.getArea());
//        if (basStation.getIsCrossZone() == 1) {
//            String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1);
//            String[] parts = content.split(",");
//            for (int i = 0; i < parts.length; i++) {
//                ids.add(Long.parseLong(parts[i].trim()));
//            }
//        }
        List<WarehouseAreas> warehouseAreasList = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>()
                .in(WarehouseAreas::getId, ids)
        );
@@ -243,7 +249,9 @@
        //验证基础信息
        BasStation basStation = checkStaStatus(barcode, sta,waitPakinPda.getArea());
        //更新站点状态
        basStation.setUseStatus(LocStsType.LOC_STS_TYPE_F.type);
        if (!basStation.getType().equals(0)){
            basStation.setUseStatus(LocStsType.LOC_STS_TYPE_F.type);
        }
        basStation.setBarcode(barcode);
        if (!basStationService.updateById(basStation)) {
            throw new CoolException("更新站点状态失败");
@@ -262,7 +270,7 @@
        BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                        .eq(BasStation::getBarcode, barcode)
                , false
                .last("limit 1")
        );
        if (!Cools.isEmpty(isBarcodeSta)) {
            throw new CoolException("该条码已被" + isBarcodeSta.getStationName() + "站绑定");
@@ -274,7 +282,9 @@
            throw new CoolException("未找到站点信息");
        }
        if (!Cools.isEmpty(basStation.getContainerType())) {
            List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class);
            List<Long> longs1 = basStation.getContainerType().stream()
                    .map(Integer::longValue)
                    .collect(Collectors.toList());
            List<BasContainer> containers = basContainerService.list(
                    new LambdaQueryWrapper<BasContainer>()
                            .in(BasContainer::getContainerType, longs1)
@@ -330,12 +340,13 @@
            throw new CoolException("站点为光电站点,禁止呼叫AGV");
        }
        List<String> areaList = JSONObject.parseArray(basStation.getCrossZoneArea(), String.class);
        if (!areaList.contains(area)) {
        if (!basStation.getCrossZoneArea().contains(Integer.parseInt(area))) {
            throw new CoolException("当前站点不支持目标库区");
        }
        if (!Cools.isEmpty(basStation.getContainerType())) {
            List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class);
            List<Long> longs1 = basStation.getContainerType().stream()
                    .map(Integer::longValue)
                    .collect(Collectors.toList());
            List<BasContainer> containers = basContainerService.list(
                    new LambdaQueryWrapper<BasContainer>()
                            .in(BasContainer::getContainerType, longs1)