admin
2019-11-13 772c048171cb9b3fdc7e05b711d28458ef3e7543
Merge remote-tracking branch 'origin/div' into div
9个文件已修改
85 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/redpack/RedPackExchangeMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackExchangeMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackWinInviteServiceImpl.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackWinNewUserServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/TokenRecordService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -147,7 +147,7 @@
        text = text.trim();
        try {
            TokenVO tokenVO = tokenRecordService.discernToken(text, uid);
            TokenVO tokenVO = tokenRecordService.discernToken(text, uid, acceptData);
            out.print(JsonUtil.loadTrueResult(tokenVO));
            return;
        } catch (TokenRecordException e) {
@@ -506,7 +506,7 @@
    @RequestMapping(value = "tokenReceive", method = RequestMethod.POST)
    public void tokenReceive(AcceptData acceptData, Long uid, String token, PrintWriter out) {
        try {
            String msg = tokenRecordService.receiveToken(token, uid);
            String msg = tokenRecordService.receiveToken(token, uid, acceptData);
            out.print(JsonUtil.loadTrueResult(msg));
        } catch (TokenRecordException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/redpack/RedPackExchangeMapper.java
@@ -38,5 +38,12 @@
     * @return
     */
    BigDecimal countMoneyByUidAndState(@Param("uid") Long uid, @Param("state") Integer state);
    /**
     * 统计当日提现次数
     * @param uid
     * @return
     */
    long countTodayByUid(@Param("uid") Long uid);
        
}
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackExchangeMapper.xml
@@ -87,4 +87,8 @@
    WHERE d.rpe_uid = #{uid} AND d.`rpe_state` = #{state}
  </select>
  
  <select id="countTodayByUid" resultType="Long">
      SELECT IFNULL(COUNT(d.rpe_id),0) FROM yeshi_ec_red_pack_exchange d
    WHERE d.rpe_uid = #{uid} AND TO_DAYS(d.`rpe_create_time`) = TO_DAYS(NOW())
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java
@@ -108,8 +108,14 @@
        if (amount.compareTo(new BigDecimal(moneyMin)) < 0 || amount.compareTo(new BigDecimal(moneyMax)) > 0)
            throw new RedPackExchangeException(1, "提现金额至少" + moneyMin + "元至多" + moneyMax + "元");
        
        Date nowDate = new Date();
        
        long countToday = redPackExchangeMapper.countTodayByUid(uid);
        String extractDayMax = redPackConfigService.getValueByKey("extract_day_max");
        if (!StringUtil.isNullOrEmpty(extractDayMax) && countToday >= Long.parseLong(extractDayMax))
            throw new RedPackExchangeException(1, "今日红包提现次数超限");
        Date nowDate = new Date();
        // 提现申请
        RedPackExchange exchange = new RedPackExchange();
        exchange.setUid(uid);
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackWinInviteServiceImpl.java
@@ -12,7 +12,6 @@
import com.google.gson.Gson;
import com.yeshi.fanli.dao.mybatis.redpack.RedPackWinInviteMapper;
import com.yeshi.fanli.dto.mq.user.body.UserAccountBindingMQMsg;
import com.yeshi.fanli.dto.msg.MsgRedPackAddContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserActiveLog;
@@ -103,13 +102,13 @@
        UserInfo boss = threeSaleSerivce.getBoss(uid);
        if(boss != null) {
            UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(boss.getId());
            if (activeLog != null) {
                // 小于2.0.2版本不增加积分
                if (!VersionUtil.greaterThan_2_0_2("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
                        activeLog.getVersionCode()))
                    return;
            }
            if (activeLog == null)
                return;
            
            // 小于2.0.2版本不增加
            if (!VersionUtil.greaterThan_2_0_2("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
                    activeLog.getVersionCode()))
                return;
            
            bossReward(boss.getId(), uid, source, orderNo);
        }
@@ -182,7 +181,8 @@
        dto.setTitle("红包增加");
        dto.setMoney("¥" + money.setScale(2));
        dto.setBalance("¥" + redPackBalanceService.getBalance(uid).setScale(2));
        userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackFirstSharedOrder, new Gson().toJson(dto), "红包可用于购买会员");
        userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackFirstSharedOrder,
                new Gson().toJson(dto), "请到“我的-红包”中查看");
    }
    
    
@@ -241,7 +241,8 @@
        dto.setTitle("红包增加");
        dto.setMoney("¥" + money.setScale(2));
        dto.setBalance("¥" + redPackBalanceService.getBalance(uid).setScale(2));
        userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackMonthSharedOrder, new Gson().toJson(dto), "红包可用于购买会员");
        userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackMonthSharedOrder,
                new Gson().toJson(dto), "请到“我的-红包”中查看");
    }
    
    
@@ -256,14 +257,14 @@
            return;
        
        UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(boss.getId());
        if (activeLog != null) {
            // 小于2.0.2版本不增加积分
            if (!VersionUtil.greaterThan_2_0_2("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
                    activeLog.getVersionCode()))
                return;
        }
        if (activeLog == null)
            return;
        
        // 小于2.0.2版本不增加
        if (!VersionUtil.greaterThan_2_0_2("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
                activeLog.getVersionCode()))
            return;
        // 同一队员奖励一次
        long totalReward = redPackWinInviteMapper.countByUidAndTeamUidAndType(boss.getId(), uid, RedPackWinInviteTypeEnum.inviteSucceed.name());
        if (totalReward > 0)
@@ -322,7 +323,8 @@
            dto.setTitle("红包增加");
            dto.setMoney("¥" + money.setScale(2));
            dto.setBalance("¥" + redPackBalanceService.getBalance(boss.getId()).setScale(2));
            userMoneyMsgNotificationService.redPackMsg(boss.getId(), MsgTypeMoneyTypeEnum.redPackInviteSucceed, new Gson().toJson(dto), "红包可用于购买会员");
            userMoneyMsgNotificationService.redPackMsg(boss.getId(), MsgTypeMoneyTypeEnum.redPackInviteSucceed,
                    new Gson().toJson(dto), "请到“我的-红包”中查看");
        }
    }
    
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackWinNewUserServiceImpl.java
@@ -11,6 +11,7 @@
import com.yeshi.fanli.dao.mongodb.redpack.RedPackWinNewUserDao;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.redpack.RedPackBalance;
import com.yeshi.fanli.entity.redpack.RedPackWinNewUser;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
@@ -49,6 +50,11 @@
            if (uid == null || uid <= 0) 
                return true; // 未登录弹出
            
            RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
            if (redPackBalance != null && redPackBalance.getState() != null
                    && redPackBalance.getState() == RedPackBalance.STATE_LOCKED)
                return false;  // 红包封禁
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
            if (userInfoExtra == null || userInfoExtra.getFirstLoginTime() == null) 
                return false;
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -16,6 +16,7 @@
import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord;
import com.yeshi.fanli.entity.bus.user.TokenRecord;
@@ -48,6 +49,7 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TokenUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.vo.msg.TokenVO;
@Service
@@ -117,7 +119,7 @@
    }
    @Override
    public TokenVO discernToken(String token, Long uid) throws TokenRecordException {
    public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException {
        // 解析口令
        String parseToken = TokenUtil.parseToken(token);
        if (StringUtil.isNullOrEmpty(parseToken)) 
@@ -218,6 +220,10 @@
                throw new TokenRecordException(1, "口令已失效");
            }
        } else if (tokenType == TokenTypeEnum.redPack) {
            if(!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
                throw new TokenRecordException(1, "请升级到最新版");
            type = 13;
            RedPackGiveRecord giveRecord = redPackGiveRecordService.selectByPrimaryKey(Long.parseLong(identify));
            if (giveRecord == null)
@@ -288,7 +294,7 @@
    
    @Override
    public String receiveToken(String token, Long uid) throws TokenRecordException {
    public String receiveToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException {
        if (uid == null || uid <= 0)
            throw new TokenRecordException(1, "用户未登录");
@@ -504,6 +510,9 @@
                }
            });
        } else if (tokenType == TokenTypeEnum.redPack) {
            if(!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
                throw new TokenRecordException(1, "请升级到最新版");
            try {
                msg = "领取红包成功,请到[我的-红包]中查看";
                // 领取红包、更新记录
fanli/src/main/java/com/yeshi/fanli/service/inter/user/TokenRecordService.java
@@ -2,6 +2,7 @@
import java.util.List;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.TokenRecord;
import com.yeshi.fanli.exception.user.TokenRecordException;
import com.yeshi.fanli.vo.msg.TokenVO;
@@ -25,7 +26,7 @@
     * @return
     * @throws TokenRecordException
     */
    public TokenVO discernToken(String token, Long uid) throws TokenRecordException;
    public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException;
    
    /**
@@ -34,7 +35,7 @@
     * @param uid
     * @throws TokenRecordException
     */
    public String receiveToken(String token, Long uid) throws TokenRecordException;
    public String receiveToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException;
    
    public void updateByPrimaryKeySelective(TokenRecord record);
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -1805,7 +1805,7 @@
        goods.setIncludeDxjh(0);
        goods.setSellerId(item.optLong("seller_id"));
        goods.setShopTitle(item.optString("shop_title"));
        goods.setShopTitle(item.optString("nick"));
        goods.setTitle(item.optString("title"));
        goods.setProvcity(item.optString("provcity"));