|
|
|
@@ -22,7 +22,7 @@ public class TtWebProductServiceImpl implements TtWebProductService { |
|
|
|
@Override |
|
|
|
public String supplierSync(TtSupplierSync supplierSync) throws WxErrorException { |
|
|
|
final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin() + this.POST_SUPPLIER_SYNC; |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.POST_SUPPLIER_SYNC; |
|
|
|
String result = this.service.execute(executor, apiUrl, supplierSync.toJson()); |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result); |
|
|
|
return jsonObject.getString("supplier_id"); |
|
|
|
@@ -31,7 +31,7 @@ public class TtWebProductServiceImpl implements TtWebProductService { |
|
|
|
@Override |
|
|
|
public TtSupplierSyncQuery supplierQuery(String supplierExtId) throws WxErrorException { |
|
|
|
final TtWebGetRequestExecutor executor = new TtWebGetRequestExecutor(this.service.getRequestHttp()); |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin() + this.GET_SUPPLIER_QUERY; |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.GET_SUPPLIER_QUERY; |
|
|
|
JsonObject json = new JsonObject(); |
|
|
|
json.addProperty("supplier_ext_id",supplierExtId); |
|
|
|
String result = this.service.execute(executor, apiUrl, json.toString()); |
|
|
|
@@ -41,7 +41,7 @@ public class TtWebProductServiceImpl implements TtWebProductService { |
|
|
|
@Override |
|
|
|
public String spuSync(TtSpuSync spuSync) throws WxErrorException { |
|
|
|
final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin() + this.POST_SPU_SYNC; |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.POST_SPU_SYNC; |
|
|
|
String result = this.service.execute(executor, apiUrl, spuSync.toJson()); |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result); |
|
|
|
return jsonObject.getString("spu_id"); |
|
|
|
@@ -50,7 +50,7 @@ public class TtWebProductServiceImpl implements TtWebProductService { |
|
|
|
@Override |
|
|
|
public TtSpuStatusSync spuStatusSync(TtSpuStatusSync spuStatusSync) throws WxErrorException { |
|
|
|
final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin() + this.POST_SPU_STATUS_SYNC; |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.POST_SPU_STATUS_SYNC; |
|
|
|
String result = this.service.execute(executor, apiUrl, spuStatusSync.toJson()); |
|
|
|
TtSpuStatusSync ttSpuStatusSync = TtSpuStatusSync.fromJson(result); |
|
|
|
ttSpuStatusSync.setStatus(spuStatusSync.getStatus()); |
|
|
|
@@ -60,7 +60,7 @@ public class TtWebProductServiceImpl implements TtWebProductService { |
|
|
|
@Override |
|
|
|
public TtSpuGetResult spuGet(TtSpuGet spuGet) throws WxErrorException { |
|
|
|
final TtWebGetRequestExecutor executor = new TtWebGetRequestExecutor(this.service.getRequestHttp()); |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin() + this.GET_SPU_GET; |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.GET_SPU_GET; |
|
|
|
String result = this.service.execute(executor, apiUrl, spuGet.toString()); |
|
|
|
return TtSpuGetResult.fromJson(result); |
|
|
|
} |
|
|
|
@@ -68,7 +68,7 @@ public class TtWebProductServiceImpl implements TtWebProductService { |
|
|
|
@Override |
|
|
|
public boolean spuStockUpdate(TtSpuStockSync spuStockSync) throws WxErrorException { |
|
|
|
final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin() + this.POST_SPU_STOCK_UPDATE; |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.POST_SPU_STOCK_UPDATE; |
|
|
|
String result = this.service.execute(executor, apiUrl, spuStockSync.toJson()); |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result); |
|
|
|
String spuExtId = jsonObject.getString("spu_ext_id"); |
|
|
|
|