yujian
2020-05-19 44327a748a3e6e04a21faa85e44c89e60a954f23
活动通用券 取消验证
1个文件已修改
56 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
@@ -930,36 +930,43 @@
            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);
@@ -972,9 +979,6 @@
            }
        }
        GoodsEvaluate resultObj = goodsEvaluateDao.getById(pid);
        if (resultObj == null)
            throw new GoodsEvaluateException(1, "第一部分信息缺失");
        List<CommentInfo> comments = new ArrayList<>();
        CommentInfo currencyCoupon = null;