Browse Source

新增物料的时候返回值1

wangdy 8 years ago
parent
commit
da9d2af351

+ 2 - 5
src/main/java/com/uas/ps/product/controller/ProductController.java

@@ -16,10 +16,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -85,7 +82,7 @@ public class ProductController {
      */
     @RequestMapping(value = "/update", method = RequestMethod.POST)
     @ResponseBody
-    public List<Long> updateProdInfo(@RequestParam("data") String data) throws UnsupportedEncodingException {
+    public List<Long> updateProdInfo(@RequestBody String data) throws UnsupportedEncodingException {
         // TODO 物料信息中的企业UU和用户UU,需要在调用接口之前设置。有id为更新,无id为新增
         List<Product> productInfo = JSONObject.parseArray(URLDecoder.decode(data, "utf-8"), Product.class);
         List<Long> resultProducts = new ArrayList<>();