cp
2024-10-30 431f88fdade07a22b636714f1690cee3a55668d0
zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/MobileController.java
@@ -78,22 +78,93 @@
        return mobileService.WarehouseOut(combParam,getHostId());
    }
    @RequestMapping("/outBound/mat/list")
    @ManagerAuth
    public R WarehouseMat(@RequestParam String matnr, @RequestParam String orderNo) {
        if (Cools.isEmpty(matnr)) {
            R.error("品号不能为空");
        }
        ArrayList<PickMatParam> maps = new ArrayList<>();
        if (Cools.isEmpty(orderNo)) {
            List<OrderDetl> list = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>()
                    .eq(OrderDetl::getMatnr, matnr)
                    .orderByDesc(OrderDetl::getCreateTime));
            List<OrderDetl> orderDetls = new ArrayList<OrderDetl>();
            for (OrderDetl orderDetl : list
            ) {
                Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderDetl.getOrderNo()));
                if (!Cools.isEmpty(order)) {
                    DocType docType = docTypeService.getOne(new LambdaQueryWrapper<DocType>().eq(DocType::getDocId, order.getDocType()));
                    if (!Cools.isEmpty(docType) && docType.getPakout() == 1) {
                        double count = orderDetl.getAnfme() - orderDetl.getWorkQty();
                        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(maps);
        } else {
            List<OrderDetl> list = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>()
                    .eq(OrderDetl::getMatnr, matnr)
                    .like(OrderDetl::getOrderNo, orderNo)
                    .orderByDesc(OrderDetl::getCreateTime));
            for (OrderDetl orderDetl:list
                 ) {
                double count = orderDetl.getAnfme() - orderDetl.getWorkQty();
                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(maps);
        }
    }
    /**
     * 并板途中拣料
     *
     * @param combParam
     * @return
     */
    @RequestMapping("/pda/WarehouseOut/v1")
    @ManagerAuth
    public R WarehouseOutV1(@RequestBody CombParam combParam){
        return mobileService.WarehouseOutV1(combParam,getHostId());
        return mobileService.WarehouseOutV1(combParam, getHostId(), getUserId());
    }
    /**
     * 拣料途中并板
     *
     * @param param
     * @return
     */
    @RequestMapping("/pda/WarehouseOutPickMerge/v1")
    @ManagerAuth
    public R WarehouseOutPickMergeV1(@RequestBody WarehouseOutPickMergeParam param){
        return mobileService.WarehouseOutPickMergeV1(param, getHostId());
        return mobileService.WarehouseOutPickMergeV1(param, getHostId(),getUserId());
    }
    /**
     * 多次并板
     * @param param
     * @return
     */
    @RequestMapping("/pda/WarehouseOutMergeBoardMany/v1")
    @ManagerAuth
    public R WarehouseOutMergeBoardManyV1(@RequestBody WarehouseOutMergeBoardManyParam param){
        return mobileService.WarehouseOutMergeBoardMany(param, getHostId());
        return mobileService.WarehouseOutMergeBoardMany(param, getHostId(),getUserId());
    }
    @RequestMapping("/menu/pda/auth")
@@ -397,7 +468,7 @@
    @RequestMapping("/pick/mat/list")
    @ManagerAuth(memo = "获取并板物料")
    public R pickMats(@RequestParam(required = false) String matnr){
    public R pickMats(@RequestParam(required = false) String matnr, @RequestParam(required = false) String orderNo) {
        List<DocType> docTypes = docTypeService.list(new LambdaQueryWrapper<DocType>().like(DocType::getPakin, 1));
        ArrayList<Long> typeList = new ArrayList<>();
        for (DocType docType : docTypes) {
@@ -420,10 +491,13 @@
        wrapper1.eq(OrderDetl::getStatus, 1);
        wrapper1.eq(OrderDetl::getHostId, getHostId());
        wrapper1.in(OrderDetl::getOrderId, orderIds);
        wrapper1.orderByDesc(OrderDetl::getCreateTime);
        if (!Cools.isEmpty(matnr)) {
            wrapper1.like(OrderDetl::getMatnr, matnr);
        }
        if (!Cools.isEmpty(orderNo)) {
            wrapper1.like(OrderDetl::getOrderNo, orderNo);
        }
        List<OrderDetl> list = orderDetlService.list(wrapper1);
        ArrayList<PickMatParam> maps = new ArrayList<>();
@@ -576,14 +650,24 @@
                    .eq(WrkMast::getWrkSts, 199L)
                    .eq(WrkMast::getIoType, 104));
            wrkMastArrayList.addAll(wrkMasts);
            List<WrkMast> wrkMasts1 = wrkMastService.list(new LambdaQueryWrapper<WrkMast>()
                    .eq(WrkMast::getHostId, getHostId())
                    .eq(WrkMast::getWrkSts, 199L)
                    .eq(WrkMast::getIoType, 107));
            wrkMastArrayList.addAll(wrkMasts1);
        } else {
            List<WrkMast> wrkMasts = wrkMastService.list(new LambdaQueryWrapper<WrkMast>()
                    .like(WrkMast::getBarcode, barcode)
                    .eq(WrkMast::getHostId, getHostId())
                    .eq(WrkMast::getWrkSts, 199L)
                    .eq(WrkMast::getIoType, 104)
            );
                    .eq(WrkMast::getIoType, 104));
            wrkMastArrayList.addAll(wrkMasts);
            List<WrkMast> wrkMasts1 = wrkMastService.list(new LambdaQueryWrapper<WrkMast>()
                    .like(WrkMast::getBarcode, barcode)
                    .eq(WrkMast::getHostId, getHostId())
                    .eq(WrkMast::getWrkSts, 199L)
                    .eq(WrkMast::getIoType, 107));
            wrkMastArrayList.addAll(wrkMasts1);
        }
        return R.ok().add(wrkMastArrayList);
@@ -600,6 +684,11 @@
                    .eq(WrkMast::getWrkSts, 199L)
                    .eq(WrkMast::getIoType, 103));
            wrkMastArrayList.addAll(wrkMasts);
            List<WrkMast> wrkMasts1 = wrkMastService.list(new LambdaQueryWrapper<WrkMast>()
                    .eq(WrkMast::getHostId, getHostId())
                    .eq(WrkMast::getWrkSts, 199L)
                    .eq(WrkMast::getIoType, 107));
            wrkMastArrayList.addAll(wrkMasts1);
        } else {
            List<WrkMast> wrkMasts = wrkMastService.list(new LambdaQueryWrapper<WrkMast>()
                    .like(WrkMast::getBarcode, barcode)
@@ -608,6 +697,12 @@
                    .eq(WrkMast::getIoType, 103)
            );
            wrkMastArrayList.addAll(wrkMasts);
            List<WrkMast> wrkMasts1 = wrkMastService.list(new LambdaQueryWrapper<WrkMast>()
                    .like(WrkMast::getBarcode, barcode)
                    .eq(WrkMast::getHostId, getHostId())
                    .eq(WrkMast::getWrkSts, 199L)
                    .eq(WrkMast::getIoType, 107));
            wrkMastArrayList.addAll(wrkMasts1);
        }
        return R.ok().add(wrkMastArrayList);