yujian
2019-09-11 e37efa8cd59942980d646444eec5951466c650f9
金币任务bug
5个文件已修改
42 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java
@@ -114,4 +114,12 @@
    long countUsableByUid(@Param("uid") Long uid, @Param("list") List<Long> listCouponId);
    /**
     *  查询免券
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCoupon> getFreeCouponByType(@Param("uid") Long uid, @Param("type") String type);
}
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml
@@ -216,4 +216,9 @@
            separator=",">#{item}</foreach>
  </select>
  
 <select id="getFreeCouponByType" resultMap="BaseResultMap">
     SELECT * FROM `yeshi_ec_user_system_coupon` t
    LEFT JOIN `yeshi_ec_system_coupon` c ON t.`usc_coupon_id` = c.`sc_id`
    WHERE t.usc_uid = #{uid} AND c.`sc_type`= #{type}
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.entity.integral.IntegralExchange;
import com.yeshi.fanli.entity.integral.IntegralExchange.ExchangeTypeEnum;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.integral.IntegralExchangeException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
@@ -229,21 +230,25 @@
        boolean once = false; // 兑换一次是否消失
        try {
            if (ExchangeTypeEnum.freeCouponBuy == type) {
                List<UserSystemCoupon> listCoupon = userSystemCouponService.getFreeCouponByType(uid, CouponTypeEnum.freeCouponBuy.name());
                if (listCoupon != null && listCoupon.size() > 0)
                    throw new IntegralExchangeException(1, "自购免单券,仅能兑换一次");
                thing = "自购免单券";
                thingNum = "1张";
                userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, null);
                userSystemCouponService.exchangeCoupon(uid, CouponTypeEnum.freeCouponBuy.name(), UserSystemCoupon.SOURCE_EXCHANGE, null);
                once = true; 
                couponNews = 1;
            } else if (ExchangeTypeEnum.freeCouponGive == type) {
                thing = "赠送免单券";
                thingNum = "1张";
                userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, null);
                userSystemCouponService.exchangeCoupon(uid, CouponTypeEnum.freeCouponGive.name(), UserSystemCoupon.SOURCE_EXCHANGE, null);
                couponNews = 1;
            } else if (ExchangeTypeEnum.rebatePercentCoupon == type) {
                thing = "返利奖励券";
                thingNum = "1张";
                String percent = configService.get("exchange_rebate_percent");
                userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, new BigDecimal(percent));
                userSystemCouponService.exchangeCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(), UserSystemCoupon.SOURCE_EXCHANGE, new BigDecimal(percent));
                couponNews = 1;
            } else if (ExchangeTypeEnum.inviteCodePublish == type) {
                thing = "邀请码发布卡";
@@ -333,6 +338,8 @@
                exchange = null;
            
            return exchange;
        } catch (IntegralExchangeException e) {
            throw new IntegralExchangeException(1, e.getMsg());
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
            throw new IntegralExchangeException(1, "兑换异常");
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -1790,7 +1790,7 @@
                
                if (CouponTypeEnum.rebatePercentCoupon == type) {
                    userCouponVO.setState(UserSystemCoupon.STATE_GIVE_IN);
                    tips = configService.get("give_free_coupon_tips");
                    tips = configService.get("give_rebate_percent_coupon_tips");
                    tokenType = TokenTypeEnum.rebatePercentCoupon;
                }
                
@@ -2416,4 +2416,10 @@
        return listCoupon;
    }
    @Override
    public List<UserSystemCoupon> getFreeCouponByType(Long uid, String type) {
        return userSystemCouponMapper.getFreeCouponByType(uid, type);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -301,4 +301,12 @@
     */
    public long countUsableRewardCoupon(Long uid);
    /**
     * 查询免券数量
     * @param uid
     * @param type
     * @return
     */
    public List<UserSystemCoupon> getFreeCouponByType(Long uid, String type);
}