123
This commit is contained in:
@@ -251,7 +251,6 @@ public class CaiLoginManager {
|
|||||||
add.setMobile(user.getUsername());
|
add.setMobile(user.getUsername());
|
||||||
add.setAvatar(null);
|
add.setAvatar(null);
|
||||||
add.setGender(user.getGender());
|
add.setGender(user.getGender());
|
||||||
add.setCity(user.getCity());
|
|
||||||
add.setInviteId(user.getInviteId());
|
add.setInviteId(user.getInviteId());
|
||||||
add.setImToken(IdUtil.simpleUUID());
|
add.setImToken(IdUtil.simpleUUID());
|
||||||
userService.save(add);
|
userService.save(add);
|
||||||
|
|||||||
@@ -18,6 +18,4 @@ public class CaiRegisterUser {
|
|||||||
private Long inviteId;
|
private Long inviteId;
|
||||||
@Schema(description = "性别")
|
@Schema(description = "性别")
|
||||||
private Integer gender;
|
private Integer gender;
|
||||||
@Schema(description = "城市")
|
|
||||||
private Long city;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ruoyi.cai.domain.Report;
|
import com.ruoyi.cai.domain.Report;
|
||||||
|
import com.ruoyi.cai.dto.admin.vo.ReportAdminVo;
|
||||||
import com.ruoyi.cai.service.ReportService;
|
import com.ruoyi.cai.service.ReportService;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
@@ -41,8 +42,8 @@ public class ReportController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("cai:report:list")
|
@SaCheckPermission("cai:report:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<Report> list(Report bo, PageQuery pageQuery) {
|
public TableDataInfo<ReportAdminVo> list(ReportAdminVo bo, PageQuery pageQuery) {
|
||||||
Page<Report> page = reportService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
Page<ReportAdminVo> page = reportService.pageAdmin(pageQuery, bo);
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.ruoyi.cai.dto.admin.vo;
|
||||||
|
|
||||||
|
import com.ruoyi.cai.domain.Report;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ReportAdminVo extends Report {
|
||||||
|
/**
|
||||||
|
* 用户号/ID号
|
||||||
|
*/
|
||||||
|
private String usercode;
|
||||||
|
/**
|
||||||
|
* 昵称
|
||||||
|
*/
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
|
||||||
|
private String reportUsercode;
|
||||||
|
private String reportNickname;
|
||||||
|
private String reportMobile;
|
||||||
|
private String reportAvatar;
|
||||||
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.ruoyi.cai.mapper;
|
package com.ruoyi.cai.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ruoyi.cai.domain.Report;
|
import com.ruoyi.cai.domain.Report;
|
||||||
|
import com.ruoyi.cai.dto.admin.vo.ReportAdminVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 举报Mapper接口
|
* 举报Mapper接口
|
||||||
@@ -11,4 +14,5 @@ import com.ruoyi.cai.domain.Report;
|
|||||||
*/
|
*/
|
||||||
public interface ReportMapper extends BaseMapper<Report> {
|
public interface ReportMapper extends BaseMapper<Report> {
|
||||||
|
|
||||||
|
Page<ReportAdminVo> pageAdmin(@Param("build") Page<Object> build, @Param("bo") ReportAdminVo bo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.ruoyi.cai.service;
|
package com.ruoyi.cai.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.ruoyi.cai.domain.Report;
|
import com.ruoyi.cai.domain.Report;
|
||||||
|
import com.ruoyi.cai.dto.admin.vo.ReportAdminVo;
|
||||||
import com.ruoyi.cai.dto.app.query.UserReportReq;
|
import com.ruoyi.cai.dto.app.query.UserReportReq;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 举报Service接口
|
* 举报Service接口
|
||||||
@@ -13,4 +16,6 @@ import com.ruoyi.cai.dto.app.query.UserReportReq;
|
|||||||
public interface ReportService extends IService<Report> {
|
public interface ReportService extends IService<Report> {
|
||||||
|
|
||||||
void report(UserReportReq reportRes);
|
void report(UserReportReq reportRes);
|
||||||
|
|
||||||
|
Page<ReportAdminVo> pageAdmin(PageQuery pageQuery, ReportAdminVo bo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class CitysServiceImpl extends ServiceImpl<CitysMapper, Citys> implements
|
|||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
List<Citys> list = this.list();
|
List<Citys> list = this.list();
|
||||||
Map<Long, String> map = list.stream().collect(Collectors.toMap(Citys::getId, Citys::getName));
|
Map<String, String> map = list.stream().collect(Collectors.toMap(i -> String.valueOf(i.getId()), Citys::getName));
|
||||||
redisTemplate.opsForHash().putAll(RedisConstant.CITY_CACHE_REDIS, map);
|
redisTemplate.opsForHash().putAll(RedisConstant.CITY_CACHE_REDIS, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ public class CitysServiceImpl extends ServiceImpl<CitysMapper, Citys> implements
|
|||||||
if(cityId == null || cityId == 0){
|
if(cityId == null || cityId == 0){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Object val = redisTemplate.opsForHash().get(RedisConstant.CITY_CACHE_REDIS, cityId);
|
Object val = redisTemplate.opsForHash().get(RedisConstant.CITY_CACHE_REDIS, cityId+"");
|
||||||
if(val != null){
|
if(val != null){
|
||||||
return String.valueOf(val);
|
return String.valueOf(val);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
package com.ruoyi.cai.service.impl;
|
package com.ruoyi.cai.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.cai.domain.Report;
|
import com.ruoyi.cai.domain.Report;
|
||||||
import com.ruoyi.cai.domain.ReportCate;
|
import com.ruoyi.cai.domain.ReportCate;
|
||||||
|
import com.ruoyi.cai.dto.admin.vo.ReportAdminVo;
|
||||||
import com.ruoyi.cai.dto.app.query.UserReportReq;
|
import com.ruoyi.cai.dto.app.query.UserReportReq;
|
||||||
import com.ruoyi.cai.mapper.ReportMapper;
|
import com.ruoyi.cai.mapper.ReportMapper;
|
||||||
import com.ruoyi.cai.service.ReportCateService;
|
import com.ruoyi.cai.service.ReportCateService;
|
||||||
import com.ruoyi.cai.service.ReportService;
|
import com.ruoyi.cai.service.ReportService;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -34,4 +37,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|||||||
report.setContent(reportRes.getContent());
|
report.setContent(reportRes.getContent());
|
||||||
this.save(report);
|
this.save(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<ReportAdminVo> pageAdmin(PageQuery pageQuery, ReportAdminVo bo) {
|
||||||
|
return baseMapper.pageAdmin(pageQuery.build(),bo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="status" column="status"/>
|
<result property="status" column="status"/>
|
||||||
<result property="createTime" column="create_time"/>
|
<result property="createTime" column="create_time"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
<select id="pageAdmin" resultType="com.ruoyi.cai.dto.admin.vo.ReportAdminVo">
|
||||||
|
select t1.*,
|
||||||
|
t2.usercode,t2.nickname,t2.mobile,t2.avatar,t2.gender,t2.age,
|
||||||
|
t3.usercode as report_usercode,t3.nickname as report_nickname,t3.mobile as report_mobile,t3.avatar as report_avatar,t3.gender as report_gender,t3.age as report_age
|
||||||
|
from cai_report t1
|
||||||
|
left join cai_user t2 on t1.user_id = t2.id
|
||||||
|
left join cai_user t3 on t1.report_uid = t3.id
|
||||||
|
<where>
|
||||||
|
<if test="bo.mobile != null and bo.mobile != ''">
|
||||||
|
and t2.mobile = #{bo.mobile}
|
||||||
|
</if>
|
||||||
|
<if test="bo.usercode != null and bo.usercode != ''">
|
||||||
|
and t2.usercode = #{bo.usercode}
|
||||||
|
</if>
|
||||||
|
<if test="bo.reportMobile != null and bo.reportMobile != ''">
|
||||||
|
and t3.mobile = #{bo.reportMobile}
|
||||||
|
</if>
|
||||||
|
<if test="bo.reportUsercode != null and bo.reportUsercode != ''">
|
||||||
|
and t3.usercode = #{bo.reportUsercode}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by t1.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user