自动化立体仓库 - WMS系统
zhangc
2025-02-18 874dac1bb34cc7ef3b75f4c9306eb2a94f683f80
src/main/java/com/zy/asrs/controller/OrderDetlController.java
@@ -201,31 +201,34 @@
                         @RequestParam(required = false) String orderByField,
                         @RequestParam(required = false) String orderByType,
                         @RequestParam Map<String, Object> param) {
        //StopWatch stopWatch = new StopWatch();
        //stopWatch.start();
        EntityWrapper<OrderDetl> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        Object o = param.get("orderType");
        if (o != null) {
            String[] split = o.toString().split(",");
            wrapper.in("source", split);
            param.remove("orderType");
        }
        convertLike(param, wrapper);
        if (!Cools.isEmpty(orderByField)) {
            wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
        } else {
            wrapper.orderBy("create_time", false);
        }
        List<DocType> pakins = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakout", 1));
        List<Long> docIds = new ArrayList<>();
        for (DocType pakin : pakins) {
            if (pakin.getDocId() != 17 && pakin.getDocId() != 33 && pakin.getDocId() != 34 && pakin.getDocId() != 35) {
                docIds.add(pakin.getDocId());
            }
        }
        wrapper.in("source", docIds);
//        List<DocType> pakins = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakout", 1));
//        List<Long> docIds = new ArrayList<>();
//        for (DocType pakin : pakins) {
//            if (pakin.getDocId() != 17 && pakin.getDocId() != 33 && pakin.getDocId() != 34 && pakin.getDocId() != 35) {
//                docIds.add(pakin.getDocId());
//            }
//        }
//        wrapper.in("source", docIds);
        Page<OrderDetl> page = orderDetlService.selectPage(new Page<>(curr, limit), wrapper);
        for (OrderDetl record : page.getRecords()) {
            Double sumAnfme = agvLocDetlService.getSumAnfme(record.getMatnr(), record.getThreeCode());
            record.setStock(sumAnfme == null ? 0 : sumAnfme);
        }
        //stopWatch.stop();
        //System.out.println(stopWatch.getTotalTimeSeconds());
        return R.ok(page);
    }