自动化立体仓库 - WMS系统
skyouc
13 小时以前 91aa478d200d53ecf5e3032ce7f7e026a218e526
no message
2个文件已修改
85 ■■■■ 已修改文件
src/main/java/com/zy/api/enums/MatType.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/enums/MatType.java
@@ -21,4 +21,16 @@
        this.desc = desc;
    }
    public static Long getTag(String type) {
        if (type.equals(MatType.LARGE.type)) {
            return Long.parseLong(MatLocType.AUTOMATED.type);
        } else if (type.equals(MatType.MIDDEL.type)) {
            return Long.parseLong(MatLocType.SO_HOLDING.type);
        } else if (type.equals(MatType.SMALL.type)) {
            return Long.parseLong(MatLocType.EO_HOLDING.type);
        } else {
            return null;
        }
    }
}
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -6,6 +6,8 @@
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.core.common.*;
import com.core.exception.CoolException;
import com.zy.api.enums.MatLocType;
import com.zy.api.enums.MatType;
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.*;
import com.zy.asrs.entity.result.FindLocNoAttributeVo;
@@ -701,15 +703,15 @@
                throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!");
            }
            BasContainer container = basContainerService.selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
            if (Objects.isNull(container)) {
                throw new CoolException("数据错误:容器码不存在!!");
            }
            if (container.getMixMax() < detlDtos.size()) {
                throw new CoolException("超出容器最大混装数量,当前容器最大数量为:" + container.getMixMax() + "!!");
            }
//            BasContainer container = basContainerService.selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
//            if (Objects.isNull(container)) {
//                throw new CoolException("数据错误:容器码不存在!!");
//            }
//            if (container.getMixMax() < detlDtos.size()) {
//                throw new CoolException("超出容器最大混装数量,当前容器最大数量为:" + container.getMixMax() + "!!");
//            }
            //还可以放入多少种物料
            Integer suplus = container.getMixMax();
//            Integer suplus = container.getMixMax();
            for (DetlDto detlDto : detlDtos) {
                Mat mat = matService.selectByMatnr(detlDto.getMatnr());
                if (Cools.isEmpty(mat)) {
@@ -731,6 +733,7 @@
                WaitPakin waitPakin = new WaitPakin();
                BeanUtils.copyProperties(mat, waitPakin);
                waitPakin.setOrderNo(detlDto.getOrderNo());   // 单据编号
                waitPakin.setType(param.getType());
                waitPakin.setOrderId(detlDto.getOrderId());
                waitPakin.setBatch(detlDto.getBatch());     // 序列码
                waitPakin.setZpallet(param.getBarcode());   // 托盘码
@@ -1225,7 +1228,7 @@
     * @version 1.0
     */
    @Override
    public R callAgvMove(AgvCallParams params, Long userId) {
    public synchronized R callAgvMove(AgvCallParams params, Long userId) {
        if (Objects.isNull(params.getOrgSite())) {
            throw new CoolException("源站点不能为空!!");
        }
@@ -1290,8 +1293,35 @@
        if (Objects.isNull(locCaches)) {
            throw new CoolException("暂无满足需求库位!");
        }
        //获取缓存区信息
        BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type));
        if (Objects.isNull(basAreas)) {
            throw new CoolException("库区不存在!!");
        }
        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                .eq("area_id", basAreas.getId())
                .eq("loc_no", locCaches.getLocNo()));
        if (Objects.isNull(locDetls) || locDetls.isEmpty()) {
            throw new CoolException("库存明细不存在!!");
        }
        Set<String> set = locDetls.stream().map(LocDetl::getMatnr).collect(Collectors.toSet());
        List<Mat> matList = matService.selectList(new EntityWrapper<Mat>().in("matnr", set));
        if (Objects.isNull(matList) || matList.isEmpty()) {
            throw new CoolException("物料库不存在该物料!!");
        }
        Set<Long> longs = matList.stream().map(Mat::getTagId).collect(Collectors.toSet());
        if (!longs.isEmpty() && longs.size() > 1) {
            throw new CoolException("物料类型不一致,请检查数据是否正确!!");
        }
        Mat mat = matList.stream().findFirst().get();
        BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
                .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
                .eq("crn_type", mat.getTagId())
                .eq("dev_no", params.getTarSite()));
        if (Objects.isNull(station)) {
            throw new CoolException("站点正在执行任务!!");
@@ -1379,8 +1409,6 @@
            throw new CoolException("站点信息不存在!!");
        }
        List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", barcode));
        if (!tasks.isEmpty()) {
            throw new CoolException("托盘已在任务执行中..");
@@ -1434,8 +1462,6 @@
                throw new CoolException("保存工作档明细失败");
            }
        }
        // 修改目标库位状态
        if (loc.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {
@@ -1919,15 +1945,16 @@
            throw new CoolException("库存明细不存在!!");
        }
        Set<String> set = locDetls.stream().map(LocDetl::getMatnr).collect(Collectors.toSet());
        List<Mat> matList = matService.selectList(new EntityWrapper<Mat>().in("matnr", set));
        if (Objects.isNull(matList) || matList.isEmpty()) {
            throw new CoolException("物料库不存在该物料!!");
        }
        Set<Long> longs = matList.stream().map(Mat::getTagId).collect(Collectors.toSet());
        if (!longs.isEmpty() && longs.size() > 1) {
            throw new CoolException("物料类型不一致,请检查数据是否正确!!");
        }
//        Set<String> set = locDetls.stream().map(LocDetl::getMatnr).collect(Collectors.toSet());
//        List<Mat> matList = matService.selectList(new EntityWrapper<Mat>().in("matnr", set));
//
//        if (Objects.isNull(matList) || matList.isEmpty()) {
//            throw new CoolException("物料库不存在该物料!!");
//        }
//        Set<Long> longs = matList.stream().map(Mat::getTagId).collect(Collectors.toSet());
//        if (!longs.isEmpty() && longs.size() > 1) {
//            throw new CoolException("物料类型不一致,请检查数据是否正确!!");
//        }
        //获取立库区信息
        BasAreas one = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_CRN.type));
@@ -2182,7 +2209,7 @@
     * @version 1.0
     */
    @Transactional(rollbackFor = Exception.class)
    public void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId) {
    public synchronized void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId) {
        List<WaitPakin> pakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode));
        if (Objects.isNull(pakins) || pakins.isEmpty()) {
            throw new CoolException("组托信息不存在!!");