admin
2019-08-27 e6764831a890de26fcfebb4fb8f3a22e9f8cc816
Merge remote-tracking branch 'origin/div' into div
6个文件已修改
155 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java
@@ -186,14 +186,16 @@
            for (IntegralTaskClassVO taskClassVO : list) {
                UniqueKeyEnum uniqueKey = taskClassVO.getUniqueKey();
                UserInfoExtraVO extraVO = userInfoExtraService.getInfoExtraVOByUid(uid);
                if (extraVO == null || StringUtil.isNullOrEmpty(extraVO.getInviteCode())) {
                    JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache("invite_activate",
                            Constant.getPlatformCode(acceptData.getPlatform()),
                            Integer.parseInt(acceptData.getVersion()));
                    taskClassVO.setJumpDetail(jumpDetailV2);
                // 邀请好友:是否激活邀请码
                if (uniqueKey == UniqueKeyEnum.inviteTeam) {
                    UserInfoExtraVO extraVO = userInfoExtraService.getInfoExtraVOByUid(uid);
                    if (extraVO == null || StringUtil.isNullOrEmpty(extraVO.getInviteCode())) {
                        JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache("invite_activate",
                                Constant.getPlatformCode(acceptData.getPlatform()),
                                Integer.parseInt(acceptData.getVersion()));
                        taskClassVO.setJumpDetail(jumpDetailV2);
                    }
                }
                String progress = taskClassVO.getProgress();
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java
@@ -65,21 +65,21 @@
     */
    List<UserSystemCoupon> getCouponByTypeAndNotActivated(@Param("uid") Long uid, @Param("couponId") Long couponId);
    
//    /**
//     *  查询兑换的券
//     * @param uid
//     * @param source
//     * @return
//     */
//    List<UserSystemCoupon> countIncludeExchange(@Param("uid") Long uid, @Param("source") String source);
//
//
//    /**
//     *  查询排出兑换的券
//     * @param uid
//     * @param source
//     * @return
//     */
//    List<UserSystemCoupon> countNotIncludeExchange(@Param("uid") Long uid, @Param("source") String source);
//
    /**
     *  查询兑换的券
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCoupon> getIncludeExchange(@Param("uid") Long uid, @Param("list") List<String> list);
    /**
     *  查询排出兑换的券
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCoupon> getIncludeNotExchange(@Param("uid") Long uid,@Param("list") List<String> list);
}
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml
@@ -157,4 +157,19 @@
        AND (usc_state_activate = 0 OR usc_state_activate is null)
  </select>
  
  <select id="getIncludeExchange" resultMap="BaseResultMap">
    SELECT * FROM yeshi_ec_user_system_coupon
    WHERE usc_state_activate = 1 AND usc_state = 1
          AND usc_uid = #{uid} AND usc_source in
          <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
  </select>
  <select id="getIncludeNotExchange" resultMap="BaseResultMap">
    SELECT * FROM yeshi_ec_user_system_coupon
    WHERE usc_state_activate = 1 AND usc_state = 1
          AND usc_uid = #{uid} AND usc_source not in
          <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java
@@ -10,7 +10,10 @@
import com.yeshi.fanli.dao.mybatis.ThreeSaleMapper;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserRank;
import com.yeshi.fanli.entity.integral.IntegralTask;
import com.yeshi.fanli.entity.integral.IntegralTaskRank;
import com.yeshi.fanli.entity.integral.IntegralTask.FrequencyEnum;
import com.yeshi.fanli.entity.integral.IntegralTask.TaskUniqueKeyEnum;
import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
@@ -18,8 +21,10 @@
import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.integral.IntegralGetService;
import com.yeshi.fanli.service.inter.integral.IntegralTaskRankService;
import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
import com.yeshi.fanli.service.inter.integral.IntegralTaskService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.annotation.integral.IntegralGetFrequencyLimit;
import com.yeshi.fanli.util.annotation.integral.IntegralGetVersionLimit;
@@ -39,6 +44,12 @@
    @Resource
    private RedisManager redisManager;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private IntegralTaskRankService integralTaskRankService;
    // TODO 有bug
    private UserInfo getBossByUid(Long uid) {
@@ -68,10 +79,31 @@
            if (count > 0)
                throw new IntegralGetException(2, "事件触发达到上限");
        }
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra == null)
            throw new IntegralGetException(2, "额外信息不存在");
        UserRank userRank = userInfoExtra.getUserRank();
        if (userRank == null)
            throw new IntegralGetException(2,"等级信息不存在");
        int goldCoin = task.getGoldCoin();
        if (task.getDoubleNum() != null && task.getDoubleNum() > 0)
            goldCoin = task.getDoubleNum() * goldCoin;
        Long taskId = task.getId();
        IntegralTaskRank traskRank = integralTaskRankService.getByTsakIdAndRankId(taskId, userRank.getId());
        if (traskRank != null) {
            Integer addCoin = traskRank.getAddCoin();
            if (addCoin != null && addCoin > 0)
                goldCoin += addCoin;
            Integer doubleNum = traskRank.getDoubleNum();
            if (doubleNum != null && doubleNum > 0) {
                goldCoin = goldCoin * doubleNum;
            }
        }
        IntegralTaskRecord record = new IntegralTaskRecord();
        record.setCid(task.getTaskClass().getId());
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -2122,13 +2122,17 @@
            if (systemCoupon == null)
                continue;
            
            String couponName = systemCoupon.getName();
            if (CouponTypeEnum.freeCouponGive == systemCoupon.getType())
                couponName = "免单券";
            // 退回消息
            String beiZhu = "请到我的-福利中心查看";
            SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
            MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
            msgOther.setType(MsgOtherGiveContentDTO.TYEP_COUPON);
            msgOther.setTitle("赠送" + systemCoupon.getName() + "退回");
            msgOther.setGiveType("你赠送的"+ systemCoupon.getName() + "未被成功领取");
            msgOther.setTitle("赠送" + couponName + "退回");
            msgOther.setGiveType("你赠送的"+ couponName + "未被成功领取");
            msgOther.setGiveTime(sd.format(record.getGiveTime()));
            msgOther.setReturnTime(sd.format(new Date()));
            userOtherMsgNotificationService.tokenGiveMsg(record.getGiveUid(), beiZhu, msgOther);
@@ -2136,17 +2140,27 @@
    }
    
    
//    @Override
//    public boolean countIncludeExchange(Long uid) {
//
//
//    }
//
//
//    @Override
//    public boolean countNotIncludeExchange(Long uid) {
//
//
//    }
    @Override
    public boolean getIncludeExchange(Long uid) {
        List<String> list = new ArrayList<String>();
        list.add(UserSystemCoupon.SOURCE_EXCHANGE);
        list.add(UserSystemCoupon.SOURCE_GIVE);
        List<UserSystemCoupon> listCoupon = userSystemCouponMapper.getIncludeExchange(uid, list);
        if (listCoupon == null || listCoupon.size() == 0)
            return false;
        return true;
    }
    @Override
    public boolean getIncludeNotExchange(Long uid) {
        List<String> list = new ArrayList<String>();
        list.add(UserSystemCoupon.SOURCE_EXCHANGE);
        list.add(UserSystemCoupon.SOURCE_GIVE);
        List<UserSystemCoupon> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid, list);
        if (listCoupon == null || listCoupon.size() == 0)
            return false;
        return true;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -253,4 +253,18 @@
     */
    public void updateCounponInvalid(List<UserSystemCoupon> list);
    /**
     * 兑换
     * @param uid
     * @return
     */
    public boolean getIncludeExchange(Long uid);
    /**
     * 非兑换
     * @param uid
     * @return
     */
    public boolean getIncludeNotExchange(Long uid);
}