1
12 小时以前 34503a2e9a29418346a4ac8f84170ab8f4321d6e
rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/phyz/ERPController.java
@@ -41,7 +41,6 @@
    @Autowired(required = false)
    private WmsServerFeignClient wmsServerFeignClient;
    @ApiOperation("仓库信息同步")
    @PostMapping("/wareHouse/sync")
    public CommonResponse syncWareHouse(@RequestBody Object objParams) {
@@ -56,7 +55,11 @@
        JSONArray params = paramsFormat(objParams);
        List<Warehouse> warehouseList = JSON.parseArray(params.toJSONString(), Warehouse.class);
        // 数据处理,转发server
        return CommonResponse.ok();
        String resultMsg = erpReportService.syncWareHouse(warehouseList);
        if ("200".equals(resultMsg)){
            return  CommonResponse.ok(resultMsg);
        }
        return CommonResponse.error(resultMsg);
    }
    @ApiOperation("物料信息同步")
@@ -73,7 +76,11 @@
        JSONArray params = paramsFormat(objParams);
        List<Material> materialList = JSON.parseArray(params.toJSONString(), Material.class);
        // 数据处理,转发server
        return CommonResponse.ok();
        String resultMsg = erpReportService.syncMaterial(materialList);
        if ("200".equals(resultMsg)){
            return  CommonResponse.ok(resultMsg);
        }
        return CommonResponse.error(resultMsg);
    }
    @ApiOperation("客户信息同步")
@@ -90,7 +97,11 @@
        JSONArray params = paramsFormat(objParams);
        List<Customer> customerList = JSON.parseArray(params.toJSONString(), Customer.class);
        // 数据处理,转发server
        return CommonResponse.ok();
        String resultMsg = erpReportService.syncCustomer(customerList);
        if ("200".equals(resultMsg)){
            return  CommonResponse.ok(resultMsg);
        }
        return CommonResponse.error(resultMsg);
    }
    @ApiOperation("供应商信息同步")
@@ -107,7 +118,11 @@
        JSONArray params = paramsFormat(objParams);
        List<Supplier> supplierList = JSON.parseArray(params.toJSONString(), Supplier.class);
        // 数据处理,转发server
        return CommonResponse.ok();
        String resultMsg = erpReportService.syncSupplier(supplierList);
        if ("200".equals(resultMsg)){
            return  CommonResponse.ok(resultMsg);
        }
        return CommonResponse.error(resultMsg);
    }
    @ApiOperation("入/出库任务通知单")
@@ -129,13 +144,57 @@
            String i = erpReportService.addOrderToServer(order);
            if (i.equals("200")){
                errorMsg.append(order.getOrderNo()+"下发成功;");
                if (orderList.size()==1){
                    return CommonResponse.ok(errorMsg.toString());
                }
            } else {
                errorMsg.append(order.getOrderNo()+"下发失败,原因:"+i+";");
                if (orderList.size()==1){
                    return CommonResponse.error(errorMsg.toString());
                }
            }
        }
        return CommonResponse.ok(errorMsg.toString());
    }
    @ApiOperation("入/出库任务通知单(新链路)")
    @PostMapping("/order/add/new")
    public CommonResponse addOrderNew(@RequestBody Object objParams) {
        if (Objects.isNull(objParams)) {
            throw new CoolException("参数不能为空!!");
        }
        if (SIMULATED_DATA_ENABLE.equals("1")) {
            return CommonResponse.ok();
        }
        JSONArray params = paramsFormat(objParams);
        List<Order> orderList = JSON.parseArray(params.toJSONString(), Order.class);
        StringBuffer msg = new StringBuffer();
        boolean allSuccess = true;
        for (Order order : orderList) {
            String result = erpReportService.addOrderToServerNew(order);
            if ("200".equals(result)) {
                msg.append(order.getOrderNo()).append("下发成功;");
            } else {
                allSuccess = false;
                msg.append(order.getOrderNo()).append("下发失败,原因:").append(result).append(";");
            }
        }
        return allSuccess ? CommonResponse.ok(msg.toString()) : CommonResponse.error(msg.toString());
    }
    @ApiOperation("订单信息上报(新链路)")
    @PostMapping("/report/order/new")
    public CommonResponse reportOrderNew(@RequestBody Object objParams) {
        if (Objects.isNull(objParams)) {
            throw new CoolException("参数不能为空!!");
        }
        if (SIMULATED_DATA_ENABLE.equals("1")) {
            return CommonResponse.ok();
        }
        return erpReportService.reportOrderNew(objParams);
    }
    @ApiOperation("入/出库任务通知单取消")
    @PostMapping("/order/cancel")
    public CommonResponse cancelOrder(@RequestBody Object objParams) {