liujunchi 2 년 전
부모
커밋
8cbac53f1a
33개의 변경된 파일1040개의 추가작업 그리고 37개의 파일을 삭제
  1. 12 0
      cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/AdminFeignService.java
  2. 140 0
      cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/dto/EmployeeApi.java
  3. 134 0
      cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/dto/StudentApi.java
  4. 362 0
      cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/dto/TeacherApi.java
  5. 18 0
      cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/fallback/AdminFeignServiceFallback.java
  6. 3 3
      cooleshow-auth/auth-api/src/main/java/com/yonge/cooleshow/auth/api/entity/SysUser.java
  7. 44 7
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/core/provider/service/DefaultUserDetailsService.java
  8. 4 0
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/dal/dao/SysUserDao.java
  9. 4 0
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/service/SysUserService.java
  10. 5 0
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/service/impl/SysUserServiceImpl.java
  11. 28 12
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/web/controller/UserController.java
  12. 12 0
      cooleshow-auth/auth-server/src/main/resources/config/mybatis/SysUserMapper.xml
  13. 2 2
      cooleshow-common/src/main/java/com/yonge/cooleshow/common/enums/UserLockFlag.java
  14. 1 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/ActivityEvaluationController.java
  15. 1 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/EmployeeController.java
  16. 46 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/open/AdminClient.java
  17. 1 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/EmployeeSearch.java
  18. 11 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/StudentSearch.java
  19. 13 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/TeacherSearch.java
  20. 12 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Employee.java
  21. 12 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Student.java
  22. 12 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Teacher.java
  23. 16 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/TeacherAuthEntryRecord.java
  24. 34 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/AuthTypeEnum.java
  25. 10 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherAuthEntryRecordServiceImpl.java
  26. 1 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/EmployeeVo.java
  27. 1 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherVo.java
  28. 10 4
      cooleshow-user/user-biz/src/main/resources/config/mybatis/EmployeeMapper.xml
  29. 7 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml
  30. 2 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherAuthEntryRecordMapper.xml
  31. 7 3
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  32. 27 0
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/open/OpenClient.java
  33. 48 0
      cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/controller/open/OpenClient.java

+ 12 - 0
cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/AdminFeignService.java

@@ -1,5 +1,8 @@
 package com.yonge.cooleshow.api.feign;
 
+import com.yonge.cooleshow.api.feign.dto.EmployeeApi;
+import com.yonge.cooleshow.api.feign.dto.StudentApi;
+import com.yonge.cooleshow.api.feign.dto.TeacherApi;
 import com.yonge.cooleshow.api.feign.fallback.AdminFeignServiceFallback;
 import com.yonge.cooleshow.common.constant.AppConstant;
 import com.yonge.cooleshow.common.entity.ContractDto;
@@ -101,4 +104,13 @@ public interface AdminFeignService {
             @RequestParam("userId") Long userId,
             @RequestParam("userType") String userType,
             @RequestParam("firstTimeType") UserFirstTimeTypeEnum firstTimeType);
+
+    @GetMapping(value = "/open/adminClient/getTeacher")
+    HttpResponseResult<TeacherApi> getTeacher(@RequestParam("userId") Long userId);
+
+    @GetMapping(value = "/open/adminClient/getStudent")
+    HttpResponseResult<StudentApi> getStudent(@RequestParam("userId") Long userId);
+
+    @GetMapping(value = "/open/adminClient/getEmployee")
+    HttpResponseResult<EmployeeApi> getEmployee(@RequestParam("userId") Long userId);
 }

+ 140 - 0
cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/dto/EmployeeApi.java

@@ -0,0 +1,140 @@
+package com.yonge.cooleshow.api.feign.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 员工表
+ */
+public class EmployeeApi implements Serializable {
+	private static final long serialVersionUID = 1L;
+	private Long userId;
+	private String jobNature;
+	private String isProbationPeriod;
+	private String educationBackground;
+	private String graduateSchool;
+	private String technicalTitles;
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+	private Date entryDate;
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+	private Date createTime;
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+	private Date updateTime;
+	private String introduction;
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+	private Date demissionDate;
+	private String contactAddress;
+	private UserLockFlag lockFlag;
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
+
+	public String getJobNature() {
+		return jobNature;
+	}
+
+	public void setJobNature(String jobNature) {
+		this.jobNature = jobNature;
+	}
+
+	public String getIsProbationPeriod() {
+		return isProbationPeriod;
+	}
+
+	public void setIsProbationPeriod(String isProbationPeriod) {
+		this.isProbationPeriod = isProbationPeriod;
+	}
+
+	public String getEducationBackground() {
+		return educationBackground;
+	}
+
+	public void setEducationBackground(String educationBackground) {
+		this.educationBackground = educationBackground;
+	}
+
+	public String getGraduateSchool() {
+		return graduateSchool;
+	}
+
+	public void setGraduateSchool(String graduateSchool) {
+		this.graduateSchool = graduateSchool;
+	}
+
+	public String getTechnicalTitles() {
+		return technicalTitles;
+	}
+
+	public void setTechnicalTitles(String technicalTitles) {
+		this.technicalTitles = technicalTitles;
+	}
+
+	public Date getEntryDate() {
+		return entryDate;
+	}
+
+	public void setEntryDate(Date entryDate) {
+		this.entryDate = entryDate;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public String getIntroduction() {
+		return introduction;
+	}
+
+	public void setIntroduction(String introduction) {
+		this.introduction = introduction;
+	}
+
+	public Date getDemissionDate() {
+		return demissionDate;
+	}
+
+	public void setDemissionDate(Date demissionDate) {
+		this.demissionDate = demissionDate;
+	}
+
+	public String getContactAddress() {
+		return contactAddress;
+	}
+
+	public void setContactAddress(String contactAddress) {
+		this.contactAddress = contactAddress;
+	}
+
+	public UserLockFlag getLockFlag() {
+		return lockFlag;
+	}
+
+	public void setLockFlag(UserLockFlag lockFlag) {
+		this.lockFlag = lockFlag;
+	}
+}

+ 134 - 0
cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/dto/StudentApi.java

@@ -0,0 +1,134 @@
+package com.yonge.cooleshow.api.feign.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 学生表
+ */
+public class StudentApi implements Serializable {
+	private static final long serialVersionUID = 1L;
+    private Long userId;
+    /** 
+    * 学员声部 
+    */
+    private String subjectId;
+    /**
+    * 会员等级 
+    */
+    private Long memberRankSettingId;
+    /** 
+    * 有效期开始时间 
+    */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date membershipStartTime;
+    /** 
+    * 有效期结束时间 
+    */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date membershipEndTime;
+    /** 
+    * 小酷Ai连续使用天数 
+    */
+    private Integer cloudStudySequenceDays;
+    /** 
+    * 小酷Ai最后使用日期 
+    */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date cloudStudyUseLastDay;
+
+    private UserLockFlag lockFlag;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date createTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date updateTime;
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(String subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Long getMemberRankSettingId() {
+        return memberRankSettingId;
+    }
+
+    public void setMemberRankSettingId(Long memberRankSettingId) {
+        this.memberRankSettingId = memberRankSettingId;
+    }
+
+    public Date getMembershipStartTime() {
+        return membershipStartTime;
+    }
+
+    public void setMembershipStartTime(Date membershipStartTime) {
+        this.membershipStartTime = membershipStartTime;
+    }
+
+    public Date getMembershipEndTime() {
+        return membershipEndTime;
+    }
+
+    public void setMembershipEndTime(Date membershipEndTime) {
+        this.membershipEndTime = membershipEndTime;
+    }
+
+    public Integer getCloudStudySequenceDays() {
+        return cloudStudySequenceDays;
+    }
+
+    public void setCloudStudySequenceDays(Integer cloudStudySequenceDays) {
+        this.cloudStudySequenceDays = cloudStudySequenceDays;
+    }
+
+    public Date getCloudStudyUseLastDay() {
+        return cloudStudyUseLastDay;
+    }
+
+    public void setCloudStudyUseLastDay(Date cloudStudyUseLastDay) {
+        this.cloudStudyUseLastDay = cloudStudyUseLastDay;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public UserLockFlag getLockFlag() {
+        return lockFlag;
+    }
+
+    public void setLockFlag(UserLockFlag lockFlag) {
+        this.lockFlag = lockFlag;
+    }
+}

+ 362 - 0
cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/dto/TeacherApi.java

@@ -0,0 +1,362 @@
+package com.yonge.cooleshow.api.feign.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
+import com.yonge.cooleshow.common.enums.YesOrNoEnum;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 教师表
+ */
+@TableName("teacher")
+public class TeacherApi implements Serializable {
+	private static final long serialVersionUID = 1L;
+    /** 
+    * 对应user表用户编号 
+    */
+    private Long userId;
+    /** 
+    * 学历 
+    */
+    private String educationBackground;
+    /** 
+    * 毕业学校 
+    */
+    private String graduateSchool;
+    /** 
+    * 技术职称 
+    */
+    private String technicalTitles;
+    /** 
+    * 工作单位 
+    */
+    private String workUnit;
+    /** 
+    * 专业技能(支持多个,用逗号分隔),对应声部表编号
+    */
+    private String subjectId;
+    /**
+     * 个人介绍
+     */
+    private String introduction;
+    /**
+     * 学校专业
+     */
+    private String subject;
+    /**
+     * 毕业证书
+     */
+    private String gradCertificate;
+    /**
+     * 学位证书
+     */
+    private String degreeCertificate;
+    /**
+     * 教师资格证
+     */
+    private String teacherCertificate;
+    /**
+     * 老师入驻  0 否 1 是
+     */
+    private YesOrNoEnum entryFlag;
+    /**
+    * 入驻时间 
+    */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date entryAuthDate;
+
+    private String tag;
+
+    /** 
+    * 音乐人  0 否 1 是
+    */
+    private YesOrNoEnum musicianFlag;
+    /**
+     * 音乐人认证时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date musicianDate;
+    private YesOrNoEnum liveFlag;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date liveDate;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date musicDate;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date videoDate;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date styleDate;
+
+    /**
+     * 会员等级
+     */
+    private Long memberRankSettingId;
+    /**
+     * 有效期开始时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date membershipStartTime;
+    /**
+     * 有效期结束时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date membershipEndTime;
+
+    private Integer browse;
+    private String memo;
+    private UserLockFlag lockFlag;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date createTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date updateTime;
+
+
+    public Date getMusicDate() {
+        return musicDate;
+    }
+
+    public void setMusicDate(Date musicDate) {
+        this.musicDate = musicDate;
+    }
+
+    public Date getVideoDate() {
+        return videoDate;
+    }
+
+    public void setVideoDate(Date videoDate) {
+        this.videoDate = videoDate;
+    }
+
+    public Date getStyleDate() {
+        return styleDate;
+    }
+
+    public void setStyleDate(Date styleDate) {
+        this.styleDate = styleDate;
+    }
+
+    public String getTag() {
+        return tag;
+    }
+
+    public void setTag(String tag) {
+        this.tag = tag;
+    }
+
+    public Long getMemberRankSettingId() {
+        return memberRankSettingId;
+    }
+
+    public void setMemberRankSettingId(Long memberRankSettingId) {
+        this.memberRankSettingId = memberRankSettingId;
+    }
+
+    public Date getMembershipStartTime() {
+        return membershipStartTime;
+    }
+
+    public void setMembershipStartTime(Date membershipStartTime) {
+        this.membershipStartTime = membershipStartTime;
+    }
+
+    public Date getMembershipEndTime() {
+        return membershipEndTime;
+    }
+
+    public void setMembershipEndTime(Date membershipEndTime) {
+        this.membershipEndTime = membershipEndTime;
+
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getEducationBackground() {
+        return educationBackground;
+    }
+
+    public void setEducationBackground(String educationBackground) {
+        this.educationBackground = educationBackground;
+    }
+
+    public String getGraduateSchool() {
+        return graduateSchool;
+    }
+
+    public void setGraduateSchool(String graduateSchool) {
+        this.graduateSchool = graduateSchool;
+    }
+
+    public String getTechnicalTitles() {
+        return technicalTitles;
+    }
+
+    public void setTechnicalTitles(String technicalTitles) {
+        this.technicalTitles = technicalTitles;
+    }
+
+    public String getWorkUnit() {
+        return workUnit;
+    }
+
+    public void setWorkUnit(String workUnit) {
+        this.workUnit = workUnit;
+    }
+
+    public String getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(String subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getIntroduction() {
+        return introduction;
+    }
+
+    public void setIntroduction(String introduction) {
+        this.introduction = introduction;
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public String getGradCertificate() {
+        return gradCertificate;
+    }
+
+    public void setGradCertificate(String gradCertificate) {
+        this.gradCertificate = gradCertificate;
+    }
+
+    public String getDegreeCertificate() {
+        return degreeCertificate;
+    }
+
+    public void setDegreeCertificate(String degreeCertificate) {
+        this.degreeCertificate = degreeCertificate;
+    }
+
+    public String getTeacherCertificate() {
+        return teacherCertificate;
+    }
+
+    public void setTeacherCertificate(String teacherCertificate) {
+        this.teacherCertificate = teacherCertificate;
+    }
+
+    public YesOrNoEnum getEntryFlag() {
+        return entryFlag;
+    }
+
+    public void setEntryFlag(YesOrNoEnum entryFlag) {
+        this.entryFlag = entryFlag;
+    }
+
+    public Date getEntryAuthDate() {
+        return entryAuthDate;
+    }
+
+    public void setEntryAuthDate(Date entryAuthDate) {
+        this.entryAuthDate = entryAuthDate;
+    }
+
+    public YesOrNoEnum getMusicianFlag() {
+        return musicianFlag;
+    }
+
+    public void setMusicianFlag(YesOrNoEnum musicianFlag) {
+        this.musicianFlag = musicianFlag;
+    }
+
+    public Date getMusicianDate() {
+        return musicianDate;
+    }
+
+    public void setMusicianDate(Date musicianDate) {
+        this.musicianDate = musicianDate;
+    }
+
+    public YesOrNoEnum getLiveFlag() {
+        return liveFlag;
+    }
+
+    public void setLiveFlag(YesOrNoEnum liveFlag) {
+        this.liveFlag = liveFlag;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getLiveDate() {
+        return liveDate;
+    }
+
+    public void setLiveDate(Date liveDate) {
+        this.liveDate = liveDate;
+    }
+
+    public Integer getBrowse() {
+        return browse;
+    }
+
+    public void setBrowse(Integer browse) {
+        this.browse = browse;
+    }
+
+    public UserLockFlag getLockFlag() {
+        return lockFlag;
+    }
+
+    public void setLockFlag(UserLockFlag lockFlag) {
+        this.lockFlag = lockFlag;
+    }
+}

+ 18 - 0
cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/fallback/AdminFeignServiceFallback.java

@@ -1,6 +1,9 @@
 package com.yonge.cooleshow.api.feign.fallback;
 
 import com.yonge.cooleshow.api.feign.AdminFeignService;
+import com.yonge.cooleshow.api.feign.dto.EmployeeApi;
+import com.yonge.cooleshow.api.feign.dto.StudentApi;
+import com.yonge.cooleshow.api.feign.dto.TeacherApi;
 import com.yonge.cooleshow.common.entity.ContractDto;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.cooleshow.common.entity.MallOrderItemDto;
@@ -76,4 +79,19 @@ public class AdminFeignServiceFallback implements AdminFeignService {
     public HttpResponseResult recordTime(Long userId, String userType, UserFirstTimeTypeEnum firstTimeTypeEnum) {
         return null;
     }
+
+    @Override
+    public HttpResponseResult<TeacherApi> getTeacher(Long userId) {
+        return null;
+    }
+
+    @Override
+    public HttpResponseResult<StudentApi> getStudent(Long userId) {
+        return null;
+    }
+
+    @Override
+    public HttpResponseResult<EmployeeApi> getEmployee(Long userId) {
+        return null;
+    }
 }

+ 3 - 3
cooleshow-auth/auth-api/src/main/java/com/yonge/cooleshow/auth/api/entity/SysUser.java

@@ -47,12 +47,12 @@ public class SysUser implements Serializable{
 	/** 修改时间 */
 	private java.util.Date updateTime;
 
-	/** 0-正常,9-锁定 */
-	@ApiModelProperty(value = "0-正常,1-锁定")
+	/** 0-正常, 1-锁定 */
+	@ApiModelProperty(value = "0-正常, 1-锁定")
 	private Integer lockFlag;
 
 	/** 0-正常,1-删除 */
-	@ApiModelProperty(value = "0-正常,1+ -删除")
+	@ApiModelProperty(value = "0-正常,1-删除")
 	private Boolean delFlag;
 
 	/** 微信openid */

+ 44 - 7
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/core/provider/service/DefaultUserDetailsService.java

@@ -3,6 +3,12 @@ package com.yonge.cooleshow.auth.core.provider.service;
 import java.util.ArrayList;
 import java.util.List;
 
+import com.yonge.cooleshow.api.feign.AdminFeignService;
+import com.yonge.cooleshow.api.feign.dto.EmployeeApi;
+import com.yonge.cooleshow.api.feign.dto.StudentApi;
+import com.yonge.cooleshow.api.feign.dto.TeacherApi;
+import com.yonge.cooleshow.common.enums.SysUserType;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
 import com.yonge.cooleshow.common.util.WebUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +28,8 @@ import com.yonge.cooleshow.auth.service.SysUserService;
 import com.yonge.cooleshow.common.security.AuthUser;
 import com.yonge.cooleshow.common.security.SecurityConstants;
 
+import javax.annotation.Resource;
+
 @Service
 public class DefaultUserDetailsService implements UserDetailsService {
 
@@ -31,6 +39,9 @@ public class DefaultUserDetailsService implements UserDetailsService {
     @Autowired
     private SysUserService sysUserService;
 
+    @Resource
+    private AdminFeignService adminFeignService;
+
     private final String BCRYPT = "{bcrypt}";
 
     @Override
@@ -38,6 +49,8 @@ public class DefaultUserDetailsService implements UserDetailsService {
         if (StringUtils.isBlank(username)) {
             return null;
         }
+        String clientId = WebUtil.getParameter("clientId").toUpperCase();
+        String clientSecret = WebUtil.getParameter("clientSecret");
 
         SysUserInfo userInfo;
 
@@ -48,15 +61,43 @@ public class DefaultUserDetailsService implements UserDetailsService {
         } else {
             userInfo = sysUserService.queryUserInfoByUsername(username);
         }
-        if (userInfo == null) {
+        SysUser sysUser = userInfo.getSysUser();
+
+        if (userInfo == null || sysUser == null) {
             throw new UsernameNotFoundException("账户不存在");
-        } else if (userInfo.getSysUser().getLockFlag() == 9) {
+        } else if (sysUser.getLockFlag() == 9) {
             throw new LockedException("账户被锁定");
         }
+        //判断用户是否被锁定
+        if (SysUserType.STUDENT.getCode().equals(clientId)) {
+            StudentApi data = adminFeignService.getStudent(sysUser.getId()).getData();
+            if (data == null) {
+                throw new UsernameNotFoundException("账户不存在");
+            }
+            if (UserLockFlag.LOCKED.equals(data.getLockFlag())) {
+                throw new LockedException("账户被锁定");
+            }
+        }else if(SysUserType.TEACHER.getCode().equals(clientId)) {
+            TeacherApi data = adminFeignService.getTeacher(sysUser.getId()).getData();
+            if (data == null) {
+                throw new UsernameNotFoundException("账户不存在");
+            }
+            if (UserLockFlag.LOCKED.equals(data.getLockFlag())) {
+                throw new LockedException("账户被锁定");
+            }
+        }else if(SysUserType.SYSTEM.getCode().equals(clientId)) {
+            EmployeeApi data = adminFeignService.getEmployee(sysUser.getId()).getData();
+            if (data == null) {
+                throw new UsernameNotFoundException("账户不存在");
+            }
+            if (UserLockFlag.LOCKED.equals(data.getLockFlag())) {
+                throw new LockedException("账户被锁定");
+            }
+        }
 
         List<GrantedAuthority> authorities = null;
 
-        String userType = userInfo.getSysUser().getUserType();
+        String userType = sysUser.getUserType();
         String[] roles = userType.split(",");
 
         if (userType.contains("SYSTEM")) {
@@ -73,10 +114,6 @@ public class DefaultUserDetailsService implements UserDetailsService {
             authorities.add(new SimpleGrantedAuthority(StringUtils.lowerCase(role)));
         }
 
-        SysUser sysUser = userInfo.getSysUser();
-
-        String clientId = WebUtil.getParameter("clientId");
-        String clientSecret = WebUtil.getParameter("clientSecret");
         return new AuthUser(sysUser.getId(), username, BCRYPT + sysUser.getPassword(), sysUser.getLockFlag() == 0, true, true, true, authorities, clientId, clientSecret);
     }
 

+ 4 - 0
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/dal/dao/SysUserDao.java

@@ -2,6 +2,8 @@ package com.yonge.cooleshow.auth.dal.dao;
 
 import java.util.List;
 
+import com.yonge.cooleshow.common.enums.SysUserType;
+import io.swagger.models.auth.In;
 import org.apache.ibatis.annotations.Param;
 
 import com.yonge.cooleshow.auth.api.dto.RealnameAuthReq;
@@ -170,4 +172,6 @@ public interface SysUserDao extends BaseDAO<Long, SysUser> {
     List<SysUser> queryHistoryUserById(@Param("id")Long id);
 
     Integer getUnCompCourseNum(@Param("userId") Long userId);
+
+    void updateLockStatus(@Param("userId")Long userId, @Param("lockFlag") Integer lockFlag, @Param("SysUserType")  String sysUserType);
 }

+ 4 - 0
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/service/SysUserService.java

@@ -9,6 +9,8 @@ import com.yonge.cooleshow.auth.api.dto.UserSetReq;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.auth.api.vo.UserSetVo;
 import com.yonge.cooleshow.common.entity.ImUserModel;
+import com.yonge.cooleshow.common.enums.SysUserType;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
 import com.yonge.toolset.mybatis.service.BaseService;
 
 public interface SysUserService extends BaseService<Long, SysUser> {
@@ -191,4 +193,6 @@ public interface SysUserService extends BaseService<Long, SysUser> {
      * @param id
      */
     void logoffById(Long id);
+
+    void updateLockStatus(Long userId, Integer lockFlag, String sysUserType);
 }

+ 5 - 0
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/service/impl/SysUserServiceImpl.java

@@ -8,6 +8,7 @@ import com.yonge.cooleshow.auth.config.RongCloudConfig;
 import com.yonge.cooleshow.common.enums.CacheNameEnum;
 import com.yonge.cooleshow.common.enums.SysUserType;
 import com.yonge.cooleshow.common.enums.UserFirstTimeTypeEnum;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
 import com.yonge.toolset.mybatis.service.impl.BaseServiceImpl;
 import io.rong.models.user.UserModel;
 import org.apache.commons.lang3.StringUtils;
@@ -282,4 +283,8 @@ public class SysUserServiceImpl extends BaseServiceImpl<Long, SysUser> implement
         sysUserDao.logoffById(id, maxVersion);
     }
 
+    @Override
+    public void updateLockStatus(Long userId, Integer lockFlag, String sysUserType) {
+        sysUserDao.updateLockStatus(userId, lockFlag, sysUserType);
+    }
 }

+ 28 - 12
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/web/controller/UserController.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.auth.web.controller;
 
 import com.yonge.cooleshow.common.constant.SysConfigConstant;
 import com.yonge.cooleshow.common.enums.SysUserType;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
 import com.yonge.toolset.base.util.StringUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -192,7 +193,7 @@ public class UserController extends BaseController {
                 sysUser.setRealName(username);
             }
             sysUser.setUsername(username);
-            if(SysUserType.TEACHER.getCode().equals(authUser.getClientId().toUpperCase())){
+            if (SysUserType.TEACHER.getCode().equals(authUser.getClientId().toUpperCase())) {
                 sysUser.setLastUsernameTime(new Date());
             }
         }
@@ -247,6 +248,18 @@ public class UserController extends BaseController {
         }
     }
 
+    private void loginOut(SysUser sysUser, SysUserType sysUserType) {
+        if (SysUserType.STUDENT.equals(sysUserType)) {
+            tokenService.revokeToken("student", sysUser.getPhone());
+        }
+        if (SysUserType.TEACHER.equals(sysUserType)) {
+            tokenService.revokeToken("teacher", sysUser.getPhone());
+        }
+        if (SysUserType.SYSTEM.equals(sysUserType)) {
+            tokenService.revokeToken("system", sysUser.getPhone());
+        }
+    }
+
     @ApiOperation(value = "原密码修改密码")
     @PostMapping(value = "/updatePasswordByOldPassword")
     public Object updatePasswordByOldPassword(@RequestBody UpdatePasswordDto updatePasswordDto) {
@@ -320,14 +333,16 @@ public class UserController extends BaseController {
     /**
      * 启用/冻结
      */
-    @GetMapping(value = "/changeLock/{userId}/{lockFlag}")
+    @GetMapping(value = "/changeLock/{userId}/{lockFlag}/{userType}")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "userId", value = "userId", paramType = "path", dataType = "long", required = true),
-            @ApiImplicitParam(name = "lockFlag", value = "锁定状态 0-正常,1-锁定", paramType = "path", dataType = "int", required = true)
+            @ApiImplicitParam(name = "lockFlag", value = "锁定状态 0-正常, 1-锁定", paramType = "path", dataType = "int", required = true),
+            @ApiImplicitParam(name = "userType", value = "用户类型 STUDENT 学生 TEACHER 老师 SYSTEM 员工", paramType = "path", dataType = "String", required = true)
     })
     @ApiOperation(value = "启用/冻结", notes = "传入lockFlag")
-    public HttpResponseResult<Boolean> changeLock(@PathVariable("userId") Long userId, @PathVariable("lockFlag") Integer lockFlag) {
-        if (userId == null && lockFlag != 0 && lockFlag != 1) {
+    public HttpResponseResult<Boolean> changeLock(@PathVariable("userId") Long userId
+            , @PathVariable("lockFlag") UserLockFlag lockFlag, @PathVariable("userType") SysUserType sysUserType) {
+        if (userId == null || lockFlag == null || sysUserType == null) {
             return failed("参数校验异常");
         }
         SysUser sysUser = sysUserService.queryUserInfo(userId);
@@ -337,13 +352,14 @@ public class UserController extends BaseController {
         if (sysUser.getId() != userId.longValue()) {
             return failed("非法操作");
         }
-        sysUser.setLockFlag(lockFlag);
-
-        if (lockFlag == 1) {
-            loginOut(sysUser);
+        //退出对应用户
+        if (UserLockFlag.LOCK.equals(lockFlag)) {
+            loginOut(sysUser, sysUserType);
         }
-        sysUser.setUpdateTime(new Date());
-        sysUserService.update(sysUser);
+        //sysUser.setLockFlag(lockFlag.getCode());
+        //sysUser.setUpdateTime(new Date());
+        //sysUserService.update(sysUser);
+        sysUserService.updateLockStatus(userId, lockFlag.getCode(), sysUserType.getCode());
         return succeed();
     }
 
@@ -599,7 +615,7 @@ public class UserController extends BaseController {
             if (null != user.getLastUsernameTime()
                     && StringUtils.isNotEmpty(configValue)) {
                 Long lastUsernameMonth = Long.parseLong(configValue);
-                Long monthDiff = DateUtil.getMonthDiff(user.getLastUsernameTime(),new Date());
+                Long monthDiff = DateUtil.getMonthDiff(user.getLastUsernameTime(), new Date());
 
                 if (monthDiff < lastUsernameMonth && lastUsernameMonth > 0) {
                     throw new BizException("每隔" + lastUsernameMonth + "个月可修改一次");

+ 12 - 0
cooleshow-auth/auth-server/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -304,4 +304,16 @@
           and status_ in ('NOT_START','ING')
     </select>
 
+    <update id="updateLockStatus">
+        <if test="sysUserType == 'STUDENT'">
+            update student set lock_flag_ = #{lockFlag} where user_id_ = #{userId}
+        </if>
+        <if test="sysUserType == 'TEACHER'">
+            update teacher set lock_flag_ = #{lockFlag} where user_id_ = #{userId}
+        </if>
+        <if test="sysUserType == 'SYSTEM'">
+            update employee set lock_flag_ = #{lockFlag} where user_id_ = #{userId}
+        </if>
+    </update>
+
 </mapper>

+ 2 - 2
cooleshow-common/src/main/java/com/yonge/cooleshow/common/enums/UserLockFlag.java

@@ -4,11 +4,11 @@ import com.baomidou.mybatisplus.annotation.EnumValue;
 import com.yonge.toolset.base.enums.BaseEnum;
 
 /**
- * 会员状态枚举类
+ * 用户状态枚举类
  */
 public enum UserLockFlag implements BaseEnum<Integer, UserLockFlag> {
 
-	NORMAL(0, "正常"), LOCKED(9, "锁定"), CANCELLED(1, "冻结");
+	NORMAL(0, "正常"), LOCK(1, "锁定");
 
 	@EnumValue
 	private int code;

+ 1 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/ActivityEvaluationController.java

@@ -38,6 +38,7 @@ public class ActivityEvaluationController extends BaseController {
     private ActivityEvaluationService activityEvaluationService;
 	@Resource
 	private SysUserFeignService sysUserFeignService;
+
     /**
      * 查询分页
      */

+ 1 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/EmployeeController.java

@@ -97,4 +97,5 @@ public class EmployeeController extends BaseController {
         }
         return failed("获取用户信息失败");
     }
+
 }

+ 46 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/open/AdminClient.java

@@ -1,6 +1,15 @@
 package com.yonge.cooleshow.admin.controller.open;
 
+import com.yonge.cooleshow.api.feign.dto.EmployeeApi;
+import com.yonge.cooleshow.api.feign.dto.StudentApi;
+import com.yonge.cooleshow.api.feign.dto.TeacherApi;
+import com.yonge.cooleshow.biz.dal.entity.Employee;
+import com.yonge.cooleshow.biz.dal.entity.Student;
+import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.cooleshow.biz.dal.service.EmployeeService;
+import com.yonge.cooleshow.biz.dal.service.StudentService;
+import com.yonge.cooleshow.biz.dal.service.TeacherService;
 import com.yonge.cooleshow.biz.dal.service.UserFirstTimeService;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.ContractDto;
@@ -9,6 +18,7 @@ import com.yonge.cooleshow.common.enums.UserFirstTimeTypeEnum;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -23,6 +33,15 @@ public class AdminClient extends BaseController {
     @Autowired
     private UserFirstTimeService userFirstTimeService;
 
+    @Autowired
+    private TeacherService teacherService;
+
+    @Autowired
+    private StudentService studentService;
+
+    @Autowired
+    private EmployeeService employeeService;
+
     @GetMapping("/recordTime")
     public HttpResponseResult<Boolean> recordTime(
             @RequestParam("userId") Long userId,
@@ -34,4 +53,31 @@ public class AdminClient extends BaseController {
         return succeed(true);
     }
 
+    @GetMapping("/getTeacher")
+    public HttpResponseResult<TeacherApi> getTeacher(@RequestParam("userId") Long userId) {
+        Teacher teacher = teacherService.getById(userId);
+
+        TeacherApi teacherApi = new TeacherApi();
+        BeanUtils.copyProperties(teacher, teacherApi);
+        return succeed(teacherApi);
+    }
+
+    @GetMapping("/getStudent")
+    public HttpResponseResult<StudentApi> getStudent(@RequestParam("userId") Long userId) {
+        Student student = studentService.getById(userId);
+
+        StudentApi studentApi = new StudentApi();
+        BeanUtils.copyProperties(student, studentApi);
+        return succeed(studentApi);
+    }
+
+    @GetMapping("/getEmployee")
+    public HttpResponseResult<EmployeeApi> getEmployee(@RequestParam("userId") Long userId) {
+        Employee employee = employeeService.get(userId);
+
+        EmployeeApi employeeApi = new EmployeeApi();
+        BeanUtils.copyProperties(employee, employeeApi);
+        return succeed(employeeApi);
+    }
+
 }

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/EmployeeSearch.java

@@ -22,7 +22,7 @@ public class EmployeeSearch extends QueryInfo{
     private GenderEnum gender;
     @ApiModelProperty("学员声部 ")
     private String subjectIdList;
-    @ApiModelProperty(value = "0-正常,9-锁定")
+    @ApiModelProperty(value = "0-正常, 1-锁定")
     private YesOrNoEnum lockFlag;
     @ApiModelProperty(value = "创建开始时间")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/StudentSearch.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.biz.dal.dto.search;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.yonge.cooleshow.biz.dal.enums.GenderEnum;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
@@ -22,6 +23,8 @@ public class StudentSearch extends QueryInfo{
     private GenderEnum gender;
     @ApiModelProperty("学员声部 ")
     private String subjectId;
+    @ApiModelProperty(value = "0-正常, 1-锁定")
+    private UserLockFlag lockFlag;
     @ApiModelProperty(value = "是否会员 0否 1是")
     private YesOrNoEnum isVip;
     @ApiModelProperty(value = "注册开始时间")
@@ -61,6 +64,14 @@ public class StudentSearch extends QueryInfo{
         this.subjectId = subjectId;
     }
 
+    public UserLockFlag getLockFlag() {
+        return lockFlag;
+    }
+
+    public void setLockFlag(UserLockFlag lockFlag) {
+        this.lockFlag = lockFlag;
+    }
+
     public YesOrNoEnum getIsVip() {
         return isVip;
     }

+ 13 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/TeacherSearch.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.biz.dal.dto.search;
 
+import com.yonge.cooleshow.common.enums.UserLockFlag;
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -17,6 +18,9 @@ public class TeacherSearch extends QueryInfo{
     
     @ApiModelProperty(value = "徽章(STYLE-个人风采  LIVE-直播  VIDEO-视频课  MUSIC-曲谱)")
     private String tag;
+
+    @ApiModelProperty(value = "0-正常, 1-锁定")
+    private UserLockFlag lockFlag;
     
     @ApiModelProperty(value = "是否会员(0-否 1-是)")
     private Integer isVip;
@@ -45,7 +49,15 @@ public class TeacherSearch extends QueryInfo{
 		this.tag = tag;
 	}
 
-	public Integer getIsVip() {
+    public UserLockFlag getLockFlag() {
+        return lockFlag;
+    }
+
+    public void setLockFlag(UserLockFlag lockFlag) {
+        this.lockFlag = lockFlag;
+    }
+
+    public Integer getIsVip() {
 		return isVip;
 	}
 

+ 12 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Employee.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -60,6 +61,9 @@ public class Employee implements Serializable {
 	@ApiModelProperty("联系地址 ")
 	@TableField(value = "contact_address_")
 	private String contactAddress;
+	@ApiModelProperty("锁定状态 0-正常, 1=锁定")
+	@TableField(value = "lock_flag_")
+	private UserLockFlag lockFlag;
 
 	public Long getUserId() {
 		return userId;
@@ -156,4 +160,12 @@ public class Employee implements Serializable {
 	public void setContactAddress(String contactAddress) {
 		this.contactAddress = contactAddress;
 	}
+
+	public UserLockFlag getLockFlag() {
+		return lockFlag;
+	}
+
+	public void setLockFlag(UserLockFlag lockFlag) {
+		this.lockFlag = lockFlag;
+	}
 }

+ 12 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Student.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.biz.dal.entity;
 
 import com.baomidou.mybatisplus.annotation.*;
+import com.yonge.cooleshow.common.enums.UserLockFlag;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -60,6 +61,9 @@ public class Student implements Serializable {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date cloudStudyUseLastDay;
+    @ApiModelProperty("锁定状态 0-正常, 1=锁定")
+    @TableField(value = "lock_flag_")
+    private UserLockFlag lockFlag;
 	@TableField(value = "create_time_")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@@ -140,4 +144,12 @@ public class Student implements Serializable {
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
+
+    public UserLockFlag getLockFlag() {
+        return lockFlag;
+    }
+
+    public void setLockFlag(UserLockFlag lockFlag) {
+        this.lockFlag = lockFlag;
+    }
 }

+ 12 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Teacher.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 
+import com.yonge.cooleshow.common.enums.UserLockFlag;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -178,6 +179,9 @@ public class Teacher implements Serializable {
     @ApiModelProperty("备注 ")
 	@TableField(value = "memo_")
     private String memo;
+    @ApiModelProperty("锁定状态 0-正常, 1=锁定")
+    @TableField(value = "lock_flag_")
+    private UserLockFlag lockFlag;
 	@TableField(value = "create_time_")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@@ -412,4 +416,12 @@ public class Teacher implements Serializable {
     public void setBrowse(Integer browse) {
         this.browse = browse;
     }
+
+    public UserLockFlag getLockFlag() {
+        return lockFlag;
+    }
+
+    public void setLockFlag(UserLockFlag lockFlag) {
+        this.lockFlag = lockFlag;
+    }
 }

+ 16 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/TeacherAuthEntryRecord.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 
 import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
+import com.yonge.cooleshow.biz.dal.enums.AuthTypeEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -87,7 +88,13 @@ public class TeacherAuthEntryRecord implements Serializable {
     @ApiModelProperty("达人认证审核状态 UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过")
 	@TableField(value = "teacher_auth_status_")
     private AuthStatusEnum teacherAuthStatus;
-    /** 
+    /**
+     * 认证审核类型 ADD 新增 MODIFY 修改
+     */
+    @ApiModelProperty("认证审核类型 ADD 新增 MODIFY 修改")
+    @TableField(value = "teacher_auth_type_")
+    private AuthTypeEnum teacherAuthType;
+    /**
     * 审核人 
     */
     @ApiModelProperty("审核人 ")
@@ -198,6 +205,14 @@ public class TeacherAuthEntryRecord implements Serializable {
         this.teacherAuthStatus = teacherAuthStatus;
     }
 
+    public AuthTypeEnum getTeacherAuthType() {
+        return teacherAuthType;
+    }
+
+    public void setTeacherAuthType(AuthTypeEnum teacherAuthType) {
+        this.teacherAuthType = teacherAuthType;
+    }
+
     public Long getVerifyUserId() {
         return verifyUserId;
     }

+ 34 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/AuthTypeEnum.java

@@ -0,0 +1,34 @@
+package com.yonge.cooleshow.biz.dal.enums;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.yonge.toolset.base.enums.BaseEnum;
+
+/**
+ * 认证审核类型 ADD 新增 MODIFY 修改
+ *
+ * @Author: liweifan
+ * @Data: 2022/3/16 10:19
+ */
+public enum AuthTypeEnum implements BaseEnum<String, AuthTypeEnum> {
+    ADD("新增"),
+    MODIFY("修改"),
+
+    ;
+    @EnumValue
+    private String code;
+    private String name;
+
+    AuthTypeEnum(String name) {
+        this.code = this.name();
+        this.name = name;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+
+    public String getName() {
+        return name;
+    }
+}

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

@@ -13,6 +13,7 @@ import com.yonge.cooleshow.biz.dal.dto.search.AuthEntryRecordSearch;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.entity.TeacherStyleVideo;
 import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
+import com.yonge.cooleshow.biz.dal.enums.AuthTypeEnum;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
 import com.yonge.cooleshow.biz.dal.service.SysMessageService;
@@ -37,6 +38,7 @@ import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
 import com.yonge.cooleshow.biz.dal.dao.TeacherAuthEntryRecordDao;
 import com.yonge.cooleshow.biz.dal.service.TeacherAuthEntryRecordService;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
 import java.util.*;
@@ -195,11 +197,18 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
         if (YesOrNoEnum.YES.equals(teacher.getEntryFlag())) {
             return HttpResponseResult.failed("已经通过审批");
         }
+
         //新增申请记录
         TeacherAuthEntryRecord teacherAuthEntryRecord = new TeacherAuthEntryRecord();
         BeanUtils.copyProperties(teacherApplyDetailDto, teacherAuthEntryRecord);
         teacherAuthEntryRecord.setTeacherAuthStatus(AuthStatusEnum.DOING);
+        teacherAuthEntryRecord.setTeacherAuthType(AuthTypeEnum.MODIFY);
 
+        List<TeacherAuthEntryRecord> olds = baseMapper.selectList(Wrappers.<TeacherAuthEntryRecord>query().lambda()
+                .eq(TeacherAuthEntryRecord::getUserId, sysUser.getId()));
+        if(CollectionUtils.isEmpty(olds)){
+            teacherAuthEntryRecord.setTeacherAuthType(AuthTypeEnum.ADD);
+        }
         return HttpResponseResult.status(baseMapper.insert(teacherAuthEntryRecord) > 0);
     }
 
@@ -223,7 +232,7 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
     private Boolean hasApply(Long userId) {
         TeacherAuthEntryRecord teacherAuthEntryRecord = baseMapper.selectOne(Wrappers.<TeacherAuthEntryRecord>query().lambda()
                 .eq(TeacherAuthEntryRecord::getUserId, userId)
-                .eq(TeacherAuthEntryRecord::getTeacherAuthStatus, 1));
+                .eq(TeacherAuthEntryRecord::getTeacherAuthStatus, AuthStatusEnum.DOING));
         return teacherAuthEntryRecord != null;
     }
 

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/EmployeeVo.java

@@ -25,7 +25,7 @@ public class EmployeeVo extends Employee {
     private String phone;
     @ApiModelProperty(value = "头像")
     private String avatar;
-    @ApiModelProperty(value = "0-正常,9-锁定")
+    @ApiModelProperty(value = "0-正常, 1-锁定")
     private UserLockFlag lockFlag;
     @ApiModelProperty(value = "角色id列表")
     private List<Long> roleIds;

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

@@ -45,7 +45,7 @@ public class TeacherVo extends Teacher {
     private Date birthdate;
     @ApiModelProperty(value = "审核人")
     private String verifyUser;
-    @ApiModelProperty(value = "0-正常,9-锁定")
+    @ApiModelProperty(value = "0-正常, 1-锁定")
     private UserLockFlag lockFlag;
     @ApiModelProperty(value = "声部名称(支持多个,用逗号分隔) ")
     private String subjectName;

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

@@ -19,6 +19,7 @@
         <result column="introduction_" property="introduction"/>
         <result column="demission_date_" property="demissionDate"/>
         <result column="contact_address_" property="contactAddress"/>
+        <result column="lock_flag_" property="lockFlag" />
     </resultMap>
 
     <resultMap type="com.yonge.cooleshow.auth.api.entity.SysUser" id="SysUser">
@@ -58,11 +59,13 @@
         , t.introduction_ as "introduction"
         , t.demission_date_ as "demissionDate"
         , t.contact_address_ as "contactAddress"
-        </sql>
+        , t.lock_flag_ as "lockFlag"
+    </sql>
 
     <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.EmployeeVo">
         SELECT
             <include refid="baseColumns" />,
+            if(u.lock_flag_ = 0 and t.lock_flag_ = 0,0,1) as lockFlag,
             username_ as username,
             phone_ as phone,
             gender_ as gender
@@ -74,10 +77,10 @@
     <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.EmployeeVo">
         SELECT
             <include refid="baseColumns" />,
+            if(u.lock_flag_ = 0 and t.lock_flag_ = 0,0,1) as lockFlag,
             u.username_ as username,
             u.phone_ as phone,
-            u.gender_ as gender,
-            u.lock_flag_ as lockFlag
+            u.gender_ as gender
         FROM employee t
         left join sys_user u on t.user_id_ = u.id_
         <where>
@@ -93,7 +96,7 @@
                 and u.gender_ = #{param.gender}
             </if>
             <if test="null != param.lockFlag">
-                and u.lock_flag_ = #{param.lockFlag}
+                and (u.lock_flag_ = #{param.lockFlag} or t.lock_flag_ = #{param.lockFlag})
             </if>
             <if test="param.startTime !=null">
                 <![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
@@ -222,6 +225,9 @@
             <if test="contactAddress != null">
                 contact_address_ = #{contactAddress},
             </if>
+            <if test="lockFlag != null">
+                lock_flag_ = #{lockFlag},
+            </if>
         </set>
         WHERE user_id_ = #{userId}
     </update>

+ 7 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -9,6 +9,7 @@
         <result column="membership_end_time_" property="membershipEndTime"/>
         <result column="cloud_study_sequence_days_" property="cloudStudySequenceDays"/>
         <result column="cloud_study_use_last_day_" property="cloudStudyUseLastDay"/>
+        <result column="lock_flag_" property="lockFlag" />
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
     </resultMap>
@@ -33,6 +34,7 @@
     <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.StudentVo">
         SELECT
             <include refid="baseColumns"/>,
+            if(u.lock_flag_ = 0 and t.lock_flag_ = 0,0,1) as lockFlag,
             u.avatar_ as avatar,
             u.real_name_ as realName,
             u.id_card_no_ as idCardNo,
@@ -54,6 +56,7 @@
     <select id="detailByPhone" resultType="com.yonge.cooleshow.biz.dal.vo.StudentVo">
         SELECT
             <include refid="baseColumns"/>,
+            if(u.lock_flag_ = 0 and t.lock_flag_ = 0,0,1) as lockFlag,
             u.avatar_ as avatar,
             u.real_name_ as realName,
             u.id_card_no_ as idCardNo,
@@ -76,6 +79,7 @@
     <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.StudentVo">
         SELECT
             <include refid="baseColumns"/>,
+            if(u.lock_flag_ = 0 and t.lock_flag_ = 0,0,1) as lockFlag,
             u.username_ as username,
             u.gender_ as gender,
             u.birthdate_ as birthdate,
@@ -119,6 +123,9 @@
             <if test="param.endTime !=null">
                 <![CDATA[AND t.create_time_ < #{param.endTime} ]]>
             </if>
+            <if test="null != param.lockFlag">
+                and (u.lock_flag_ = #{param.lockFlag} or t.lock_flag_ = #{param.lockFlag})
+            </if>
         </where>
     </select>
 

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

@@ -13,6 +13,7 @@
         <result column="teacher_certificate_" property="teacherCertificate"/>
         <result column="style_video_json_" property="styleVideoJson"/>
         <result column="teacher_auth_status_" property="teacherAuthStatus"/>
+        <result column="teacher_auth_type_" property="teacherAuthType"/>
         <result column="verify_user_id_" property="verifyUserId"/>
         <result column="reason_" property="reason"/>
         <result column="create_time_" property="createTime"/>
@@ -32,6 +33,7 @@
         , t.teacher_certificate_ as "teacherCertificate"
         , t.style_video_json_ as "styleVideoJson"
         , t.teacher_auth_status_ as "teacherAuthStatus"
+        , t.teacher_auth_type_ as "teacherAuthType"
         , t.verify_user_id_ as "verifyUserId"
         , t.reason_ as "reason"
         , t.create_time_ as "createTime"

+ 7 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -27,6 +27,7 @@
         <result column="style_date_" property="styleDate" />
         <result column="browse_" property="browse" />
         <result column="memo_" property="memo" />
+        <result column="lock_flag_" property="lockFlag" />
         <result column="create_time_" property="createTime" />
         <result column="update_time_" property="updateTime" />
     </resultMap>
@@ -66,12 +67,12 @@
     <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherVo" >
         SELECT
             <include refid="baseColumns"/>,
+            if(u.lock_flag_ = 0 and t.lock_flag_ = 0,0,1) as lockFlag,
             u.username_ as username,
             u.phone_ as phone,
             u.real_name_ as realName,
             (case when t.membership_end_time_ &gt;= now() then 1 else 0 end) isVip,
 <!--            t.tag_ tag,-->
-            u.lock_flag_ as lockFlag,
             u.del_flag_ as delFlag,
             (case when isnull(u.id_card_no_) then 0 else 1 end) as isReal,
             (case when isnull(b.user_id_) then 0 else 1 end) as isBank
@@ -114,6 +115,9 @@
             <if test="param.tag != null">
             	and find_in_set(#{param.tag},t.tag_)
             </if>
+            <if test="null != param.lockFlag">
+                and (u.lock_flag_ = #{param.lockFlag} or t.lock_flag_ = #{param.lockFlag})
+            </if>
         </where>
     </select>
 
@@ -139,16 +143,16 @@
     <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherVo">
         SELECT
             <include refid="baseColumns"/>,
+            if(u.lock_flag_ = 0 and t.lock_flag_ = 0,0,1) as lockFlag,
             u.avatar_ as avatar,
             u.username_ as username,
             u.gender_ as `gender`,
             u.birthdate_ as birthdate,
             u.phone_ as phone,
             (case when isnull(u.id_card_no_) then 0 else 1 end) as isReal,
-        (!isnull(membership_end_time_) and membership_end_time_ > now()) as isVip,
+            (!isnull(membership_end_time_) and membership_end_time_ > now()) as isVip,
             u.real_name_ as realName,
             u.id_card_no_ as idCardNo,
-            u.lock_flag_ as lockFlag,
             (case when isnull(b.user_id_) then 0 else 1 end) as isBank,
             (
                 SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)

+ 27 - 0
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/open/OpenClient.java

@@ -1,15 +1,18 @@
 package com.yonge.cooleshow.student.controller.open;
 
+import com.ksyun.ks3.dto.PostObjectFormFields;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.service.ActivityPlanService;
 import com.yonge.cooleshow.biz.dal.service.StudentService;
 import com.yonge.cooleshow.biz.dal.service.TeacherService;
+import com.yonge.cooleshow.biz.dal.service.UploadFileService;
 import com.yonge.cooleshow.biz.dal.vo.MusicActivityVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.toolset.base.util.StringUtil;
+import com.yonge.toolset.thirdparty.entity.UploadSign;
 import com.yonge.toolset.utils.string.ValueUtil;
 import io.swagger.annotations.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,6 +31,8 @@ public class OpenClient extends BaseController {
     private SysUserFeignService sysUserFeignService;
 
     @Autowired
+    private UploadFileService uploadFileService;
+    @Autowired
     private StudentService studentService;
 
     @ApiOperation(value = "查询老师头像昵称信息")
@@ -74,4 +79,26 @@ public class OpenClient extends BaseController {
 
         return succeed(activityVo);
     }
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "bucketName", dataType = "String", value = "为空时默认使用daya"),
+            @ApiImplicitParam(name = "fileName", dataType = "String", value = "要上传的文件名称,不包含路径信息"),
+            @ApiImplicitParam(name = "postData", dataType = "Map", value = "1.如果使用js sdk上传的时候设置了ACL请设置,例\"acl\":\"public-read\"值要与SDK中一致,没有则删除该项</br>" +
+                    "2.提供js sdk中的key值,例\"key\":\"20150115/中文/${filename}\""),
+            @ApiImplicitParam(name = "unknowValueField", dataType = "List", value = "对于用户无法确定表单值的放在unknownValueField中(比如有的上传控件会添加一些表单项,但表单项的值可能是随机的)"),
+    })
+    @ApiOperation(value = "获取上传文件签名", notes = "{\n" +
+            "    \"bucketName\":\"\",\n" +
+            "    \"filename\":\"test.png\",\n" +
+            "    \"postData\":{\n" +
+            "        \"acl\":\"public-read\",\n" +
+            "        \"key\":\"20150115/中文/${filename}\"\n" +
+            "    },\n" +
+            "    \"unknowValueField\":[\"test\"]\n" +
+            "}")
+    @PostMapping("/getUploadSign")
+    public HttpResponseResult<PostObjectFormFields> getUploadSign(@RequestBody UploadSign uploadSign) {
+        return succeed(uploadFileService.getUploadSign(uploadSign));
+    }
 }

+ 48 - 0
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/controller/open/OpenClient.java

@@ -0,0 +1,48 @@
+package com.yonge.cooleshow.website.controller.open;
+
+import com.ksyun.ks3.dto.PostObjectFormFields;
+import com.yonge.cooleshow.biz.dal.service.UploadFileService;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.thirdparty.entity.UploadSign;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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.RestController;
+
+
+@RestController
+@RequestMapping("/open")
+@Api(value = "开放权限接口", tags = "开放权限接口")
+public class OpenClient extends BaseController {
+
+    @Autowired
+    private UploadFileService uploadFileService;
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "bucketName", dataType = "String", value = "为空时默认使用daya"),
+            @ApiImplicitParam(name = "fileName", dataType = "String", value = "要上传的文件名称,不包含路径信息"),
+            @ApiImplicitParam(name = "postData", dataType = "Map", value = "1.如果使用js sdk上传的时候设置了ACL请设置,例\"acl\":\"public-read\"值要与SDK中一致,没有则删除该项</br>" +
+                    "2.提供js sdk中的key值,例\"key\":\"20150115/中文/${filename}\""),
+            @ApiImplicitParam(name = "unknowValueField", dataType = "List", value = "对于用户无法确定表单值的放在unknownValueField中(比如有的上传控件会添加一些表单项,但表单项的值可能是随机的)"),
+    })
+    @ApiOperation(value = "获取上传文件签名", notes = "{\n" +
+            "    \"bucketName\":\"\",\n" +
+            "    \"filename\":\"test.png\",\n" +
+            "    \"postData\":{\n" +
+            "        \"acl\":\"public-read\",\n" +
+            "        \"key\":\"20150115/中文/${filename}\"\n" +
+            "    },\n" +
+            "    \"unknowValueField\":[\"test\"]\n" +
+            "}")
+    @PostMapping("/getUploadSign")
+    public HttpResponseResult<PostObjectFormFields> getUploadSign(@RequestBody UploadSign uploadSign) {
+        return succeed(uploadFileService.getUploadSign(uploadSign));
+    }
+}