Browse Source

老师接口编写

weifanli 3 years ago
parent
commit
4f94f9b060
18 changed files with 409 additions and 201 deletions
  1. 103 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherController.java
  2. 18 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherDao.java
  3. 10 10
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/RealnameAuthDto.java
  4. 3 3
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/TeacherApplyDetailDto.java
  5. 52 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/req/TeacherSetReq.java
  6. 18 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/req/UpdatePassword.java
  7. 1 27
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Teacher.java
  8. 18 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TeacherService.java
  9. 11 7
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherServiceImpl.java
  10. 3 6
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherAuthEntryRecordVo.java
  11. 5 7
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherHomeVo.java
  12. 63 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherVo.java
  13. 4 4
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherAuthEntryRecordMapper.xml
  14. 53 25
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  15. 10 12
      cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherAuthEntryRecordController.java
  16. 0 1
      cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherAuthMusicianRecordController.java
  17. 33 92
      cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherController.java
  18. 4 4
      toolset/utils/src/main/java/com/yonge/toolset/utils/idcard/IdcardInfoExtractor.java

+ 103 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherController.java

@@ -0,0 +1,103 @@
+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.dao.SubjectDao;
+import com.yonge.cooleshow.biz.dal.entity.Teacher;
+import com.yonge.cooleshow.biz.dal.service.TeacherService;
+import com.yonge.cooleshow.biz.dal.support.Condition;
+import com.yonge.cooleshow.biz.dal.support.Query;
+import com.yonge.cooleshow.biz.dal.vo.TeacherHomeVo;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+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.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@RequestMapping("/Teacher")
+@Api(value = "教师表", tags = "教师表")
+public class TeacherController extends BaseController {
+
+    @Autowired
+    private TeacherService teacherService;
+
+    /**
+     * 查询单条
+     */
+    @GetMapping("/detail")
+    @ApiOperation(value = "详情", notes = "传入teacher")
+    public HttpResponseResult<Teacher> detail(Teacher teacher) {
+        Teacher detail = teacherService.getOne(Condition.getQueryWrapper(teacher));
+        return succeed(detail);
+    }
+
+    /**
+     * 查询集合
+     */
+    @GetMapping("/list")
+    @ApiOperation(value = "查询集合", notes = "传入teacher")
+    public HttpResponseResult<List<Teacher>> list(Teacher teacher) {
+        List<Teacher> list = teacherService.list();
+        return succeed(list);
+    }
+
+    /**
+     * 查询分页
+     */
+    @GetMapping("/page")
+    @ApiOperation(value = "查询分页", notes = "传入teacher")
+    public HttpResponseResult<IPage<Teacher>> page(Teacher teacher, Query query) {
+        IPage<Teacher> pages = teacherService.selectPage(Condition.getPage(query), teacher);
+        return succeed(pages);
+    }
+
+    /**
+     * 新增
+     */
+    @PostMapping("/save")
+    @ApiOperation(value = "新增", notes = "传入teacher")
+    public HttpResponseResult save(@Valid @RequestBody Teacher teacher) {
+        return status(teacherService.save(teacher));
+    }
+
+    /**
+     * 修改
+     */
+    @PostMapping("/update")
+    @ApiOperation(value = "修改", notes = "传入teacher")
+    public HttpResponseResult update(@Valid @RequestBody Teacher teacher) {
+        return status(teacherService.updateById(teacher));
+    }
+
+    /**
+     * 新增或修改
+     */
+    @PostMapping("/submit")
+    @ApiOperation(value = "新增或修改", notes = "传入teacher")
+    public HttpResponseResult submit(@RequestBody Teacher teacher) {
+        return status(teacherService.saveOrUpdate(teacher));
+    }
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public HttpResponseResult remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        if (StringUtil.isEmpty(ids)) {
+            return failed("参数不能为空");
+        }
+        return status(teacherService.removeByIds(StringUtil.toLongList(ids)));
+    }
+
+
+}

+ 18 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherDao.java

@@ -4,7 +4,9 @@ import java.util.List;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.req.TeacherSetReq;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
+import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 public interface TeacherDao extends BaseMapper<Teacher> {
 public interface TeacherDao extends BaseMapper<Teacher> {
@@ -14,6 +16,21 @@ public interface TeacherDao extends BaseMapper<Teacher> {
      */
      */
     List<Teacher> selectPage(@Param("page") IPage page, @Param("param") Teacher teacher);
     List<Teacher> selectPage(@Param("page") IPage page, @Param("param") Teacher teacher);
 
 
-    Teacher detail1(@Param("userId") Long userId);
+    /***
+     * 查询老师设置详情
+     * @author liweifan
+     * @param: id
+     * @updateTime 2022/3/22 10:24
+     * @return: com.yonge.cooleshow.biz.dal.vo.TeacherVo
+     */
+    TeacherVo getSetDetail(@Param("id") Long id);
 
 
+    /***
+     * 修改老师设置信息
+     * @author liweifan
+     * @param: setReq
+     * @param: id
+     * @updateTime 2022/3/22 11:06
+     */
+    void updatetSetDetail(@Param("param") TeacherSetReq setReq, @Param("id") Long id);
 }
 }

+ 10 - 10
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/RealnameAuthDto.java

@@ -16,25 +16,25 @@ public class RealnameAuthDto {
 
 
     @NotBlank(message = "用户真实姓名不能为空")
     @NotBlank(message = "用户真实姓名不能为空")
     @ApiModelProperty(value = "用户真实姓名", required = true)
     @ApiModelProperty(value = "用户真实姓名", required = true)
-    private String realname;
+    private String realName;
 
 
     @NotBlank(message = "用户身份证号不能为空")
     @NotBlank(message = "用户身份证号不能为空")
     @ApiModelProperty(value = "用户身份证号", required = true)
     @ApiModelProperty(value = "用户身份证号", required = true)
-    private String idcardNo;
+    private String idCardNo;
 
 
-    public String getRealname() {
-        return realname;
+    public String getRealName() {
+        return realName;
     }
     }
 
 
-    public void setRealname(String realname) {
-        this.realname = realname;
+    public void setRealName(String realName) {
+        this.realName = realName;
     }
     }
 
 
-    public String getIdcardNo() {
-        return idcardNo;
+    public String getIdCardNo() {
+        return idCardNo;
     }
     }
 
 
-    public void setIdcardNo(String idcardNo) {
-        this.idcardNo = idcardNo;
+    public void setIdCardNo(String idCardNo) {
+        this.idCardNo = idCardNo;
     }
     }
 }
 }

+ 3 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/TeacherApplyDetailDto.java

@@ -29,7 +29,7 @@ public class TeacherApplyDetailDto implements Serializable {
 
 
     @NotBlank(message = "性别不能为空")
     @NotBlank(message = "性别不能为空")
     @ApiModelProperty(value = "性别(0,女  1,男)", required = true)
     @ApiModelProperty(value = "性别(0,女  1,男)", required = true)
-    private String gender;
+    private Integer gender;
 
 
     @ApiModelProperty(value = "出生日期 ", required = true)
     @ApiModelProperty(value = "出生日期 ", required = true)
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -83,11 +83,11 @@ public class TeacherApplyDetailDto implements Serializable {
         this.idCardNo = idCardNo;
         this.idCardNo = idCardNo;
     }
     }
 
 
-    public String getGender() {
+    public Integer getGender() {
         return gender;
         return gender;
     }
     }
 
 
-    public void setGender(String gender) {
+    public void setGender(Integer gender) {
         this.gender = gender;
         this.gender = gender;
     }
     }
 
 

+ 52 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/req/TeacherSetReq.java

@@ -0,0 +1,52 @@
+package com.yonge.cooleshow.biz.dal.dto.req;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022/3/22 11:00
+ */
+@ApiModel(value = "TeacherSetReq对象", description = "教师设置请求对象")
+public class TeacherSetReq {
+    @ApiModelProperty("头像地址")
+    private String avatar;
+    @ApiModelProperty("昵称")
+    private String username;
+    @ApiModelProperty(value = "性别 0女 1男")
+    private Integer gender;
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public Integer getGender() {
+        return gender;
+    }
+
+    public void setGender(Integer gender) {
+        this.gender = gender;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+}

+ 18 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/req/UpdatePassword.java

@@ -0,0 +1,18 @@
+package com.yonge.cooleshow.biz.dal.dto.req;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022/3/22 11:20
+ */
+@ApiModel(value = "UpdatePassword对象", description = "用户修改密码")
+public class UpdatePassword {
+    @ApiModelProperty("旧密码")
+    private String oldPassword;
+    @ApiModelProperty("新密码")
+    private String newPasswordFirst;
+    @ApiModelProperty(value = "新密码")
+    private String newPasswordSecond;
+}

+ 1 - 27
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Teacher.java

@@ -12,7 +12,6 @@ import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
 
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import com.yonge.cooleshow.auth.api.entity.SysUser;
 
 
 import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 
 
@@ -21,7 +20,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  */
  */
 @TableName("teacher")
 @TableName("teacher")
 @ApiModel(value = "Teacher对象", description = "教师表")
 @ApiModel(value = "Teacher对象", description = "教师表")
-public class Teacher extends SysUser implements Serializable {
+public class Teacher implements Serializable {
 	private static final long serialVersionUID = 1L;
 	private static final long serialVersionUID = 1L;
     /** 
     /** 
     * 对应user表用户编号 
     * 对应user表用户编号 
@@ -275,29 +274,4 @@ public class Teacher extends SysUser implements Serializable {
     public void setUpdateTime(Date updateTime) {
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
         this.updateTime = updateTime;
     }
     }
-
-    @Override
-    public String toString() {
-        return "Teacher{" +
-				"userId=" + userId +
-						",educationBackground='" + educationBackground + "'" + 
-						",graduateSchool='" + graduateSchool + "'" + 
-						",technicalTitles='" + technicalTitles + "'" + 
-						",workUnit='" + workUnit + "'" + 
-						",subjectId='" + subjectId + "'" + 
-						",entryStatus='" + entryStatus + "'" + 
-						",entryAuthDate='" + entryAuthDate + "'" + 
-						",introduction='" + introduction + "'" + 
-						",musicianAuthStatus='" + musicianAuthStatus + "'" + 
-						",musicianDate='" + musicianDate + "'" + 
-						",subject='" + subject + "'" + 
-						",gradCertificate='" + gradCertificate + "'" + 
-						",degreeCertificate='" + degreeCertificate + "'" + 
-						",teacherCertificate='" + teacherCertificate + "'" + 
-						",memo='" + memo + "'" + 
-						",createTime='" + createTime + "'" + 
-						",updateTime='" + updateTime + "'" + 
-		                '}';
-    }
-	
 }
 }

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

@@ -2,7 +2,9 @@ package com.yonge.cooleshow.biz.dal.service;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.dto.req.TeacherSetReq;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
+import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
 
 
 /**
 /**
  * 教师表 服务类
  * 教师表 服务类
@@ -18,7 +20,21 @@ public interface TeacherService extends IService<Teacher>  {
  	 * @date 2022-03-18
  	 * @date 2022-03-18
      */
      */
     IPage<Teacher> selectPage(IPage<Teacher> page, Teacher teacher);
     IPage<Teacher> selectPage(IPage<Teacher> page, Teacher teacher);
-
-    Teacher detail1(Long userId);
+    /***
+     * 查询老师设置页面详情
+     * @author liweifan
+     * @param: id
+     * @updateTime 2022/3/22 10:22
+     * @return: com.yonge.cooleshow.biz.dal.vo.TeacherVo
+     */
+    TeacherVo getSetDetail(Long id);
+    /***
+     * 设置老师详情
+     * @author liweifan
+     * @param: setReq
+     * @param: id
+     * @updateTime 2022/3/22 11:04
+     */
+    void submitSetDetail(TeacherSetReq setReq, Long id);
 
 
 }
 }

+ 11 - 7
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherServiceImpl.java

@@ -3,7 +3,9 @@ package com.yonge.cooleshow.biz.dal.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yonge.cooleshow.biz.dal.dao.SubjectDao;
 import com.yonge.cooleshow.biz.dal.dao.SubjectDao;
+import com.yonge.cooleshow.biz.dal.dto.req.TeacherSetReq;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
+import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
@@ -16,20 +18,22 @@ import java.util.List;
 
 
 @Service
 @Service
 public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> implements TeacherService {
 public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> implements TeacherService {
-    @Autowired
-    private SubjectDao subjectDao;
     /**
     /**
      * 分页查询
      * 分页查询
      */
      */
-     @Override
-    public IPage<Teacher> selectPage(IPage<Teacher> page, Teacher teacher){
+    @Override
+    public IPage<Teacher> selectPage(IPage<Teacher> page, Teacher teacher) {
         return page.setRecords(baseMapper.selectPage(page, teacher));
         return page.setRecords(baseMapper.selectPage(page, teacher));
     }
     }
 
 
     @Override
     @Override
-    public Teacher detail1(Long userId) {
-        List<Subject> bySubjectIds = subjectDao.findBySubjectIds(Arrays.asList(1L));
-        return baseMapper.detail1(userId);
+    public TeacherVo getSetDetail(Long id) {
+        return baseMapper.getSetDetail(id);
+    }
+
+    @Override
+    public void submitSetDetail(TeacherSetReq setReq, Long id) {
+        baseMapper.updatetSetDetail(setReq, id);
     }
     }
 
 
 }
 }

+ 3 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherAuthEntryRecordVo.java

@@ -1,8 +1,5 @@
 package com.yonge.cooleshow.biz.dal.vo;
 package com.yonge.cooleshow.biz.dal.vo;
 
 
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
 import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
@@ -21,7 +18,7 @@ public class TeacherAuthEntryRecordVo extends TeacherAuthEntryRecord {
     private String idCardNo;
     private String idCardNo;
 
 
     @ApiModelProperty(value = "性别(0,女  1,男)")
     @ApiModelProperty(value = "性别(0,女  1,男)")
-    private String gender;
+    private Integer gender;
 
 
     @ApiModelProperty("手机号 ")
     @ApiModelProperty("手机号 ")
     private String phone;
     private String phone;
@@ -48,11 +45,11 @@ public class TeacherAuthEntryRecordVo extends TeacherAuthEntryRecord {
         this.idCardNo = idCardNo;
         this.idCardNo = idCardNo;
     }
     }
 
 
-    public String getGender() {
+    public Integer getGender() {
         return gender;
         return gender;
     }
     }
 
 
-    public void setGender(String gender) {
+    public void setGender(Integer gender) {
         this.gender = gender;
         this.gender = gender;
     }
     }
 
 

+ 5 - 7
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherHomeVo.java

@@ -14,17 +14,15 @@ public class TeacherHomeVo {
     @ApiModelProperty("头像地址")
     @ApiModelProperty("头像地址")
     private String heardUrl;
     private String heardUrl;
     @ApiModelProperty("老师姓名")
     @ApiModelProperty("老师姓名")
-    private String name;
+    private String username;
     @ApiModelProperty("星级")
     @ApiModelProperty("星级")
     private Integer starGrade;
     private Integer starGrade;
-
     @ApiModelProperty("粉丝数")
     @ApiModelProperty("粉丝数")
     private Integer fansNum;
     private Integer fansNum;
     @ApiModelProperty("已上课时")
     @ApiModelProperty("已上课时")
     private Integer expTime;
     private Integer expTime;
     @ApiModelProperty("未上课时")
     @ApiModelProperty("未上课时")
     private Integer unExpTime;
     private Integer unExpTime;
-
     @ApiModelProperty("老师入驻状态  1、审核中 2、通过 3、不通过 ")
     @ApiModelProperty("老师入驻状态  1、审核中 2、通过 3、不通过 ")
     private Integer entryStatus;
     private Integer entryStatus;
 
 
@@ -36,12 +34,12 @@ public class TeacherHomeVo {
         this.heardUrl = heardUrl;
         this.heardUrl = heardUrl;
     }
     }
 
 
-    public String getName() {
-        return name;
+    public String getUsername() {
+        return username;
     }
     }
 
 
-    public void setName(String name) {
-        this.name = name;
+    public void setUsername(String username) {
+        this.username = username;
     }
     }
 
 
     public Integer getStarGrade() {
     public Integer getStarGrade() {

+ 63 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherVo.java

@@ -0,0 +1,63 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.yonge.cooleshow.biz.dal.entity.Teacher;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022/3/22 10:10
+ */
+@ApiModel(value = "TeacherVo对象", description = "教师详情")
+public class TeacherVo extends Teacher {
+    @ApiModelProperty("头像地址")
+    private String avatar;
+    @ApiModelProperty("老师姓名")
+    private String username;
+    @ApiModelProperty(value = "性别0女1男")
+    private Integer gender;
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+    @ApiModelProperty(value = "是否实名 0否 1是")
+    private Boolean isReal;
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public Integer getGender() {
+        return gender;
+    }
+
+    public void setGender(Integer gender) {
+        this.gender = gender;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public Boolean getReal() {
+        return isReal;
+    }
+
+    public void setReal(Boolean real) {
+        isReal = real;
+    }
+}

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

@@ -39,16 +39,16 @@
     <update id="updateUserCard">
     <update id="updateUserCard">
         UPDATE sys_user
         UPDATE sys_user
         <set>
         <set>
-            <if test="realName != null and realName != ''">
+            <if test="param.realName != null and param.realName != ''">
                 real_name_ = #{param.realName},
                 real_name_ = #{param.realName},
             </if>
             </if>
-            <if test="idCardNo != null and idCardNo != ''">
+            <if test="param.idCardNo != null and param.idCardNo != ''">
                 id_card_no_ = #{param.idCardNo},
                 id_card_no_ = #{param.idCardNo},
             </if>
             </if>
-            <if test="gender != null and gender != ''">
+            <if test="param.gender != null">
                 gender_ = #{param.gender},
                 gender_ = #{param.gender},
             </if>
             </if>
-            <if test="birthdate != null">
+            <if test="param.birthdate != null and param.birthdate != ''">
                 birthdate_ = #{param.birthdate},
                 birthdate_ = #{param.birthdate},
             </if>
             </if>
         </set>
         </set>

+ 53 - 25
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -23,36 +23,64 @@
 		</resultMap>  
 		</resultMap>  
     
     
     <!-- 表字段 -->
     <!-- 表字段 -->
-    <sql id="baseColumns">
-         t.user_id_
-        , t.education_background_
-        , t.graduate_school_
-        , t.technical_titles_
-        , t.work_unit_
-        , t.subject_id_
-        , t.entry_status_
-        , t.entry_auth_date_
-        , t.introduction_
-        , t.musician_auth_status_
-        , t.musician_date_
-        , t.subject_
-        , t.grad_certificate_
-        , t.degree__certificate_
-        , t.teacher__certificate_
-        , t.memo_
-        , t.create_time_
-        , t.update_time_
-        </sql> 
-    
-    <!-- 分页查询 -->
+	<sql id="baseColumns">
+         t.user_id_ as "userId"
+        , t.education_background_ as "educationBackground"
+        , t.graduate_school_ as "graduateSchool"
+        , t.technical_titles_ as "technicalTitles"
+        , t.work_unit_ as "workUnit"
+        , t.subject_id_ as "subjectId"
+        , t.entry_status_ as "entryStatus"
+        , t.entry_auth_date_ as "entryAuthDate"
+        , t.introduction_ as "introduction"
+        , t.musician_auth_status_ as "musicianAuthStatus"
+        , t.musician_date_ as "musicianDate"
+        , t.subject_ as "subject"
+        , t.grad_certificate_ as "gradCertificate"
+        , t.degree__certificate_ as "degreeCertificate"
+        , t.teacher__certificate_ as "teacherCertificate"
+        , t.memo_ as "memo"
+        , t.create_time_ as "createTime"
+        , t.update_time_ as "updateTime"
+        </sql>
+
+	<!-- 分页查询 -->
     <select id="selectPage" resultMap="BaseResultMap">
     <select id="selectPage" resultMap="BaseResultMap">
 		SELECT         
 		SELECT         
         	<include refid="baseColumns" />
         	<include refid="baseColumns" />
 		FROM teacher t
 		FROM teacher t
 	</select>
 	</select>
-	<select id="detail1" resultMap="BaseResultMap">
+
+	<select id="getSetDetail" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherVo">
 		SELECT
 		SELECT
-		<include refid="baseColumns" />
-		FROM teacher t where  t.user_id_ = #{userId}
+			<include refid="baseColumns" />,
+			u.avatar_ as avatar,
+			u.username_ as username,
+			u.gender_ as gender,
+			u.phone_ as phone,
+			(case when isnull(u.id_card_no_) then 0 else 1 end) as isReal
+		FROM teacher t
+		left join sys_user u on t.user_id_ = u.id_
+		where t.user_id_ = #{id}
 	</select>
 	</select>
+
+	<update id="updatetSetDetail">
+		UPDATE sys_user
+		<set>
+			<if test="param.avatar != null and param.avatar != ''">
+				avatar_ = #{param.avatar},
+			</if>
+			<if test="param.username != null and param.username != ''">
+				username_ = #{param.username},
+			</if>
+			<if test="param.gender != null">
+				gender_ = #{param.gender},
+			</if>
+			<if test="param.phone != null and param.phone != ''">
+				phone_ = #{param.phone},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
 </mapper>
 </mapper>

+ 10 - 12
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherAuthEntryRecordController.java

@@ -1,7 +1,5 @@
 package com.yonge.cooleshow.teacher.controller;
 package com.yonge.cooleshow.teacher.controller;
 
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
 
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
@@ -41,19 +39,19 @@ public class TeacherAuthEntryRecordController extends BaseController {
     @Autowired
     @Autowired
     private RealnameAuthenticationPlugin realnameAuthenticationPlugin;
     private RealnameAuthenticationPlugin realnameAuthenticationPlugin;
 
 
-    @PostMapping("/realnameAuth")
-    @ApiOperation(value = "实名认证", notes = "传入realnameAuthDto")
+    @PostMapping("/realNameAuth")
+    @ApiOperation(value = "实名认证", notes = "传入realNameAuthDto")
     @ResponseBody
     @ResponseBody
-    public HttpResponseResult<IdcardInfoExtractor> realnameAuth(@Valid @RequestBody RealnameAuthDto realnameAuthDto) {
+    public HttpResponseResult<IdcardInfoExtractor> realNameAuth(@Valid @RequestBody RealnameAuthDto realNameAuthDto) {
         IdcardValidator idcardValidator = new IdcardValidator();
         IdcardValidator idcardValidator = new IdcardValidator();
         //验证身份证号合法性
         //验证身份证号合法性
-        boolean validatedAllIdcard = idcardValidator.isValidatedAllIdcard(realnameAuthDto.getIdcardNo());
+        boolean validatedAllIdcard = idcardValidator.isValidatedAllIdcard(realNameAuthDto.getIdCardNo());
         if (!validatedAllIdcard) {
         if (!validatedAllIdcard) {
             return failed("身份证号不合法");
             return failed("身份证号不合法");
         }
         }
         //通过身份证号获取身份信息
         //通过身份证号获取身份信息
-        IdcardInfoExtractor idcardInfoExtractor = new IdcardInfoExtractor(realnameAuthDto.getIdcardNo(), validatedAllIdcard);
-        boolean verify = realnameAuthenticationPlugin.verify(realnameAuthDto.getRealname(), realnameAuthDto.getIdcardNo());
+        IdcardInfoExtractor idcardInfoExtractor = new IdcardInfoExtractor(realNameAuthDto.getIdCardNo(), validatedAllIdcard);
+        boolean verify = realnameAuthenticationPlugin.verify(realNameAuthDto.getRealName(), realNameAuthDto.getIdCardNo());
         if (verify) {
         if (verify) {
             return succeed(idcardInfoExtractor);
             return succeed(idcardInfoExtractor);
         } else {
         } else {
@@ -63,9 +61,9 @@ public class TeacherAuthEntryRecordController extends BaseController {
 
 
     @PostMapping("/doApply")
     @PostMapping("/doApply")
     @ApiOperation(value = "提交申请", notes = "传入teacherAuthEntryRecord")
     @ApiOperation(value = "提交申请", notes = "传入teacherAuthEntryRecord")
-    public HttpResponseResult<Boolean> doApply(@Valid @RequestBody TeacherApplyDetailDto teacherApplyDetailDto) throws Exception{
+    public HttpResponseResult<Boolean> doApply(@Valid @RequestBody TeacherApplyDetailDto teacherApplyDetailDto) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-		//处理老师申请逻辑
+        //处理老师申请逻辑
         return teacherAuthEntryRecordService.doApply(teacherApplyDetailDto, sysUser);
         return teacherAuthEntryRecordService.doApply(teacherApplyDetailDto, sysUser);
     }
     }
 
 
@@ -85,14 +83,14 @@ public class TeacherAuthEntryRecordController extends BaseController {
     @GetMapping("/detail")
     @GetMapping("/detail")
     @ApiOperation(value = "详情", notes = "传入teacherAuthEntryRecord")
     @ApiOperation(value = "详情", notes = "传入teacherAuthEntryRecord")
     public HttpResponseResult<TeacherAuthEntryRecordVo> detail(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
     public HttpResponseResult<TeacherAuthEntryRecordVo> detail(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
-        TeacherAuthEntryRecordVo detail =  teacherAuthEntryRecordService.detail(id);
+        TeacherAuthEntryRecordVo detail = teacherAuthEntryRecordService.detail(id);
         return succeed(detail);
         return succeed(detail);
     }
     }
 
 
 
 
     @PostMapping("/doAuth")
     @PostMapping("/doAuth")
     @ApiOperation(value = "审核", notes = "传入authOperaDto")
     @ApiOperation(value = "审核", notes = "传入authOperaDto")
-    public HttpResponseResult<Boolean> doAuth(@Valid AuthOperaDto authOperaDto) throws Exception{
+    public HttpResponseResult<Boolean> doAuth(@Valid AuthOperaDto authOperaDto) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         return teacherAuthEntryRecordService.doAuth(authOperaDto, sysUser);
         return teacherAuthEntryRecordService.doAuth(authOperaDto, sysUser);
     }
     }

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

@@ -59,7 +59,6 @@ public class TeacherAuthMusicianRecordController extends BaseController {
 	}
 	}
 
 
 
 
-
 	/**
 	/**
      * 查询单条
      * 查询单条
      */
      */

+ 33 - 92
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherController.java

@@ -1,34 +1,21 @@
 package com.yonge.cooleshow.teacher.controller;
 package com.yonge.cooleshow.teacher.controller;
 
 
+import com.yonge.cooleshow.biz.dal.dto.req.TeacherSetReq;
 import com.yonge.cooleshow.biz.dal.vo.TeacherHomeVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherHomeVo;
+import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-
-import java.util.List;
-
-import javax.validation.Valid;
 
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
-import com.yonge.cooleshow.biz.dal.dao.SubjectDao;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.service.TeacherService;
 import com.yonge.cooleshow.biz.dal.service.TeacherService;
-import com.yonge.cooleshow.biz.dal.support.Condition;
-import com.yonge.cooleshow.biz.dal.support.Query;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
-import com.yonge.toolset.utils.string.StringUtil;
 
 
 @RestController
 @RestController
 @RequestMapping("/Teacher")
 @RequestMapping("/Teacher")
@@ -41,9 +28,6 @@ public class TeacherController extends BaseController {
     @Autowired
     @Autowired
     private SysUserFeignService sysUserFeignService;
     private SysUserFeignService sysUserFeignService;
 
 
-    @Autowired
-    private SubjectDao subjectDao;
-
     @ApiOperation(value = "根据教师编号查询教师基本信息")
     @ApiOperation(value = "根据教师编号查询教师基本信息")
     @GetMapping("/queryUserInfo")
     @GetMapping("/queryUserInfo")
     public HttpResponseResult<TeacherHomeVo> queryUserInfo() {
     public HttpResponseResult<TeacherHomeVo> queryUserInfo() {
@@ -51,10 +35,10 @@ public class TeacherController extends BaseController {
         if (user == null) {
         if (user == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
         }
-        Teacher teacher = teacherService.detail1(user.getId());
+        Teacher teacher = teacherService.getById(user.getId());
 		TeacherHomeVo teacherHomeVo = new TeacherHomeVo();
 		TeacherHomeVo teacherHomeVo = new TeacherHomeVo();
 		teacherHomeVo.setHeardUrl(user.getAvatar());
 		teacherHomeVo.setHeardUrl(user.getAvatar());
-		teacherHomeVo.setName(user.getUsername());
+		teacherHomeVo.setUsername(user.getUsername());
 		//todo 老师授课信息
 		//todo 老师授课信息
 		teacherHomeVo.setStarGrade(1);
 		teacherHomeVo.setStarGrade(1);
 		teacherHomeVo.setFansNum(1);
 		teacherHomeVo.setFansNum(1);
@@ -76,84 +60,41 @@ public class TeacherController extends BaseController {
         return HttpResponseResult.succeed(true);
         return HttpResponseResult.succeed(true);
     }
     }
 
 
-    /**
-     * 查询单条
-     */
-    @GetMapping("/detail")
-    @ApiOperation(value = "详情", notes = "传入teacher")
-    public HttpResponseResult<Teacher> detail(Teacher teacher) {
-        Teacher detail = teacherService.getOne(Condition.getQueryWrapper(teacher));
+    @GetMapping("/getSetDetail")
+    @ApiOperation(value = "获取设置详情")
+    public HttpResponseResult<TeacherVo> getSetDetail() {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        TeacherVo detail = teacherService.getSetDetail(user.getId());
         return succeed(detail);
         return succeed(detail);
     }
     }
 
 
-    /**
-     * 查询单条
-     */
-    @GetMapping("/detail1")
-    @ApiOperation(value = "详情", notes = "传入teacher")
-    public HttpResponseResult<Teacher> detail1(Teacher teacher) {
-        return succeed(teacherService.detail1(teacher.getUserId()));
-    }
-
-
-    /**
-     * 查询集合
-     */
-    @GetMapping("/list")
-    @ApiOperation(value = "查询集合", notes = "传入teacher")
-    public HttpResponseResult<List<Teacher>> list(Teacher teacher) {
-        List<Teacher> list = teacherService.list();
-        return succeed(list);
-    }
-
-    /**
-     * 查询分页
-     */
-    @GetMapping("/page")
-    @ApiOperation(value = "查询分页", notes = "传入teacher")
-    public HttpResponseResult<IPage<Teacher>> page(Teacher teacher, Query query) {
-        IPage<Teacher> pages = teacherService.selectPage(Condition.getPage(query), teacher);
-        return succeed(pages);
-    }
-
-    /**
-     * 新增
-     */
-    @PostMapping("/save")
-    @ApiOperation(value = "新增", notes = "传入teacher")
-    public HttpResponseResult save(@Valid @RequestBody Teacher teacher) {
-        return status(teacherService.save(teacher));
-    }
-
-    /**
-     * 修改
-     */
-    @PostMapping("/update")
-    @ApiOperation(value = "修改", notes = "传入teacher")
-    public HttpResponseResult update(@Valid @RequestBody Teacher teacher) {
-        return status(teacherService.updateById(teacher));
-    }
+    @PostMapping("/submitSetDetail")
+    @ApiOperation(value = "修改设置信息", notes = "传入teacher")
+    public HttpResponseResult<TeacherVo> submitSetDetail(@RequestBody TeacherSetReq setReq) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        //设置
+        teacherService.submitSetDetail(setReq,user.getId());
 
 
-    /**
-     * 新增或修改
-     */
-    @PostMapping("/submit")
-    @ApiOperation(value = "新增或修改", notes = "传入teacher")
-    public HttpResponseResult submit(@RequestBody Teacher teacher) {
-        return status(teacherService.saveOrUpdate(teacher));
+        return succeed(teacherService.getSetDetail(user.getId()));
     }
     }
 
 
-    /**
-     * 删除
-     */
-    @PostMapping("/remove")
-    @ApiOperation(value = "逻辑删除", notes = "传入ids")
-    public HttpResponseResult remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-        if (StringUtil.isEmpty(ids)) {
-            return failed("参数不能为空");
+    @PostMapping("/updatePassword")
+    @ApiOperation(value = "修改密码", notes = "传入teacher")
+    public HttpResponseResult<TeacherVo> updatePassword(@RequestBody TeacherSetReq setReq) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
         }
         }
-        return status(teacherService.removeByIds(StringUtil.toLongList(ids)));
-    }
+        //设置
+        teacherService.submitSetDetail(setReq,user.getId());
 
 
+        return succeed(teacherService.getSetDetail(user.getId()));
+    }
 
 
 }
 }

+ 4 - 4
toolset/utils/src/main/java/com/yonge/toolset/utils/idcard/IdcardInfoExtractor.java

@@ -32,7 +32,7 @@ public class IdcardInfoExtractor {
 	// 出生日期
 	// 出生日期
 	private Date birthday;
 	private Date birthday;
 
 
-	private static Properties idCardCodeTable;
+	/*private static Properties idCardCodeTable;
 
 
 	static {
 	static {
 		if (idCardCodeTable == null) {
 		if (idCardCodeTable == null) {
@@ -43,7 +43,7 @@ public class IdcardInfoExtractor {
 		} catch (IOException e) {
 		} catch (IOException e) {
 			throw new UtilException("银行卡信息查询接口异常", e);
 			throw new UtilException("银行卡信息查询接口异常", e);
 		}
 		}
-	}
+	}*/
 
 
 	private IdcardValidator validator = null;
 	private IdcardValidator validator = null;
 
 
@@ -61,14 +61,14 @@ public class IdcardInfoExtractor {
 			idcard = validator.convertIdcarBy15bit(idcard);
 			idcard = validator.convertIdcarBy15bit(idcard);
 		}
 		}
 		// 获取省份
 		// 获取省份
-		provinceCode = idcard.substring(0, 2) + "0000";
+		/*provinceCode = idcard.substring(0, 2) + "0000";
 		province = idCardCodeTable.getProperty(provinceCode);
 		province = idCardCodeTable.getProperty(provinceCode);
 
 
 		cityCode = idcard.substring(0, 4) + "00";
 		cityCode = idcard.substring(0, 4) + "00";
 		city = idCardCodeTable.getProperty(cityCode);
 		city = idCardCodeTable.getProperty(cityCode);
 
 
 		regionCode = idcard.substring(0, 6);
 		regionCode = idcard.substring(0, 6);
-		region = idCardCodeTable.getProperty(regionCode);
+		region = idCardCodeTable.getProperty(regionCode);*/
 
 
 		// 获取性别
 		// 获取性别
 		String id17 = idcard.substring(16, 17);
 		String id17 = idcard.substring(16, 17);