|
|
@@ -16,10 +16,12 @@ import zs.payment.req.*;
|
|
|
import zs.payment.entity.Orders;
|
|
|
import zs.payment.req.aftersales.AfterSalesOrderReq;
|
|
|
import zs.payment.req.aftersales.AfterSalesOrderTypeReq;
|
|
|
+import zs.payment.req.storage.StoragePageReq;
|
|
|
import zs.payment.resp.Result;
|
|
|
import zs.payment.service.OrdersService;
|
|
|
import zs.payment.utils.HttpUtil;
|
|
|
import zs.payment.utils.RedisUtils;
|
|
|
+import zs.payment.dto.OrderDetailDTO;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.HashMap;
|
|
|
@@ -154,15 +156,18 @@ public class YxSupplyChannelManualController {
|
|
|
log.info("查看商品详情失败,{}",req.getIds());
|
|
|
return Result.fail(respJson.getString("msg"));
|
|
|
}
|
|
|
- //添加到我的选品库
|
|
|
- resp = HttpUtil.restTemplatePost(prefixUrl + "/supplyapi/app/product/storage/addStorage", params, headers);
|
|
|
- JSONObject respJson2 = JSONObject.parseObject(resp);
|
|
|
- if (respJson2.getIntValue("code") != 0) {
|
|
|
- log.info("添加选品库失败,{}",req.getIds());
|
|
|
- return Result.fail(respJson2.getString("msg"));
|
|
|
- }
|
|
|
|
|
|
- return Result.success(respJson.getJSONObject("data"));
|
|
|
+ List<OrderDetailDTO> list = JSONObject.parseArray(
|
|
|
+ respJson.getJSONObject("data").getJSONArray("list").toJSONString(),
|
|
|
+ OrderDetailDTO.class
|
|
|
+ );
|
|
|
+
|
|
|
+ //todo 导入到企云商城
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return Result.success(list);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -432,10 +437,10 @@ public class YxSupplyChannelManualController {
|
|
|
JSONObject reqJson = JSONObject.parseObject(JSONObject.toJSONString(req));
|
|
|
String messageType = reqJson.getString("message_type");
|
|
|
//当 message_type == 商品类的事件 时跳过保存,其他类型才入库
|
|
|
- if (CallbackMessageType.GOODS_ALTER.equalsIgnoreCase(messageType) || CallbackMessageType.GOODS_UNDERCARRIAGE.equalsIgnoreCase(messageType)
|
|
|
- || CallbackMessageType.GOODS_ON_SALE.equalsIgnoreCase(messageType) || CallbackMessageType.GOODS_DELETE.equalsIgnoreCase(messageType)) {
|
|
|
- return result;
|
|
|
- }
|
|
|
+// if (CallbackMessageType.GOODS_ALTER.equalsIgnoreCase(messageType) || CallbackMessageType.GOODS_UNDERCARRIAGE.equalsIgnoreCase(messageType)
|
|
|
+// || CallbackMessageType.GOODS_ON_SALE.equalsIgnoreCase(messageType) || CallbackMessageType.GOODS_DELETE.equalsIgnoreCase(messageType)) {
|
|
|
+// return result;
|
|
|
+// }
|
|
|
|
|
|
//售后通过
|
|
|
if (CallbackMessageType.AFTER_SALES_PASS.equalsIgnoreCase(messageType)) {
|
|
|
@@ -449,4 +454,36 @@ public class YxSupplyChannelManualController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //================选品===========================
|
|
|
+ //我的选品库
|
|
|
+ @PostMapping("/getMyStorageIdsList")
|
|
|
+ public Result getMyStorageIdsList(@Valid @RequestBody StoragePageReq req){
|
|
|
+ String token = redisUtils.get(SUPPLY_TOKEN);
|
|
|
+ if (token == null || token.isEmpty()) {
|
|
|
+ Result tokenResult = fetchAndCacheToken();
|
|
|
+ if (!tokenResult.isSuccess()) {
|
|
|
+ return tokenResult;
|
|
|
+ }
|
|
|
+ token = (String) tokenResult.getBody().get("token");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("page", req.getPage());
|
|
|
+ params.put("pageSize",req.getPageSize());
|
|
|
+ params.put("create_sort",req.getCreateSort());
|
|
|
+
|
|
|
+ Map<String, String> headers = new HashMap<>();
|
|
|
+ headers.put("x-token", token);
|
|
|
+
|
|
|
+ String resp = HttpUtil.restTemplatePost(prefixUrl + "/supplyapi/app/product/storage/getMyStorageIdsList", params, headers);
|
|
|
+ JSONObject respJson = JSONObject.parseObject(resp);
|
|
|
+ if (respJson.getIntValue("code") != 0) {
|
|
|
+ return Result.fail(respJson.getString("msg"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return Result.success(respJson.getJSONObject("data"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|