Browse Source

音乐人认证接口编写

weifanli 3 years ago
parent
commit
44a3fc5424
13 changed files with 294 additions and 120 deletions
  1. 2 2
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherAuthEntryRecordController.java
  2. 75 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherAuthMusicianRecordController.java
  3. 2 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherAuthEntryRecordDao.java
  4. 20 4
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherAuthMusicianRecordDao.java
  5. 8 8
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/AuthEntryRecordSearch.java
  6. 2 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TeacherAuthEntryRecordService.java
  7. 24 3
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TeacherAuthMusicianRecordService.java
  8. 14 4
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherAuthEntryRecordServiceImpl.java
  9. 30 5
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherAuthMusicianRecordServiceImpl.java
  10. 57 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/MusicianAuthEntryRecordVo.java
  11. 4 3
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherAuthEntryRecordMapper.xml
  12. 56 17
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherAuthMusicianRecordMapper.xml
  13. 0 70
      cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherAuthMusicianRecordController.java

+ 2 - 2
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherAuthEntryRecordController.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
-import com.yonge.cooleshow.biz.dal.dto.search.TeacherAuthEntryRecordSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
 import com.yonge.cooleshow.biz.dal.service.TeacherAuthEntryRecordService;
 import com.yonge.cooleshow.biz.dal.support.Condition;
 import com.yonge.cooleshow.biz.dal.support.Query;
@@ -35,7 +35,7 @@ public class TeacherAuthEntryRecordController extends BaseController {
      */
     @GetMapping("/page")
     @ApiOperation(value = "查询分页", notes = "传入teacherAuthEntryRecord")
-    public HttpResponseResult<PageInfo<TeacherAuthEntryRecordVo>> page(TeacherAuthEntryRecordSearch search, Query query) {
+    public HttpResponseResult<PageInfo<TeacherAuthEntryRecordVo>> page(AuthEntryRecordSearch search, Query query) {
         IPage<TeacherAuthEntryRecordVo> pages = teacherAuthEntryRecordService.selectPage(Condition.getPage(query), search);
         return succeed(Condition.pageInfo(pages));
     }

+ 75 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherAuthMusicianRecordController.java

@@ -0,0 +1,75 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
+import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
+import com.yonge.cooleshow.biz.dal.entity.TeacherAuthMusicianRecord;
+import com.yonge.cooleshow.biz.dal.service.TeacherAuthMusicianRecordService;
+import com.yonge.cooleshow.biz.dal.support.Condition;
+import com.yonge.cooleshow.biz.dal.support.Query;
+import com.yonge.cooleshow.biz.dal.vo.MusicianAuthEntryRecordVo;
+import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.cooleshow.common.page.PageInfo;
+import com.yonge.toolset.utils.string.StringUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@RequestMapping("/TeacherAuthMusicianRecord")
+@Api(value = "老师音乐人审核表", tags = "老师音乐人审核表")
+public class TeacherAuthMusicianRecordController extends BaseController {
+
+    @Autowired
+    private TeacherAuthMusicianRecordService teacherAuthMusicianRecordService;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	/**
+	 * 查询分页
+	 */
+	@GetMapping("/page")
+	@ApiOperation(value = "查询分页", notes = "传入AuthEntryRecordSearch")
+	public HttpResponseResult<PageInfo<MusicianAuthEntryRecordVo>> page(AuthEntryRecordSearch search, Query query) {
+		IPage<MusicianAuthEntryRecordVo> pages = teacherAuthMusicianRecordService.selectPage(Condition.getPage(query), search);
+		return succeed(Condition.pageInfo(pages));
+	}
+
+	/**
+	 * 查询单条详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperation(value = "详情", notes = "传入teacherAuthEntryRecord")
+	public HttpResponseResult<MusicianAuthEntryRecordVo> detail(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
+		MusicianAuthEntryRecordVo detail = teacherAuthMusicianRecordService.detail(id);
+		return succeed(detail);
+	}
+
+	@PostMapping("/doAuth")
+	@ApiOperation(value = "审核", notes = "传入authOperaDto")
+	public HttpResponseResult<Boolean> doAuth(@Valid @RequestBody AuthOperaReq authOperaReq) throws Exception {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		return teacherAuthMusicianRecordService.doAuth(authOperaReq, sysUser);
+	}
+
+ 	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public HttpResponseResult remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        if (StringUtil.isEmpty(ids)) {
+			return failed("参数不能为空");
+		}
+		return status(teacherAuthMusicianRecordService.removeByIds(StringUtil.toLongList(ids)));
+	}
+}

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherAuthEntryRecordDao.java

@@ -5,7 +5,7 @@ import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.biz.dal.dto.req.TeacherApplyDetailReq;
-import com.yonge.cooleshow.biz.dal.dto.search.TeacherAuthEntryRecordSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
 import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
 import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
 import org.apache.ibatis.annotations.Param;
@@ -15,7 +15,7 @@ public interface TeacherAuthEntryRecordDao extends BaseMapper<TeacherAuthEntryRe
 	/**
 	 * 自定义分页
 	 */
-	List<TeacherAuthEntryRecordVo> selectPage(IPage page,@Param("param") TeacherAuthEntryRecordSearch search);
+	List<TeacherAuthEntryRecordVo> selectPage(IPage page,@Param("param") AuthEntryRecordSearch search);
 
 	/***
 	 * 修改用户实名信息

+ 20 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherAuthMusicianRecordDao.java

@@ -4,13 +4,29 @@ import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
 import com.yonge.cooleshow.biz.dal.entity.TeacherAuthMusicianRecord;
+import com.yonge.cooleshow.biz.dal.vo.MusicianAuthEntryRecordVo;
+import org.apache.ibatis.annotations.Param;
 
 public interface TeacherAuthMusicianRecordDao extends BaseMapper<TeacherAuthMusicianRecord>{
 
-	/**
-	 * 自定义分页
+	/***
+	 * 音乐人审批页面查询
+	 * @author liweifan
+	 * @param: page
+	 * @param: authEntryRecordSearch
+	 * @updateTime 2022/3/22 19:58
+	 * @return: java.util.List<com.yonge.cooleshow.biz.dal.vo.MusicianAuthEntryRecordVo>
 	 */
-	List<TeacherAuthMusicianRecord> selectPage(IPage page, TeacherAuthMusicianRecord teacherAuthMusicianRecord);
-	
+	List<MusicianAuthEntryRecordVo> selectPage(IPage page, AuthEntryRecordSearch authEntryRecordSearch);
+
+	/***
+	 * 审批详情
+	 * @author liweifan
+	 * @param: id
+	 * @updateTime 2022/3/22 19:58
+	 * @return: com.yonge.cooleshow.biz.dal.vo.MusicianAuthEntryRecordVo
+	 */
+	MusicianAuthEntryRecordVo detail(@Param("id") Long id);
 }

+ 8 - 8
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/TeacherAuthEntryRecordSearch.java → cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/AuthEntryRecordSearch.java

@@ -11,8 +11,8 @@ import java.util.Date;
  * @Author: liweifan
  * @Data: 2022/3/21 15:26
  */
-@ApiModel(value = "TeacherAuthEntryRecordSearch", description = "老师入驻审核列表查询")
-public class TeacherAuthEntryRecordSearch {
+@ApiModel(value = "AuthEntryRecordSearch", description = "审核列表查询")
+public class AuthEntryRecordSearch {
     @ApiModelProperty(value = "老师编号/名称/电话")
     private String search;
     @ApiModelProperty(value = "审批人")
@@ -25,8 +25,8 @@ public class TeacherAuthEntryRecordSearch {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTime;
-    @ApiModelProperty(value = "老师认证审核状态  1、审核中 2、通过 3、不通过")
-    private Integer teacherAuthStatus;
+    @ApiModelProperty(value = "审核状态  1、审核中 2、通过 3、不通过")
+    private Integer authStatus;
 
     public String getSearch() {
         return search;
@@ -60,11 +60,11 @@ public class TeacherAuthEntryRecordSearch {
         this.endTime = endTime;
     }
 
-    public Integer getTeacherAuthStatus() {
-        return teacherAuthStatus;
+    public Integer getAuthStatus() {
+        return authStatus;
     }
 
-    public void setTeacherAuthStatus(Integer teacherAuthStatus) {
-        this.teacherAuthStatus = teacherAuthStatus;
+    public void setAuthStatus(Integer authStatus) {
+        this.authStatus = authStatus;
     }
 }

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TeacherAuthEntryRecordService.java

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
 import com.yonge.cooleshow.biz.dal.dto.req.TeacherApplyDetailReq;
-import com.yonge.cooleshow.biz.dal.dto.search.TeacherAuthEntryRecordSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
 import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
 import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
@@ -21,7 +21,7 @@ public interface TeacherAuthEntryRecordService extends IService<TeacherAuthEntry
      * @author liweifan
  	 * @date 2022-03-18
      */
-    IPage<TeacherAuthEntryRecordVo> selectPage(IPage<TeacherAuthEntryRecordVo> page, TeacherAuthEntryRecordSearch search);
+    IPage<TeacherAuthEntryRecordVo> selectPage(IPage<TeacherAuthEntryRecordVo> page, AuthEntryRecordSearch search);
     /***
      * 老师入驻申请
      * @author liweifan

+ 24 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TeacherAuthMusicianRecordService.java

@@ -2,7 +2,11 @@ package com.yonge.cooleshow.biz.dal.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
+import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
 import com.yonge.cooleshow.biz.dal.entity.TeacherAuthMusicianRecord;
+import com.yonge.cooleshow.biz.dal.vo.MusicianAuthEntryRecordVo;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 
 /**
@@ -14,12 +18,19 @@ public interface TeacherAuthMusicianRecordService extends IService<TeacherAuthMu
 
 
     /**
-     * 自定义分页
+     * 自查询分页
      * @author liweifan
  	 * @date 2022-03-18
      */
-    IPage<TeacherAuthMusicianRecord> selectPage(IPage<TeacherAuthMusicianRecord> page, TeacherAuthMusicianRecord teacherAuthMusicianRecord);
-
+    IPage<MusicianAuthEntryRecordVo> selectPage(IPage<MusicianAuthEntryRecordVo> page, AuthEntryRecordSearch authEntryRecordSearch);
+    /***
+     * 查询音乐人审批单详情
+     * @author liweifan
+     * @param: id
+     * @updateTime 2022/3/22 19:57
+     * @return: com.yonge.cooleshow.biz.dal.vo.MusicianAuthEntryRecordVo
+     */
+    MusicianAuthEntryRecordVo detail(Long id);
     /***
      * 获取音乐人认证状态
      * @author liweifan
@@ -36,4 +47,14 @@ public interface TeacherAuthMusicianRecordService extends IService<TeacherAuthMu
      * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<java.lang.Boolean>
      */
     HttpResponseResult<Boolean> doApply(Long id);
+
+    /***
+     * 审核
+     * @author liweifan
+     * @param: authOperaReq
+     * @param: sysUser
+     * @updateTime 2022/3/22 20:06
+     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<java.lang.Boolean>
+     */
+    HttpResponseResult<Boolean> doAuth(AuthOperaReq authOperaReq, SysUser sysUser);
 }

+ 14 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherAuthEntryRecordServiceImpl.java

@@ -7,7 +7,7 @@ import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dao.TeacherDao;
 import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
 import com.yonge.cooleshow.biz.dal.dto.req.TeacherApplyDetailReq;
-import com.yonge.cooleshow.biz.dal.dto.search.TeacherAuthEntryRecordSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
@@ -20,6 +20,8 @@ import com.yonge.cooleshow.biz.dal.dao.TeacherAuthEntryRecordDao;
 import com.yonge.cooleshow.biz.dal.service.TeacherAuthEntryRecordService;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
+
 
 @Service
 public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEntryRecordDao, TeacherAuthEntryRecord> implements TeacherAuthEntryRecordService {
@@ -30,7 +32,7 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
      * 分页查询
      */
     @Override
-    public IPage<TeacherAuthEntryRecordVo> selectPage(IPage<TeacherAuthEntryRecordVo> page, TeacherAuthEntryRecordSearch search) {
+    public IPage<TeacherAuthEntryRecordVo> selectPage(IPage<TeacherAuthEntryRecordVo> page, AuthEntryRecordSearch search) {
         return page.setRecords(baseMapper.selectPage(page, search));
     }
 
@@ -62,11 +64,19 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public HttpResponseResult<Boolean> doAuth(AuthOperaReq authOperaReq, SysUser sysUser) {
-        TeacherAuthEntryRecord build = new TeacherAuthEntryRecord();
-        build.setId(authOperaReq.getId());
+        TeacherAuthEntryRecord build = baseMapper.selectById(authOperaReq.getId());
         build.setTeacherAuthStatus(authOperaReq.getPass() ? AuthStatusEnum.PASS.getCode() : AuthStatusEnum.UNPASS.getCode());
         build.setReason(authOperaReq.getReason());
+
+        //修改teacher表
+        Teacher teacher = new Teacher();
+        teacher.setUserId(build.getUserId());
+        teacher.setEntryStatus(build.getTeacherAuthStatus());
+        teacher.setEntryAuthDate(new Date());
+        teacherDao.updateById(teacher);
+
         return HttpResponseResult.succeed(baseMapper.updateById(build) > 0);
     }
 

+ 30 - 5
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherAuthMusicianRecordServiceImpl.java

@@ -3,12 +3,16 @@ package com.yonge.cooleshow.biz.dal.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dao.TeacherDao;
+import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
+import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
 import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.service.TeacherService;
 import com.yonge.cooleshow.biz.dal.support.Condition;
+import com.yonge.cooleshow.biz.dal.vo.MusicianAuthEntryRecordVo;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -17,6 +21,8 @@ import com.yonge.cooleshow.biz.dal.dao.TeacherAuthMusicianRecordDao;
 import com.yonge.cooleshow.biz.dal.service.TeacherAuthMusicianRecordService;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
+
 
 @Service
 public class TeacherAuthMusicianRecordServiceImpl extends ServiceImpl<TeacherAuthMusicianRecordDao, TeacherAuthMusicianRecord> implements TeacherAuthMusicianRecordService {
@@ -25,12 +31,14 @@ public class TeacherAuthMusicianRecordServiceImpl extends ServiceImpl<TeacherAut
     @Autowired
     private TeacherDao teacherDao;
 
-    /**
-     * 分页查询
-     */
     @Override
-    public IPage<TeacherAuthMusicianRecord> selectPage(IPage<TeacherAuthMusicianRecord> page, TeacherAuthMusicianRecord teacherAuthMusicianRecord) {
-        return page.setRecords(baseMapper.selectPage(page, teacherAuthMusicianRecord));
+    public IPage<MusicianAuthEntryRecordVo> selectPage(IPage<MusicianAuthEntryRecordVo> page, AuthEntryRecordSearch authEntryRecordSearch) {
+        return page.setRecords(baseMapper.selectPage(page, authEntryRecordSearch));
+    }
+
+    @Override
+    public MusicianAuthEntryRecordVo detail(Long id) {
+        return baseMapper.detail(id);
     }
 
     @Override
@@ -59,6 +67,23 @@ public class TeacherAuthMusicianRecordServiceImpl extends ServiceImpl<TeacherAut
         return HttpResponseResult.status(baseMapper.insert(record) > 0);
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public HttpResponseResult<Boolean> doAuth(AuthOperaReq authOperaReq, SysUser sysUser) {
+        TeacherAuthMusicianRecord build = baseMapper.selectById(authOperaReq.getId());
+        build.setTeacherAuthStatus(authOperaReq.getPass() ? AuthStatusEnum.PASS.getCode() : AuthStatusEnum.UNPASS.getCode());
+        build.setReason(authOperaReq.getReason());
+
+        //修改teacher表
+        Teacher teacher = new Teacher();
+        teacher.setUserId(build.getUserId());
+        teacher.setMusicianAuthStatus(build.getTeacherAuthStatus());
+        teacher.setMusicianDate(new Date());
+        teacherDao.updateById(teacher);
+
+        return HttpResponseResult.succeed(baseMapper.updateById(build) > 0);
+    }
+
     /***
      * 判断用户是否已经提交申请
      * @author liweifan

+ 57 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/MusicianAuthEntryRecordVo.java

@@ -0,0 +1,57 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.yonge.cooleshow.biz.dal.entity.TeacherAuthMusicianRecord;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022/3/21 13:34
+ */
+@ApiModel(value = "TeacherAuthEntryRecordVo对象", description = "老师入驻审核详情")
+public class MusicianAuthEntryRecordVo extends TeacherAuthMusicianRecord {
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "身份证号")
+    private String idCardNo;
+
+    @ApiModelProperty("手机号 ")
+    private String phone;
+
+    @ApiModelProperty("审核人 ")
+    private String verifyUser;
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public String getIdCardNo() {
+        return idCardNo;
+    }
+
+    public void setIdCardNo(String idCardNo) {
+        this.idCardNo = idCardNo;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getVerifyUser() {
+        return verifyUser;
+    }
+
+    public void setVerifyUser(String verifyUser) {
+        this.verifyUser = verifyUser;
+    }
+}

+ 4 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherAuthEntryRecordMapper.xml

@@ -61,7 +61,8 @@
             <include refid="baseColumns"/>,
             u.real_name_ as realName,
             u.id_card_no_ as idCardNo,
-            u.phone_ as phone
+            u.phone_ as phone,
+            u.gender as gender
         FROM teacher_auth_entry_record t
         left join sys_user u on t.user_id_ = u.id_
         left join sys_user v on t.verify_user_id_ = u.id_
@@ -82,8 +83,8 @@
             <if test="param.endTime !=null">
                 <![CDATA[AND t.create_time_ <= #{param.endTime} ]]>
             </if>
-            <if test="param.teacherAuthStatus !=null">
-                AND t.teacher_auth_status_ = #{param.teacherAuthStatus}
+            <if test="param.authStatus !=null">
+                AND t.teacher_auth_status_ = #{param.authStatus}
             </if>
         </where>
     </select>

+ 56 - 17
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherAuthMusicianRecordMapper.xml

@@ -9,23 +9,62 @@
 	        <result column="reason_" property="reason" />
 	        <result column="create_time_" property="createTime" />
 	        <result column="update_time_" property="updateTime" />
-		</resultMap>  
-    
-    <!-- 表字段 -->
-    <sql id="baseColumns">
-         t.id_
-        , t.user_id_
-        , t.teacher_auth_status_
-        , t.verify_user_id_
-        , t.reason_
-        , t.create_time_
-        , t.update_time_
-        </sql> 
-    
-    <!-- 分页查询 -->
-    <select id="selectPage" resultMap="BaseResultMap">
-		SELECT         
-        	<include refid="baseColumns" />
+		</resultMap>
+
+	<!-- 表字段 -->
+	<sql id="baseColumns">
+         t.id_ as "id"
+        , t.user_id_ as "userId"
+        , t.teacher_auth_status_ as "teacherAuthStatus"
+        , t.verify_user_id_ as "verifyUserId"
+        , t.reason_ as "reason"
+        , t.create_time_ as "createTime"
+        , t.update_time_ as "updateTime"
+        </sql>
+
+	<!-- 分页查询 -->
+	<select id="selectPage" resultType = "com.yonge.cooleshow.biz.dal.vo.MusicianAuthEntryRecordVo">
+		SELECT
+		<include refid="baseColumns"/>,
+		u.real_name_ as realName,
+		u.id_card_no_ as idCardNo,
+		u.phone_ as phone
 		FROM teacher_auth_musician_record t
+		left join sys_user u on t.user_id_ = u.id_
+		left join sys_user v on t.verify_user_id_ = u.id_
+		<where>
+			<if test="null != param.search and '' != param.search">
+				AND (
+				t.user_id_ LIKE CONCAT('%', #{param.search}, '%') or
+				u.username_ LIKE CONCAT('%', #{param.search}, '%') or
+				u.phone_ LIKE CONCAT('%', #{param.search}, '%')
+				)
+			</if>
+			<if test="null != param.verifyUser and '' != param.verifyUser">
+				AND v.username_ LIKE CONCAT('%', #{param.verifyUser}, '%')
+			</if>
+			<if test="param.startTime !=null">
+				<![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
+			</if>
+			<if test="param.endTime !=null">
+				<![CDATA[AND t.create_time_ <= #{param.endTime} ]]>
+			</if>
+			<if test="param.authStatus !=null">
+				AND t.teacher_auth_status_ = #{param.authStatus}
+			</if>
+		</where>
+	</select>
+
+	<select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.MusicianAuthEntryRecordVo">
+		select
+			<include refid="baseColumns"/>,
+			u.real_name_ as realName,
+			u.id_card_no_ as idCardNo,
+			(
+				SELECT u.username_ FROM sys_user u WHERE u.id_ = t.verify_user_id_
+			) as verifyUser
+		from teacher_auth_entry_record t
+		left join sys_user u on t.user_id_ = u.id_
+		where t.id_ = #{id}
 	</select>
 </mapper>

+ 0 - 70
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherAuthMusicianRecordController.java

@@ -55,74 +55,4 @@ public class TeacherAuthMusicianRecordController extends BaseController {
 		return teacherAuthMusicianRecordService.doApply(sysUser.getId());
 	}
 
-
-	/**
-     * 查询单条
-     */
-    @GetMapping("/detail")
-    @ApiOperation(value = "详情", notes = "传入teacherAuthMusicianRecord")
-    public HttpResponseResult<TeacherAuthMusicianRecord> detail(TeacherAuthMusicianRecord teacherAuthMusicianRecord) {
-		TeacherAuthMusicianRecord detail = teacherAuthMusicianRecordService.getOne(Condition.getQueryWrapper(teacherAuthMusicianRecord));
-		return succeed(detail);
-	}
-    
-    
-    /**
-     * 查询集合
-     */
-    @GetMapping("/list")
-    @ApiOperation(value = "查询集合", notes = "传入teacherAuthMusicianRecord")
-    public HttpResponseResult<List<TeacherAuthMusicianRecord>> list(TeacherAuthMusicianRecord teacherAuthMusicianRecord) {
-		List<TeacherAuthMusicianRecord> list = teacherAuthMusicianRecordService.list();
-		return succeed(list);
-	}
-    
-    /**
-     * 查询分页
-     */
-    @GetMapping("/page")
-    @ApiOperation(value = "查询分页", notes = "传入teacherAuthMusicianRecord")
-    public HttpResponseResult<IPage<TeacherAuthMusicianRecord>> page(TeacherAuthMusicianRecord teacherAuthMusicianRecord, Query query) {
-		IPage<TeacherAuthMusicianRecord> pages = teacherAuthMusicianRecordService.selectPage(Condition.getPage(query), teacherAuthMusicianRecord);
-		return succeed(pages);
-	}
-    
-    /**
-	 * 新增
-	 */
-	@PostMapping("/save")
-	@ApiOperation(value = "新增", notes = "传入teacherAuthMusicianRecord")
-	public HttpResponseResult save(@Valid @RequestBody TeacherAuthMusicianRecord teacherAuthMusicianRecord) {
-    	return status(teacherAuthMusicianRecordService.save(teacherAuthMusicianRecord));
-	}
-    
-    /**
-	 * 修改
-	 */
-	@PostMapping("/update")
-	@ApiOperation(value = "修改", notes = "传入teacherAuthMusicianRecord")
-	public HttpResponseResult update(@Valid @RequestBody TeacherAuthMusicianRecord teacherAuthMusicianRecord) {
-        return status(teacherAuthMusicianRecordService.updateById(teacherAuthMusicianRecord));
-	}
-    
-    /**
-	 * 新增或修改
-	 */
-    @PostMapping("/submit")
-    @ApiOperation(value = "新增或修改", notes = "传入teacherAuthMusicianRecord")
-	public HttpResponseResult submit(@RequestBody TeacherAuthMusicianRecord teacherAuthMusicianRecord) {
-        return status(teacherAuthMusicianRecordService.saveOrUpdate(teacherAuthMusicianRecord));
-    }
-
- 	/**
-	 * 删除
-	 */
-	@PostMapping("/remove")
-	@ApiOperation(value = "逻辑删除", notes = "传入ids")
-	public HttpResponseResult remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-        if (StringUtil.isEmpty(ids)) {
-			return failed("参数不能为空");
-		}
-		return status(teacherAuthMusicianRecordService.removeByIds(StringUtil.toLongList(ids)));
-	}
 }