xiaoyong931011
2021-08-24 978a6a97c1497a44f271c3380bb160667b07aead
20210824
2 files added
4 files modified
107 ■■■■■ changed files
gc-user/src/main/java/com/xzx/gc/user/controller/UserController.java 14 ●●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/dto/TgmxInfoListDto.java 24 ●●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/mapper/UserMapper.java 4 ●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/service/UserService.java 13 ●●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/vo/TgmxInfoListVo.java 26 ●●●●● patch | view | raw | blame | history
gc-user/src/main/resources/mapper/user/UserMapper.xml 26 ●●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/controller/UserController.java
@@ -32,6 +32,8 @@
import com.xzx.gc.user.dto.*;
import com.xzx.gc.user.mapper.*;
import com.xzx.gc.user.service.*;
import com.xzx.gc.user.vo.JhyInfoListVo;
import com.xzx.gc.user.vo.TgmxInfoListVo;
import com.xzx.gc.user.vo.UserIdentityVo;
import com.xzx.gc.util.DoubleUtil;
import com.xzx.gc.util.SessionUtil;
@@ -1055,5 +1057,17 @@
        return Result.success();
    }
    @ApiOperation(value = "推广明细列表")
    @ApiResponses(
            @ApiResponse(code = 200, message = "success", response = TgmxInfoListVo.class)
    )
    @PostMapping(value = Constants.ADMIN_VIEW_PREFIX + "/user/tgmxInfo.json")
    public JsonResult<Map<String, Object>> tgmxInfo(@RequestBody TgmxInfoListDto tgmxInfoListDto) {
        return JsonResult.success(userService.tgmxInfo(tgmxInfoListDto));
    }
}
gc-user/src/main/java/com/xzx/gc/user/dto/TgmxInfoListDto.java
New file
@@ -0,0 +1,24 @@
package com.xzx.gc.user.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class TgmxInfoListDto {
    @ApiModelProperty("邀请用户名称")
    private String yqrName;
    @ApiModelProperty("注册用户名称")
    private String zcName;
    @ApiModelProperty("邀请用户/注册用户手机号")
    private String phone;
    @ApiModelProperty(value="第几页",required=true)
    private int page;
    @ApiModelProperty(value="每一页数量",required=true)
    private int limit;
}
gc-user/src/main/java/com/xzx/gc/user/mapper/UserMapper.java
@@ -3,6 +3,8 @@
import com.xzx.gc.entity.UserInfo;
import com.xzx.gc.model.admin.UserModel;
import com.xzx.gc.model.user.*;
import com.xzx.gc.user.dto.TgmxInfoListDto;
import com.xzx.gc.user.vo.TgmxInfoListVo;
import com.xzx.gc.util.GcMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@@ -70,4 +72,6 @@
    List<UserModel> queryAllUserByPid(@Param("userName") String userName, @Param("roleType") String roleType, @Param("partnerId") String partnerId);
    UserModel queryUserById(@Param("userId") String userId);
    List<TgmxInfoListVo> tgmxInfo(@Param("record")TgmxInfoListDto model);
}
gc-user/src/main/java/com/xzx/gc/user/service/UserService.java
@@ -23,8 +23,10 @@
import com.xzx.gc.model.user.*;
import com.xzx.gc.user.dto.AddressDto;
import com.xzx.gc.user.dto.RayaltyDto;
import com.xzx.gc.user.dto.TgmxInfoListDto;
import com.xzx.gc.user.mapper.*;
import com.xzx.gc.user.vo.CategaryVo;
import com.xzx.gc.user.vo.TgmxInfoListVo;
import com.xzx.gc.user.vo.UserIdentityVo;
import com.xzx.gc.util.DoubleUtil;
import lombok.extern.slf4j.Slf4j;
@@ -904,4 +906,15 @@
        userMapper.insertSelective(userInfo);
    }
    public Map<String, Object> tgmxInfo(TgmxInfoListDto model) {
        PageHelper.startPage(model.getPage(), model.getLimit());
        List<TgmxInfoListVo> maps = userMapper.tgmxInfo(model);
        PageInfo pageInfo = new PageInfo(maps);
        int count = Convert.toInt(pageInfo.getTotal());
        Map<String, Object> map = new HashMap<>();
        map.put("data", maps);
        map.put("count", count);
        map.put("code", 0);
        return map;
    }
}
gc-user/src/main/java/com/xzx/gc/user/vo/TgmxInfoListVo.java
New file
@@ -0,0 +1,26 @@
package com.xzx.gc.user.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "TgmxInfoListVo", description = "返回参数类")
public class TgmxInfoListVo {
    @ApiModelProperty(value = "邀请人名称")
    private String yqrName;
    @ApiModelProperty(value = "邀请人手机号")
    private String yqrPhone;
    @ApiModelProperty(value = "注册用户名称")
    private String zcName;
    @ApiModelProperty(value = "注册用户手机号")
    private String zcPhone;
    @ApiModelProperty(value = "注册日期")
    private String zcDate;
}
gc-user/src/main/resources/mapper/user/UserMapper.xml
@@ -305,4 +305,30 @@
            and user_id=#{userId}
        </if>
    </select>
    <select id="tgmxInfo" resultType="com.xzx.gc.user.vo.TgmxInfoListVo">
        SELECT
            a.mobile_phone yqrPhone,
            from_base64(b.nick_name) yqrName,
            from_base64(c.nick_name) zcName,
            a.register_mobile_phone zcPhone,
            a.register_time zcDate
        FROM xzx_user_share_info a
        LEFT JOIN xzx_user_info b ON a.mobile_phone=b.mobile_phone
        LEFT JOIN xzx_user_info c ON a.register_mobile_phone=c.mobile_phone
        <where>
            1=1
            <if test="record.yqrName != null and record.yqrName != ''">
                and from_base64(b.nick_name) like concat('%',#{record.yqrName},'%')
            </if>
            <if test="record.zcName != null and record.zcName != ''">
                and from_base64(c.nick_name) like concat('%',#{record.zcName},'%')
            </if>
            <if test="record.phone != null and record.phone != ''">
                and (a.register_mobile_phone like concat('%',#{record.phone},'%')
                    or a.mobile_phone like concat('%',#{record.phone},'%'))
            </if>
        </where>
        order by a.register_time desc
    </select>
</mapper>