自动化立体仓库 - WMS系统
zhou zhou
2025-12-19 b0d80cc56a883a6fac242623e778a3ae20c71b79
src/main/java/com/zy/asrs/controller/OrderPakinController.java
@@ -42,6 +42,27 @@
    private WrkMastService wrkMastService;
    @Autowired
    private WrkMastLogService wrkMastLogService;
    @Autowired
    private ClientService clientService;
    @RequestMapping(value = "/order/list/pda/page/auth")
    @ManagerAuth
    public R pdaPageList(@RequestParam(required = true)Long tagId,
                         @RequestParam(defaultValue = "1")Integer curr,
                         @RequestParam(defaultValue = "10")Integer limit){
        List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakin", 1));
        ArrayList<Integer> arrayList = new ArrayList<>();
        docTypes.forEach(docType -> {
            arrayList.add(docType.getDocId().intValue());
        });
        EntityWrapper<OrderPakin> wrapper = new EntityWrapper<>();
//        wrapper.eq("tag_id", tagId);
        wrapper.in("doc_type", arrayList);
        wrapper.in("settle",1,2);
        wrapper.orderBy("create_time", false);
        Page<OrderPakin> orderPage = orderService.selectPage(new Page<>(curr, limit), wrapper);
        return R.ok().add(orderPage);
    }
    @RequestMapping(value = "/order/nav/list/auth")
    @ManagerAuth
@@ -112,19 +133,23 @@
        if (order != null) {
            return R.error("单据编号已存在");
        }
        Client client = clientService.selectOne(new EntityWrapper<Client>().eq("name", param.getCstmrName()));
        if (null == client){
            return R.error("客户不存在");
        }
        Date now = new Date();
        order = new OrderPakin(
                String.valueOf(snowflakeIdWorker.nextId()),    // 编号[非空]
                param.getOrderNo(),    // 订单编号
                DateUtils.convert(now),    // 单据日期
                param.getOrderTime(),    // 单据日期
                param.getDocType(),    // 单据类型
                null,    // 项目编号
                null,    //
                null,    // 调拨项目编号
                null,    // 初始票据号
                null,    // 票据号
                null,    // 客户编号
                null,    // 客户
                client.getCode(),    // 客户编号
                client.getName(),    // 客户
                null,    // 联系方式
                null,    // 操作人员
                null,    // 合计金额
@@ -194,14 +219,23 @@
        }
        Date now = new Date();
        Long userId = getUserId();
        Client client = clientService.selectOne(new EntityWrapper<Client>().eq("name", param.getCstmrName()));
        if (null == client){
            return R.error("客户不存在");
        }
        order.setCstmr(client.getCode());
        order.setCstmrName(client.getName());
        // 修改主档
        if (!param.getDocType().equals(order.getDocType())) {
        if (!param.getDocType().equals(order.getDocType()) || !param.getOrderTime().equals(order.getOrderTime())) {
            order.setDocType(param.getDocType());
            order.setUpdateBy(userId);
            order.setUpdateTime(now);
            if (!orderService.updateById(order)) {
                throw new CoolException("修改订单类型失败");
            }
            order.setOrderTime(param.getOrderTime());
        }
        order.setUpdateBy(userId);
        order.setUpdateTime(now);
        if (!orderService.updateById(order)) {
            throw new CoolException("修改订单类型失败");
        }
        // 修改明细档
//        List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
@@ -310,7 +344,7 @@
                .add("list", wrkTraceVos)
                .add("orderNo", order.getOrderNo())
                .add("totalQty", totalQty)
                .add("wrkQty", wrkQty + endQty)
                .add("wrkQty", wrkQty)
                .add("lackQty", lackQty)
                .add("endQty", endQty)
        );