| | |
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil; |
| | | import com.yeshi.fanli.util.RedisManager; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.TimeUtil; |
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil; |
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil; |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; |
| | |
| | | throw new GoodsEvaluateException(1, "请保存第一部分信息"); |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(commentInfo.getCoupon())) { |
| | | throw new GoodsEvaluateException(1, "券面额不能为空"); |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(commentInfo.getTagDesc())) { |
| | | throw new GoodsEvaluateException(1, "描述语不能为空"); |
| | | } |
| | | |
| | | String tagUrl = commentInfo.getTagUrl(); |
| | | String content = commentInfo.getContent(); |
| | | if (StringUtil.isNullOrEmpty(tagUrl) && StringUtil.isNullOrEmpty(content)) { |
| | | throw new GoodsEvaluateException(1, "评论语和链接不能同时为空"); |
| | | } |
| | | |
| | | String endTime = commentInfo.getEndTime(); |
| | | if (!StringUtil.isNullOrEmpty(endTime)) { |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | sdf.parse(endTime); |
| | | } catch (Exception e) { |
| | | throw new GoodsEvaluateException(1, "请填写正确的时间格式:2020-03-05"); |
| | | GoodsEvaluate resultObj = goodsEvaluateDao.getById(pid); |
| | | if (resultObj == null) |
| | | throw new GoodsEvaluateException(1, "第一部分信息缺失"); |
| | | |
| | | if (EvaluateEnum.activity != resultObj.getType()) { |
| | | if (StringUtil.isNullOrEmpty(commentInfo.getCoupon())) { |
| | | throw new GoodsEvaluateException(1, "券面额不能为空"); |
| | | } |
| | | } else { |
| | | throw new GoodsEvaluateException(1, "请填写券截止时间"); |
| | | |
| | | if (StringUtil.isNullOrEmpty(commentInfo.getTagDesc())) { |
| | | throw new GoodsEvaluateException(1, "描述语不能为空"); |
| | | } |
| | | |
| | | String tagUrl = commentInfo.getTagUrl(); |
| | | String content = commentInfo.getContent(); |
| | | if (StringUtil.isNullOrEmpty(tagUrl) && StringUtil.isNullOrEmpty(content)) { |
| | | throw new GoodsEvaluateException(1, "评论语和链接不能同时为空"); |
| | | } |
| | | |
| | | String endTime = commentInfo.getEndTime(); |
| | | if (!StringUtil.isNullOrEmpty(endTime)) { |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | sdf.parse(endTime); |
| | | } catch (Exception e) { |
| | | throw new GoodsEvaluateException(1, "请填写正确的时间格式:2020-03-05"); |
| | | } |
| | | } else { |
| | | throw new GoodsEvaluateException(1, "请填写券截止时间"); |
| | | } |
| | | } |
| | | |
| | | if (commentInfo.getNeedSpin() == null) { |
| | | commentInfo.setNeedSpin(false); |
| | | } |
| | | |
| | | String content = commentInfo.getContent(); |
| | | if (!StringUtil.isNullOrEmpty(content) && commentInfo.getNeedSpin()) { |
| | | try { |
| | | convertLinkManager.convertLinkFromText(content, Constant.LINK_TOKEN_VERIFY_UID, true); |
| | |
| | | } |
| | | } |
| | | |
| | | GoodsEvaluate resultObj = goodsEvaluateDao.getById(pid); |
| | | if (resultObj == null) |
| | | throw new GoodsEvaluateException(1, "第一部分信息缺失"); |
| | | |
| | | List<CommentInfo> comments = new ArrayList<>(); |
| | | CommentInfo currencyCoupon = null; |
| | |
| | | } |
| | | } |
| | | |
| | | String activityUrl = imgInfo.getActivityUrl(); |
| | | // 编辑图片 |
| | | List<ImgInfo> tempList = new ArrayList<ImgInfo>(); |
| | | if (!StringUtil.isNullOrEmpty(picUrls)) { |
| | |
| | | if (listOld != null) { |
| | | for (ImgInfo info: listOld) { |
| | | if (info.getUrl().equals(picLink)) { |
| | | info.setActivityUrl(activityUrl); |
| | | tempList.add(info); |
| | | break; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 上传文件替换 |
| | | if (fileRequest != null) { |
| | | for (int i = 0; i < 9; i++) { |
| | |
| | | imgInfo0.setPid(pid); |
| | | imgInfo0.setUrl(info.getUrl()); |
| | | imgInfo0.setUrlHD(info.getUrl()); |
| | | imgInfo0.setType(ImgEnum.img); |
| | | imgInfo0.setType(ImgEnum.activity); |
| | | imgInfo0.setW(info.getW()); |
| | | imgInfo0.setH(info.getH()); |
| | | |
| | | imgInfo0.setActivityUrl(activityUrl); |
| | | if (i < tempList.size()) { |
| | | tempList.set(i, imgInfo0); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | int lineNum = 0; |
| | | int totalImg = tempList.size(); |
| | |
| | | } |
| | | } |
| | | |
| | | resultObj.setJumpLink(imgInfo.getActivityUrl()); |
| | | resultObj.setJumpLink(activityUrl); |
| | | resultObj.setLineNum(lineNum); |
| | | resultObj.setImgList(listImg); |
| | | goodsEvaluateDao.save(resultObj); |
| | |
| | | } |
| | | |
| | | // 按照发布显示时间段起始时间为准。 |
| | | goodsEvaluate.setPublishTime(goodsEvaluate.getStartTime()); |
| | | evaluateNew.setPublishTime(evaluateNew.getStartTime()); |
| | | |
| | | List<CommentInfo> comments = evaluateNew.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
| | |
| | | |
| | | try { |
| | | Date now = new Date(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | |
| | | if (commentInfoEnum != null && commentInfoEnum == CommentInfoEnum.currencyCoupon) { |
| | | String endTime = commentInfo.getEndTime(); |
| | | if (!StringUtil.isNullOrEmpty(endTime)) { |
| | | Date endDay = sdf.parse(endTime); |
| | | Date endDay = format.parse(endTime); |
| | | if (endDay.getTime() < now.getTime()) { |
| | | goodsEvaluate.setState(0); // 活动过期 |
| | | } |
| | |
| | | * 删除已过期时间 |
| | | */ |
| | | private void removeOverdue() { |
| | | if(1>0) |
| | | return; |
| | | |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryOverdue(); |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | |
| | | * 删除商品已下架-单品 |
| | | */ |
| | | private void removeDownGoods() { |
| | | if(1>0) |
| | | return; |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.removeDownGoods(); |
| | | if (list == null || list.size() == 0) { |