From 7e7db2fa55a9a3af46d4fd8ede0dee147f101d64 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 09 五月 2020 21:41:27 +0800 Subject: [PATCH] 2.1需求 --- fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java index 06e5ae7..846e223 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java @@ -407,14 +407,14 @@ * @param out */ @RequestMapping(value = "saveActivityPic") - public void saveActivityPic(String callback, String pid, ImgInfo imgInfo, HttpServletRequest request, + public void saveActivityPic(String callback, String pid, ImgInfo imgInfo, String picUrls, HttpServletRequest request, PrintWriter out) { try { MultipartHttpServletRequest fileRequest = null; if (request instanceof MultipartHttpServletRequest) { fileRequest = (MultipartHttpServletRequest) request; } - goodsEvaluateService.saveActivityPic(pid, imgInfo, fileRequest); + goodsEvaluateService.saveActivityPic(pid, imgInfo,picUrls, fileRequest); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇濆瓨鎴愬姛")); } catch (GoodsEvaluateException e) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); @@ -436,19 +436,19 @@ try { String videoPic = ""; String videoUrl = ""; - String activityPic = ""; String activityUrl = ""; + List<String> list = new ArrayList<String>(); GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid); if (goodsEvaluate != null && goodsEvaluate.getImgList() != null && goodsEvaluate.getImgList().size() > 0) { + activityUrl = goodsEvaluate.getJumpLink(); List<ImgInfo> imgList = goodsEvaluate.getImgList(); for (ImgInfo imgInfo : imgList) { ImgEnum type = imgInfo.getType(); if (type == ImgEnum.video) { videoPic = imgInfo.getUrl(); videoUrl = imgInfo.getVideoUrl(); - } else if (type == ImgEnum.activity) { - activityPic = imgInfo.getUrl(); - activityUrl = imgInfo.getActivityUrl(); + } else { + list.add(imgInfo.getUrl()); } } } @@ -456,7 +456,7 @@ JSONObject data = new JSONObject(); data.put("videoUrl", videoUrl); data.put("videoPic", videoPic); - data.put("activityPic", activityPic); + data.put("listPic", list); data.put("activityUrl", activityUrl); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); } catch (Exception e) { @@ -608,8 +608,7 @@ * @param out */ @RequestMapping(value = "query") - public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, - PrintWriter out) { + public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, String typeEnum, PrintWriter out) { if (pageIndex == null || pageIndex < 1) { pageIndex = 1; } @@ -618,7 +617,7 @@ } try { - List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 1); + List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 1, typeEnum); if (list == null || list.size() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁")); return; @@ -640,7 +639,7 @@ } } - long count = goodsEvaluateService.count(key, state, 1); + long count = goodsEvaluateService.count(key, state, 1, typeEnum); int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); @@ -675,7 +674,7 @@ } try { - List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 2); + List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 2, null); if (list == null || list.size() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁")); return; @@ -697,7 +696,7 @@ } } - long count = goodsEvaluateService.count(key, state, 2); + long count = goodsEvaluateService.count(key, state, 2, null); int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); -- Gitblit v1.8.0