Kaynağa Gözat

修改个人产品批量删除方法

dongbw 7 yıl önce
ebeveyn
işleme
601b88d761

+ 3 - 3
src/main/java/com/uas/ps/product/controller/ProductUsersController.java

@@ -129,14 +129,14 @@ public class ProductUsersController {
      * @throws Exception
      */
     @RequestMapping(value = "/edit/deleteByBatch", method = RequestMethod.POST)
-    public ModelMap deleteByBatch(@RequestParam("ids") String ids) {
-        List<Long> idList = JSONObject.parseArray(ids, Long.class);
+    public ModelMap deleteByBatch(@RequestParam("ids") String ids) throws UnsupportedEncodingException {
+        List<Long> idList = JSONObject.parseArray(URLDecoder.decode(ids, "utf-8"), Long.class);
         ModelMap map = new ModelMap();
         try {
             productUsersService.deleteByBatch(idList);
 //            logger.log("删除个人产品",  "数量:" + idList.size());
         } catch (Exception e) {
-            map.put("error", "删除个人产品失败");
+            throw new RuntimeException("删除个人产品失败");
         }
         return map;
     }