mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
Compare commits
26 Commits
250701-add
...
20251029-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55dac06e5f | ||
|
|
a72a042636 | ||
|
|
4110d0632f | ||
|
|
6fe6f7c6e5 | ||
|
|
249a8d81a6 | ||
|
|
7abb00772b | ||
|
|
04e11f2e71 | ||
|
|
2feb149e92 | ||
|
|
16fa9cb028 | ||
|
|
cac466ba73 | ||
|
|
30d2a0cde2 | ||
|
|
541e542d9b | ||
|
|
aa04e16209 | ||
|
|
57e22492e5 | ||
|
|
1917647a99 | ||
|
|
f5f7ab3bc5 | ||
|
|
413a2ebc33 | ||
|
|
22db916abf | ||
|
|
8ce284ea7e | ||
|
|
c485757061 | ||
|
|
9a00b41cde | ||
|
|
59beaa5b74 | ||
|
|
9b9e97a8d4 | ||
|
|
200ec38038 | ||
|
|
7613f30ca7 | ||
|
|
248e0799bd |
@@ -45,10 +45,7 @@ import javax.annotation.Resource;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.concurrent.ForkJoinPool;
|
import java.util.concurrent.ForkJoinPool;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
@@ -407,4 +404,20 @@ public class ThirdApi {
|
|||||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||||
log.info("-------delOnLineById = " + resp);
|
log.info("-------delOnLineById = " + resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取字典信息
|
||||||
|
public List<Dict> getDictItems(CommonSearchVo searcher) {
|
||||||
|
try {
|
||||||
|
List<Dict> dictList = dictRemoteClient.getList(searcher);
|
||||||
|
if(!Objects.isNull(dictList) && dictList.size() > 0){
|
||||||
|
// List<String> dicts = dictList.stream().map(Dict::getValue).collect(Collectors.toList());
|
||||||
|
return dictList;
|
||||||
|
}else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("-------获取字典信息 = " + e.getMessage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import com.xboe.api.ThirdApi;
|
import com.xboe.api.ThirdApi;
|
||||||
import com.xboe.module.course.dto.CourseParam;
|
import com.xboe.module.course.dto.CourseParam;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -321,6 +322,7 @@ public class CourseAuditApi extends ApiBaseController{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/hrbp-submit-audit")
|
@PostMapping("/hrbp-submit-audit")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JsonResponse<Boolean> hrbpAudit(String auditId,String courseId,String title,Boolean pass,String remark, HttpServletRequest request){
|
public JsonResponse<Boolean> hrbpAudit(String auditId,String courseId,String title,Boolean pass,String remark, HttpServletRequest request){
|
||||||
if(StringUtils.isBlank(auditId)){
|
if(StringUtils.isBlank(auditId)){
|
||||||
return badRequest("参数错误");
|
return badRequest("参数错误");
|
||||||
@@ -350,7 +352,6 @@ public class CourseAuditApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
CurrentUser cu=getCurrent();
|
CurrentUser cu=getCurrent();
|
||||||
service.hrbpSubmitAudit(auditId, courseId,open, pass,cu.getAccountId(),cu.getName(), remark);
|
service.hrbpSubmitAudit(auditId, courseId,open, pass,cu.getAccountId(),cu.getName(), remark);
|
||||||
|
|
||||||
@@ -359,13 +360,11 @@ public class CourseAuditApi extends ApiBaseController{
|
|||||||
String token = request.getHeader("Xboe-Access-Token");
|
String token = request.getHeader("Xboe-Access-Token");
|
||||||
CourseParam param = new CourseParam();
|
CourseParam param = new CourseParam();
|
||||||
param.setId(courseId);
|
param.setId(courseId);
|
||||||
thirdApi.updateOnLineStatua(param,token);
|
param.setOrgId(c.getOrgId());
|
||||||
|
param.setOrgName(c.getOrgName());
|
||||||
|
thirdApi.updateOrSaveCourse(param,token);
|
||||||
}
|
}
|
||||||
return success(true);
|
return success(true);
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("HRBP审核提交处理错误",e);
|
|
||||||
return error("审核处理失败",e.getMessage(),false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/last-audit-list")
|
@PostMapping("/last-audit-list")
|
||||||
@@ -390,6 +389,7 @@ public class CourseAuditApi extends ApiBaseController{
|
|||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@PostMapping("/submit-publish")
|
@PostMapping("/submit-publish")
|
||||||
@AutoLog(module = "课程",action = "默认管理员提交发布",info = "")
|
@AutoLog(module = "课程",action = "默认管理员提交发布",info = "")
|
||||||
public JsonResponse<Boolean> submitAndPublish(@RequestBody CourseFullDto dto, HttpServletRequest request){
|
public JsonResponse<Boolean> submitAndPublish(@RequestBody CourseFullDto dto, HttpServletRequest request){
|
||||||
@@ -423,7 +423,6 @@ public class CourseAuditApi extends ApiBaseController{
|
|||||||
dto.getCourse().setStatus(Course.STATUS_AUDIT_FINISH);//设置为审核通过状态
|
dto.getCourse().setStatus(Course.STATUS_AUDIT_FINISH);//设置为审核通过状态
|
||||||
dto.getCourse().setEnabled(true);//设置启用状态问题
|
dto.getCourse().setEnabled(true);//设置启用状态问题
|
||||||
dto.getCourse().setPublished(false);//重新提交审核设置为未发布状态
|
dto.getCourse().setPublished(false);//重新提交审核设置为未发布状态
|
||||||
try {
|
|
||||||
|
|
||||||
courseService.submitAndPublish(dto,cuser.getAccountId(),cuser.getName());
|
courseService.submitAndPublish(dto,cuser.getAccountId(),cuser.getName());
|
||||||
log.info("---------------在线课开始同步到讲师管理 ------- token = " + token);
|
log.info("---------------在线课开始同步到讲师管理 ------- token = " + token);
|
||||||
@@ -434,12 +433,6 @@ public class CourseAuditApi extends ApiBaseController{
|
|||||||
thirdApi.updateOrSaveCourse(param,token);
|
thirdApi.updateOrSaveCourse(param,token);
|
||||||
log.info("---------------在线课同步到讲师管理完毕 -------");
|
log.info("---------------在线课同步到讲师管理完毕 -------");
|
||||||
return success(true);
|
return success(true);
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("默认管理员提交直接发布处理失败",e);
|
|
||||||
e.printStackTrace();
|
|
||||||
return error("发布课程失败",e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,19 @@
|
|||||||
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.boe.feign.api.infrastructure.entity.CommonSearchVo;
|
||||||
|
import com.boe.feign.api.infrastructure.entity.Dict;
|
||||||
import com.xboe.api.ThirdApi;
|
import com.xboe.api.ThirdApi;
|
||||||
import com.xboe.module.course.dto.*;
|
import com.xboe.module.course.dto.*;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@@ -170,17 +174,46 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
|
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
|
||||||
List<CourseCrowd> crowds=courseService.findCrowdByCourseId(id);
|
List<CourseCrowd> crowds=courseService.findCrowdByCourseId(id);
|
||||||
|
|
||||||
//
|
CommonSearchVo searcher = new CommonSearchVo();
|
||||||
|
searcher.setPid(637L);
|
||||||
|
searcher.setType(1);
|
||||||
|
List<Dict> dictList = thirdApi.getDictItems(searcher);
|
||||||
|
boolean isPermission = false;
|
||||||
|
if(dictList != null && dictList.size() > 0){
|
||||||
|
List<String> dicts = dictList.stream().map(Dict::getValue).collect(Collectors.toList());
|
||||||
|
isPermission = dicts.contains(course.getOrgId());
|
||||||
|
rs.put("dicts",dicts);
|
||||||
|
}
|
||||||
|
log.error("-------是否仅内网查看 = " + isPermission);
|
||||||
rs.put("course",course);
|
rs.put("course",course);
|
||||||
rs.put("contents",cclist);
|
rs.put("contents",cclist);
|
||||||
rs.put("sections",sectionlist);
|
rs.put("sections",sectionlist);
|
||||||
rs.put("teachers",teachers);
|
rs.put("teachers",teachers);
|
||||||
rs.put("crowds",crowds);
|
rs.put("crowds",crowds);
|
||||||
|
rs.put("isPermission",isPermission);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return success(rs);
|
return success(rs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@GetMapping("/getDictIds")
|
||||||
|
public JsonResponse<Map<String,Object>> getDictIds(Long pid,Integer type){
|
||||||
|
CommonSearchVo searcher = new CommonSearchVo();
|
||||||
|
if(pid==null || type ==null){
|
||||||
|
return badRequest("参数错误");
|
||||||
|
}
|
||||||
|
Map<String,Object> rs=new HashMap<String,Object>();
|
||||||
|
searcher.setPid(pid);
|
||||||
|
searcher.setType(type);
|
||||||
|
List<Dict> dictList = thirdApi.getDictItems(searcher);
|
||||||
|
rs.put("dicts",null);
|
||||||
|
if(dictList != null && dictList.size() > 0){
|
||||||
|
List<String> dicts = dictList.stream().map(Dict::getValue).collect(Collectors.toList());
|
||||||
|
rs.put("dicts",dicts);
|
||||||
|
}
|
||||||
|
return success(rs);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理员审核列表,教师的审核不在这里,此审核也应该移动CourseAuditApi中去
|
* 管理员审核列表,教师的审核不在这里,此审核也应该移动CourseAuditApi中去
|
||||||
@@ -268,6 +301,7 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@AutoLog(module = "课程",action = "保存课程基本信息",info = "")
|
@AutoLog(module = "课程",action = "保存课程基本信息",info = "")
|
||||||
public JsonResponse<CourseFullDto> saveCourseFull(@RequestBody CourseFullDto dto, HttpServletRequest request){
|
public JsonResponse<CourseFullDto> saveCourseFull(@RequestBody CourseFullDto dto, HttpServletRequest request){
|
||||||
if(dto.getCourse()==null){
|
if(dto.getCourse()==null){
|
||||||
@@ -289,7 +323,6 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//填充必要的信息
|
//填充必要的信息
|
||||||
try {
|
|
||||||
if(StringUtils.isBlank(dto.getCourse().getId())) {
|
if(StringUtils.isBlank(dto.getCourse().getId())) {
|
||||||
//只有在第一次添加保存时才会这样
|
//只有在第一次添加保存时才会这样
|
||||||
fillCourseData(dto.getCourse());
|
fillCourseData(dto.getCourse());
|
||||||
@@ -309,10 +342,6 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
thirdApi.updateOrSaveCourse(param,token);
|
thirdApi.updateOrSaveCourse(param,token);
|
||||||
log.info("---------------在线课同步到讲师管理完毕 -------");
|
log.info("---------------在线课同步到讲师管理完毕 -------");
|
||||||
return success(dto);
|
return success(dto);
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("整体保存课程信息错误",e);
|
|
||||||
return error("保存失败",e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
@@ -411,6 +440,7 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/submit")
|
@PostMapping("/submit")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@AutoLog(module = "课程",action = "提交课程",info = "")
|
@AutoLog(module = "课程",action = "提交课程",info = "")
|
||||||
public JsonResponse<CourseFullDto> submitCourseFull(@RequestBody CourseFullDto dto){
|
public JsonResponse<CourseFullDto> submitCourseFull(@RequestBody CourseFullDto dto){
|
||||||
if(dto.getCourse()==null){
|
if(dto.getCourse()==null){
|
||||||
@@ -488,7 +518,6 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
//检查课程内容的完整性
|
//检查课程内容的完整性
|
||||||
//填充必要的信息
|
//填充必要的信息
|
||||||
//fillCourseData(dto.getCourse());
|
//fillCourseData(dto.getCourse());
|
||||||
try {
|
|
||||||
CourseHRBPAudit hrbpAudit = hrbpAuditService.hasAuditing(dto.getCourse().getId());
|
CourseHRBPAudit hrbpAudit = hrbpAuditService.hasAuditing(dto.getCourse().getId());
|
||||||
if(hrbpAudit!=null) {
|
if(hrbpAudit!=null) {
|
||||||
return badRequest("此课程中已有审核,不能再提交审核,如修改请先撤回");
|
return badRequest("此课程中已有审核,不能再提交审核,如修改请先撤回");
|
||||||
@@ -546,10 +575,6 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
return error("课程已提交,但邮件发送失败",ex.getMessage());
|
return error("课程已提交,但邮件发送失败",ex.getMessage());
|
||||||
}
|
}
|
||||||
return success(dto);
|
return success(dto);
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("提交保存课程信息错误",e);
|
|
||||||
return error("提交课程处理失败",e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String createEmailHtml(String name,String orgId, String orgName,String createBy,String courseName) throws Exception {
|
private String createEmailHtml(String name,String orgId, String orgName,String createBy,String courseName) throws Exception {
|
||||||
@@ -583,6 +608,7 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/sumbits")
|
@PostMapping("/sumbits")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JsonResponse<Boolean> sumbitId(HttpServletRequest request,CourseHRBPAudit audit,String ucode,String ukid,String email,String orgName){
|
public JsonResponse<Boolean> sumbitId(HttpServletRequest request,CourseHRBPAudit audit,String ucode,String ukid,String email,String orgName){
|
||||||
if(StringUtils.isBlank(audit.getCourseId())){
|
if(StringUtils.isBlank(audit.getCourseId())){
|
||||||
return badRequest("参数错误");
|
return badRequest("参数错误");
|
||||||
@@ -605,7 +631,6 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
return badRequest(error);
|
return badRequest(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
CourseHRBPAudit hrbpAudit = hrbpAuditService.hasAuditing(audit.getCourseId());
|
CourseHRBPAudit hrbpAudit = hrbpAuditService.hasAuditing(audit.getCourseId());
|
||||||
if(hrbpAudit!=null) {
|
if(hrbpAudit!=null) {
|
||||||
return badRequest("此课程中已有审核,不能再提交审核,如修改请先撤回");
|
return badRequest("此课程中已有审核,不能再提交审核,如修改请先撤回");
|
||||||
@@ -671,10 +696,6 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
return success(true);
|
return success(true);
|
||||||
}catch(Exception e) {
|
|
||||||
log.error("提交保存课程信息错误",e);
|
|
||||||
return error("提交课程处理失败",e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/revoke")
|
@PostMapping("/revoke")
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ public class Course extends BaseEntity {
|
|||||||
/**所有的设备*/
|
/**所有的设备*/
|
||||||
public static int DEVICE_ALL=3;
|
public static int DEVICE_ALL=3;
|
||||||
|
|
||||||
|
/**仅内网*/
|
||||||
|
public static int DEVICE_INTERNAL=4;
|
||||||
|
|
||||||
/**未提交,草稿*/
|
/**未提交,草稿*/
|
||||||
public static final int STATUS_NONE=1;
|
public static final int STATUS_NONE=1;
|
||||||
|
|
||||||
|
|||||||
@@ -161,14 +161,14 @@ public interface ICourseService {
|
|||||||
* 课程信息的整体更新,用于对课程的编辑处理
|
* 课程信息的整体更新,用于对课程的编辑处理
|
||||||
* @param full
|
* @param full
|
||||||
*/
|
*/
|
||||||
void update(CourseFullDto full)throws Exception;
|
void update(CourseFullDto full);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交课程,提交进入课程审核,独立的方法处理
|
* 提交课程,提交进入课程审核,独立的方法处理
|
||||||
* @param full
|
* @param full
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
void submit(CourseFullDto full)throws Exception;
|
void submit(CourseFullDto full);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于默认管理员,直接提交发布,不走审核流程
|
* 用于默认管理员,直接提交发布,不走审核流程
|
||||||
@@ -177,14 +177,14 @@ public interface ICourseService {
|
|||||||
* @param aname 姓名
|
* @param aname 姓名
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
void submitAndPublish(CourseFullDto full,String aid,String aname)throws Exception;
|
void submitAndPublish(CourseFullDto full,String aid,String aname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交一个课程
|
* 提交一个课程
|
||||||
* @param audit
|
* @param audit
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
void submit(CourseHRBPAudit audit) throws Exception;
|
void submit(CourseHRBPAudit audit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* update 传一个id直接改值
|
* update 传一个id直接改值
|
||||||
|
|||||||
@@ -183,6 +183,8 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
filters.add(FieldFilters.in("device", Course.DEVICE_MOBILE, Course.DEVICE_ALL));
|
filters.add(FieldFilters.in("device", Course.DEVICE_MOBILE, Course.DEVICE_ALL));
|
||||||
} else if (dto.getDevice() == Course.DEVICE_ALL) {
|
} else if (dto.getDevice() == Course.DEVICE_ALL) {
|
||||||
filters.add(FieldFilters.eq("device", Course.DEVICE_ALL));
|
filters.add(FieldFilters.eq("device", Course.DEVICE_ALL));
|
||||||
|
}else if (dto.getDevice() == Course.DEVICE_INTERNAL) {
|
||||||
|
filters.add(FieldFilters.eq("device", Course.DEVICE_INTERNAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -974,7 +976,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(CourseFullDto full) throws Exception {
|
public void update(CourseFullDto full) {
|
||||||
|
|
||||||
Course c = full.getCourse();//当前的课程信息
|
Course c = full.getCourse();//当前的课程信息
|
||||||
Course nowCourse = courseDao.get(c.getId());//修改之前的课程信息
|
Course nowCourse = courseDao.get(c.getId());//修改之前的课程信息
|
||||||
@@ -1026,7 +1028,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void submit(CourseFullDto full) throws Exception {
|
public void submit(CourseFullDto full) {
|
||||||
|
|
||||||
Course c = full.getCourse();//当前的课程信息
|
Course c = full.getCourse();//当前的课程信息
|
||||||
if (c.getVisible() == null) {
|
if (c.getVisible() == null) {
|
||||||
@@ -1082,7 +1084,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void submitAndPublish(CourseFullDto full, String aid, String aname) throws Exception {
|
public void submitAndPublish(CourseFullDto full, String aid, String aname) {
|
||||||
|
|
||||||
Course c = full.getCourse();//当前的课程信息
|
Course c = full.getCourse();//当前的课程信息
|
||||||
c.setPublished(true);
|
c.setPublished(true);
|
||||||
@@ -1129,7 +1131,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void submit(CourseHRBPAudit hrbpAudit) throws Exception {
|
public void submit(CourseHRBPAudit hrbpAudit) {
|
||||||
|
|
||||||
courseDao.updateMultiFieldById(hrbpAudit.getCourseId(), UpdateBuilder.create("status", Course.STATUS_SUBMIT),
|
courseDao.updateMultiFieldById(hrbpAudit.getCourseId(), UpdateBuilder.create("status", Course.STATUS_SUBMIT),
|
||||||
UpdateBuilder.create("published", false), UpdateBuilder.create("publishTime", LocalDateTime.now()));
|
UpdateBuilder.create("published", false), UpdateBuilder.create("publishTime", LocalDateTime.now()));
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.xboe.module.popup.entity;
|
package com.xboe.module.popup.entity;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.xboe.core.SysConstant;
|
import com.xboe.core.SysConstant;
|
||||||
import com.xboe.core.orm.IdEntity;
|
import com.xboe.core.orm.IdEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -24,12 +25,14 @@ public class Popup extends IdEntity {
|
|||||||
* 开始时间
|
* 开始时间
|
||||||
* */
|
* */
|
||||||
@Column(name = "start_time")
|
@Column(name = "start_time")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime startTime;
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
* */
|
* */
|
||||||
@Column(name = "end_time")
|
@Column(name = "end_time")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime endTime;
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.alibaba.nacos.shaded.com.google.common.util.concurrent.RateLimiter;
|
import com.alibaba.nacos.shaded.com.google.common.util.concurrent.RateLimiter;
|
||||||
|
import com.boe.feign.api.infrastructure.entity.CommonSearchVo;
|
||||||
|
import com.boe.feign.api.infrastructure.entity.Dict;
|
||||||
import com.xboe.api.ThirdApi;
|
import com.xboe.api.ThirdApi;
|
||||||
import com.xboe.constants.CacheName;
|
import com.xboe.constants.CacheName;
|
||||||
import com.xboe.module.course.vo.TeacherVo;
|
import com.xboe.module.course.vo.TeacherVo;
|
||||||
@@ -233,6 +235,29 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
rs.put("contents",cclist);
|
rs.put("contents",cclist);
|
||||||
rs.put("sections",sectionlist);
|
rs.put("sections",sectionlist);
|
||||||
rs.put("teachers",teachers);
|
rs.put("teachers",teachers);
|
||||||
|
// 未选择仅内网时isPermission = false,不用区分内外网
|
||||||
|
boolean isPermission = false;
|
||||||
|
if(course.getDevice() ==4){
|
||||||
|
CommonSearchVo searcher = new CommonSearchVo();
|
||||||
|
searcher.setPid(637L);
|
||||||
|
searcher.setType(1);
|
||||||
|
List<Dict> dictList = thirdApi.getDictItems(searcher);
|
||||||
|
if(dictList != null && dictList.size() > 0){
|
||||||
|
List<String> dicts = dictList.stream().map(Dict::getValue).collect(Collectors.toList());
|
||||||
|
// 选择仅内网 并且字典中配置了此课程资源归属,那么只能内网观看 返回 truw
|
||||||
|
isPermission = dicts.contains(course.getOrgId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rs.put("isPermission",isPermission);
|
||||||
|
|
||||||
|
CommonSearchVo warn = new CommonSearchVo();
|
||||||
|
warn.setCode("course_warn");
|
||||||
|
warn.setType(1);
|
||||||
|
List<Dict> warns = thirdApi.getDictItems(warn);
|
||||||
|
if(warns != null && warns.size() > 0){
|
||||||
|
rs.put("warn",warns.get(0).getValue());
|
||||||
|
rs.put("warnTitle",warns.get(0).getName());
|
||||||
|
}
|
||||||
|
|
||||||
//检查是否已报名
|
//检查是否已报名
|
||||||
StudyCourse sc=service.findByCourseIdAndAid(cid, aid);
|
StudyCourse sc=service.findByCourseIdAndAid(cid, aid);
|
||||||
@@ -567,8 +592,8 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
studyService.finishVideoStudyItem(itemId, studyId,courseId,cnum,token);
|
studyService.finishVideoStudyItem(itemId, studyId,courseId,cnum,token);
|
||||||
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
// List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
||||||
log.info("在线课学习记录"+allUserList);
|
// log.info("在线课学习记录"+allUserList);
|
||||||
return success(true);
|
return success(true);
|
||||||
}catch(Exception e) {
|
}catch(Exception e) {
|
||||||
log.error("记录内容学习完成错误",e);
|
log.error("记录内容学习完成错误",e);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.xboe.module.course.entity.CourseExam;
|
|||||||
import com.xboe.school.study.dao.StudyCourseDao;
|
import com.xboe.school.study.dao.StudyCourseDao;
|
||||||
import com.xboe.school.study.dao.StudyCourseItemDao;
|
import com.xboe.school.study.dao.StudyCourseItemDao;
|
||||||
import com.xboe.school.study.dao.StudyExamDao;
|
import com.xboe.school.study.dao.StudyExamDao;
|
||||||
|
import com.xboe.school.study.entity.StudyCourse;
|
||||||
import com.xboe.school.study.entity.StudyCourseItem;
|
import com.xboe.school.study.entity.StudyCourseItem;
|
||||||
import com.xboe.school.study.entity.StudyExam;
|
import com.xboe.school.study.entity.StudyExam;
|
||||||
import com.xboe.school.study.service.IStudyExamService;
|
import com.xboe.school.study.service.IStudyExamService;
|
||||||
@@ -170,15 +171,32 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
|||||||
}
|
}
|
||||||
builder.addGroupBy("studyId");
|
builder.addGroupBy("studyId");
|
||||||
List<StudyExam> list1 = dao.findList(builder.builder());
|
List<StudyExam> list1 = dao.findList(builder.builder());
|
||||||
log.info("------------QueryBuilder list1.size = " + list1.size() + ",0 = " + list1.get(0));
|
if(list1 != null && list1.size() > 0){
|
||||||
|
log.info("----------StudyExam--QueryBuilder list1.size = " + list1.size() + ",0 = " + list1.get(0));
|
||||||
for(StudyExam item : list1){
|
for(StudyExam item : list1){
|
||||||
log.info("-----------------CourseId = " + item.getCourseId() + " , StudyId = " + item.getStudyId() + " , StudentId = " + item.getStudentId());
|
log.info("--------------StudyExam---CourseId = " + item.getCourseId() + " , StudyId = " + item.getStudyId() + " , StudentId = " + item.getStudentId());
|
||||||
int totalContent = courseContentDao.getCount(item.getCourseId());
|
int totalContent = courseContentDao.getCount(item.getCourseId());
|
||||||
log.info("----------准备判断进度-------totalContent = " + totalContent);
|
log.info("--------StudyExam--准备判断进度-------totalContent = " + totalContent);
|
||||||
scDao.finishCheck1(item.getStudyId(),item.getCourseId(),totalContent);
|
scDao.finishCheck1(item.getStudyId(),item.getCourseId(),totalContent);
|
||||||
log.info("----------判断进度完毕----------------------");
|
log.info("--------StudyExam--判断进度完毕----------------------");
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
QueryBuilder builder1 = QueryBuilder.from(StudyCourse.class);
|
||||||
|
if (StringUtils.isEmpty(courseId)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
builder1.addFilter(FieldFilters.eq("courseId", courseId));
|
||||||
|
List<StudyCourse> list2 = scDao.findList(builder1.builder());
|
||||||
|
log.info("------------StudyCourse list2.size = " + list2.size() + ",0 = " + list2.get(0));
|
||||||
|
for(StudyCourse item : list2){
|
||||||
|
log.info("-------------StudyCourse----CourseId = " + item.getCourseId() + " , StudyId = " + item.getId() + " , StudentId = " + item.getAid());
|
||||||
|
int totalContent = courseContentDao.getCount(item.getCourseId());
|
||||||
|
log.info("--------StudyCourse--准备判断进度-------totalContent = " + totalContent);
|
||||||
|
scDao.finishCheck1(item.getId(),item.getCourseId(),totalContent);
|
||||||
|
log.info("--------StudyCourse--判断进度完毕----------------------");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
log.info("------异常----------------------:" +exception.getMessage());
|
log.info("------异常----------------------:" +exception.getMessage());
|
||||||
|
|||||||
@@ -282,11 +282,12 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String sql = "select a.id, a.course_id, a.course_name, a.aname, " +
|
String sql = "select a.id, a.course_id, a.course_name, a.aname, " +
|
||||||
"IFNULL(b.finish_time, '0') as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " +
|
"IFNULL(b.finish_time, '0') as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status,b.score " +
|
||||||
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "' and aname like '%"+name+"%') a " +
|
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "' and aname like '%"+name+"%') a " +
|
||||||
"left join " +
|
"left join " +
|
||||||
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
|
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status,MAX(item.score) score " +
|
||||||
"from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " +
|
"from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " +
|
||||||
"where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' and item.aname like '%"+name+"%' group by bsc.id) b " +
|
"where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' and item.aname like '%"+name+"%' group by bsc.id) b " +
|
||||||
"on a.course_id = b.course_id and a.id = b.id " +
|
"on a.course_id = b.course_id and a.id = b.id " +
|
||||||
@@ -315,6 +316,9 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
sc.setProgress(Integer.valueOf(objs[5].toString()));
|
sc.setProgress(Integer.valueOf(objs[5].toString()));
|
||||||
sc.setStatus(Integer.valueOf(objs[6].toString()));
|
sc.setStatus(Integer.valueOf(objs[6].toString()));
|
||||||
sc.setAname(objs[3].toString());
|
sc.setAname(objs[3].toString());
|
||||||
|
if(objs[7] != null){
|
||||||
|
sc.setScore(Float.valueOf(objs[7].toString()));
|
||||||
|
}
|
||||||
item.add(sc);
|
item.add(sc);
|
||||||
}
|
}
|
||||||
log.info("资源完成情况人员"+item);
|
log.info("资源完成情况人员"+item);
|
||||||
|
|||||||
Reference in New Issue
Block a user