|
|
@@ -1,5 +1,6 @@
|
|
|
package com.uas.ps.product.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.uas.ps.entity.Product;
|
|
|
import com.uas.ps.product.service.ProductService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -8,6 +9,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+import java.net.URLDecoder;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -40,8 +43,10 @@ public class ProductGetController {
|
|
|
* @return 物料List
|
|
|
*/
|
|
|
@RequestMapping(value = "/findByEnUUAndCodes", method = RequestMethod.GET)
|
|
|
- public List<Product> findByEnUUAndCodes(@RequestParam("enUU") Long enUU, @RequestParam("codes") List<String> codes) {
|
|
|
- return productService.findByEnUUAndCodes(enUU, codes);
|
|
|
+ public List<Product> findByEnUUAndCodes(@RequestParam("enUU") Long enUU, @RequestParam("codes") String codes) throws UnsupportedEncodingException {
|
|
|
+ codes = URLDecoder.decode(codes, "UTF-8");
|
|
|
+ List<String> codeList = JSON.parseArray(codes, String.class);
|
|
|
+ return productService.findByEnUUAndCodes(enUU, codeList);
|
|
|
}
|
|
|
|
|
|
/**
|