自动化立体仓库 - WMS系统
#
zhou zhou
14 小时以前 5ed4c86f13606a64e32757b0e17bb0721f75f299
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1228,11 +1228,14 @@
     * @version 1.0
     */
    @Override
    @Transactional
    public synchronized R callAgvMove(AgvCallParams params, Long userId) {
        if (Objects.isNull(params.getOrgSite())) {
            throw new CoolException("源站点不能为空!!");
        }
        BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type));
        LocCache locCache = locCacheService.selectOne(new EntityWrapper<LocCache>()
                .eq("area_id",basAreas.getId())
                .eq("frozen", 0)
                .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
//                .eq("loc_no", params.getTarSite())
@@ -1242,7 +1245,12 @@
            throw new CoolException("请检查目标库位是否闲置中!!");
        }
        try {
        generateAgvTask("agv", locCache, params.getOrgSite(), params.getBarcode(), userId);
        }catch (Exception e) {
            throw new CoolException(e.getMessage());
        }
        return R.ok();
    }
@@ -2209,7 +2217,7 @@
     * @version 1.0
     */
    @Transactional(rollbackFor = Exception.class)
    public synchronized void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId) {
    public 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("组托信息不存在!!");
@@ -2245,11 +2253,10 @@
            throw new CoolException("保存工作档失败");
        }
        List<TaskDetl> taskDetls = new ArrayList<>();
        pakins.forEach(pakin -> {
        for (WaitPakin pakin :pakins){
            TaskDetl wrkDetl = new TaskDetl();
            BeanUtils.copyProperties(pakin, wrkDetl);
            wrkDetl.setWrkNo(workNo)
            wrkDetl.setId(null).setWrkNo(workNo)
                    .setIoTime(new Date())
                    .setOrderNo(pakin.getOrderNo())
                    .setAnfme(pakin.getAnfme())
@@ -2262,21 +2269,21 @@
                    .setModel(pakin.getModel())
                    .setAppeTime(new Date())
                    .setModiUser(userId);
            taskDetls.add(wrkDetl);
        });
        //保存工作档明细
        if (!taskDetlService.insertBatch(taskDetls)) {
            if (!taskDetlService.insert(wrkDetl)){
            throw new CoolException("保存工作档明细失败");
        }
        pakins.forEach(pakin -> {
            pakin.setIoStatus("Y");
        });
        }
        if (!waitPakinService.updateBatchById(pakins)) {
        for (WaitPakin pakin : pakins){
            pakin.setIoStatus("Y");
            if (!waitPakinService.updateById(pakin)) {
            throw new CoolException("更新组托信息失败");
        }
        }
        // 修改目标库位状态
        if (loc.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {