yujian
2019-03-13 af7759852175239571753975c260eb107578658e
用户封禁+ 邀请红包统计修该
15个文件已修改
1059 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/HongBaoV2CountMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/UserInfoMapper.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/ForbiddenUserIdentifyCodeMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/admin/UserInfoAdmin.java 244 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml 200 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2CountMapper.xml 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/ForbiddenUserIdentifyCodeMapper.xml 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/count/HongBaoV2CountServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ForbiddenUserIdentifyCodeServiceImpl.java 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java 233 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserRankingsServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/count/HongBaoV2CountService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/ForbiddenUserIdentifyCodeService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java
@@ -31,7 +31,6 @@
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.controller.admin.utils.AdminUtils;
import com.yeshi.fanli.dto.money.AccountDetails;
import com.yeshi.fanli.entity.admin.UserInfoAdmin;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.Extract;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
@@ -73,7 +72,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.AccountDetailsFactory;
import com.yeshi.fanli.vo.user.ForbiddenUserIdentifyCodeVO;
import com.yeshi.fanli.vo.user.UserInfoVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -643,22 +642,15 @@
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer userType, Integer days,
            String startTime, String endTime, Integer orderMode, PrintWriter out) {
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,
            Integer days, String startTime, String endTime, Integer orderMode, Integer type, PrintWriter out) {
        try {
            // 结束时间 2018-06-06 00:00:00 加上一天
            if (!StringUtil.isNullOrEmpty(endTime)) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                Date enddate = sdf.parse(endTime);
                Calendar c = Calendar.getInstance();
                c.setTime(enddate);
                c.add(Calendar.DAY_OF_MONTH, 1);// 今天+1天
                endTime = sdf.format(c.getTime());
            if (type == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户类型type不能为空"));
                return;
            }
            if (pageIndex == null)
                pageIndex = 1;
@@ -679,15 +671,35 @@
                }
            }
            List<UserInfoAdmin> userList = userInfoService.query((pageIndex - 1) * pageSize, pageSize, key, userType,
                    days, startTime, endTime, orderField, orderMode);
            String userRank = null;
            if (rank != null) {
                switch (rank) {
                case 1:
                    userRank = "青铜";
                    break;
                case 2:
                    userRank = "白银";
                    break;
                case 3:
                    userRank = "黄金";
                    break;
                case 4:
                    userRank = "铂金";
                    break;
                default:
                    break;
                }
            }
            List<UserInfoVO> userList = userInfoService.query((pageIndex - 1) * pageSize, pageSize, type, key, keyType,
                    userRank, days, startTime, endTime, orderField, orderMode);
            if (userList == null || userList.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无相关数据"));
                return;
            }
            long count = userInfoService.queryCount(key, userType, days, startTime, endTime);
            long count = userInfoService.queryCount(type, key, keyType, userRank, days, startTime, endTime);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
@@ -698,7 +710,6 @@
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            // data.put("sumMoney", sumMoney);
            data.put("resultList", gson.toJson(userList));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
@@ -1626,56 +1637,6 @@
    }
    
    /**
     * 查询封禁
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param key
     * @param type
     * @param out
     */
    @RequestMapping(value = "forbiddenQuery")
    public void forbiddenQuery(String callback, Integer pageIndex, Integer pageSize, String key, Integer type, PrintWriter out) {
        try {
            if (pageIndex == null)
                pageIndex = 1;
            if (pageSize == null)
                pageSize = Constant.PAGE_SIZE;
            List<ForbiddenUserIdentifyCodeVO> list = forbiddenUserIdentifyCodeService.listQuery((pageIndex - 1) * pageSize,
                    pageSize, key, type);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无相关数据"));
                return;
            }
            long count = forbiddenUserIdentifyCodeService.countQuery(key, type);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            GsonBuilder gsonBuilder = new GsonBuilder();
            gsonBuilder.serializeNulls();
            Gson gson = gsonBuilder.create();
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", gson.toJson(list));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    
    /**
     * 用户账号- 封禁/解封 
@@ -1685,13 +1646,13 @@
     * @param out
     */
    @RequestMapping(value = "saveForbiddenInfo")
    public void saveForbiddenInfo(String callback, String code, Integer type, boolean state, PrintWriter out) {
    public void saveForbiddenInfo(String callback, String code, Integer type, PrintWriter out) {
        try {
            if (code == null || code.trim().length() == 0 || type == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
            }
            
            forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type, state);
            forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type);
            
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/HongBaoV2CountMapper.java
@@ -7,6 +7,8 @@
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.vo.order.HongBaoV2VO;
public interface HongBaoV2CountMapper {
    
@@ -113,5 +115,8 @@
     */
    List<Map<String, Object>> count24HOderByChannel(@Param("channel") String channel, @Param("type") Integer type,
            @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime);
    List<HongBaoV2VO> listShareAndInviteMoney(@Param("start") long start, @Param("count") int count,
            @Param("date") String date);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/UserInfoMapper.java
@@ -7,6 +7,7 @@
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.vo.user.UserInfoVO;
public interface UserInfoMapper {
@@ -70,12 +71,14 @@
     * @param orderMode  排序方式
     * @return
     */
    List<UserInfo> query(@Param("start") long start, @Param("count") int count, @Param("key") String key,
            @Param("userType")Integer userType,    @Param("days")Integer days,
    List<UserInfoVO> query(@Param("start") long start, @Param("count") int count, @Param("userState")Integer userState,
            @Param("key") String key, @Param("keyType") Integer keyType,
            @Param("userRank") String userRank,    @Param("days")Integer days,
            @Param("startTime") String startTime, @Param("endTime") String endTime, 
            @Param("orderField") Integer orderField, @Param("orderMode") Integer orderMode);
    
    long queryCount(@Param("key") String key, @Param("userType")Integer userType,    @Param("days")Integer days,
    long queryCount( @Param("userState")Integer userState, @Param("key") String key,  @Param("keyType") Integer keyType,
            @Param("userRank")String userRank,@Param("days")Integer days,
            @Param("startTime") String startTime, @Param("endTime") String endTime);
    
    /**
@@ -166,13 +169,9 @@
     * @return
     */
    UserInfo getInfoByPhoneOrInviteCode(@Param("phone")String phone, @Param("inviteCode")String inviteCode);
    
    
    // 根据AppId与电话号码获取用户
    List<UserInfo> listByClosed(@Param("appId") String appId, @Param("phone") String phone);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/ForbiddenUserIdentifyCodeMapper.java
@@ -21,18 +21,4 @@
    List<ForbiddenUserIdentifyCode> listByTypeAndIdentifyCode(@Param("type") ForbiddenUserIdentifyCodeTypeEnum type,
            @Param("identifyCode") String identifyCode);
    
    /**
     *       查询封禁记录
     * @param start
     * @param count
     * @param key
     * @return
     */
    List<ForbiddenUserIdentifyCodeVO> listQuery(@Param("start") long start, @Param("count") int count,
            @Param("key") String key, @Param("type") Integer type);
    long countQuery(@Param("key") String key, @Param("type") Integer type);
}
fanli/src/main/java/com/yeshi/fanli/entity/admin/UserInfoAdmin.java
@@ -1,54 +1,46 @@
package com.yeshi.fanli.entity.admin;
import java.io.Serializable;
import com.yeshi.fanli.entity.bus.user.UserInfo;
public class UserInfoAdmin {
public class UserInfoAdmin implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    // 用户基本信息
    private UserInfo userInfo;
    private int tbNameState; // 淘宝昵称   1未录入 2已存在  3解绑
    private int wxNameState;// 微信昵称        1未录入 2已存在  3解绑
    private int phoneState; // 电话号码      1未录入 2已存在  3解绑
    // 最近下单时间
    private long lastOrderTime;
    // 微信昵称 -历史
    private String wxNameHistory;
    // 淘宝昵称-历史
    private String tbNameHistory;
    // 电话-历史
    private String phoneHistory;
    // 修改内容
    private String contentChange;
    // 未入账
    // 未到账收益
    private String unaccountedMoney;
    // 历史总收益
    private String totalMoneyHistory;
    // 累计提现
    // 累计提现金额
    private double totalExtract;
    // 今日订单
    private long todayOrder;
    // 本月订单
    private long monthOrder;
    // 累计订单
    private long totalOrder;
    // 一度队员
    // 最近下单时间
    private long lastOrderTime;
    // 一级队员
    private long countLevelOne;
    // 二度队员
    // 二级队员
    private long countLevelTwo;
    // 浏览足迹
    private long countScanHistory;
     // 分享商品
    // 分享商品
    private long countUserShares;
     // // 历史搜索
     // private String contentChange;
    // 支付包绑定id
    // 绑定支付包id
    private long accountBindId;
    // 支付宝
    private String accountAlipay;
@@ -56,7 +48,7 @@
    private String accountName;
    // 累计转账-支付宝
    private double totalMoney;
    // 微信绑定id
    private long accountBindIdWX;
    /// 微信账号
@@ -65,9 +57,14 @@
    private String accountNameWX;
    // 累计转账-微信
    private double totalMoneyWX;
    private int wxUnionIdState; // 微信unionId状态
    private int taobaoUidState; // 淘宝ID状态
    private int phoneState; // 手机号状态
    private int alipayAccountState; // 支付宝账号状态
    public UserInfo getUserInfo() {
        return userInfo;
@@ -77,39 +74,21 @@
        this.userInfo = userInfo;
    }
    public String getWxNameHistory() {
        return wxNameHistory;
    public String getUnaccountedMoney() {
        return unaccountedMoney;
    }
    public void setWxNameHistory(String wxNameHistory) {
        this.wxNameHistory = wxNameHistory;
    public void setUnaccountedMoney(String unaccountedMoney) {
        this.unaccountedMoney = unaccountedMoney;
    }
    public String getTbNameHistory() {
        return tbNameHistory;
    public String getTotalMoneyHistory() {
        return totalMoneyHistory;
    }
    public void setTbNameHistory(String tbNameHistory) {
        this.tbNameHistory = tbNameHistory;
    public void setTotalMoneyHistory(String totalMoneyHistory) {
        this.totalMoneyHistory = totalMoneyHistory;
    }
    public String getPhoneHistory() {
        return phoneHistory;
    }
    public void setPhoneHistory(String phoneHistory) {
        this.phoneHistory = phoneHistory;
    }
    public String getContentChange() {
        return contentChange;
    }
    public void setContentChange(String contentChange) {
        this.contentChange = contentChange;
    }
    public double getTotalExtract() {
        return totalExtract;
@@ -143,7 +122,53 @@
        this.totalOrder = totalOrder;
    }
    public long getLastOrderTime() {
        return lastOrderTime;
    }
    public void setLastOrderTime(long lastOrderTime) {
        this.lastOrderTime = lastOrderTime;
    }
    public long getCountLevelOne() {
        return countLevelOne;
    }
    public void setCountLevelOne(long countLevelOne) {
        this.countLevelOne = countLevelOne;
    }
    public long getCountLevelTwo() {
        return countLevelTwo;
    }
    public void setCountLevelTwo(long countLevelTwo) {
        this.countLevelTwo = countLevelTwo;
    }
    public long getCountScanHistory() {
        return countScanHistory;
    }
    public void setCountScanHistory(long countScanHistory) {
        this.countScanHistory = countScanHistory;
    }
    public long getCountUserShares() {
        return countUserShares;
    }
    public void setCountUserShares(long countUserShares) {
        this.countUserShares = countUserShares;
    }
    public long getAccountBindId() {
        return accountBindId;
    }
    public void setAccountBindId(long accountBindId) {
        this.accountBindId = accountBindId;
    }
    public String getAccountAlipay() {
        return accountAlipay;
@@ -167,6 +192,14 @@
    public void setTotalMoney(double totalMoney) {
        this.totalMoney = totalMoney;
    }
    public long getAccountBindIdWX() {
        return accountBindIdWX;
    }
    public void setAccountBindIdWX(long accountBindIdWX) {
        this.accountBindIdWX = accountBindIdWX;
    }
    public String getAccountWX() {
@@ -193,20 +226,20 @@
        this.totalMoneyWX = totalMoneyWX;
    }
    public int getTbNameState() {
        return tbNameState;
    public int getWxUnionIdState() {
        return wxUnionIdState;
    }
    public void setTbNameState(int tbNameState) {
        this.tbNameState = tbNameState;
    public void setWxUnionIdState(int wxUnionIdState) {
        this.wxUnionIdState = wxUnionIdState;
    }
    public int getWxNameState() {
        return wxNameState;
    public int getTaobaoUidState() {
        return taobaoUidState;
    }
    public void setWxNameState(int wxNameState) {
        this.wxNameState = wxNameState;
    public void setTaobaoUidState(int taobaoUidState) {
        this.taobaoUidState = taobaoUidState;
    }
    public int getPhoneState() {
@@ -217,77 +250,12 @@
        this.phoneState = phoneState;
    }
    public long getCountUserShares() {
        return countUserShares;
    public int getAlipayAccountState() {
        return alipayAccountState;
    }
    public void setCountUserShares(long countUserShares) {
        this.countUserShares = countUserShares;
    }
    public long getCountScanHistory() {
        return countScanHistory;
    }
    public void setCountScanHistory(long countScanHistory) {
        this.countScanHistory = countScanHistory;
    }
    public long getLastOrderTime() {
        return lastOrderTime;
    }
    public void setLastOrderTime(long lastOrderTime) {
        this.lastOrderTime = lastOrderTime;
    }
    public long getCountLevelOne() {
        return countLevelOne;
    }
    public void setCountLevelOne(long countLevelOne) {
        this.countLevelOne = countLevelOne;
    }
    public long getCountLevelTwo() {
        return countLevelTwo;
    }
    public void setCountLevelTwo(long countLevelTwo) {
        this.countLevelTwo = countLevelTwo;
    }
    public long getAccountBindId() {
        return accountBindId;
    }
    public void setAccountBindId(long accountBindId) {
        this.accountBindId = accountBindId;
    }
    public long getAccountBindIdWX() {
        return accountBindIdWX;
    }
    public void setAccountBindIdWX(long accountBindIdWX) {
        this.accountBindIdWX = accountBindIdWX;
    }
    public String getUnaccountedMoney() {
        return unaccountedMoney;
    }
    public void setUnaccountedMoney(String unaccountedMoney) {
        this.unaccountedMoney = unaccountedMoney;
    }
    public String getTotalMoneyHistory() {
        return totalMoneyHistory;
    }
    public void setTotalMoneyHistory(String totalMoneyHistory) {
        this.totalMoneyHistory = totalMoneyHistory;
    public void setAlipayAccountState(int alipayAccountState) {
        this.alipayAccountState = alipayAccountState;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -29,9 +29,49 @@
        <result column="state_desc" property="stateDesc" jdbcType="VARCHAR" />
        <!-- <association property="system" column="sid" resultMap="com.yeshi.fanli.dao.mybatis.SystemMapper.BaseResultMap" 
            /> -->
    </resultMap>
    <resultMap id="BaseResultMapVO" type="com.yeshi.fanli.vo.user.UserInfoVO">
        <id column="id" property="id" jdbcType="BIGINT" />
        <result column="identifycode" property="openid" jdbcType="VARCHAR" />
        <result column="login_type" property="loginType" jdbcType="INTEGER" />
        <result column="wx_open_id" property="wxOpenId" jdbcType="VARCHAR" />
        <result column="wx_union_id" property="wxUnionId" jdbcType="VARCHAR" />
        <result column="nick_name" property="nickName" jdbcType="VARCHAR" />
        <result column="tbName" property="tbName" jdbcType="VARCHAR" />
        <result column="tbPic" property="tbPic" jdbcType="VARCHAR" />
        <result column="wxName" property="wxName" jdbcType="VARCHAR" />
        <result column="wxPic" property="wxPic" jdbcType="VARCHAR" />
        <result column="portrait" property="portrait" jdbcType="VARCHAR" />
        <result column="createtime" property="createtime" jdbcType="BIGINT" />
        <result column="last_logintime" property="lastLoginTime"
            jdbcType="BIGINT" />
        <result column="loginip" property="lastLoginIp" jdbcType="VARCHAR" />
        <result column="tuiguang_code" property="tuiGuangCode"
            jdbcType="VARCHAR" />
        <result column="appid" property="appId" jdbcType="VARCHAR" />
        <result column="my_hongBao" property="myHongBao" jdbcType="DECIMAL" />
        <result column="pay_password" property="payPassword" jdbcType="VARCHAR" />
        <result column="rank" property="rank" jdbcType="INTEGER" />
        <result column="phone" property="phone" jdbcType="VARCHAR" />
        <result column="state" property="state" jdbcType="INTEGER" />
        <result column="state_desc" property="stateDesc" jdbcType="VARCHAR" />
        <result column="ur_id" property="rankId" jdbcType="BIGINT" />
        <result column="ur_name" property="rankName"    jdbcType="VARCHAR" />
        <result column="ur_picture" property="rankPicture"    jdbcType="VARCHAR" />
        <result column="totalOrder" property="totalOrder"    jdbcType="BIGINT" />
        <result column="monthOrder" property="monthOrder"    jdbcType="BIGINT" />
        <result column="f_wxUnionId" property="f_wxUnionId"    jdbcType="VARCHAR" />
        <result column="f_taobaoUid" property="f_taobaoUid"    jdbcType="VARCHAR" />
        <result column="f_phone" property="f_phone"    jdbcType="VARCHAR" />
        <result column="f_alipayAccount" property="f_alipayAccount"    jdbcType="VARCHAR" />
    </resultMap>
    <sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,tuiguang_code,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
@@ -211,88 +251,133 @@
     call procedure_connect_user(#{mainUid},#{lessUid})
    </select>
    
    <select id="query"  resultMap="BaseResultMap">
           SELECT u.*
           <if test="orderField != null and orderField != 5 and orderField != 6">
    <select id="query"  resultMap="BaseResultMapVO">
           SELECT *
           ,(SELECT COUNT(hb.hb_id) FROM `yeshi_ec_hongbao_v2` hb 
                   WHERE hb.hb_uid = u.id AND (hb.hb_type = 1 or hb.hb_type = 2)
               <if test="orderMode == 2">
                AND DATE_FORMAT(hb.`hb_create_time`,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m')
            </if>
           )AS total
           </if>
               <if test="orderMode == 3">
                ,(SELECT COUNT(tr.`id`) FROM `yeshi_ec_threesale` tr
                     WHERE  tr.`boss_id`=u.id AND tr.state = 1) AS totalThree
             </if>
                   WHERE hb.hb_uid = u.id AND hb.hb_type = 1 )AS totalOrder <!-- 累计订单 -->
           ,(SELECT COUNT(hb.hb_id) FROM `yeshi_ec_hongbao_v2` hb
                   WHERE hb.hb_uid = u.id AND hb.hb_type = 1
                   AND DATE_FORMAT(hb.`hb_create_time`,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m'))AS monthOrder <!-- 累计本月订单 -->
        ,(SELECT COUNT(tr.`id`) FROM `yeshi_ec_threesale` tr  <!-- 队员 -->
             WHERE  tr.`boss_id`=u.id AND tr.state = 1) AS totalPlayers
           FROM yeshi_ec_user u 
               LEFT JOIN yeshi_ec_binding_account  b ON u.`id` = b.`uid`  
           where  1=1
                <if test="key != null and key !='' ">
                   AND    (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%'  OR u.`wxName` LIKE '%${key}%'
                   OR u.`nick_name` LIKE '%${key}%'  OR u.`tbName` LIKE '%${key}%' OR b.`account` LIKE '%${key}%')
                </if>
                <if test="startTime != null and startTime !='' ">
                   <![CDATA[ AND FROM_UNIXTIME(createtime/1000) >= '${startTime}' ]]>
                </if>
                <if test="endTime != null and endTime !=''">
                   <![CDATA[ AND FROM_UNIXTIME(createtime/1000) < '${endTime}'  ]]>
                </if>
                   <if test="userType != null">
                   AND u.rank = #{userType}
                </if>
                  <if test="days != null">
                <!--  时间   -->
                    AND <![CDATA[DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(createtime/1000)]]>
               LEFT JOIN yeshi_ec_user_info_extra  ext ON u.`id` = ext.uie_uid
               LEFT JOIN yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
        <if test="userState == 2"> <!-- 封禁用户 -->
               LEFT JOIN
            (SELECT A.uid AS buid,MAX(A.f_wxUnionId) AS f_wxUnionId ,MAX(A.f_taobaoUid) AS f_taobaoUid,MAX(A.f_phone) AS f_phone,MAX(A.f_alipayAccount) AS f_alipayAccount FROM
            (SELECT u.`id`AS uid,b.account AS alipayAccount,b.name AS alipayAccountName,fu.* FROM yeshi_ec_user u
            LEFT JOIN yeshi_ec_binding_account b ON b.`uid` = u.`id`
            LEFT JOIN (SELECT fc.fuc_effective,IF(fc.`fuc_type` = 'wxUnionId',fc.`fuc_identify_code`,NULL)AS f_wxUnionId,
                IF(fc.`fuc_type` = 'taobaoUid',fc.`fuc_identify_code`,NULL)AS f_taobaoUid,
                IF(fc.`fuc_type` = 'phone',fc.`fuc_identify_code`,NULL)AS f_phone,
                IF(fc.`fuc_type` = 'alipayAccount',fc.`fuc_identify_code`,NULL)AS f_alipayAccount
            FROM yeshi_ec_forbidden_user_identify_code fc)fu ON (fu.f_wxUnionId = u.`wx_union_id` OR fu.f_taobaoUid = u.`identifycode` OR fu.f_phone = u.`phone` OR fu.f_alipayAccount = b.`account`)
            WHERE b.`type`= 1 AND fu.fuc_effective = 1
            )A GROUP BY A.uid) B ON u.id= B.buid
           </if>
           where 1=1
               <if test="userState == 1">
                   AND u.`state` <![CDATA[<>]]> 2 <!--  正常用户 -->
               </if>
               <if test="userState == 2">
                    AND u.`state` =2   <!-- 封禁用户 -->
               </if>
               <if test="startTime != null and startTime !='' ">
                   AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]> DATE_FORMAT(#{startTime},'%Y%m%d')
               </if>
               <if test="endTime != null and endTime !=''">
                   AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[<=]]> DATE_FORMAT(#{endTime},'%Y%m%d')
               </if>
                  <if test="userRank != null">
                   AND rak.ur_name = #{userRank}
               </if>
               <if test="days != null">
                    <!--  注册时间   -->
                    AND <![CDATA[DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(u.createtime/1000)]]>
            </if>
               <if test="key != null and key !='' ">
                   <if test="keyType == 1">
                       AND    u.id  = #{key}
                   </if>
                   <if test="keyType == 2">
                       AND    u.`nick_name` LIKE '%${key}%'
                   </if>
                   <if test="keyType == 3">
                       AND    u.`phone` = #{key}
                   </if>
                   <if test="keyType == 3">
                       AND    b.`account` = #{key}
                   </if>
               </if>
              
              ORDER BY 
              <if test="orderField == 1">
                  total,
                  totalOrder,
              </if>
              <if test="orderField == 2">
                  total DESC,
                  totalOrder DESC,
              </if>
               <if test="orderField == 3">
                  total,
              <if test="orderField == 3">
                  monthOrder,
              </if>
              <if test="orderField == 4">
                  total DESC,
                  monthOrder DESC,
              </if>
              <if test="orderField == 5">
                  totalThree,
                  totalPlayers,
              </if>
              <if test="orderField == 6">
                  totalThree DESC,
                  totalPlayers DESC,
              </if>
              u.createtime DESC
              
              createtime DESC  LIMIT ${start},${count}
              LIMIT ${start},${count}
    </select>
    
    <select id="queryCount" resultType="java.lang.Long">
           SELECT count(u.id) FROM yeshi_ec_user u
           SELECT IFNULL(count(u.id),0) FROM yeshi_ec_user u
               LEFT JOIN yeshi_ec_binding_account  b ON u.`id` = b.`uid`  
           where <![CDATA[ 1>0 ]]>
                 <if test="key != null and key !='' ">
                   AND    (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%'  OR u.`wxName` LIKE '%${key}%'
                   OR u.`nick_name` LIKE '%${key}%'  OR u.`tbName` LIKE '%${key}%' OR b.`account` LIKE '%${key}%')
                </if>
               LEFT JOIN yeshi_ec_user_info_extra  ext ON u.`id` = ext.uie_uid
               LEFT JOIN yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
           where 1=1
                <if test="userState == 1">
                   AND u.`state` <![CDATA[<>]]> 2 <!--  正常用户 -->
               </if>
               <if test="userState == 2">
                    AND u.`state` =2   <!-- 封禁用户 -->
               </if>
                <if test="startTime != null and startTime !='' ">
                   <![CDATA[ AND FROM_UNIXTIME(createtime/1000) >= '${startTime}' ]]>
                   AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]> DATE_FORMAT(#{startTime},'%Y%m%d')
                </if>
                <if test="endTime != null and endTime !=''">
                   <![CDATA[ AND FROM_UNIXTIME(createtime/1000) < '${endTime}'  ]]>
                   AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[<=]]> DATE_FORMAT(#{endTime},'%Y%m%d')
                </if>
                   <if test="userType != null">
                   AND u.rank = #{userType}
                   <if test="userRank != null">
                   AND rak.ur_name = #{userRank}
                </if>
                  <if test="days != null">
                <!--  时间   -->
                    AND <![CDATA[DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(createtime/1000)]]>
            </if>
                <if test="days != null">  <!--  注册时间   -->
                    AND <![CDATA[DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(u.createtime/1000)]]>
             </if>
             <if test="key != null and key !='' ">
                   <if test="keyType == 1">
                       AND    u.id  = #{key}
                   </if>
                   <if test="keyType == 2">
                       AND    u.`nick_name` LIKE '%${key}%'
                   </if>
                   <if test="keyType == 3">
                       AND    u.`phone` = #{key}
                   </if>
                   <if test="keyType == 3">
                       AND    b.`account` = #{key}
                   </if>
               </if>
    </select>
    
    <select id="querySumMoney" resultType="java.lang.Double">
@@ -495,4 +580,5 @@
              AND (u.`phone` =#{phone} OR uf.`uie_invite_code` = #{inviteCode})
        LIMIT 1
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2CountMapper.xml
@@ -3,6 +3,35 @@
<mapper namespace="com.yeshi.fanli.dao.mybatis.HongBaoV2CountMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.HongBaoV2">
        <id column="hb_id" property="id" jdbcType="BIGINT" />
        <result column="hb_urank" property="urank" jdbcType="INTEGER" />
        <result column="hb_money" property="money" jdbcType="DECIMAL" />
        <result column="hb_type" property="type" jdbcType="INTEGER" />
        <result column="hb_state" property="state" jdbcType="INTEGER" />
        <result column="hb_version" property="version" jdbcType="INTEGER" />
        <result column="hb_beizhu" property="beizhu" jdbcType="VARCHAR" />
        <result column="hb_pre_get_time" property="preGetTime"
            jdbcType="TIMESTAMP" />
        <result column="hb_get_time" property="getTime" jdbcType="TIMESTAMP" />
        <result column="hb_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="hb_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <association property="userInfo" column="hb_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="hb_uid" property="id" jdbcType="BIGINT" />
        </association>
        <association property="parent" column="hb_pid"
            javaType="com.yeshi.fanli.entity.bus.user.HongBaoV2">
            <id column="hb_pid" property="id" jdbcType="BIGINT" />
        </association>
        <result column="totalMoney" property="totalMoney" jdbcType="DECIMAL" />
    </resultMap>
    <sql id="Column_DateType">
        <if test="dateType == 1">
            DATE_FORMAT(t.`hb_create_time`,'%Y-%m-%d') AS 'showDate'
@@ -217,4 +246,15 @@
    </select>
    
    <select id="listShareAndInviteMoney" resultMap="BaseResultMap">
        SELECT IFNULL(SUM(h.`hb_money`),0) as totalMoney,h.*
        FROM `yeshi_ec_hongbao_v2` h
        WHERE  h.hb_state <![CDATA[<>]]>4
        AND DATE_FORMAT(h.hb_create_time, '%Y-%m-%d' )= #{date}
        AND ( h.`hb_type` =5 OR h.`hb_type` =6 OR h.`hb_type` =7 OR h.`hb_type` =20 OR h.`hb_type` =21 OR h.`hb_type` =22 )
        GROUP BY h.`hb_uid`
        ORDER BY totalMoney DESC
        LIMIT ${start},${count}
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/ForbiddenUserIdentifyCodeMapper.xml
@@ -18,20 +18,6 @@
            jdbcType="TIMESTAMP" />
    </resultMap>
    
    <resultMap id="BaseResultMapVO" type="com.yeshi.fanli.vo.user.ForbiddenUserIdentifyCodeVO">
        <result column="f_wxUnionId" property="f_wxUnionId"    jdbcType="VARCHAR" />
        <result column="f_taobaoUid" property="f_taobaoUid"    jdbcType="VARCHAR" />
        <result column="f_phone" property="f_phone"    jdbcType="VARCHAR" />
        <result column="f_alipayAccount" property="f_alipayAccount"    jdbcType="VARCHAR" />
        <result column="alipayAccount" property="alipayAccount"    jdbcType="VARCHAR" />
        <result column="alipayAccountName" property="alipayAccountName"    jdbcType="VARCHAR" />
        <association property="userInfo" column="id"
            resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap"/>
    </resultMap>
    <sql id="Base_Column_List">fuc_id,fuc_type,fuc_identify_code,fuc_effective,fuc_create_time,fuc_update_time,fuc_beizhu
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
@@ -110,70 +96,4 @@
        </set>
        where fuc_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="listQuery" resultMap="BaseResultMapVO">
        SELECT * FROM (SELECT A.uid,A.alipayAccount,A.alipayAccountName,MAX(A.f_wxUnionId) AS f_wxUnionId ,MAX(A.f_taobaoUid) AS f_taobaoUid,MAX(A.f_phone) AS f_phone,MAX(A.f_alipayAccount) AS f_alipayAccount FROM
        (SELECT u.`id`AS uid,b.account AS alipayAccount,b.name AS alipayAccountName,fu.* FROM yeshi_ec_user u
        LEFT JOIN yeshi_ec_binding_account b ON b.`uid` = u.`id`
        LEFT JOIN (SELECT fc.fuc_effective,IF(fc.`fuc_type` = 'wxUnionId',fc.`fuc_identify_code`,NULL)AS f_wxUnionId,
            IF(fc.`fuc_type` = 'taobaoUid',fc.`fuc_identify_code`,NULL)AS f_taobaoUid,
            IF(fc.`fuc_type` = 'phone',fc.`fuc_identify_code`,NULL)AS f_phone,
            IF(fc.`fuc_type` = 'alipayAccount',fc.`fuc_identify_code`,NULL)AS f_alipayAccount
        FROM yeshi_ec_forbidden_user_identify_code fc)fu ON (fu.f_wxUnionId = u.`wx_union_id` OR fu.f_taobaoUid = u.`identifycode` OR fu.f_phone = u.`phone` OR fu.f_alipayAccount = b.`account`)
        WHERE b.`type`= 1 AND fu.fuc_effective = 1
            <if test="key != null and key != '' ">
                AND fu.fuc_identify_code = '%#{key}%'
            </if>
            <if test="type == 1">
                AND fu.fuc_type = 'wxUnionId'
            </if>
            <if test="type == 2">
                AND fu.fuc_type = 'taobaoUid'
            </if>
            <if test="type == 3">
                AND fu.fuc_type = 'phone'
            </if>
            <if test="type == 4">
                AND fu.fuc_type = 'alipayAccount'
            </if>
        )A
        GROUP BY A.uid) B
        LEFT JOIN yeshi_ec_user u ON u.id= B.uid
        LIMIT ${start},${count}
    </select>
    <select id="countQuery" resultType="java.lang.Long">
        SELECT IFNULL(COUNT(DISTINCT A.uid),0) FROM
        (SELECT u.`id`AS uid,fu.* FROM yeshi_ec_user u
        LEFT JOIN yeshi_ec_binding_account b ON b.`uid` = u.`id`
        LEFT JOIN (SELECT fc.fuc_effective,IF(fc.`fuc_type` = 'wxUnionId',fc.`fuc_identify_code`,NULL)AS f_wxUnionId,
            IF(fc.`fuc_type` = 'taobaoUid',fc.`fuc_identify_code`,NULL)AS f_taobaoUid,
            IF(fc.`fuc_type` = 'phone',fc.`fuc_identify_code`,NULL)AS f_phone,
            IF(fc.`fuc_type` = 'alipayAccount',fc.`fuc_identify_code`,NULL)AS f_alipayAccount
        FROM yeshi_ec_forbidden_user_identify_code fc)fu ON (fu.f_wxUnionId = u.`wx_union_id` OR fu.f_taobaoUid = u.`identifycode` OR fu.f_phone = u.`phone` OR fu.f_alipayAccount = b.`account`)
        WHERE b.`type`= 1 AND fu.fuc_effective = 1
            <if test="key != null and key != '' ">
                AND fu.fuc_identify_code = '%#{key}%'
            </if>
            <if test="type == 1">
                AND fu.fuc_type = 'wxUnionId'
            </if>
            <if test="type == 2">
                AND fu.fuc_type = 'taobaoUid'
            </if>
            <if test="type == 3">
                AND fu.fuc_type = 'phone'
            </if>
            <if test="type == 4">
                AND fu.fuc_type = 'alipayAccount'
            </if>
        )A
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/count/HongBaoV2CountServiceImpl.java
@@ -25,6 +25,7 @@
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.vo.order.HongBaoV2VO;
@Service
public class HongBaoV2CountServiceImpl implements HongBaoV2CountService {
@@ -289,4 +290,12 @@
            String startTime, String endTime) throws Exception{
        return hongBaoV2CountMapper.count24HOderByChannel(channel, type, years, startTime, endTime);
    }
    @Override
    public List<HongBaoV2VO> listShareAndInviteMoney(long start, int count, String date) {
        return hongBaoV2CountMapper.listShareAndInviteMoney(start, count, date);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ForbiddenUserIdentifyCodeServiceImpl.java
@@ -13,7 +13,6 @@
import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.vo.user.ForbiddenUserIdentifyCodeVO;
@Service
public class ForbiddenUserIdentifyCodeServiceImpl implements ForbiddenUserIdentifyCodeService {
@@ -65,48 +64,7 @@
    
    @Override
    public List<ForbiddenUserIdentifyCodeVO> listQuery(long start, int count, String key, Integer type) {
        List<ForbiddenUserIdentifyCodeVO> list = forbiddenUserIdentifyCodeMapper.listQuery(start, count, key, type);
        if (list == null || list.size() == 0) {
            return list;
        }
        for (ForbiddenUserIdentifyCodeVO forbiddenUserIdentifyCodeVO: list) {
            String f_alipayAccount = forbiddenUserIdentifyCodeVO.getF_alipayAccount();
            if (f_alipayAccount != null && f_alipayAccount.trim().length() > 0) {
                forbiddenUserIdentifyCodeVO.setAlipayAccountState(1);
            }
            String f_phone = forbiddenUserIdentifyCodeVO.getF_phone();
            if (f_phone != null && f_phone.trim().length() > 0) {
                forbiddenUserIdentifyCodeVO.setPhoneState(1);
            }
            String f_taobaoUid = forbiddenUserIdentifyCodeVO.getF_taobaoUid();
            if (f_taobaoUid != null && f_taobaoUid.trim().length() > 0) {
                forbiddenUserIdentifyCodeVO.setTaobaoUidState(1);
            }
            String f_wxUnionId = forbiddenUserIdentifyCodeVO.getF_wxUnionId();
            if (f_wxUnionId != null && f_wxUnionId.trim().length() > 0) {
                forbiddenUserIdentifyCodeVO.setWxUnionIdState(1);
            }
        }
        return list;
    }
    @Override
    public long countQuery(String key,  Integer type) {
        return forbiddenUserIdentifyCodeMapper.countQuery(key, type);
    }
    @Override
    public void saveForbiddenInfo(String identifyCode, Integer type, boolean state) throws ForbiddenUserIdentifyCodeException{
    public void saveForbiddenInfo(String identifyCode, Integer type) throws ForbiddenUserIdentifyCodeException{
        
        ForbiddenUserIdentifyCodeTypeEnum typeEnum = null;
        
@@ -134,20 +92,16 @@
        ForbiddenUserIdentifyCode codeObject = listByTypeAndIdentifyCode(typeEnum ,identifyCode);
        if (codeObject == null) {
            // 封禁账户
            if (state) {
                codeObject = new ForbiddenUserIdentifyCode();
                codeObject.setType(typeEnum);
                codeObject.setIdentifyCode(identifyCode);
                codeObject.setEffective(state);
                codeObject.setCreateTime(new Date());
                codeObject.setUpdateTime(new Date());
                forbiddenUserIdentifyCodeMapper.insertSelective(codeObject);
            } else {
                throw new ForbiddenUserIdentifyCodeException(1, "未找到可解封号码");
            }
            codeObject = new ForbiddenUserIdentifyCode();
            codeObject.setType(typeEnum);
            codeObject.setIdentifyCode(identifyCode);
            codeObject.setEffective(true);
            codeObject.setCreateTime(new Date());
            codeObject.setUpdateTime(new Date());
            forbiddenUserIdentifyCodeMapper.insertSelective(codeObject);
        } else {
            codeObject.setEffective(state);
            codeObject.setEffective(false);
            codeObject.setUpdateTime(new Date());
            forbiddenUserIdentifyCodeMapper.updateByPrimaryKeySelective(codeObject);
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java
@@ -34,7 +34,6 @@
import com.yeshi.fanli.dao.mybatis.UserShareGoodsHistoryMapper;
import com.yeshi.fanli.dao.mybatis.share.ShareMapper;
import com.yeshi.fanli.dao.user.UserInfoDao;
import com.yeshi.fanli.entity.admin.UserInfoAdmin;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.InviteUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -54,6 +53,7 @@
import com.yeshi.fanli.util.Utils;
import com.yeshi.fanli.util.account.UserUtil;
import com.yeshi.fanli.util.wx.WXLoginUtil;
import com.yeshi.fanli.vo.user.UserInfoVO;
@Service
public class UserInfoServiceImpl implements UserInfoService {
@@ -636,137 +636,126 @@
    }
    @Override
    public List<UserInfoAdmin> query(long start, int count, String key, Integer userType, Integer days,
            String startTime, String endTime, Integer orderField, Integer orderMode) {
    public long queryCount( Integer userState, String key, Integer keyType, String userRank, Integer days, String startTime, String endTime) {
        return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime);
    }
    @Override
    public List<UserInfoVO> query(long start, int count,  Integer userState, String key, Integer keyType,
            String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode) {
        List<UserInfoAdmin> adminList = new ArrayList<UserInfoAdmin>();
        List<UserInfo> userList = userInfoMapper.query(start, count, key, userType, days, startTime, endTime,
        List<UserInfoVO> userList = userInfoMapper.query(start, count,userState, key, keyType, userRank, days, startTime, endTime,
                orderField, orderMode);
        if (userList == null || userList.size() == 0) {
            return null;
        }
        for (UserInfo userInfo : userList) {
            UserInfoAdmin userInfoAdmin = new UserInfoAdmin();
            Long lastLoginTime = userInfo.getLastLoginTime();
            if (lastLoginTime == null) {
                userInfo.setLastLoginTime(0L);
            }
            userInfoAdmin.setUserInfo(userInfo);
            String wxName = userInfo.getWxName();
            if (StringUtil.isNullOrEmpty(wxName)) {
                userInfoAdmin.setWxNameState(1);
            } else {
                userInfoAdmin.setWxNameState(2);
            }
            String phone = userInfo.getPhone();
            if (StringUtil.isNullOrEmpty(phone)) {
                userInfoAdmin.setPhoneState(1);
            } else {
                userInfoAdmin.setPhoneState(2);
            }
            String tbName = userInfo.getTbName();
            if (StringUtil.isNullOrEmpty(tbName)) {
                userInfoAdmin.setTbNameState(1);
            } else {
                userInfoAdmin.setTbNameState(2);
            }
            Long uid = userInfo.getId();
            /* 绑定账号信息 */
            List<BindingAccount> account = bindingAccountMapper.selectByUid(uid);
            if (account != null && account.size() > 0) {
                BindingAccount bindingAccount = account.get(0);
                Integer type = bindingAccount.getType();
                if (type != null && type == 1) {
                    // 支付宝
                    userInfoAdmin.setAccountAlipay(bindingAccount.getAccount());
                    userInfoAdmin.setAccountName(bindingAccount.getName());
                    userInfoAdmin.setAccountBindId(bindingAccount.getId());
                } else if (type != null && type == 2) {
                    // 微信
                    userInfoAdmin.setAccountWX(bindingAccount.getAccount());
                    userInfoAdmin.setAccountNameWX(bindingAccount.getName());
                    userInfoAdmin.setAccountBindIdWX(bindingAccount.getId());
                }
            }
            // 最后一次下单时间
            Date lastOrderTime = hongBaoV2CountService.getLastHongBaoTime(uid);
            if (lastOrderTime == null) {
                userInfoAdmin.setLastOrderTime(0);
            } else {
                userInfoAdmin.setLastOrderTime(lastOrderTime.getTime());
            }
            // 历史总订单
            long totalOrder = hongBaoV2CountService.countValidNumberByUid(uid, null);
            // 今日总订单
            long todayOrder = hongBaoV2CountService.countValidNumberByUid(uid, 1);
            // 本月总订单
            long monthOrder = hongBaoV2CountService.countValidNumberByUid(uid, 2);
            userInfoAdmin.setTotalOrder(totalOrder);
            userInfoAdmin.setTodayOrder(todayOrder);
            userInfoAdmin.setMonthOrder(monthOrder);
            // 未领取红包 待入账金额
            BigDecimal unaccountedMoney = hongBaoV2CountService.countWillGetMoneyByUid(uid);
            if (unaccountedMoney == null) {
                unaccountedMoney = new BigDecimal(0);
            }
            userInfoAdmin.setUnaccountedMoney(unaccountedMoney.toString());
            // 历史总收益
            BigDecimal totalMoneyHistory = hongBaoV2CountService.countMoneyByUidAndState(uid, 3);
            if (totalMoneyHistory == null) {
                totalMoneyHistory = new BigDecimal(0);
            }
            userInfoAdmin.setTotalMoneyHistory(totalMoneyHistory.toString());
            // 支付宝账号 累计转账总金额
            double totalMoney = payInfoMapper.sumMoneyByUid(uid);
            userInfoAdmin.setTotalMoney(totalMoney);
            // 累计提现 (暂未计入微信)
            userInfoAdmin.setTotalExtract(totalMoney);
            // 统计分享个数
            long countUserShares = userShareGoodsHistoryMapper.countUserShares(uid);
            userInfoAdmin.setCountUserShares(countUserShares);
            // 统计浏览足迹
            long countScanHistory = scanHistoryMapper.countUserScanHistory(uid);
            userInfoAdmin.setCountScanHistory(countScanHistory);
            // 一度队员数量
            int firstTeamCount = shareMapper.myFirstTeamCount(uid + "");
            userInfoAdmin.setCountLevelOne(firstTeamCount);
            // 二度队员数量
            int secondTeamCount = shareMapper.mySecondTeamCount(uid + "");
            userInfoAdmin.setCountLevelTwo(secondTeamCount);
            adminList.add(userInfoAdmin);
        for (UserInfoVO userInfoVO : userList) {
            // 数据加工处理
            convertUserInfoVOData(userInfoVO);
        }
        return adminList;
        return userList;
    }
    public void convertUserInfoVOData(UserInfoVO userInfoVO) {
        String f_alipayAccount = userInfoVO.getF_alipayAccount();
        if (f_alipayAccount != null && f_alipayAccount.trim().length() > 0) {
            userInfoVO.setAlipayAccountState(1);
        }
        String f_phone = userInfoVO.getF_phone();
        if (f_phone != null && f_phone.trim().length() > 0) {
            userInfoVO.setPhoneState(1);
        }
        String f_taobaoUid = userInfoVO.getF_taobaoUid();
        if (f_taobaoUid != null && f_taobaoUid.trim().length() > 0) {
            userInfoVO.setTaobaoUidState(1);
        }
        String f_wxUnionId = userInfoVO.getF_wxUnionId();
        if (f_wxUnionId != null && f_wxUnionId.trim().length() > 0) {
            userInfoVO.setWxUnionIdState(1);
        }
        // 最近登录时间
        Long lastLoginTime = userInfoVO.getLastLoginTime();
        if (lastLoginTime != null && lastLoginTime == 0) {
            userInfoVO.setLastLoginTime(null);
        }
        Long uid = userInfoVO.getId();
        /* 绑定收款账号信息 */
        List<BindingAccount> account = bindingAccountMapper.selectByUid(uid);
        if (account != null && account.size() > 0) {
            BindingAccount bindingAccount = account.get(0);
            Integer type = bindingAccount.getType();
            if (type != null && type == 1) {
                // 支付宝
                userInfoVO.setAccountAlipay(bindingAccount.getAccount());
                userInfoVO.setAccountName(bindingAccount.getName());
                userInfoVO.setAccountBindId(bindingAccount.getId());
            } else if (type != null && type == 2) {
                // 微信
                userInfoVO.setAccountWX(bindingAccount.getAccount());
                userInfoVO.setAccountNameWX(bindingAccount.getName());
                userInfoVO.setAccountBindIdWX(bindingAccount.getId());
            }
        }
        // 最近一次下单时间
        Date lastOrderTime = hongBaoV2CountService.getLastHongBaoTime(uid);
        if (lastOrderTime != null) {
            userInfoVO.setLastOrderTime(lastOrderTime.getTime());
        }
        // 今日总订单
        long todayOrder = hongBaoV2CountService.countValidNumberByUid(uid, 1);
        userInfoVO.setTodayOrder(todayOrder);
        // 未领取红包 待入账金额
        BigDecimal unaccountedMoney = hongBaoV2CountService.countWillGetMoneyByUid(uid);
        if (unaccountedMoney == null) {
            unaccountedMoney = new BigDecimal(0);
        }
        userInfoVO.setUnaccountedMoney(unaccountedMoney.toString());
        // 历史总收益
        BigDecimal totalMoneyHistory = hongBaoV2CountService.countMoneyByUidAndState(uid, 3);
        if (totalMoneyHistory == null) {
            totalMoneyHistory = new BigDecimal(0);
        }
        userInfoVO.setTotalMoneyHistory(totalMoneyHistory.toString());
        // 支付宝账号 累计转账总金额
        double totalMoney = payInfoMapper.sumMoneyByUid(uid);
        userInfoVO.setTotalMoney(totalMoney);
        // 累计提现 (暂未计入微信)
        userInfoVO.setTotalExtract(totalMoney);
        // 统计分享个数
        long countUserShares = userShareGoodsHistoryMapper.countUserShares(uid);
        userInfoVO.setCountUserShares(countUserShares);
        // 统计浏览足迹
        long countScanHistory = scanHistoryMapper.countUserScanHistory(uid);
        userInfoVO.setCountScanHistory(countScanHistory);
        // 一度队员数量
        int firstTeamCount = shareMapper.myFirstTeamCount(uid + "");
        userInfoVO.setCountLevelOne(firstTeamCount);
        // 二度队员数量
        int secondTeamCount = shareMapper.mySecondTeamCount(uid + "");
        userInfoVO.setCountLevelTwo(secondTeamCount);
    }
    @Override
    public long queryCount(String key, Integer userType, Integer days, String startTime, String endTime) {
        return userInfoMapper.queryCount(key, userType, days, startTime, endTime);
    }
    @Override
    public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime) {
@@ -828,5 +817,5 @@
    public UserInfo getInfoByPhoneOrInviteCode(String phone, String inviteCode) {
        return userInfoMapper.getInfoByPhoneOrInviteCode(phone, inviteCode);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserRankingsServiceImpl.java
@@ -20,6 +20,7 @@
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.dao.mybatis.UserRankingsMapper;
import com.yeshi.fanli.entity.admin.InviteGetMoney;
@@ -27,11 +28,10 @@
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserRankings;
import com.yeshi.fanli.exception.UserRankingsException;
import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.service.inter.user.UserRankingsService;
import com.yeshi.fanli.util.StringUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.vo.order.HongBaoV2VO;
@Service
public class UserRankingsServiceImpl implements UserRankingsService {
@@ -39,7 +39,7 @@
    @Resource
    private UserRankingsMapper userRankingsMapper;
    @Resource
    private HongBaoService hongBaoService;
    private HongBaoV2CountService hongBaoV2CountService;
    @Override
    public int insertSelective(UserRankings record) throws UserRankingsException {
@@ -369,18 +369,18 @@
            String defaultDate = sdf.format(calendar.getTime()); // 格式化前一天
            // 真实用户
            List<HongBao> listHongBao = hongBaoService.listShareAndInviteMoney(0, count, defaultDate);
            List<HongBaoV2VO> listHongBao = hongBaoV2CountService.listShareAndInviteMoney(0, count, defaultDate);
            if (listHongBao != null && listHongBao.size() > 0) {
                HongBao hongBao = listHongBao.get(0);
                BigDecimal maxMoney = hongBao.getShareAndInviteMoney();
                HongBaoV2VO hongBao = listHongBao.get(0);
                BigDecimal maxMoney = hongBao.getTotalMoney();
                UserRankings userRankings = userRankingsList.get(userRankingsList.size() - 1);
                BigDecimal mminMoney = userRankings.getTradeReward();
                // 真实数据大于最低金额
                if (maxMoney.compareTo(mminMoney) > 0) {
                    for (HongBao hb : listHongBao) {
                        BigDecimal rewardMoney = hb.getShareAndInviteMoney();
                    for (HongBaoV2VO hb : listHongBao) {
                        BigDecimal rewardMoney = hb.getTotalMoney();
                        // 奖金高到低排序,不满足结束循环
                        if (rewardMoney.compareTo(mminMoney) <= 0) {
fanli/src/main/java/com/yeshi/fanli/service/inter/count/HongBaoV2CountService.java
@@ -5,6 +5,8 @@
import java.util.List;
import java.util.Map;
import com.yeshi.fanli.vo.order.HongBaoV2VO;
public interface HongBaoV2CountService {
    
@@ -110,5 +112,14 @@
     */
    public List<Map<String, Object>> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
            String endTime) throws Exception;
    /**
     * 查询邀请=分享奖金
     * @param start
     * @param count
     * @param date
     * @return
     */
    public List<HongBaoV2VO> listShareAndInviteMoney(long start, int count, String date);
    
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/ForbiddenUserIdentifyCodeService.java
@@ -1,11 +1,8 @@
package com.yeshi.fanli.service.inter.user;
import java.util.List;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
import com.yeshi.fanli.vo.user.ForbiddenUserIdentifyCodeVO;
public interface ForbiddenUserIdentifyCodeService {
@@ -40,24 +37,12 @@
    public void delete(ForbiddenUserIdentifyCode identifyCode);
    /**
     * 查询已封禁的号码   用户信息
     * @param start
     * @param count
     * @param key
     * @param type
     * @return
     */
    public List<ForbiddenUserIdentifyCodeVO> listQuery(long start, int count, String key, Integer type);
    public long countQuery(String key, Integer type);
    /**
     * 对账号封禁、解封操作
     * @param identifyCode 号码
     * @param type  类型   
     * @param state  状态: true 封
     * @throws ForbiddenUserIdentifyCodeException
     */
    public void saveForbiddenInfo(String identifyCode, Integer type, boolean state) throws ForbiddenUserIdentifyCodeException;
    public void saveForbiddenInfo(String identifyCode, Integer type) throws ForbiddenUserIdentifyCodeException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoService.java
@@ -5,9 +5,9 @@
import java.util.List;
import java.util.Map;
import com.yeshi.fanli.entity.admin.UserInfoAdmin;
import com.yeshi.fanli.entity.bus.user.InviteUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.vo.user.UserInfoVO;
public interface UserInfoService {
    /**
@@ -108,10 +108,10 @@
     * @param orderMode
     * @return
     */
    public List<UserInfoAdmin> query(long start, int count, String key, Integer userType,
    public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType, String userRank,
            Integer days, String startTime, String endTime,Integer orderField, Integer orderMode);
    public long queryCount(String key, Integer userType, Integer days, String startTime,
    public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days, String startTime,
            String endTime);
    public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime);