yujian
2019-08-23 08bc0a13c0c2e00658e5ea63839893e73902810f
金币任务
24个文件已修改
859 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserCouponControllerV2.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/share/ShareGoodsRecordDTO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/integral/IntegralTask.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponGiveRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/CodePublishRecordServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java 347 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskClassServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskRecordServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsRecordServiceImpl.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/integral/IntegralGetService.java 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserShareGoodsRecordService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java
@@ -26,6 +26,7 @@
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
import com.yeshi.fanli.service.inter.integral.IntegralGetService;
import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
@@ -40,6 +41,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.factory.MonitorFactory;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@@ -84,8 +86,13 @@
    @Resource
    private TLJBuyGoodsService tljBuyGoodsService;
    @Resource
    private IntegralGetService integralGetService;
    private void doTaoLiJinBuy(Long uid, Long auctionId, PrintWriter out) {
    private void doTaoLiJinBuy(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
        JSONObject data = new JSONObject();
        TaoBaoLink taoBaoLink;
        try {
@@ -111,6 +118,11 @@
        data.put("type", 1);
        data.put("link", link);
        out.print(JsonUtil.loadTrueResult(data));
        // 1.6.5 自购立减添加 金币
        if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
            integralGetService.addTaoLiJinBuy(uid, auctionId);
    }
    /**
@@ -157,7 +169,7 @@
        }
        if ("taolijin_buy".equalsIgnoreCase(source)) {
            doTaoLiJinBuy(uid, auctionId, out);
            doTaoLiJinBuy(acceptData, uid, auctionId, out);
            return;
        }
@@ -275,6 +287,10 @@
            data.put("link", link);
            out.print(JsonUtil.loadTrueResult(data));
            // 获得金币
            if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
                integralGetService.addCouponRebate(uid);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
@@ -406,6 +422,10 @@
        history.setGoodsId(goodsId);
        recommendGoodsDeleteHistoryService.addRecommendGoodsDeleteHistory(history);
        out.print(JsonUtil.loadTrueResult(""));
        // 获得金币
        if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
            integralGetService.addCloseRecommendGoods(uid);
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -253,7 +253,7 @@
            data.put("shareMoney", "¥" + shareMoney.toString());
            try {
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO, false);
                data.put("shareId", shareRecord.getRedisKey());
            } catch (Exception e) {
                try {
@@ -419,7 +419,7 @@
            data.put("shareMoney", "¥" + shareMoney.toString());
            try {
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO, true);
                data.put("shareId", shareRecord.getRedisKey());
            } catch (Exception e) {
                try {
@@ -614,7 +614,7 @@
            @Override
            public void run() {
                try {
                    userShareGoodsRecordService.takeEffectShareRecord(shareId);
                    userShareGoodsRecordService.takeEffectShareRecord(acceptData, shareId);
                } catch (UserShareGoodsRecordException eu) {
                    try {
                        LogHelper.errorDetailInfo(eu);
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java
@@ -485,20 +485,25 @@
            out.print(JsonUtil.loadFalseResult(1, "页码不正确"));
            return;
        }
        try {
            List<CodePublishRecord> list = codePublishRecordService.listValid((page - 1) * Constant.PAGE_SIZE,
                    Constant.PAGE_SIZE);
            if (list == null) {
                list = new ArrayList<CodePublishRecord>();
            }
        List<CodePublishRecord> list = codePublishRecordService.listValid((page - 1) * Constant.PAGE_SIZE,
                Constant.PAGE_SIZE);
        if (list == null) {
            list = new ArrayList<CodePublishRecord>();
            long count = codePublishRecordService.countValid();
            JSONObject data = new JSONObject();
            data.put("count", count);
            data.put("list", getGson().toJson(list));
            data.put("helpLink", configService.get("publish_list_help_link"));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "获取失败"));
            return;
        }
        long count = codePublishRecordService.countValid();
        JSONObject data = new JSONObject();
        data.put("count", count);
        data.put("list", getGson().toJson(list));
        data.put("helpLink", configService.get("publish_list_help_link"));
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -352,6 +352,12 @@
            return;
        }
        
        UserInfo userInfo = userInfoService.selectByPKey(uid);
        if (userInfo == null) {
            out.print(JsonUtil.loadFalseResult("用户信息不存在"));
            return;
        }
        ThreeSale threeSale = threeSaleSerivce.selectByPrimaryKey(inviteId);
        if (threeSale == null) {
            out.print(JsonUtil.loadFalseResult("关系id不存在"));
@@ -372,25 +378,21 @@
            return;
        }
        
        UserInfo userInfo = userInfoService.selectByPKey(remindId);
        if (userInfo == null) {
            out.print(JsonUtil.loadFalseResult("被提醒人信息不存在"));
            return;
        }
        Long bossId = null;
        Long workerId = null;
        String title = "队员提醒消息";
        String content = "";
        if (remindBoss) {
            // 提示队长
            bossId = remindId;
            workerId = uid;
            content = "你的邀请人"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系帮助你更好的省钱,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
            content = "你的一级队员"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
        } else {
            // 提示队员
            bossId = uid;
            workerId = remindId;
        }    content = "你的一级队员"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
            content = "你的邀请人"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系帮助你更好的省钱,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
        }
        
        try {
            List<String> listIOS = new ArrayList<String>();
@@ -413,6 +415,8 @@
                newInfo.setUpdateTime(new Date());
                threeSaleExtraInfoSerivce.updateByPrimaryKeySelective(newInfo);
            } else {
                newInfo.setBoss(new UserInfo(bossId));
                newInfo.setWorker(new UserInfo(workerId));
                newInfo.setCreateTime(new Date());
                newInfo.setUpdateTime(new Date());
                threeSaleExtraInfoSerivce.insertSelective(newInfo);
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -304,7 +304,7 @@
            // 分享id
            try {
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
                        Constant.SOURCE_TYPE_TAOBAO);
                        Constant.SOURCE_TYPE_TAOBAO, false);
                shareInfo.setShareId(shareRecord.getRedisKey());
            } catch (Exception e) {
                try {
@@ -479,7 +479,7 @@
            shareInfo.setShareMoney("¥" + shareMoney.toString());
            try {
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId,
                        Constant.SOURCE_TYPE_TAOBAO);
                        Constant.SOURCE_TYPE_TAOBAO, true);
                shareInfo.setShareId(shareRecord.getRedisKey());
            } catch (Exception e) {
                try {
@@ -604,7 +604,7 @@
        shareInfo.setShareMoney("¥" + shareMoney.toString());
        try {
            ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
                    Constant.SOURCE_TYPE_JD);
                    Constant.SOURCE_TYPE_JD, false);
            shareInfo.setShareId(shareRecord.getRedisKey());
        } catch (Exception e) {
            try {
@@ -719,7 +719,7 @@
        try {
            ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
                    Constant.SOURCE_TYPE_PDD);
                    Constant.SOURCE_TYPE_PDD, false);
            shareInfo.setShareId(shareRecord.getRedisKey());
        } catch (Exception e) {
            try {
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserCouponControllerV2.java
@@ -161,8 +161,10 @@
            return;
        }
        try {
            String tips = UserSystemCouponService.giveCoupon(uid, id);
            out.print(JsonUtil.loadTrueResult(tips));
            UserSystemCouponVO vo = UserSystemCouponService.giveCoupon(uid, id);
            JSONObject data = new JSONObject();
            data.put("result", JsonUtil.getApiCommonGson().toJson(vo));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
        }
fanli/src/main/java/com/yeshi/fanli/dto/share/ShareGoodsRecordDTO.java
@@ -17,6 +17,9 @@
    private Integer goodsType;
    private List<CommonGoods> listGoods;
    private List<Long> listId;
    // 是否创建淘礼金
    private boolean isTaolijin;
    
    public Long getUid() {
        return uid;
@@ -98,4 +101,12 @@
        this.listGoods = listGoods;
    }
    public boolean isTaolijin() {
        return isTaolijin;
    }
    public void setTaolijin(boolean isTaolijin) {
        this.isTaolijin = isTaolijin;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/integral/IntegralTask.java
@@ -32,6 +32,30 @@
        }
    }
    
    public enum TaskUniqueKeyEnum {
        dailySign1("第1天签到"), dailySign2("第2天签到"),dailySign3("第3天签到"),dailySign4("第4天签到"), dailySign5("第5天签到"),
        dailySign6("第6天签到"), dailySign7("第7天签到"), recommendSearch("完成搜索"),    taoLiJinBuy("点击立减"),
        inviteLevelOne("直接邀请"),inviteLevelTwo("间接邀请"), buyReduce("自购立减"), shareSingleGoods("分享单个商品"),
        shareMultipleGoods("分享多个商品"), shareInvite("邀请素材"), shareTLJGoods("爆款商品") ,
        giveRebateCoupon("返利奖励券"), giveFreeCoupon("赠送免单券"),giveTaoLiJin("赠送推广红包"),inShop("浏览店铺"),
        inShopLevelOne("一级队员浏览店铺"),inShopLevelTwo("二级队员浏览店铺"),scanPush("浏览推荐记录"),scanGoods("浏览商品详情页"),
        scanSearchResult("浏览搜索结果页"),scanHomeBanner("浏览横幅专题"),scanSpecial("浏览首页专题"),scanTBCart("浏览购物车页"),
        closeRecommendGoods("关闭推荐商品"),couponRebate("点击领券返利"),couponRebateLevelOne("浏览购物车页"),couponRebateLevelTwo("浏览购物车页"),
        rebateOrder("完成返利订单"),inviteOrderLevelOne("一级队员邀请订单"),inviteOrderLevelTwo("二级队员邀请订单"),shareOrder("分享订单"),
        bindWeiXin("微信授权"),bindPhone("绑定手机"),bindTaoBao("淘宝授权"), setWeiXinNum("添加微信号"),setGender("首次设置性别"),
        setPortrait("首次修改头像"),    setNickname("修改昵称"),bindAlipay("绑定支付宝"),inviteActivate("激活邀请");
        private final String desc;
        private TaskUniqueKeyEnum(String desc) {
            this.desc = desc;
        }
        public String getDesc() {
            return desc;
        }
    }
    @Column(name = "it_id")
    private Long id;
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponGiveRecordMapper.xml
@@ -56,7 +56,7 @@
  <select id="getRecordByUidAndCouponId" resultMap="BaseResultMap">
    SELECT * FROM yeshi_ec_user_system_coupon_give_record
    WHERE cgr_state = 0  AND cgr_give_uid = #{uid} AND  cgr_coupon_id = #{couponId} 
    ORDER BY cgr_end_time desc
    ORDER BY cgr_give_time desc
    LIMIT 1 
  </select>
  
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -23,6 +23,7 @@
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleExtraInfoSerivce;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.integral.IntegralGetService;
import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
import com.yeshi.fanli.service.inter.msg.UserInviteMsgNotificationService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
@@ -69,6 +70,10 @@
    
    @Resource
    private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
    @Resource
    private IntegralGetService  integralGetService;
    
    
    @Resource(name = "taskExecutor")
@@ -552,8 +557,9 @@
        executor.execute(new Runnable() {
            @Override
            public void run() {
                UserActiveLog activeLog  = userActiveLogService.getUserLatestActiveInfo(inviter.getId());
                try {
                    UserActiveLog activeLog  = userActiveLogService.getUserLatestActiveInfo(inviter.getId());
                    if (activeLog != null  && !StringUtil.isNullOrEmpty(activeLog.getVersionCode()) ) {
                        String versionCode = activeLog.getVersionCode();
                        String channel = activeLog.getChannel();
@@ -582,6 +588,23 @@
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
                if (activeLog != null  && !StringUtil.isNullOrEmpty(activeLog.getVersionCode()) ) {
                    String versionCode = activeLog.getVersionCode();
                    String channel = activeLog.getChannel();
                    boolean result = false;
                    if (!StringUtil.isNullOrEmpty(channel) && "appstore".equalsIgnoreCase(channel)) {
                        result = VersionUtil.greaterThan_1_6_5("ios", versionCode);
                    } else {
                        result = VersionUtil.greaterThan_1_6_5("android", versionCode);
                    }
                    if (result) {
                        // 邀请金币
                        integralGetService.addInviteLevelOne(inviter.getId(), invitee.getId());
                    }
                }
            }
        });
        
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/CodePublishRecordServiceImpl.java
@@ -49,8 +49,15 @@
            return listValid;
        }
        
        for (CodePublishRecord codePublishRecord: listValid) {
        for (int i = 0; i < listValid.size(); i ++) {
            CodePublishRecord codePublishRecord = listValid.get(i);
            String inviteCode = codePublishRecord.getInviteCode();
            if (StringUtil.isNullOrEmpty(inviteCode)) {
                listValid.remove(i);
                i--;
                continue;
            }
            String index = inviteCode.substring(0, 1);
            String end = inviteCode.substring(inviteCode.length()-2, inviteCode.length()-1);
            codePublishRecord.setInviteCode("TA的邀请码:" + index + "****" + end);
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java
@@ -5,13 +5,18 @@
import javax.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.integral.IntegralTask;
import com.yeshi.fanli.entity.integral.IntegralTask.FrequencyEnum;
import com.yeshi.fanli.entity.integral.IntegralTask.TaskUniqueKeyEnum;
import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
import com.yeshi.fanli.exception.integral.IntegralGetException;
import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.integral.IntegralGetService;
import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
import com.yeshi.fanli.service.inter.integral.IntegralTaskService;
@@ -27,6 +32,9 @@
    @Resource
    private IntegralTaskRecordService integralTaskRecordService;
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    @Resource
    private RedisManager redisManager;
@@ -59,10 +67,19 @@
        record.setUid(uid);
        try {
            return integralTaskRecordService.addRecord(record);
             IntegralTaskRecord addRecord = integralTaskRecordService.addRecord(record);
             if (TaskUniqueKeyEnum.inShop == TaskUniqueKeyEnum.valueOf(event)) {
                 UserInfo boss = threeSaleSerivce.getBoss(uid);
                 if (boss != null)
                     addInShopLevelOne(boss.getId()); // 下级浏览店铺
             }
             return addRecord;
        } catch (IntegralTaskRecordException e) {
            throw new IntegralGetException(3, "添加记录失败");
        }
        // switch (event) {
        // case "recommendSearch":
@@ -105,6 +122,28 @@
        // TODO Auto-generated method stub
    }
    @Async()
    private void addInShopLevelOne(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inShopLevelOne.name(), null);
            UserInfo boss = threeSaleSerivce.getBoss(uid);
            if (boss != null)
                addInShopLevelTwo(boss.getId()); // 二级队员
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    private void addInShopLevelTwo(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inShopLevelTwo.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Override
    public void addScanPushHistory(Long uid) throws IntegralGetException {
@@ -136,4 +175,310 @@
    }
    @Async()
    @Override
    public void addTaoLiJinBuy(Long uid, Long goodsId) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.taoLiJinBuy.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addInviteLevelOne(Long uid, Long workerId) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteLevelOne.name(), null);
            UserInfo boss = threeSaleSerivce.getBoss(uid);
            if (boss != null)
                addInviteLevelTwo(boss.getId());
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    /**
     * 间接邀请
     * @param uid
     */
    @Async()
    private void addInviteLevelTwo(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteLevelTwo.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addShareSingleGoods(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.shareSingleGoods.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addShareMultipleGoods(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.shareMultipleGoods.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addShareTLJGoods(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.shareTLJGoods.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addGiveRebateCoupon(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.giveRebateCoupon.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addGiveFreeCoupon(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.giveFreeCoupon.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addGiveTaoLiJin(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.giveTaoLiJin.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addCloseRecommendGoods(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.closeRecommendGoods.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addCouponRebate(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.couponRebate.name(), null);
            UserInfo boss = threeSaleSerivce.getBoss(uid);
            if (boss != null)
                addCouponRebateLevelOne(boss.getId());
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    /**
     * 一级队员领券返利
     * @param uid
     */
    @Async()
    private void addCouponRebateLevelOne(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.couponRebateLevelOne.name(), null);
            UserInfo boss = threeSaleSerivce.getBoss(uid);
            if (boss != null)
                addCouponRebateLevelTwo(boss.getId()); // 二级队员
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    /**
     *  二级队员领券返利
     * @param uid
     */
    @Async()
    private void addCouponRebateLevelTwo(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.couponRebateLevelTwo.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addRebateOrder(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.rebateOrder.name(), null);
            UserInfo boss = threeSaleSerivce.getBoss(uid);
            if (boss != null)
                addInviteOrderLevelOne(boss.getId());
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    /**
     * 一级队员邀请订单
     * @param uid
     */
    @Async()
    private void addInviteOrderLevelOne(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelOne.name(), null);
            UserInfo boss = threeSaleSerivce.getBoss(uid);
            if (boss != null)
                addInviteOrderLevelTwo(boss.getId());
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    /**
     * 二级队员邀请订单
     * @param uid
     */
    @Async()
    private void addInviteOrderLevelTwo(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelTwo.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addShareOrder(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.shareOrder.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addBindWeiXin(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.bindWeiXin.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addBindPhone(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.bindPhone.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addBindTaoBao(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.bindTaoBao.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addSetWeiXinNum(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.setWeiXinNum.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addSetGender(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.setGender.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addSetPortrait(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.setPortrait.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addSetNickname(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.setNickname.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addBindAlipay(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.bindAlipay.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Async()
    @Override
    public void addInviteActivate(Long uid) {
        try {
            addEventStatistic(uid, TaskUniqueKeyEnum.inviteActivate.name(), null);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskClassServiceImpl.java
@@ -159,8 +159,10 @@
            String before = format.format(listDays.get(i));
            if (before.startsWith("0")) 
                before = before.substring(1, before.length());
            SignDateVO signDateVO = new SignDateVO();
            signDateVO.setDate(before);
            signDateVO.setLightUp(true);
            listSign.add(signDateVO);
        }
        
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskRecordServiceImpl.java
@@ -18,6 +18,7 @@
import com.yeshi.fanli.entity.integral.IntegralTask;
import com.yeshi.fanli.entity.integral.IntegralTask.FrequencyEnum;
import com.yeshi.fanli.entity.integral.IntegralTaskClass;
import com.yeshi.fanli.entity.integral.IntegralTaskClass.UniqueKeyEnum;
import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
@@ -251,23 +252,26 @@
        if (integralTask == null)
            return false;
        int num = 0;
        FrequencyEnum frequency = integralTask.getFrequency();
        if (frequency == FrequencyEnum.everyday) {
            num = integralTaskRecordMapper.countByTaskIdTodayNum(uid, taskId, TimeUtil.getWholeTime(record.getCreateTime().getTime()));
        } else if (frequency == FrequencyEnum.onlyOne) {
            num = 1;
        }
        if (num <= 0)
            num = 1;
        String title = taskClass.getName() + "-" + integralTask.getName() + "-" + num + "次";
        // 加入明细
        IntegralDetail detail = new IntegralDetail();
        if (UniqueKeyEnum.dailySign == taskClass.getUniqueKey()) {
            detail.setTitle(taskClass.getName() + "-" + integralTask.getName());
        } else {
            int num = 0;
            FrequencyEnum frequency = integralTask.getFrequency();
            if (frequency == FrequencyEnum.everyday) {
                num = integralTaskRecordMapper.countByTaskIdTodayNum(uid, taskId, TimeUtil.getWholeTime(record.getCreateTime().getTime()));
            } else if (frequency == FrequencyEnum.onlyOne) {
                num = 1;
            }
            if (num <= 0)
                num = 1;
            String title = taskClass.getName() + "-" + integralTask.getName() + "-" + num + "次";
            detail.setTitle(title);
        }
        detail.setUid(uid);
        detail.setTitle(title);
        detail.setMoney(record.getGoldCoin());
        detail.setCreateTime(record.getCreateTime());
        integralDetailService.insertSelective(detail);
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java
@@ -435,7 +435,7 @@
        BigDecimal total = new BigDecimal(0);
        for (UserTaoLiJinOrigin userTaoLiJinOrigin : list) {
            SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
            SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
            String time = sd.format(userTaoLiJinOrigin.getCreateTime());
            BigDecimal moneySurplus = userTaoLiJinOrigin.getMoneySurplus();
@@ -643,7 +643,7 @@
            public void run() {
                // 退回消息
                String beiZhu = "请到我的-推广红包查看";
                SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
                SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
                msgOther.setType(MsgOtherGiveContentDTO.TYEP_TLJ);
                msgOther.setTitle("赠送推广红包退回");
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java
@@ -394,7 +394,7 @@
                // 使用成功消息
                try {
                    String beizhu = "未被领取或领取后未使用部分退回";
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                    String time = sd.format(new Date());
                    MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                    content.setState("红包扣除");
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -21,12 +21,15 @@
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
import com.yeshi.fanli.exception.user.TokenRecordException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.SystemCouponService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.integral.IntegralGetService;
import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinGiveRecordService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
@@ -76,6 +79,13 @@
    @Resource
    private UserOtherMsgNotificationService userOtherMsgNotificationService;
    @Resource
    private IntegralGetService  integralGetService;
    @Resource
    private SystemCouponService systemCouponService;
    @Override
    public void insertSelective(TokenRecord record) {
@@ -320,9 +330,11 @@
                    || userCoupon.getState() != UserSystemCoupon.STATE_IN_USE)
                throw new TokenRecordException(1, "该券不存在或非赠送");
            try {
                userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCoupon.name(),
                        UserSystemCoupon.SOURCE_GIVE);
                        UserSystemCoupon.SOURCE_GIVE, null);
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                throw new TokenRecordException(1, "领取失败");
@@ -353,12 +365,14 @@
            updateGiveRecord.setState(UserSystemCouponGiveRecord.STATE_RECEIVE);
            userSystemCouponGiveRecordService.updateByPrimaryKeySelective(updateGiveRecord);
            integralGetService.addGiveFreeCoupon(giveUid);
            msg = "领取成功[免单券]成功,请到[我的-福利中心]中查看";
            // 消息 + 队员
            executor.execute(new Runnable() {
                @Override
                public void run() {
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                    boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
                    String beiZhu = "无";
                    if (addTeam)
@@ -395,9 +409,22 @@
                    || userCoupon.getState() != UserSystemCoupon.STATE_IN_USE)
                throw new TokenRecordException(1, "该券不存在或非赠送");
            SystemCoupon systemCoupon = userCoupon.getSystemCoupon();
            if (systemCoupon == null)
                throw new TokenRecordException(1, "该券不存在");
            systemCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
            if (systemCoupon == null)
                throw new TokenRecordException(1, "该券不存在");
            BigDecimal percent = null;
            String amount = systemCoupon.getAmount();
            if (!StringUtil.isNullOrEmpty(amount))
                percent = new BigDecimal(amount);
            try {
                userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCoupon.name(),
                        UserSystemCoupon.SOURCE_GIVE);
                userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(),
                        UserSystemCoupon.SOURCE_GIVE, percent);
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                throw new TokenRecordException(1, "领取失败");
@@ -428,12 +455,14 @@
            updateGiveRecord.setState(UserSystemCouponGiveRecord.STATE_RECEIVE);
            userSystemCouponGiveRecordService.updateByPrimaryKeySelective(updateGiveRecord);
            integralGetService.addGiveRebateCoupon(giveUid);
            msg = "领取成功[返利奖励券]成功,请到[我的-福利中心]中查看";
            // 消息 + 队员
            executor.execute(new Runnable() {
                @Override
                public void run() {
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                    boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
                    String beiZhu = "无";
                    if (addTeam)
@@ -477,13 +506,15 @@
                updateRecord.setState(UserTaoLiJinGiveRecord.STATE_RECEIVE);
                userTaoLiJinGiveRecordService.updateByPrimaryKeySelective(updateRecord);
                integralGetService.addGiveTaoLiJin(giveUid);
                msg = "领取成功[推广红包]成功,请到[我的-推广红包]中查看";
                // 消息 + 队员
                executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
                        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                        boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
                        String beiZhu = "无";
                        if (addTeam)
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java
@@ -196,7 +196,7 @@
            prize = "NoPrize";
        } else {
            try {
                userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_NEWBIES);
                userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_NEWBIES, null);
            } catch (UserSystemCouponException e) {
                e.printStackTrace();
            } catch (Exception e) {
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsRecordServiceImpl.java
@@ -26,6 +26,7 @@
import com.yeshi.fanli.dao.mybatis.share.UserShareGoodsRecordMapper;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum;
@@ -42,6 +43,7 @@
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.integral.IntegralGetService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
@@ -51,6 +53,7 @@
import com.yeshi.fanli.util.ImageUtil;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.factory.CommonGoodsFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@@ -90,6 +93,11 @@
    @Resource
    private UserGoodsStorageService userGoodsStorageService;
    @Resource
    private IntegralGetService integralGetService;
    @Override
    public int insert(UserShareGoodsRecord record) {
@@ -654,7 +662,7 @@
    }
    @Override
    public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType) throws UserShareGoodsRecordException {
    public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType, boolean isTaolijin) throws UserShareGoodsRecordException {
        if (auctionId == null || uid == null || uid <= 0) {
            throw new UserShareGoodsRecordException(1, "传递参数不正确");
        }
@@ -663,6 +671,7 @@
        recordDTO.setUid(uid);
        recordDTO.setAuctionId(auctionId);
        recordDTO.setGoodsType(goodsType);
        recordDTO.setTaolijin(isTaolijin);
        recordDTO.setSource(ShareSourceTypeEnum.goodsDetail);
        // 分享id
@@ -843,7 +852,7 @@
    }
    @Override
    public void takeEffectShareRecord(String shareKey) throws UserShareGoodsRecordException {
    public void takeEffectShareRecord(AcceptData acceptData, String shareKey) throws UserShareGoodsRecordException {
        if (StringUtil.isNullOrEmpty(shareKey)) {
            throw new UserShareGoodsRecordException(1, "传递参数不正确");
        }
@@ -857,6 +866,9 @@
            throw new UserShareGoodsRecordException(1, "分享信息不存在");
        }
        Long uid = recordDTO.getUid();
        boolean taolijin = recordDTO.isTaolijin();
        boolean singleGoods = true;
        Long shareId = recordDTO.getShareId();
        ShareSourceTypeEnum source = recordDTO.getSource();
        if (ShareSourceTypeEnum.goodsDetail.equals(source)) {
@@ -870,11 +882,17 @@
            shareRecord.setUpdateTime(new Date());
            updateByPrimaryKeySelective(shareRecord);
            List<CommonGoods> listGoods = recordDTO.getListGoods();
            if (listGoods != null && listGoods.size() > 1)
                singleGoods = false;
            // 保存商品信息
            multipleGoodsShareRecord(shareId, recordDTO.getListGoods());
        } else if (ShareSourceTypeEnum.storage.equals(source)) {
            // 分享库分享
            singleGoods = false;
            UserShareGoodsRecord shareRecord = new UserShareGoodsRecord();
            shareRecord.setId(shareId);
            shareRecord.setShareState(1);
@@ -898,6 +916,18 @@
        
        // 清理缓存
        redisManager.removeCommonString(shareKey);
        if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
            if (singleGoods) {
                if (taolijin) {
                    integralGetService.addShareTLJGoods(uid);
                } else {
                    integralGetService.addShareSingleGoods(uid);
                }
            } else {
                integralGetService.addShareMultipleGoods(uid);
            }
        }
    }
    /**
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -191,7 +191,7 @@
    @Override
    @Transactional
    public void insertUserCoupon(Long uid, String couponType, String source)
    public void insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent)
            throws UserSystemCouponException, Exception {
        if (couponType == null || uid == null) {
@@ -204,8 +204,12 @@
            coupon = systemCouponService.getCouponByType(couponType);
        } else if (couponType.equals(CouponTypeEnum.rebatePercentCoupon.name())) {
            // 随机奖励券
            randomRewardCoupon(1, uid, source);
            return;
            if (percent == null || percent.compareTo(new BigDecimal(0)) > 0) {
                randomRewardCoupon(1, uid, source);
                return;
            }  else {
                coupon = systemCouponService.getCouponByTypeAndPercent(couponType, percent);
            }
        }
        
        if (coupon == null) {
@@ -1809,6 +1813,7 @@
                }
            } else if (UserSystemCoupon.STATE_IN_USE == state && give) {
                userCouponVO.setCouponEffect("赠送中");
                userCouponVO.setCouponRule(systemCoupon.getRemark());
                String tips = null;
                if (CouponTypeEnum.freeCouponGive == type) {
                    userCouponVO.setState(UserSystemCoupon.STATE_GIVE_IN);
@@ -1830,6 +1835,7 @@
                                tips = tips.replace("{APP名称}", projectChineseName);
                            }
                            tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}", configService.get("app_down_link"));
                            userCouponVO.setGiveTips(tips);
                        }
                        
                        Date endTimeGive = record.getEndTime();
@@ -1839,19 +1845,20 @@
                            remainDays.put("fontColor", "#F14242");
                            userCouponVO.setRemainDays(remainDays);
                        }
                    }
                } else {
                    tips = "";
                }
                userCouponVO.setGiveTips(tips);
            } else if (UserSystemCoupon.STATE_END_USE == state) {
                if (give && CouponTypeEnum.freeCouponGive == type) {
                    }
                }
            } else if (give && UserSystemCoupon.STATE_END_USE == state) {
                userCouponVO.setCouponRule(systemCoupon.getRemark());
                if (CouponTypeEnum.freeCouponGive == type) {
                    userCouponVO.setState(UserSystemCoupon.STATE_GIVE_END);
                }
                
                if (give && CouponTypeEnum.rebatePercentCoupon == type) {
                if (CouponTypeEnum.rebatePercentCoupon == type) {
                    userCouponVO.setState(UserSystemCoupon.STATE_GIVE_END);
                }
            }else if (give && UserSystemCoupon.STATE_OVERDUE == state) {
                userCouponVO.setCouponRule(systemCoupon.getRemark());
            }
            userCouponVO.setJumpBtn(jumpBtn);
        }
@@ -1861,7 +1868,7 @@
    
    @Transactional
    @Override
    public String giveCoupon(Long uid, Long id) throws UserSystemCouponException {
    public UserSystemCouponVO giveCoupon(Long uid, Long id) throws UserSystemCouponException {
        UserSystemCoupon userSystemCoupon = userSystemCouponMapper.selectByPrimaryKey(id);
        if (userSystemCoupon == null)
            throw new UserSystemCouponException(1, "该券已不存在");
@@ -1875,11 +1882,8 @@
            throw new UserSystemCouponException(1, "该券已失效");
        
        Integer state = userSystemCoupon.getState();
        if (state == UserSystemCoupon.STATE_OVERDUE)
            throw new UserSystemCouponException(1, "该券已过期");
        if (state == UserSystemCoupon.STATE_END_USE)
            throw new UserSystemCouponException(1, "该券使用/赠送成功");
        if (state != UserSystemCoupon.STATE_CAN_USE)
            throw new UserSystemCouponException(1, "该券已被使用或赠送");
        
        CouponTypeEnum type = systemCoupon.getType();
        if (type != CouponTypeEnum.freeCouponGive && type != CouponTypeEnum.rebatePercentCoupon )
@@ -1911,7 +1915,8 @@
                    tips = tips.replace("{APP名称}", projectChineseName);
                }
                tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}", configService.get("app_down_link"));
                return tips;
                return createUserCouponVOo(userSystemCoupon, systemCoupon, record, tips);
            }
        }
        
@@ -1960,7 +1965,44 @@
            tips = tips.replace("{APP名称}", projectChineseName);
        }
        tips = tips.replace("{口令}", token).replace("{下载链接}", configService.get("app_down_link"));
        return tips;
        return createUserCouponVOo(userSystemCoupon, systemCoupon, giveRecord, tips);
    }
    private UserSystemCouponVO createUserCouponVOo(UserSystemCoupon userSystemCoupon, SystemCoupon systemCoupon,
            UserSystemCouponGiveRecord record, String tips) {
        UserSystemCouponVO userCouponVO = new UserSystemCouponVO();
        userCouponVO.setId(userSystemCoupon.getId());
        userCouponVO.setUid(userSystemCoupon.getUid());
        userCouponVO.setSource("来源:" + userSystemCoupon.getSource());
        userCouponVO.setCouponName(systemCoupon.getName());
        userCouponVO.setCouponEffect("赠送中");
        userCouponVO.setState(UserSystemCoupon.STATE_GIVE_IN);
        userCouponVO.setCouponRule(systemCoupon.getRemark());
        userCouponVO.setCouponRuleLink(systemCoupon.getRuleLink());
        userCouponVO.setCouponPicture(systemCoupon.getPicture());
        userCouponVO.setGiveTips(tips);
        String couponTerm = "有效期:";
        Date startTime = userCouponVO.getStartTime();
        Date endTime = userCouponVO.getEndTime();
        if (endTime != null && startTime != null) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
            couponTerm = couponTerm + sdf.format(startTime) + "-" + sdf.format(endTime);
        }
        userCouponVO.setCouponTerm(couponTerm);
        Map<String, Object> remainDays = new HashMap<String, Object>();
        try {
            remainDays.put("content", "剩余" + DateUtil.dateDiff2(new Date(), record.getGiveTime()) + "过期");
        } catch (Exception e) {
        }
        remainDays.put("fontColor", "#F14242");
        userCouponVO.setRemainDays(remainDays);
        return userCouponVO;
    }
    
@@ -2025,7 +2067,7 @@
            
            // 退回消息
            String beiZhu = "请到我的-福利中心查看";
            SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
            SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
            MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
            msgOther.setType(MsgOtherGiveContentDTO.TYEP_COUPON);
            msgOther.setTitle("赠送" + systemCoupon.getName() + "退回");
fanli/src/main/java/com/yeshi/fanli/service/inter/integral/IntegralGetService.java
@@ -95,4 +95,132 @@
     */
    public void addScanTaoBaoCart(Long uid);
    /**
     * 自购立减
     * @param uid
     */
    public void addTaoLiJinBuy(Long uid, Long goodsId);
    /**
     * 直接邀请
     * @param uid
     * @param goodsId
     */
    public void addInviteLevelOne(Long uid, Long workerId);
    /**
     * 单个商品分享
     * @param uid
     */
    public void addShareSingleGoods(Long uid);
    /**
     * 多个商品分享
     * @param uid
     */
    public void addShareMultipleGoods(Long uid);
    /**
     * 分享爆款商品
     * @param uid
     */
    public void addShareTLJGoods(Long uid);
    /**
     * 赠送奖励券
     * @param uid
     */
    public void addGiveRebateCoupon(Long uid);
    /**
     * 赠送免单券
     * @param uid
     */
    public void addGiveFreeCoupon(Long uid);
    /**
     * 赠送推广红包
     * @param uid
     */
    public void addGiveTaoLiJin(Long uid);
    /**
     * 关闭 不喜欢商品
     * @param uid
     */
    public void addCloseRecommendGoods(Long uid);
    /**
     * 领券返利
     * @param uid
     */
    public void addCouponRebate(Long uid);
    /**
     *  返利订单
     * @param uid
     */
    public void addRebateOrder(Long uid);
    /**
     * 分享订单
     * @param uid
     */
    public void addShareOrder(Long uid);
    /**
     * 微信授权
     * @param uid
     */
    public void addBindWeiXin(Long uid);
    /**
     * 绑定手机
     * @param uid
     */
    public void addBindPhone(Long uid);
    /**
     * 淘宝授权
     * @param uid
     */
    public void addBindTaoBao(Long uid);
    /**
     * 添加微信号
     * @param uid
     */
    public void addSetWeiXinNum(Long uid);
    /**
     * 设置性别
     * @param uid
     */
    public void addSetGender(Long uid);
    /**
     * 修改头像
     * @param uid
     */
    public void addSetPortrait(Long uid);
    /**
     * 修改昵称
     * @param uid
     */
    public void addSetNickname(Long uid);
    /**
     * 绑定支付宝
     * @param uid
     */
    public void addBindAlipay(Long uid);
    /**
     * 激活邀请
     * @param uid
     */
    public void addInviteActivate(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserShareGoodsRecordService.java
@@ -3,6 +3,7 @@
import java.util.List;
import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord;
import com.yeshi.fanli.entity.goods.CommonGoods;
@@ -78,7 +79,7 @@
     * @param shareId
     * @throws UserShareGoodsRecordException
     */
    public void takeEffectShareRecord(String shareKey) throws UserShareGoodsRecordException;
    public void takeEffectShareRecord(AcceptData acceptData, String shareKey) throws UserShareGoodsRecordException;
    /**
@@ -107,7 +108,7 @@
     * @return
     * @throws UserShareGoodsRecordException
     */
    public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType) throws UserShareGoodsRecordException;
    public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType, boolean isTaolijin) throws UserShareGoodsRecordException;
    /**
     * 选品库商品分享
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -134,7 +134,7 @@
     * @throws UserSystemCouponException
     * @throws Exception
     */
    public void insertUserCoupon(Long uid, String couponType, String source) throws UserSystemCouponException, Exception;
    public void insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent) throws UserSystemCouponException, Exception;
    /**
@@ -231,7 +231,7 @@
     * @return
     * @throws UserSystemCouponException
     */
    public String giveCoupon(Long uid, Long id) throws UserSystemCouponException;
    public UserSystemCouponVO giveCoupon(Long uid, Long id) throws UserSystemCouponException;
    /**
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -626,7 +626,13 @@
            if (dto.getLeftDay() != null) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getLeftDay() + "", COLOR_HIGHLIGHT_CONTENT));
                contentList.add(new ClientTextStyleVO("天", COLOR_CONTENT));
                if (msg.getType() == MsgTypeOtherTypeEnum.couponMianDan) {
                    contentList.add(new ClientTextStyleVO("天(未使用将会过期)", COLOR_CONTENT));
                } else {
                    contentList.add(new ClientTextStyleVO("天", COLOR_CONTENT));
                }
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("剩余天数", COLOR_TITLE), contentList));
            }