自动化立体仓库 - WMS系统
#
zhou zhou
12 小时以前 1b3cb17b50e9f0bca21d19c7d621d94e3e6270ed
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1333,22 +1333,10 @@
    @Transactional(rollbackFor = Exception.class)
    public R OutCallAgv(AgvCallParams params, Long userId) {
        BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
                .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
                .eq("dev_no", params.getTarSite()));
        if (Objects.isNull(station)) {
            throw new CoolException("请检查站点信息!");
        }
        /** 获取入库最早的一条数据 **/
        /**获取入库最早的一条数据**/
        List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>()
                .eq("loc_sts", LocStsType.LOC_STS_TYPE_F.type)
                .eq("frozen", 0)
                .in("loc_no", new EntityWrapper<LocDetl>()
                        .setSqlSelect("DISTINCT loc_no")
                        .in("matnr", new EntityWrapper<Mat>()
                                .setSqlSelect("matnr")
                                .eq("tag_id", station.getCtnType())))
                .orderDesc(Arrays.asList("sort", "first_time")));
        if (locCaches.isEmpty()) {
@@ -1356,9 +1344,8 @@
        }
        for (LocCache locCache : locCaches) {
            // 获取缓存区信息
            BasAreas basAreas = basAreasService.selectOne(
                    new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type));
            //获取缓存区信息
            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("库区不存在!!");
            }
@@ -1382,19 +1369,18 @@
            Mat mat = matList.stream().findFirst().get();
//            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
//                    .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
//                    .eq("ctn_type", mat.getTagId())
//                    .eq("dev_no", params.getTarSite()));
            if (mat.getTagId() != station.getCtnType().longValue()){
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
                    .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
                    .eq("ctn_type", mat.getTagId())
                    .eq("dev_no", params.getTarSite()));
            if (Objects.isNull(station)) {
                continue;
            }
            /** 生成缓存区出库任务 */
            /**生成缓存区出库任务*/
            generateCacheOutTask(station, locCache, userId);
            /** 生成立库出库任务 */
            /**生成立库出库任务*/
            generateCRNOutTask(station, locCache, userId);
            return R.ok();
@@ -1695,8 +1681,7 @@
                throw new CoolException("明细内容不存在!!");
            }
            Double v = Math.round((stationDetl.getAnfme() - stationDetl.getWorkQty()) * 10000) / 10000.0;
            Double v = stationDetl.getAnfme() - stationDetl.getWorkQty();
            if (detlDto.getAnfme().compareTo(v) > 0) {
                throw new CoolException("组托上限为:" + stationDetl.getAnfme() + ", 已组托:" + stationDetl.getWorkQty() + ", 还可组托:" + v);
            }
@@ -1727,7 +1712,7 @@
                throw new CoolException("保存入库通知档失败");
            }
            Double v1 = Math.round((stationDetl.getWorkQty() + detlDto.getAnfme()) * 10000) / 10000.0 ;
            Double v1 = stationDetl.getWorkQty() + detlDto.getAnfme();
            stationDetl.setWorkQty(v1);
            if (!basStationDetlService.updateById(stationDetl)) {
@@ -1737,19 +1722,6 @@
            if (v1.compareTo(stationDetl.getWorkQty()) >= 0) {
                if (!basStationDetlService.deleteById(stationDetl)) {
                    throw new CoolException("原始数据移除失败!");
                }
            }
            List<BasStationDetl> devNo = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>().eq("dev_no", stationDetl.getDevNo()));
            if (Objects.isNull(devNo) || devNo.isEmpty()) {
                BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
                        .eq("loc_sts", LocStsType.LOC_STS_TYPE_F.type)
                        .eq("dev_no", stationDetl.getDevNo()));
                if (!Objects.isNull(station)) {
                    station.setLocSts(LocStsType.LOC_STS_TYPE_D.type);
                    if (!basStationService.updateById(station)) {
                        throw new CoolException("站点状态修改失败~!!");
                    }
                }
            }
@@ -1792,11 +1764,11 @@
            throw new CoolException("站点不存在!!");
        }
//        station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
//        if (!basStationService.updateById(station)) {
//            throw new CoolException("站点状态修改失败!");
//        }
//        basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()));
        station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
        if (!basStationService.updateById(station)) {
            throw new CoolException("站点状态修改失败!");
        }
        basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()));
//        // 任务完成
//        task.setWrkSts(15L);
@@ -1853,6 +1825,7 @@
                Mat mat = matService.selectByMatnr(combMat.getMatnr());
                BeanUtils.copyProperties(mat, basStationDetl);
                basStationDetl
                        .setId(null)
                        .setOrderNo(orderPakin.getOrderNo())
                        .setDevNo(basStation.getDevNo())
                        .setBarcode(params.getTarBarcode())
@@ -1989,7 +1962,6 @@
        waitPakins.forEach(waitPakin -> {
            WrkDetl wrkDetl = new WrkDetl();
            wrkDetl.sync(waitPakin);
            wrkDetl.setSuppCode(waitPakin.getSuppCode());
            wrkDetl.setWrkNo(wrkMast.getWrkNo());
            wrkDetl.setIoTime(wrkMast.getIoTime());
            wrkDetl.setAppeTime(now);