自动化立体仓库 - WMS系统
zyx
2024-05-16 4078d04a5ba8939886721ac47905c3c924ee1e64
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -288,9 +288,12 @@
            return R.parse(BaseRes.PARAM);
        }
        openService.syncOrder(param,true,"采购入库单");
        String docName = param.getChildren().get(0).getIQuantity() > 0 ? "银座采购入库单" : "银座采购退货单";
        boolean pakin = param.getChildren().get(0).getIQuantity() > 0 ? true : false;
        return R.ok("入库单据接受成功");
        openService.syncOrder(param,pakin,docName);
        return R.ok("单据接受成功");
    }
@@ -304,12 +307,22 @@
        if (Cools.isEmpty(param)) {
            return R.parse(BaseRes.PARAM);
        }
        if(!Cools.eq("生产",param.getCVouchtype())){
            String docName = param.getIQuantity() > 0 ?  "银座委外入库单" : "银座委外入库退货单";
            boolean pakin = param.getIQuantity() > 0 ? true : false;
            mappingPakInOrderParam(param,pakin,docName);
        openService.syncOrder(mappingPakInOrderParam(param),true,"生产入库单");
        openService.syncOrder(mappingPakOutOrderParam(param),false,"生产出库单");
            String docName1 = param.getChildren().get(0).getIQuantity() > 0 ?  "银座委外材料出库单" : "银座委外材料退料单";
            boolean pakin1 = param.getChildren().get(0).getIQuantity() > 0 ? true : false;
            mappingPakOutOrderParam(param,pakin1,docName1);
        }else {
            String docName1 = param.getChildren().get(0).getIQuantity() > 0 ?  "银座生产材料出库单" : "银座生产材料退料单";
            boolean pakin1 = param.getChildren().get(0).getIQuantity() > 0 ? true : false;
            mappingPakOutOrderParam(param,pakin1,docName1);
        }
        return R.ok("出库单据接受成功");
        return R.ok("单据接受成功");
    }
@@ -333,19 +346,20 @@
    }
    private OrderSyncParam mappingPakInOrderParam(OrderProdSyncParam param){
    private void mappingPakInOrderParam(OrderProdSyncParam param,boolean pakin,String docName){
        //生成单据主体
        OrderSyncParam orderSyncParam = new OrderSyncParam();
        orderSyncParam.setCPOID(param.getOrderNoT());
        orderSyncParam.set操作系统号(param.get操作系统号());
        orderSyncParam.setcPOID(param.getOrderNoT());
        orderSyncParam.setDdate(param.getOrderTime());
        orderSyncParam.setCMemo("");
        orderSyncParam.setcMemo(param.getCMemo());
        //生成单据明细
        OrderSyncParam.OrderDetl orderDetl = new OrderSyncParam.OrderDetl();
        orderDetl.setCInvCode(param.getCInvCode());
        orderDetl.setIQuantity(param.getIQuantity());
        orderDetl.setcInvCode(param.getCInvCode());
        orderDetl.setiQuantity(param.getIQuantity());
        orderDetl.setCsocode(param.getCsocode());
        orderDetl.setBFree1(null);
        orderDetl.setbFree1(param.getBFree1());
        //添加单据明细到单据主体
        List<OrderSyncParam.OrderDetl> orderDetls = new ArrayList<>();
@@ -353,34 +367,44 @@
        orderSyncParam.setChildren(orderDetls);
        return orderSyncParam;
//        String docName = param.getIQuantity() > 0 ?  "银座产品生产入库单" : "入库退回单";
//        boolean pakin = param.getIQuantity() > 0 ? true : false;
        openService.syncOrder(orderSyncParam,pakin,docName);
        //return orderSyncParam;
    }
    private OrderSyncParam mappingPakOutOrderParam(OrderProdSyncParam param){
    private void mappingPakOutOrderParam(OrderProdSyncParam param,boolean pakin,String docName){
        OrderSyncParam orderSyncParam = new OrderSyncParam();
        List<OrderProdSyncParam.ChildInfo> child = param.getChild();
        List<OrderProdSyncParam.ChildInfo> child = param.getChildren();
        //生成单据主体
        orderSyncParam.setCPOID(child.get(0).getOrderNoT());
        orderSyncParam.set操作系统号(param.get操作系统号());
        orderSyncParam.setcPOID(child.get(0).getOrderNoT());
        orderSyncParam.setDdate(param.getOrderTime());
        orderSyncParam.setCMemo("");
        orderSyncParam.setcMemo("");
        //生成单据明细
        List<OrderSyncParam.OrderDetl> orderDetls = new ArrayList<>();
        for(OrderProdSyncParam.ChildInfo childInfo : child){
            OrderSyncParam.OrderDetl orderDetl = new OrderSyncParam.OrderDetl();
            orderDetl.setCInvCode(childInfo.getCInvCode());
            orderDetl.setIQuantity(childInfo.getIQuantity());
            orderDetl.setcInvCode(childInfo.getCInvCode());
            orderDetl.setiQuantity(childInfo.getIQuantity());
            orderDetl.setCsocode(param.getCsocode());
            orderDetl.setBFree1(childInfo.getBFree1());
            orderDetl.setbFree1(childInfo.getBFree1());
            orderDetl.setID(childInfo.getIDs() + "");
            orderDetl.setIvouchrowno(childInfo.getIvouchrowno());
            orderDetls.add(orderDetl);
        }
        orderSyncParam.setChildren(orderDetls);
        return orderSyncParam;
        openService.syncOrder(orderSyncParam,false,docName);
        //return orderSyncParam;
    }
}