Commit a09ece2e authored by 黎博's avatar 黎博

修改/api/stock/getNewStockById接口json转对象数组逻辑

parent 0eb368d9
...@@ -5,8 +5,10 @@ import cn.qg.holmes.entity.mock.keystone.JdSellPriceRequest; ...@@ -5,8 +5,10 @@ import cn.qg.holmes.entity.mock.keystone.JdSellPriceRequest;
import cn.qg.holmes.entity.mock.keystone.JdSkuStateRequest; import cn.qg.holmes.entity.mock.keystone.JdSkuStateRequest;
import cn.qg.holmes.entity.mock.keystone.JdSkuStockRequest; import cn.qg.holmes.entity.mock.keystone.JdSkuStockRequest;
import cn.qg.holmes.entity.mock.keystone.ProductItem; import cn.qg.holmes.entity.mock.keystone.ProductItem;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -91,7 +93,8 @@ public class ProductController { ...@@ -91,7 +93,8 @@ public class ProductController {
@PostMapping("/api/stock/getNewStockById") @PostMapping("/api/stock/getNewStockById")
public JSONObject getNewStockById(JdSkuStockRequest request) { public JSONObject getNewStockById(JdSkuStockRequest request) {
JSONObject response = new JSONObject(); JSONObject response = new JSONObject();
List<JdSkuStockRequest.SkuNum> skuNumList = (List<JdSkuStockRequest.SkuNum>) JSONObject.parseObject(request.getSkuNums()); JSONArray skuNumArray = JSON.parseArray(request.getSkuNums());
List<JdSkuStockRequest.SkuNum> skuNumList = JSON.parseObject(skuNumArray.toJSONString(), new TypeReference<List<JdSkuStockRequest.SkuNum>>() {});
String areaId = request.getArea(); String areaId = request.getArea();
response.put("success", true); response.put("success", true);
response.put("resultMessage", ""); response.put("resultMessage", "");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment