|
|
@@ -35,16 +35,9 @@ public class ProductUtils {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public static List<Long> update(List<Product> products) throws Exception {
|
|
|
- HashMap<String, Object> params = new HashMap<>();
|
|
|
- params.put("data", FlexJsonUtils.toJsonDeep(products));
|
|
|
- Response res = HttpUtil.sendPostRequest(PRODUCT_PUBLIC_SERVICE_URL + "/product/update/b2b", params);
|
|
|
- if (HttpStatus.OK.value() == res.getStatusCode()) {
|
|
|
- if (null != res.getResponseText()) {
|
|
|
- // 保存成功物料的id
|
|
|
- return JSON.parseArray(res.getResponseText(), Long.class);
|
|
|
- }
|
|
|
- } else {
|
|
|
- throw new RuntimeException("更新物料失败");
|
|
|
+ String res = HttpUtil.doPost(PRODUCT_PUBLIC_SERVICE_URL + "/product/update/b2b", FlexJsonUtils.toJsonDeep(products));
|
|
|
+ if (null == res) {
|
|
|
+ throw new RuntimeException("更新物料失败");
|
|
|
}
|
|
|
return null;
|
|
|
}
|