1
2 天以前 bfc2c6e32a69ace11bb8909c0d120998d9689258
lsh#
7个文件已修改
179 ■■■■ 已修改文件
rsf-admin/src/page/basicInfo/basStation/BasStationCreate.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/basStation/BasStationEdit.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/basStation/BasStationList.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/InBoundServiceImpl.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/common/enums/WarehouseAreaType.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/basStation/BasStationCreate.jsx
@@ -97,14 +97,15 @@
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <AutocompleteInput
                                        choices={dicts}
                                        optionText="label"
                                    <SelectInput
                                        label="table.field.basStation.type"
                                        source="type"
                                        optionValue="value"
                                        parse={v => v}
                                        validate={[required()]} />
                                        choices={[
                                            { id: 0, name: '光电' },
                                            { id: 1, name: '无光电' },
                                        ]}
                                        validate={[required()]}
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <SelectInput
rsf-admin/src/page/basicInfo/basStation/BasStationEdit.jsx
@@ -74,6 +74,16 @@
                                autoFocus
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <SelectInput
                                label="table.field.basStation.type"
                                source="type"
                                choices={[
                                    { id: 0, name: '光电' },
                                    { id: 1, name: '无光电' },
                                ]}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>                            
                            <SelectInput
                                    label="table.field.basStation.inAble"
rsf-admin/src/page/basicInfo/basStation/BasStationList.jsx
@@ -137,6 +137,11 @@
                    <TextField source="useStatus$" label="table.field.basStation.useStatus" />
                    <TextField source="barcode" label="table.field.basStation.barcode" />
                    <FunctionField
                        source="type"
                        label="table.field.basStation.type"
                        render={record => record.type === 1 ? '无光电' : '光电'}
                    />
                    <FunctionField
                        source="inAble"
                        label="table.field.basStation.inAble"
                        render={record => record.inAble === 1 ? '是' : '否'}
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/InBoundServiceImpl.java
@@ -1,11 +1,13 @@
package com.vincent.rsf.server.api.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.vincent.rsf.framework.common.Cools;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.api.entity.params.PdaGeneralParam;
import com.vincent.rsf.server.api.service.AgvService;
import com.vincent.rsf.server.api.service.InBoundService;
import com.vincent.rsf.server.api.utils.LocUtils;
import com.vincent.rsf.server.manager.controller.params.GenerateTaskParams;
@@ -48,6 +50,55 @@
    @Autowired
    private TaskService taskService;
    private BasStation checkStaStatus(String barcode, String sta) {
        if (Cools.isEmpty(barcode)) {
            throw new CoolException("容器码不能为空");
        }
        if (Cools.isEmpty(sta)) {
            throw new CoolException("接驳位不能为空");
        }
        BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                        .eq(BasStation::getBarcode, barcode)
                , false
        );
        if (!Cools.isEmpty(isBarcodeSta)) {
            throw new CoolException("该条码已被" + isBarcodeSta.getStationName() + "站绑定");
        }
        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                .eq(BasStation::getStationName, sta)
        );
        if (Cools.isEmpty(basStation)) {
            throw new CoolException("未找到站点信息");
        }
        if (!basStation.getUseStatus().equals("O")) {
            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 = false;
            for (BasContainer container : containers) {
                String codeType = container.getCodeType();  // 获取正则表达式
                if (barcode.matches(codeType)) {  // 判断条码是否符合这个正则
                    matches = true;
                    break;  // 找到匹配的就退出循环
                }
            }
//            boolean matches = containers.stream()
//                    .map(BasContainer::getCodeType)
//                    .anyMatch(codeType -> barcode.matches(codeType));
            if (!matches) {
                throw new CoolException("条码与站点不匹配");
            }
        }
        return basStation;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public synchronized R generateTasks(PdaGeneralParam param, Long loginUserId) {
@@ -65,13 +116,15 @@
            throw new CoolException("未找到所属库区信息");
        }
        BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>()
                .eq(BasContainer::getCode, param.getContainerNo()));
        if (Objects.isNull(container)) {
            throw new CoolException("容器未维护入库,请维护后再操作!!");
        }
//        BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>()
//                .eq(BasContainer::getCode, param.getContainerNo()));
//        if (Objects.isNull(container)) {
//            throw new CoolException("容器未维护入库,请维护后再操作!!");
//        }
        //验证基础信息
        BasStation basStation = checkStaStatus(param.getContainerNo(), param.getTransferStationNo());
        /**获取库位*/
        String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), container.getContainerType());
        String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), null);
        if (Cools.isEmpty(targetLoc)) {
            throw new CoolException("该站点对应库区未找到库位");
        }
@@ -88,6 +141,7 @@
                .setTargLoc(targetLoc)
                .setOrgSite(deviceSite.getSite())
                .setBarcode(param.getContainerNo())
                .setTargSite(deviceSite.getDeviceSite())
                .setCreateBy(loginUserId)
                .setUpdateBy(loginUserId);
        if (!taskService.save(task)) {
rsf-server/src/main/java/com/vincent/rsf/server/common/enums/WarehouseAreaType.java
@@ -10,7 +10,8 @@
public enum WarehouseAreaType {
    //订单类型
    WAREHOUSE_AREA_RECEIPT("receipt", "收货区"),
    WAREHOUSE_AREA_COLLECTION("collection", "集货区"),
    WAREHOUSE_AREA_COLLECTION("collection", "存储区"),
    WAREHOUSE_AREA_CACHE("cache", "缓存区"),
    WAREHOUSE_AREA_DELIVERY("delivery", "发货区"),
    ;
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -207,7 +207,6 @@
        return R.ok("任务生成完毕!");
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public synchronized R generateFlatWarehouseTasks(WaitPakin pakins, String locCode, Long loginUserId) {
@@ -334,13 +333,16 @@
            throw new CoolException("请检查组拖状态是否完成!!");
        }
        waitPakins.forEach(pakin -> {
            BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>()
                    .eq(BasContainer::getCode, pakin.getBarcode()));
            if (Objects.isNull(container)) {
                throw new CoolException("容器未维护入库,请维护后再操作!!");
            }
//            BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>()
//                    .eq(BasContainer::getCode, pakin.getBarcode()));
//            if (Objects.isNull(container)) {
//                throw new CoolException("容器未维护入库,请维护后再操作!!");
//            }
            //验证基础信息
            BasStation basStation = checkStaStatus(pakin.getBarcode(), deviceSite.getSite());
            /**获取库位*/
            String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), container.getContainerType());
            String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), null);
            if (Cools.isEmpty(targetLoc)) {
                throw new CoolException("该站点对应库区未找到库位");
            }
@@ -447,6 +449,53 @@
    }
    private BasStation checkStaStatus(String barcode, String sta) {
        if (Cools.isEmpty(barcode)) {
            throw new CoolException("容器码不能为空");
        }
        if (Cools.isEmpty(sta)) {
            throw new CoolException("接驳位不能为空");
        }
        BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                        .eq(BasStation::getBarcode, barcode)
                , false
        );
        if (!Cools.isEmpty(isBarcodeSta)) {
            throw new CoolException("该条码已被" + isBarcodeSta.getStationName() + "站绑定");
        }
        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                .eq(BasStation::getStationName, sta)
        );
        if (Cools.isEmpty(basStation)) {
            throw new CoolException("未找到站点信息");
        }
        if (!basStation.getUseStatus().equals("O")) {
            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 = false;
            for (BasContainer container : containers) {
                String codeType = container.getCodeType();  // 获取正则表达式
                if (barcode.matches(codeType)) {  // 判断条码是否符合这个正则
                    matches = true;
                    break;  // 找到匹配的就退出循环
                }
            }
//            boolean matches = containers.stream()
//                    .map(BasContainer::getCodeType)
//                    .anyMatch(codeType -> barcode.matches(codeType));
            if (!matches) {
                throw new CoolException("条码与站点不匹配");
            }
        }
        return basStation;
    }
    /**
     * @param loginUserId
     * @author Munch D. Luffy
@@ -482,13 +531,18 @@
            throw new CoolException("请检查组拖状态是否完成!!");
        }
        waitPakins.forEach(pakin -> {
            BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>()
                    .eq(BasContainer::getCode, pakin.getBarcode()));
            if (Objects.isNull(container)) {
                throw new CoolException("容器未维护入库,请维护后再操作!!");
            }
            //验证基础信息
            BasStation basStation = checkStaStatus(pakin.getBarcode(), deviceSite.getSite());
//            BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>()
//                    .eq(BasContainer::getCode, pakin.getBarcode()));
//            if (Objects.isNull(container)) {
//                throw new CoolException("容器未维护入库,请维护后再操作!!");
//            }
            /**获取库位*/
            String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), container.getContainerType(),rowList);
            String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(),null,rowList);
            if (Cools.isEmpty(targetLoc)) {
                throw new CoolException("该站点对应库区未找到库位");
            }
rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
@@ -53,7 +53,7 @@
    }
    public static String getTargetLoc(Long areaId, Long containerType) {
        Long locType = null;
        Long locType = containerType;
//        if (!Objects.isNull(containerType)) {
//            LocTypeService locService = SpringUtils.getBean(LocTypeService.class);
//            if (containerType.equals(ContainerType.CONTAINER_TYPE_NORMAL.val)) {