mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-08 02:16:49 +08:00
Compare commits
18 Commits
zcwy-addXx
...
yx1101-tea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6532cf75e3 | ||
|
|
ad357a61b7 | ||
|
|
ffe232eeb9 | ||
|
|
f273e9df4a | ||
|
|
aab82de81b | ||
|
|
af6efd3151 | ||
|
|
c724080a3c | ||
|
|
aa63a6618f | ||
|
|
d3fcbaeab6 | ||
|
|
82bf84bbaa | ||
|
|
3f59552c2e | ||
|
|
e0d731e296 | ||
|
|
f5c26d02d1 | ||
|
|
0e74f11615 | ||
|
|
3559553484 | ||
|
|
9faa8307ee | ||
|
|
1a6c8f8af9 | ||
|
|
f1b96c8af9 |
@@ -232,13 +232,6 @@
|
||||
<artifactId>spring-retry</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.xuxueli</groupId>
|
||||
<artifactId>xxl-job-core</artifactId>
|
||||
<version>2.3.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<resources>
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.xboe;
|
||||
|
||||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class XxlJobConfig {
|
||||
|
||||
@Value("${xxl.job.admin.addresses}")
|
||||
private String adminAddresses;
|
||||
@Value("${xxl.job.executor.appname}")
|
||||
private String appName;
|
||||
@Value("${xxl.job.executor.ip}")
|
||||
private String ip;
|
||||
@Value("${xxl.job.executor.port}")
|
||||
private int port;
|
||||
@Value("${xxl.job.accessToken}")
|
||||
private String accessToken;
|
||||
@Value("${xxl.job.executor.logpath}")
|
||||
private String logPath;
|
||||
@Value("${xxl.job.executor.logretentiondays}")
|
||||
private int logRetentionDays;
|
||||
|
||||
@Bean
|
||||
public XxlJobSpringExecutor xxlJobExecutor() {
|
||||
// 创建 XxlJobSpringExecutor 执行器
|
||||
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
||||
xxlJobSpringExecutor.setAppname(appName);
|
||||
xxlJobSpringExecutor.setIp(ip);
|
||||
xxlJobSpringExecutor.setPort(port);
|
||||
xxlJobSpringExecutor.setAccessToken(accessToken);
|
||||
xxlJobSpringExecutor.setLogPath(logPath);
|
||||
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
||||
// 返回
|
||||
return xxlJobSpringExecutor;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import cn.hutool.core.lang.Opt;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.xboe.api.vo.*;
|
||||
import com.xboe.module.course.dto.CourseParam;
|
||||
import com.xboe.module.course.dto.ScoreParam;
|
||||
import com.xboe.module.course.vo.StudyCourseVo;
|
||||
import com.xboe.module.course.vo.TeacherInfoVo;
|
||||
import com.xboe.module.course.vo.TeacherVo;
|
||||
@@ -72,6 +74,16 @@ public class ThirdApi {
|
||||
@Value("${userBasic.getUserBasicInfo}")
|
||||
private String getUserBasicInfo;
|
||||
|
||||
@Value("${coursesuilt.updateOrSaveCourse}")
|
||||
private String updateOrSaveCourse;
|
||||
@Value("${coursesuilt.syncCourseStudent}")
|
||||
private String syncCourseStudent;
|
||||
@Value("${coursesuilt.syncOnLineScore}")
|
||||
private String syncOnLineScore;
|
||||
@Value("${coursesuilt.updateOnLineStatus}")
|
||||
private String updateOnLineStatus;
|
||||
|
||||
|
||||
//获取例外人员的id
|
||||
public List<String> getUserId(){
|
||||
String responseBody = Optional.ofNullable(HttpRequest.get(infarasApiUrl+"?pid=316&type=1").execute() //prod 316
|
||||
@@ -302,4 +314,31 @@ public class ThirdApi {
|
||||
return basicInfos;
|
||||
|
||||
}
|
||||
|
||||
public void updateOrSaveCourse(CourseParam param, String token){
|
||||
log.info("---------------准备同步在线课到讲师管理完毕 ------- param " + param);
|
||||
String resp = Optional.ofNullable(
|
||||
HttpRequest.post(updateOrSaveCourse).body(JSONUtil.toJsonStr(param)).header("token", token).execute()
|
||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||
log.info("updateOrSaveCourse = " + resp);
|
||||
}
|
||||
public void syncCourseStudent(Long courseId, String token){
|
||||
String resp = Optional.ofNullable(
|
||||
HttpRequest.post(syncCourseStudent).body(JSONUtil.toJsonStr(courseId)).header("token", token).execute()
|
||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||
log.info("syncCourseStudent = " + resp);
|
||||
}
|
||||
|
||||
public void syncOnLineScore(ScoreParam param, String token) {
|
||||
String resp = Optional.ofNullable(
|
||||
HttpRequest.post(syncOnLineScore).body(JSONUtil.toJsonStr(param)).header("token", token).execute()
|
||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||
log.info("syncOnLineScore = " + resp);
|
||||
}
|
||||
public void updateOnLineStatus(CourseParam param, String token){
|
||||
String resp = Optional.ofNullable(
|
||||
HttpRequest.post(updateOnLineStatus).body(JSONUtil.toJsonStr(param)).header("token", token).execute()
|
||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||
log.info("updateOrSaveCourse = " + resp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.xboe.module.boecase.api;
|
||||
|
||||
import com.xboe.module.boecase.service.ICasesService;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -17,7 +16,6 @@ public class CaseScheduledTasks {
|
||||
* 每月的第一天的1:00执行
|
||||
*/
|
||||
// @Scheduled(cron = "0 0 1 1 * ?")
|
||||
@XxlJob("refreshViewsRankOfMajor")
|
||||
public void refreshViewsRankOfMajor() {
|
||||
casesService.refreshViewsRankOfMajor();
|
||||
}
|
||||
@@ -25,8 +23,7 @@ public class CaseScheduledTasks {
|
||||
/**
|
||||
* 季初第一天两点执行,cron表达式设置为每个季度的第一个月的第一天的特定时间。每个季度的第一个月是1月、4月、7月和10月:
|
||||
*/
|
||||
// @Scheduled(cron = "0 0 2 1 1,4,7,10 ?")
|
||||
@XxlJob("refreshLastQuarterStatistics")
|
||||
@Scheduled(cron = "0 0 2 1 1,4,7,10 ?")
|
||||
public void refreshLastQuarterStatistics() {
|
||||
casesService.refreshLastQuarterStatistics();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,10 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.module.course.dto.CourseParam;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -55,7 +58,10 @@ public class CourseAuditApi extends ApiBaseController{
|
||||
|
||||
@Resource
|
||||
private ICourseContentService ccontentService;
|
||||
|
||||
@Resource
|
||||
private ThirdApi thirdApi;
|
||||
|
||||
|
||||
/**
|
||||
* 教师需要审核的课程
|
||||
* @param pager
|
||||
@@ -315,7 +321,7 @@ public class CourseAuditApi extends ApiBaseController{
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/hrbp-submit-audit")
|
||||
public JsonResponse<Boolean> hrbpAudit(String auditId,String courseId,String title,Boolean pass,String remark){
|
||||
public JsonResponse<Boolean> hrbpAudit(String auditId,String courseId,String title,Boolean pass,String remark, HttpServletRequest request){
|
||||
if(StringUtils.isBlank(auditId)){
|
||||
return badRequest("参数错误");
|
||||
}
|
||||
@@ -347,6 +353,14 @@ public class CourseAuditApi extends ApiBaseController{
|
||||
try {
|
||||
CurrentUser cu=getCurrent();
|
||||
service.hrbpSubmitAudit(auditId, courseId,open, pass,cu.getAccountId(),cu.getName(), remark);
|
||||
|
||||
if (pass){
|
||||
//修改在线课开课状态=已开课
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
CourseParam param = new CourseParam();
|
||||
param.setId(courseId);
|
||||
thirdApi.updateOnLineStatus(param,token);
|
||||
}
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("HRBP审核提交处理错误",e);
|
||||
@@ -378,7 +392,8 @@ public class CourseAuditApi extends ApiBaseController{
|
||||
*/
|
||||
@PostMapping("/submit-publish")
|
||||
@AutoLog(module = "课程",action = "默认管理员提交发布",info = "")
|
||||
public JsonResponse<Boolean> submitAndPublish(@RequestBody CourseFullDto dto){
|
||||
public JsonResponse<Boolean> submitAndPublish(@RequestBody CourseFullDto dto, HttpServletRequest request){
|
||||
log.info("---------------提交并直接发布,用于默认管理直接操作 -------");
|
||||
if(dto.getCourse()==null){
|
||||
return badRequest("无课程信息");
|
||||
}
|
||||
@@ -402,12 +417,22 @@ public class CourseAuditApi extends ApiBaseController{
|
||||
if(StringUtils.isBlank(dto.getCourse().getOrgId())) {
|
||||
return badRequest("请选择资源归属");
|
||||
}
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
|
||||
CurrentUser cuser=getCurrent();
|
||||
dto.getCourse().setStatus(Course.STATUS_AUDIT_FINISH);//设置为审核通过状态
|
||||
dto.getCourse().setEnabled(true);//设置启用状态问题
|
||||
dto.getCourse().setPublished(false);//重新提交审核设置为未发布状态
|
||||
try {
|
||||
|
||||
courseService.submitAndPublish(dto,cuser.getAccountId(),cuser.getName());
|
||||
log.info("---------------在线课开始同步到讲师管理 ------- token = " + token);
|
||||
CourseParam param = new CourseParam();
|
||||
param.setId(dto.getCourse().getId());
|
||||
param.setOrgId(dto.getCourse().getOrgId());
|
||||
param.setOrgName(dto.getCourse().getOrgName());
|
||||
thirdApi.updateOrSaveCourse(param,token);
|
||||
log.info("---------------在线课同步到讲师管理完毕 -------");
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("默认管理员提交直接发布处理失败",e);
|
||||
|
||||
@@ -7,6 +7,8 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.module.course.dto.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -26,11 +28,6 @@ import com.xboe.data.dto.UserOrgIds;
|
||||
import com.xboe.data.outside.IOutSideDataService;
|
||||
import com.xboe.data.service.IDataUserSyncService;
|
||||
import com.xboe.module.assistance.service.IEmailService;
|
||||
import com.xboe.module.course.dto.CourseExportDto;
|
||||
import com.xboe.module.course.dto.CourseFullDto;
|
||||
import com.xboe.module.course.dto.CourseQueryDto;
|
||||
import com.xboe.module.course.dto.CourseTeacherAndCourse;
|
||||
import com.xboe.module.course.dto.CourseTeacherExportDto;
|
||||
import com.xboe.module.course.entity.Course;
|
||||
import com.xboe.module.course.entity.CourseContent;
|
||||
import com.xboe.module.course.entity.CourseCrowd;
|
||||
@@ -100,7 +97,8 @@ public class CourseManageApi extends ApiBaseController{
|
||||
|
||||
@Autowired
|
||||
IDataUserSyncService userSyncService;
|
||||
|
||||
@Resource
|
||||
private ThirdApi thirdApi;
|
||||
|
||||
// @PostMapping("/test")
|
||||
// public JsonResponse<PageList<Course>> findTest(Pagination pager,CourseQueryDto dto){
|
||||
@@ -271,7 +269,7 @@ public class CourseManageApi extends ApiBaseController{
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@AutoLog(module = "课程",action = "保存课程基本信息",info = "")
|
||||
public JsonResponse<CourseFullDto> saveCourseFull(@RequestBody CourseFullDto dto){
|
||||
public JsonResponse<CourseFullDto> saveCourseFull(@RequestBody CourseFullDto dto, HttpServletRequest request){
|
||||
if(dto.getCourse()==null){
|
||||
return badRequest("无课程信息");
|
||||
}
|
||||
@@ -302,7 +300,14 @@ public class CourseManageApi extends ApiBaseController{
|
||||
dto.getCourse().setStatus(Course.STATUS_NONE);
|
||||
courseService.update(dto);
|
||||
}
|
||||
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
log.info("---------------在线课开始同步到讲师管理 ------- token = " + token);
|
||||
CourseParam param = new CourseParam();
|
||||
param.setId(dto.getCourse().getId());
|
||||
param.setOrgId(dto.getCourse().getOrgId());
|
||||
param.setOrgName(dto.getCourse().getOrgName());
|
||||
thirdApi.updateOrSaveCourse(param,token);
|
||||
log.info("---------------在线课同步到讲师管理完毕 -------");
|
||||
return success(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("整体保存课程信息错误",e);
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.module.course.dto.CourseQueryDto;
|
||||
import com.xboe.module.course.dto.CourseTeacherDto;
|
||||
import com.xboe.module.course.dto.RankingDto;
|
||||
import com.xboe.module.course.dto.TeacherCourseDto;
|
||||
import com.xboe.module.course.entity.*;
|
||||
import com.xboe.module.course.service.ICourseContentService;
|
||||
import com.xboe.module.course.service.ICourseSectionService;
|
||||
@@ -29,8 +28,6 @@ import com.xboe.school.study.entity.StudyHomeWork;
|
||||
import com.xboe.school.study.service.IStudyCourseService;
|
||||
import com.xboe.school.study.service.IStudyHomeWorkService;
|
||||
import com.xboe.school.study.service.IStudyService;
|
||||
import com.xboe.system.user.entity.User;
|
||||
import com.xboe.system.user.service.IUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -63,8 +60,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
|
||||
@Resource
|
||||
private ICourseService courseService;
|
||||
@Resource
|
||||
private IUserService userService;
|
||||
|
||||
@Resource
|
||||
private ITeacherService teacherService;
|
||||
|
||||
@@ -282,7 +278,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
if (!Objects.isNull(studyCourse)){
|
||||
pass = true;
|
||||
}
|
||||
if (Objects.isNull(studyCourse) && !courseCrowdList.isEmpty() && !StringUtils.isEmpty(audiences)) {
|
||||
if (Objects.isNull(studyCourse) && !courseCrowdList.isEmpty()) {
|
||||
List<String> audienceList = Arrays.asList(audiences.split(",")); // 此用户所在受众组
|
||||
log.error("---------------参数------------ audienceList = " + audienceList);
|
||||
for (CourseCrowd c : courseCrowdList) {
|
||||
@@ -305,30 +301,17 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
List<CourseContent> cclist=contentService.getByCourseId(id);
|
||||
List<CourseSection> sectionlist=sectionService.getByCourseId(id);
|
||||
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
|
||||
List<TeacherCourseDto> teacherCourseDtos = new ArrayList<>();
|
||||
|
||||
|
||||
//获取教师的介绍信息,因为一门课程 的教师不会太多,所以这里简单直接遍历查询,后续再优化
|
||||
for(CourseTeacher ct : teachers) {
|
||||
TeacherCourseDto teacherCourseDto = new TeacherCourseDto();
|
||||
Teacher t = teacherService.get(ct.getTeacherId());
|
||||
User user = userService.get(ct.getTeacherId());
|
||||
if(t!=null) {
|
||||
ct.setRemark(t.getDescription());
|
||||
if(redisTemplate.opsForValue().get(ct.getTeacherId())!=null){
|
||||
if(Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
|
||||
ct.setTeacherName("BOE教师");
|
||||
}
|
||||
teacherCourseDto.setCourseId(ct.getCourseId());
|
||||
teacherCourseDto.setTeacherName(ct.getTeacherName());
|
||||
teacherCourseDto.setTeacherId(ct.getTeacherId());
|
||||
teacherCourseDto.setCode(ct.getCode());
|
||||
teacherCourseDto.setRemark(ct.getRemark());
|
||||
teacherCourseDto.setSysCreateAid(ct.getSysCreateAid());
|
||||
teacherCourseDto.setSysCreateBy(ct.getSysCreateBy());
|
||||
teacherCourseDto.setSysCreateTime(ct.getSysCreateTime());
|
||||
teacherCourseDto.setId(ct.getId());
|
||||
teacherCourseDto.setUserNo(user.getUserNo());
|
||||
teacherCourseDtos.add(teacherCourseDto);
|
||||
}else if (redisTemplate.opsForValue().get(ct.getTeacherId())==null){
|
||||
List<String> list=new ArrayList<>();
|
||||
list.add(ct.getTeacherId());
|
||||
@@ -336,17 +319,6 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
if(Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
|
||||
ct.setTeacherName("BOE教师");
|
||||
}
|
||||
teacherCourseDto.setCourseId(ct.getCourseId());
|
||||
teacherCourseDto.setTeacherName(ct.getTeacherName());
|
||||
teacherCourseDto.setTeacherId(ct.getTeacherId());
|
||||
teacherCourseDto.setCode(ct.getCode());
|
||||
teacherCourseDto.setRemark(ct.getRemark());
|
||||
teacherCourseDto.setSysCreateAid(ct.getSysCreateAid());
|
||||
teacherCourseDto.setSysCreateBy(ct.getSysCreateBy());
|
||||
teacherCourseDto.setSysCreateTime(ct.getSysCreateTime());
|
||||
teacherCourseDto.setId(ct.getId());
|
||||
teacherCourseDto.setUserNo(user.getUserNo());
|
||||
teacherCourseDtos.add(teacherCourseDto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,7 +327,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
rs.put("isCrowd",pass);
|
||||
rs.put("contents", cclist);
|
||||
rs.put("sections",sectionlist);
|
||||
rs.put("teachers",teacherCourseDtos);
|
||||
rs.put("teachers",teachers);
|
||||
//查询课程
|
||||
return success(rs);
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xboe.module.course.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CourseParam {
|
||||
private String id;
|
||||
private String orgId;
|
||||
private String orgName;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xboe.module.course.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ScoreParam {
|
||||
private Long courseId;
|
||||
private Float score;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.xboe.module.course.dto;
|
||||
|
||||
import com.xboe.module.course.entity.CourseTeacher;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TeacherCourseDto extends CourseTeacher {
|
||||
private String userNo;
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.xboe.module.interaction.api;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.module.course.dto.ScoreParam;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -25,18 +28,27 @@ public class CourseGradeApi extends ApiBaseController {
|
||||
|
||||
@Resource
|
||||
private ICourseGradeService service;
|
||||
@Resource
|
||||
private ThirdApi thirdApi;
|
||||
|
||||
/**
|
||||
* 评分
|
||||
* */
|
||||
@PostMapping("/grade")
|
||||
@AutoLog(module = "评分",action = "评分")
|
||||
public JsonResponse<Float> grade(String courseId,Float score,String studyId){
|
||||
public JsonResponse<Float> grade(String courseId,Float score,String studyId, HttpServletRequest request){
|
||||
CourseGrade courseGrade = new CourseGrade();
|
||||
courseGrade.setCourseId(courseId);
|
||||
courseGrade.setScores(score);
|
||||
courseGrade.setStudyId(studyId);
|
||||
try {
|
||||
Float aFloat = service.save(courseGrade);
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
ScoreParam param = new ScoreParam();
|
||||
param.setCourseId(Long.parseLong(courseId));
|
||||
param.setScore(score);
|
||||
// 同步在线课评分
|
||||
// thirdApi.syncOnLineScore(param,token);
|
||||
return success(aFloat);
|
||||
}catch(Exception e) {
|
||||
log.error("评分保存错误",e);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.xboe.module.teacher.entity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@@ -153,7 +155,7 @@ public class Teacher extends BaseEntity {
|
||||
*/
|
||||
@Column(name = "courses")
|
||||
private String courses;
|
||||
|
||||
|
||||
/**
|
||||
* 发薪地id
|
||||
*/
|
||||
@@ -206,4 +208,56 @@ public class Teacher extends BaseEntity {
|
||||
@Column(name = "expertise")
|
||||
private String expertise;
|
||||
|
||||
@Column(name = "user_no",length = 1)
|
||||
private String userNo;
|
||||
|
||||
// @ApiModelProperty(value = "讲师类型 1 内部讲师 2外部讲师")
|
||||
@Column(name = "teacher_type")
|
||||
private Integer teacherType;
|
||||
|
||||
// @ApiModelProperty(value = "默认授课时长(分钟)")
|
||||
@Column(name = "default_teaching_time")
|
||||
private Integer defaultTeachingTime;
|
||||
|
||||
// @ApiModelProperty(value = "认证人")
|
||||
@Column(name = "certify_by")
|
||||
private String certifyBy;
|
||||
|
||||
// @ApiModelProperty(value = "认证时间")
|
||||
@Column(name = "certify_at")
|
||||
private LocalDateTime certifyAt;
|
||||
|
||||
// @ApiModelProperty(value = "认证资料路径")
|
||||
@Column(name = "certification")
|
||||
private String certification;
|
||||
|
||||
// @ApiModelProperty(value = "认证资料路径名称")
|
||||
@Column(name = "certification_name")
|
||||
private String certificationName;
|
||||
|
||||
// @ApiModelProperty(value = "供应商")
|
||||
@Column(name = "supplier")
|
||||
private String supplier;
|
||||
|
||||
|
||||
// @ApiModelProperty(value = "教师专长名称 逗号分割")
|
||||
@Column(name = "expertise_names")
|
||||
private String expertiseNames;
|
||||
|
||||
// @ApiModelProperty(value = "标识 0:自动录入/1:手动录入")
|
||||
@Column(name = "create_from")
|
||||
private Integer createFrom;
|
||||
|
||||
// @ApiModelProperty(value = "组织id")
|
||||
@Column(name = "org_id")
|
||||
private Long orgId;
|
||||
|
||||
// @ApiModelProperty(value = "组织名称")
|
||||
@Column(name = "org_name")
|
||||
private String orgName;
|
||||
|
||||
// @ApiModelProperty(value = "旧系统kid字段")
|
||||
@Column(name = "kid")
|
||||
private String kid;
|
||||
|
||||
}
|
||||
|
||||
@@ -102,9 +102,12 @@ public class TeacherServiceImpl implements ITeacherService {
|
||||
public List<Teacher> findByName(String name) {
|
||||
String hql="Select t.id,t.name,u.userNo from "+Teacher.class.getSimpleName()+" t,"+User.class.getSimpleName()+" u ";
|
||||
hql+=" where t.id=u.id and (t.name like '%"+name+"%' or u.userNo=?1)";
|
||||
// String hql="Select t.id,t.name,t.userNo from "+Teacher.class.getSimpleName()+" t";
|
||||
// hql+=" where t.deleted =0 and t.status =1 and (t.name like '%"+name+"%' or t.userNo like '%"+name+"%' )";
|
||||
|
||||
List<Teacher> teachers=new ArrayList<Teacher>();
|
||||
try {
|
||||
List<Object[]> list =dao.findListFields(hql,name);
|
||||
List<Object[]> list =dao.findListFields(hql);
|
||||
for(Object[] objs :list) {
|
||||
Teacher t=new Teacher();
|
||||
t.setId((String)objs[0]);
|
||||
|
||||
@@ -177,7 +177,7 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
if (!Objects.isNull(studyCourse)){
|
||||
pass = true;
|
||||
}
|
||||
if (Objects.isNull(studyCourse) && !courseCrowdList.isEmpty() && !StringUtils.isEmpty(audiences)) {
|
||||
if (Objects.isNull(studyCourse) && !courseCrowdList.isEmpty()) {
|
||||
List<String> audienceList = Arrays.asList(audiences.split(",")); // 此用户所在受众组
|
||||
log.error("---------------参数------------ audienceList = " + audienceList);
|
||||
for (CourseCrowd c : courseCrowdList) {
|
||||
@@ -228,7 +228,7 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
|
||||
//检查是否已报名
|
||||
StudyCourse sc=service.findByCourseIdAndAid(cid, aid);
|
||||
if(pass==true && sc==null) {
|
||||
if(sc==null) {
|
||||
//未报名,这里直接报名
|
||||
StudySignup signup=new StudySignup();
|
||||
signup.setCourseId(cid);
|
||||
@@ -246,13 +246,13 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
signup.setSignTime(LocalDateTime.now());
|
||||
sc=service.autoSignup(signup);
|
||||
}
|
||||
if (sc !=null){
|
||||
rs.put("studyId", sc.getId());//学习id
|
||||
rs.put("progress", sc.getProgress());
|
||||
//查询上次学习的是什么资源。查询用户的学习情况
|
||||
List<StudyCourseItem> items=studyService.findByStudyId(sc.getId());
|
||||
rs.put("contentStudys",items);//学习的内容
|
||||
}
|
||||
|
||||
rs.put("signup",true);
|
||||
rs.put("studyId", sc.getId());//学习id
|
||||
rs.put("progress", sc.getProgress());
|
||||
//查询上次学习的是什么资源。查询用户的学习情况
|
||||
List<StudyCourseItem> items=studyService.findByStudyId(sc.getId());
|
||||
rs.put("contentStudys",items);//学习的内容
|
||||
|
||||
return success(rs);
|
||||
}
|
||||
@@ -750,18 +750,26 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
* @param courseId 课程id 用于删除课程报名信息和修改课程学习人数
|
||||
* */
|
||||
@PostMapping("/delete-signup")
|
||||
public JsonResponse<Boolean> deleteSignUp(String id,String courseId,String studentId){
|
||||
public JsonResponse<Boolean> deleteSignUp(String id,String courseId,String studentId, HttpServletRequest request){
|
||||
if(StringUtils.isBlank(id)){
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
//String aid = this.getCurrent().getAccountId();
|
||||
try {
|
||||
service.deleteSignUp(id,courseId,studentId);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("删除报名信息失败",e.getMessage());
|
||||
return error("删除失败",e.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
thirdApi.syncCourseStudent(Long.parseLong(courseId),token);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return success(true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,14 +2,10 @@ package com.xboe.school.study.dao;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.constants.CacheName;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
@@ -30,9 +26,6 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
||||
|
||||
@Autowired
|
||||
StudyCourseItemDao scItemDao;
|
||||
@Autowired
|
||||
StringRedisTemplate redisTemplate;
|
||||
|
||||
|
||||
@Resource
|
||||
private ThirdApi thirdApi;
|
||||
@@ -43,11 +36,6 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
||||
* @param total
|
||||
*/
|
||||
public void finishCheck(String studyId,String courseId,Integer total,String token){
|
||||
|
||||
if(StringUtils.isNotEmpty(redisTemplate.opsForValue().get(studyId + "_" + courseId + "_" + total))){
|
||||
return ;
|
||||
}
|
||||
|
||||
log.info("------1.完成情况检查---------------studyId = " + studyId + " , courseId = " + courseId + " , total = " + total );
|
||||
LocalDateTime now=LocalDateTime.now();
|
||||
//已完成的内容
|
||||
@@ -62,9 +50,7 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
||||
}
|
||||
log.info("------3.完成情况检查---------------studyId = " + studyId + " , courseId = " + courseId + " , total = " + total );
|
||||
//以下注意,float类型,是否等于100对应
|
||||
float percent=n*100/total;
|
||||
|
||||
|
||||
float percent=n*100/total;
|
||||
if(n>=total) {
|
||||
//自主报名的课程,代表学习完成
|
||||
super.updateMultiFieldById(studyId,
|
||||
@@ -72,13 +58,11 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
||||
UpdateBuilder.create("lastTime",now),
|
||||
UpdateBuilder.create("finishTime",now),
|
||||
UpdateBuilder.create("status",StudyCourse.STATUS_FINISH));
|
||||
redisTemplate.opsForValue().set(studyId + "_" + courseId + "_" + total, "100", 24, TimeUnit.HOURS);
|
||||
}else {
|
||||
super.updateMultiFieldById(studyId,
|
||||
UpdateBuilder.create("progress",percent),
|
||||
UpdateBuilder.create("lastTime",LocalDateTime.now()),
|
||||
UpdateBuilder.create("status",StudyCourse.STATUS_STUDYING));
|
||||
// redisTemplate.opsForValue().set(studyId, String.valueOf(percent), 10, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
||||
|
||||
@@ -74,12 +74,3 @@ xboe.email.url=https://u.boe.com/api/b1/email/send
|
||||
xboe.email.from=boeu_learning@boe.com.cn
|
||||
xboe.email.user=
|
||||
xboe.email.security=
|
||||
|
||||
xxl.job.admin.addresses=http://u.boe.com/jobAdmin
|
||||
xxl.job.accessToken=65ddc683-22f5-83b4-de3a-3c97a0a29af0
|
||||
xxl.job.executor.appname=java-servers-job-api
|
||||
xxl.job.executor.port=9995
|
||||
xxl.job.executor.address=
|
||||
xxl.job.executor.ip=
|
||||
xxl.job.executor.logpath=/var/log/xxl-job/dw/
|
||||
xxl.job.executor.logretentiondays=30
|
||||
@@ -80,13 +80,4 @@ xboe.email.from=boeu_learning@boe.com.cn
|
||||
xboe.email.user=
|
||||
xboe.email.security=
|
||||
|
||||
boe.domain=https://u-pre.boe.com
|
||||
|
||||
xxl.job.admin.addresses=http://u-pre.boe.com/jobAdmin
|
||||
xxl.job.accessToken=65ddc683-22f5-83b4-de3a-3c97a0a29af0
|
||||
xxl.job.executor.appname=java-servers-job-api
|
||||
xxl.job.executor.port=9995
|
||||
xxl.job.executor.address=
|
||||
xxl.job.executor.ip=
|
||||
xxl.job.executor.logpath=/var/log/xxl-job/dw/
|
||||
xxl.job.executor.logretentiondays=30
|
||||
boe.domain=https://u-pre.boe.com
|
||||
@@ -76,3 +76,8 @@ manageApi.editExam=${boe.domain}/manageApi/admin/project/editExam
|
||||
userBasic.getTeacherIds=${boe.domain}/userbasic/user/getTeacherInfo
|
||||
coursesuilt.getStudyStatus=${boe.domain}/manageApi/stu/project/completeStatus
|
||||
userBasic.getUserBasicInfo=${boe.domain}/userbasic/user/getUserBasicInfo
|
||||
#讲师管理创建或修改在线课授课记录
|
||||
coursesuilt.updateOrSaveCourse=${boe.domain}/manageApi/admin/teacherRecord/updateOrSaveCourse
|
||||
coursesuilt.syncCourseStudent=${boe.domain}/manageApi/admin/teacherRecord/syncCourseStudent
|
||||
coursesuilt.syncOnLineScore=${boe.domain}/manageApi/admin/teacherRecord/syncOnLineScore
|
||||
coursesuilt.updateOnLineStatus=${boe.domain}/manageApi/admin/teacherRecord/updateOnLineStatus
|
||||
|
||||
Reference in New Issue
Block a user