admin
2020-05-19 5647d090f7b83f406abfc390294162bbc6d68fcb
Merge remote-tracking branch 'origin/div' into div
2个文件已修改
100 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/user/invite/TeamDailyRecordDao.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/user/invite/TeamDailyRecordDao.java
@@ -180,9 +180,9 @@
    private String getTeamNumReduce() {
        StringBuilder builder = new StringBuilder();
        builder.append("function(doc, aggr){ ");
        builder.append(" aggr.directOrderNum += doc.firstNum;");
        builder.append(" aggr.inDirectOrderNum += doc.secondNum;");
        builder.append(" aggr.beyondOrderNum += doc.beyondNum;");
        builder.append(" if(doc.firstNum > 0){ aggr.firstTotal += doc.firstNum;}");
        builder.append(" aggr.secondTotal += doc.secondNum;");
        builder.append(" aggr.beyondTotal += doc.beyondNum;");
        builder.append(" }");
        return builder.toString();
    }
@@ -213,9 +213,9 @@
        }
        Map<String, Object> map = new HashMap<>();
        map.put("directOrderNum", 0);
        map.put("inDirectOrderNum", 0);
        map.put("beyondOrderNum", 0);
        map.put("firstTotal", 0);
        map.put("secondTotal", 0);
        map.put("beyondTotal", 0);
        BasicDBObject initial = new BasicDBObject(map);
        // 进行按天、周、月分组
@@ -243,9 +243,10 @@
                    Date dtime = sdf.parse(date);
                    TeamDailyRecord dailyCount = new TeamDailyRecord();
                    dailyCount.setCountDay(dtime);
                    dailyCount.setFirstNum(new BigDecimal(dbObject.get("directOrderNum").toString()).intValue());
                    dailyCount.setSecondNum(new BigDecimal(dbObject.get("inDirectOrderNum").toString()).intValue());
                    dailyCount.setBeyondNum(new BigDecimal(dbObject.get("beyondOrderNum").toString()).intValue());
                    dailyCount.setFirstNum(new BigDecimal(dbObject.get("firstTotal").toString()).intValue());
                    dailyCount.setSecondNum(new BigDecimal(dbObject.get("secondTotal").toString()).intValue());
                    dailyCount.setBeyondNum(new BigDecimal(dbObject.get("beyondTotal").toString()).intValue());
                    results.add(dailyCount);
                } catch (Exception e) {
                    e.printStackTrace();
@@ -281,9 +282,9 @@
        }
        Map<String, Object> map = new HashMap<>();
        map.put("directOrderNum", 0);
        map.put("inDirectOrderNum", 0);
        map.put("beyondOrderNum", 0);
        map.put("firstTotal", 0);
        map.put("secondTotal", 0);
        map.put("beyondTotal", 0);
        BasicDBObject initial = new BasicDBObject(map);
        // 进行按天、周、月分组
@@ -307,9 +308,9 @@
                
                TeamDailyRecord dailyCount = new TeamDailyRecord();
                dailyCount.setYearMonth(object.toString());
                dailyCount.setFirstNum(new BigDecimal(dbObject.get("directOrderNum").toString()).intValue());
                dailyCount.setSecondNum(new BigDecimal(dbObject.get("inDirectOrderNum").toString()).intValue());
                dailyCount.setBeyondNum(new BigDecimal(dbObject.get("beyondOrderNum").toString()).intValue());
                dailyCount.setFirstNum(new BigDecimal(dbObject.get("firstTotal").toString()).intValue());
                dailyCount.setSecondNum(new BigDecimal(dbObject.get("secondTotal").toString()).intValue());
                dailyCount.setBeyondNum(new BigDecimal(dbObject.get("beyondTotal").toString()).intValue());
                        
                results.add(dailyCount);
            }
@@ -342,9 +343,9 @@
        }
        Map<String, Object> map = new HashMap<>();
        map.put("directOrderNum", 0);
        map.put("inDirectOrderNum", 0);
        map.put("beyondOrderNum", 0);
        map.put("firstTotal", 0);
        map.put("secondTotal", 0);
        map.put("beyondTotal", 0);
        BasicDBObject initial = new BasicDBObject(map);
        // 进行按天、周、月分组
@@ -367,10 +368,9 @@
                }
                
                TeamDailyRecord dailyCount = new TeamDailyRecord();
                dailyCount.setFirstNum(new BigDecimal(dbObject.get("directOrderNum").toString()).intValue());
                dailyCount.setSecondNum(new BigDecimal(dbObject.get("inDirectOrderNum").toString()).intValue());
                dailyCount.setBeyondNum(new BigDecimal(dbObject.get("beyondOrderNum").toString()).intValue());
                dailyCount.setFirstNum(new BigDecimal(dbObject.get("firstTotal").toString()).intValue());
                dailyCount.setSecondNum(new BigDecimal(dbObject.get("secondTotal").toString()).intValue());
                dailyCount.setBeyondNum(new BigDecimal(dbObject.get("beyondTotal").toString()).intValue());
                results.add(dailyCount);
            }
        }
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;