| | |
| | | private String wmsUrl; |
| | | |
| | | public Result replenish(List<ReplenishDto> dtos) { |
| | | try { |
| | | ReplenishParam param = new ReplenishParam(); |
| | | param.setList(dtos); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/open/api/replenish") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | return JSON.parseObject(response, Result.class); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return new Result(500, "服务器异常", null); |
| | | } |
| | | return new Result(200, "操作成功", null); |
| | | } |
| | | |
| | | // public Result replenish(List<ReplenishDto> dtos) { |
| | | // try { |
| | | // ReplenishParam param = new ReplenishParam(); |
| | | // param.setList(dtos); |
| | | // String response = new HttpHandler.Builder() |
| | | // .setUri(wmsUrl) |
| | | // .setPath("/open/api/replenish") |
| | | // .setJson(JSON.toJSONString(param)) |
| | | // .build() |
| | | // .doPost(); |
| | | // return JSON.parseObject(response, Result.class); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // return new Result(500, "服务器异常", null); |
| | | // } |
| | | // } |
| | | |
| | | } |