cp
2024-10-30 431f88fdade07a22b636714f1690cee3a55668d0
zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/LocDetlController.java
@@ -48,15 +48,28 @@
    @RequestMapping(value = "/locDetl/forlocNo/auth/v1")
    @ManagerAuth
    public R forlocNoV1(@RequestParam String locNo) {
        LambdaQueryWrapper<LocDetl> locDetlLambdaQueryWrapper = new LambdaQueryWrapper<LocDetl>()
                .eq(LocDetl::getLocNo, locNo)
                .eq(LocDetl::getHostId, getHostId());
        List<LocDetl> detls = locDetlService.list(locDetlLambdaQueryWrapper);
        if (Cools.isEmpty(detls)){
            return R.error("未查询到库存数据");
    public R forlocNoV1(@RequestParam String locNo,@RequestParam String matnr) {
        if(Cools.isEmpty(matnr)){
            LambdaQueryWrapper<LocDetl> locDetlLambdaQueryWrapper = new LambdaQueryWrapper<LocDetl>()
                    .eq(LocDetl::getLocNo, locNo)
                    .eq(LocDetl::getHostId, getHostId());
            List<LocDetl> detls = locDetlService.list(locDetlLambdaQueryWrapper);
            if (Cools.isEmpty(detls)){
                return R.error("未查询到库存数据");
            }
            return R.ok(detls);
        }else{
            LambdaQueryWrapper<LocDetl> locDetlLambdaQueryWrapper = new LambdaQueryWrapper<LocDetl>()
                    .eq(LocDetl::getLocNo, locNo)
                    .eq(LocDetl::getHostId, getHostId())
                    .like(LocDetl::getMatnr,matnr);
            List<LocDetl> detls = locDetlService.list(locDetlLambdaQueryWrapper);
            if (Cools.isEmpty(detls)){
                return R.error("未查询到库存数据");
            }
            return R.ok(detls);
        }
        return R.ok(detls);
    }
    @RequestMapping(value = "/locDetl/forlocNo/auth")
@@ -150,12 +163,6 @@
                  @RequestParam(required = false) String timeRange,
                  @RequestParam Map<String, Object> param) {
        QueryWrapper<LocDetl> wrapper = new QueryWrapper<>();
        Object barcode = null;
        if (!Cools.isEmpty(param.get("barcode"))) {
            barcode = param.get("barcode");
        }
        param.remove("zpallet");
        param.remove("barcode");
        if (!Cools.isEmpty(param.get("decrees"))) {
            ArrayList<String> mats = new ArrayList<>();
@@ -167,7 +174,6 @@
                    mats.add(mat.getMatnr());
                }
            }
            wrapper.in("matnr", mats);
            param.remove("decrees");
        }
@@ -183,18 +189,16 @@
            wrapper.le("appe_time", DateUtils.convert(range[1]));
        }
        if (!Cools.isEmpty(param.get("locNo"))) {
            wrapper.eq("loc_no", param.get("locNo"));
            wrapper.like("loc_no", param.get("locNo"));
        }
        if (!Cools.isEmpty(barcode)) {
            wrapper.eq("zpallet", barcode);
        if (!Cools.isEmpty(param.get("zpallet"))) {
            wrapper.like("zpallet", param.get("zpallet"));
        }
        if (!Cools.isEmpty(orderByField)){
            wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));
        }
        param.remove("locNo");
        param.remove("owner");