cp
2024-11-05 40caddc08252ad3276832a14a69cfaf9f71b08c8
zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/MobileController.java
@@ -66,16 +66,28 @@
    @Autowired
    private MatService matService;
    /**
     * 平庫上架
     * @param locNo
     * @param barcode
     * @return
     */
    @RequestMapping("/pda/WarehouseIn")
    @ManagerAuth
    public R WarehouseIn(@RequestParam String locNo, @RequestParam String barcode) {
        return mobileService.WarehouseIn(locNo, barcode, getHostId());
        return mobileService.WarehouseIn(locNo, barcode, getHostId(), getUserId());
    }
    /**
     * 平庫下架
     * @param combParam
     * @return
     */
    @RequestMapping("/pda/WarehouseOut")
    @ManagerAuth
    public R WarehouseOut(@RequestBody CombParam combParam) {
        return mobileService.WarehouseOut(combParam, getHostId());
        return mobileService.WarehouseOut(combParam, getHostId(), getUserId());
    }
    @RequestMapping("/outBound/mat/list")
@@ -520,6 +532,57 @@
        return R.ok().add(maps);
    }
    @RequestMapping("/outBound/order/list")
    @ManagerAuth(memo = "获取出库订单")
    public R outBound(@RequestParam(required = false) String matnr,@RequestParam(required = false) String orderNo){
        List<DocType> docTypes = docTypeService.list(new LambdaQueryWrapper<DocType>().like(DocType::getPakout, 1));
        ArrayList<Long> typeList = new ArrayList<>();
        for (DocType docType : docTypes) {
            typeList.add(docType.getDocId());
        }
        LambdaQueryWrapper<Order> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Order::getStatus, 1);
        wrapper.eq(Order::getHostId, getHostId());
        wrapper.in(Order::getDocType, typeList);
        List<Order> orders = orderService.list(wrapper);
        ArrayList<Long> orderIds = new ArrayList<>();
        for (Order order : orders) {
            orderIds.add(order.getId());
        }
        //搜索明细
        LambdaQueryWrapper<OrderDetl> wrapper1 = new LambdaQueryWrapper<>();
        wrapper1.eq(OrderDetl::getStatus, 1);
        wrapper1.eq(OrderDetl::getHostId, getHostId());
        wrapper1.in(OrderDetl::getOrderId, orderIds);
        if (!Cools.isEmpty(matnr)) {
            wrapper1.like(OrderDetl::getMatnr, matnr);
        }
        List<OrderDetl> list = orderDetlService.list(wrapper1);
        ArrayList<PickMatParam> maps = new ArrayList<>();
        for (OrderDetl orderDetl : list) {
            //剩余可用数量
            double count = orderDetl.getAnfme() - orderDetl.getWorkQty();
            if (count <= 0) {
                continue;
            }
            PickMatParam matParam = new PickMatParam();
            matParam.setMatnr(orderDetl.getMatnr());
            matParam.setBatch(orderDetl.getBatch());
            matParam.setOrderNo(orderDetl.getOrderNo());
            matParam.setOrderId(orderDetl.getOrderId());
            matParam.setCount(count);
            matParam.setUseCount(count);
            maps.add(matParam);
        }
        return R.ok().add(maps);
    }
    @RequestMapping("/pick/in")
    @ManagerAuth(memo = "并板入库")
    @Transactional
@@ -620,8 +683,13 @@
                throw new CoolException("保存工作档明细失败");
            }
            Order order = orderService.selectByNo(matParam.getOrderNo(), getHostId());
            if (order == null) {
                throw new CoolException("Order is not exits");
            }
            //更新订单工作数量
            orderDetlService.increaseWorkQtyByOrderNo(matParam.getOrderNo(), matParam.getMatnr(), matParam.getBatch(), matParam.getUseCount(), getHostId());
            orderService.updateSettle(order.getId(), 2L, getUserId(), getHostId());
        }
        // 修改库位状态:   F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中
        locMast = locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo, param.getLocNo()).eq(LocMast::getHostId, getHostId()));