| | |
| | | |
| | | // 原封视频面图 |
| | | ImgInfo imgVideo = null; |
| | | ImgInfo imgActivity = null; |
| | | List<String> listDel = new ArrayList<String>(); |
| | | List<String> listOld = new ArrayList<String>(); |
| | | |
| | |
| | | if (!StringUtil.isNullOrEmpty(url)) { |
| | | listOld.add(url); |
| | | } |
| | | } else if (type == ImgEnum.activity) { |
| | | imgActivity = info; |
| | | } |
| | | } |
| | | } |
| | | |
| | | MultipartFile activityFile = null; |
| | | // 视频部分 |
| | | if (fileRequest != null) { |
| | | MultipartFile filevideo = fileRequest.getFile("filevideo"); |
| | |
| | | imgVideo.setW(width); |
| | | imgVideo.setH(height); |
| | | } |
| | | |
| | | |
| | | activityFile = fileRequest.getFile("activityFile"); |
| | | } |
| | | |
| | | List<ImgInfo> listImg = new ArrayList<ImgInfo>(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (activityFile != null) { |
| | | InputStream inputStream = activityFile.getInputStream(); |
| | | BufferedImage sourceImg = ImageIO.read(inputStream); |
| | | int width = sourceImg.getWidth(); |
| | | int height = sourceImg.getHeight(); |
| | | |
| | | String picLink = uploadPicture(activityFile); |
| | | |
| | | ImgInfo activity = new ImgInfo(); |
| | | activity.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | activity.setLarge(true); |
| | | activity.setPid(pid); |
| | | activity.setUrl(picLink); |
| | | activity.setUrlHD(picLink); |
| | | activity.setActivityPic(picLink); |
| | | activity.setW(width); |
| | | activity.setH(height); |
| | | activity.setType(ImgEnum.activity); |
| | | listImg.add(activity); |
| | | } else if (imgActivity != null) { |
| | | listImg.add(imgActivity); |
| | | } |
| | | |
| | | |
| | | |
| | | // 编辑图片 |
| | | if (!StringUtil.isNullOrEmpty(picUrls)) { |
| | |
| | | if (fileRequest != null) { |
| | | MultipartFile file = fileRequest.getFile("file" + i); |
| | | if (file != null) { |
| | | InputStream inputStream = file.getInputStream(); |
| | | BufferedImage sourceImg = ImageIO.read(inputStream); |
| | | int width = sourceImg.getWidth(); |
| | | int height = sourceImg.getHeight(); |
| | | picLink = uploadPicture(file); |
| | | |
| | | ImgInfo imgInfo0 = new ImgInfo(); |
| | |
| | | imgInfo0.setUrl(picLink); |
| | | imgInfo0.setUrlHD(picLink); |
| | | imgInfo0.setType(ImgEnum.img); |
| | | imgVideo.setW(width); |
| | | imgVideo.setH(height); |
| | | imgVideo.setW(1); |
| | | imgVideo.setH(1); |
| | | listImg.add(imgInfo0); |
| | | continue; |
| | | } |
| | |
| | | GoodsDetailVO goods = goodsEvaluate.getGoods(); |
| | | if (goods != null) { |
| | | GoodsDetailVO goodsNew = getGoodsNewInfo(goods.getGoodsId(), goods.getGoodsType(), paramsDTO); |
| | | if (goodsNew != null) |
| | | goodsEvaluate.setGoods(goodsNew); |
| | | } |
| | | // 更新商品信息 |
| | | List<ImgInfo> imgList = goodsEvaluate.getImgList(); |
| | | if (imgList == null || imgList.size() == 0) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | for (ImgInfo imgInfo: imgList) { |
| | | SimpleGoods simpleGoods = imgInfo.getGoods(); |
| | | if (simpleGoods == null) { |
| | | continue; |
| | | } |
| | | |
| | | GoodsDetailVO goodsDetailVO = getGoodsNewInfo(simpleGoods.getGoodsId(), simpleGoods.getGoodsType(), paramsDTO); |
| | | if (goodsDetailVO != null) { |
| | | simpleGoods.setPrice(goodsDetailVO.getCouponPrice()); |
| | | CouponInfoVO couponInfo = goodsDetailVO.getCouponInfo(); |
| | | if (couponInfo == null) { |
| | | simpleGoods.setPrice(goodsDetailVO.getZkPrice()); |
| | | simpleGoods.setState(1); |
| | | } else { |
| | | simpleGoods.setPrice(goodsDetailVO.getCouponPrice()); |
| | | simpleGoods.setAmount(couponInfo.getAmount()); |
| | | simpleGoods.setState(0); |
| | | } |
| | | imgInfo.setGoods(simpleGoods); |
| | | imgInfo.setGoodsVO(goodsDetailVO); |
| | | } |
| | | } |
| | | |
| | | goodsEvaluate.setUpdateTime(new Date()); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |