mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-06 17:36:47 +08:00
Compare commits
65 Commits
zcwy0716-l
...
zcwy0731-l
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7be0acf350 | ||
|
|
87892fe8ef | ||
|
|
a0c891cd35 | ||
|
|
91bcec00ef | ||
|
|
6c616a1163 | ||
|
|
939325d5bd | ||
|
|
4eddbc8e8f | ||
|
|
50bdd59a26 | ||
|
|
b85eb97bc1 | ||
|
|
28b58a73cf | ||
|
|
b9adf4c45f | ||
|
|
49aab74463 | ||
|
|
9f30910d04 | ||
|
|
6658b8c04b | ||
|
|
19df4224a9 | ||
|
|
95ddc9f5d5 | ||
|
|
64965f5ec6 | ||
|
|
a407ca2dad | ||
|
|
83e71dc5d6 | ||
|
|
f5f53557b6 | ||
|
|
4b4f30b412 | ||
|
|
6f19ff7b0f | ||
|
|
f8566d2321 | ||
|
|
d6102d1ce1 | ||
|
|
6521464676 | ||
|
|
b6378b6565 | ||
|
|
66d7f2a3cf | ||
|
|
faea4f8b2a | ||
|
|
c203956bc6 | ||
|
|
cf4004f073 | ||
|
|
6bf5ccbcec | ||
|
|
63867db58e | ||
|
|
7ef0f976fc | ||
|
|
5a05ff74b7 | ||
|
|
a93580c387 | ||
|
|
78184d3a11 | ||
|
|
bcb8b59e8a | ||
|
|
1025f8f716 | ||
|
|
4c6f15a707 | ||
|
|
488e6c2872 | ||
|
|
e86afad4ef | ||
|
|
3285c639b9 | ||
|
|
db3695019a | ||
|
|
84dd5cb192 | ||
|
|
407c7693bb | ||
|
|
564bf42464 | ||
|
|
55717e4dde | ||
|
|
2698061eae | ||
|
|
eb401d8fdf | ||
|
|
20374e274a | ||
|
|
c7a39a1f22 | ||
|
|
7eb578127d | ||
|
|
f2be349301 | ||
|
|
e0037b8814 | ||
|
|
0b0bd748d9 | ||
|
|
9fd4171107 | ||
|
|
625c41f466 | ||
|
|
f950788e08 | ||
|
|
a26ceb86d1 | ||
|
|
a2317d0b59 | ||
|
|
53c38baf22 | ||
|
|
de69ba1c11 | ||
|
|
2fcdb6b4b6 | ||
|
|
62884bcc15 | ||
|
|
dd0af3cbef |
@@ -12,13 +12,10 @@ import com.xboe.module.dict.entity.DictDto;
|
||||
import com.xboe.module.exam.entity.ExamTest;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import com.xboe.system.user.dao.UserDao;
|
||||
import com.xboe.system.user.entity.User;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -17,5 +17,7 @@ public class UserOrgIds {
|
||||
private Map<String,Boolean> permissions=new HashMap<String,Boolean>();
|
||||
|
||||
private List<String> ids;
|
||||
//hrbp只读权限
|
||||
private List<String> readIds;
|
||||
|
||||
}
|
||||
|
||||
@@ -229,8 +229,10 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
public UserOrgIds getOrgIds() {
|
||||
UserOrgIds uids=new UserOrgIds();
|
||||
List<String> orgIds = new ArrayList<>();
|
||||
List<String> readIds = new ArrayList<>();
|
||||
|
||||
uids.setIds(orgIds);
|
||||
uids.setReadIds(readIds);
|
||||
String token = TokenProxy.getToken(request);
|
||||
String type="application/json";
|
||||
String[] headers=new String[] {"token",token,"Content-Type",type};
|
||||
@@ -281,7 +283,8 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
while (elements.hasNext()){
|
||||
String oid=elements.next().asText();
|
||||
if(!orgSetIds.contains(oid)) {
|
||||
orgIds.add(oid);
|
||||
// orgIds.add(oid);
|
||||
readIds.add(oid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package com.xboe.module.course.api;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -134,7 +130,6 @@ public class CourseManageApi extends ApiBaseController{
|
||||
}else {
|
||||
dto.setIsSystemAdmin(false);
|
||||
}
|
||||
|
||||
String ids="";
|
||||
if(userOrgIds.getIds()!=null && !userOrgIds.getIds().isEmpty())
|
||||
{
|
||||
@@ -142,12 +137,14 @@ public class CourseManageApi extends ApiBaseController{
|
||||
}
|
||||
//log.info("获取到的用户的组织机构权限ids",ids);
|
||||
String aid=getCurrent().getAccountId();
|
||||
// String aid="1706272694871445506";
|
||||
//如果前端查询当前人的,这里去掉
|
||||
if(StringUtils.isNotBlank(dto.getAid())) {
|
||||
dto.setAid(null);
|
||||
}
|
||||
dto.setOrgAid(aid);
|
||||
dto.setOrgIds(ids);
|
||||
dto.setReadIds(userOrgIds.getReadIds());
|
||||
PageList<Course> coursePageList = courseService.findPage(pager.getPageIndex(), pager.getPageSize(),dto);
|
||||
return success(coursePageList);
|
||||
}catch(Exception e) {
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.xboe.module.course.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 课程查询的条件对象
|
||||
*/
|
||||
@@ -102,6 +104,9 @@ public class CourseQueryDto {
|
||||
* */
|
||||
private String orgIds;
|
||||
|
||||
//hrpb只读
|
||||
private List<String> readIds;
|
||||
|
||||
/**用户权限的查询*/
|
||||
private String orgAid;
|
||||
|
||||
@@ -110,6 +115,11 @@ public class CourseQueryDto {
|
||||
*/
|
||||
private Boolean isSystemAdmin;
|
||||
|
||||
/**
|
||||
* 是否是新建在线可
|
||||
*/
|
||||
private Boolean isCreateCourse;
|
||||
|
||||
private Boolean visible;
|
||||
|
||||
private String refId;
|
||||
@@ -129,4 +139,5 @@ public class CourseQueryDto {
|
||||
* 登录人id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
}
|
||||
|
||||
@@ -371,6 +371,9 @@ public class Course extends BaseEntity {
|
||||
@Column(name = "ref_type",length=32,columnDefinition="varchar(32) comment '反向关联的类型'")
|
||||
private String refType;
|
||||
|
||||
@Transient
|
||||
private Boolean isPermission=true;
|
||||
|
||||
@Transient
|
||||
private String orgName;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -178,4 +178,5 @@ public class ExamTest extends BaseEntity {
|
||||
|
||||
@Transient
|
||||
private String paperName;
|
||||
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class ExamTestServiceImpl implements IExamTestService {
|
||||
|
||||
@Override
|
||||
public Boolean has(String paperId) {
|
||||
ExamTest et=examTestDao.findOne(FieldFilters.eq("paperId", paperId));
|
||||
ExamTest et=examTestDao.findOne(FieldFilters.eq("paperId", paperId),FieldFilters.eq("deleted", false));
|
||||
//String etId= (String)examTestDao.findField("id", FieldFilters.eq("paperId", paperId));
|
||||
if(et==null){
|
||||
return true;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class StudyAssessServiceImpl implements IStudyAssessService{
|
||||
LocalDateTime ldt=LocalDateTime.now();
|
||||
sci.setStudyId(assess.getStudyId());
|
||||
sci.setContentId(assess.getContentId());
|
||||
//sci.setContentName(homework.getContentName());
|
||||
sci.setContentName("评估");
|
||||
sci.setCourseId(assess.getCourseId());
|
||||
//sci.setCsectionId(homework.getCsectionId());
|
||||
sci.setProgress(100);//直接设置为学习完成
|
||||
|
||||
@@ -82,7 +82,7 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
||||
LocalDateTime ldt=LocalDateTime.now();
|
||||
sci.setStudyId(exam.getStudyId());
|
||||
sci.setContentId(exam.getContentId());
|
||||
//sci.setContentName(homework.getContentName());
|
||||
sci.setContentName("考试");
|
||||
sci.setCourseId(exam.getCourseId());
|
||||
//sci.setCsectionId(homework.getCsectionId());
|
||||
sci.setProgress(prog);//直接设置为学习完成
|
||||
|
||||
@@ -46,7 +46,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
|
||||
LocalDateTime ldt=LocalDateTime.now();
|
||||
sci.setStudyId(homework.getStudyId());
|
||||
sci.setContentId(homework.getContentId());
|
||||
//sci.setContentName(homework.getContentName());
|
||||
sci.setContentName(homework.getHwName());
|
||||
sci.setCourseId(homework.getCourseId());
|
||||
//sci.setCsectionId(homework.getCsectionId());
|
||||
sci.setProgress(100);//直接设置为学习完成
|
||||
@@ -67,7 +67,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
|
||||
//只是保留一条作业记录,不再保存多条记录了
|
||||
//dao.save(homework);
|
||||
//设置id。然后进行悠
|
||||
homework.setId(obj.toString());
|
||||
homework.setId(homework.getStudyItemId());
|
||||
dao.update(homework);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,29 +180,31 @@ public class StudyServiceImpl implements IStudyService{
|
||||
query.addFilter(FieldFilters.eq("courseId",courseId));
|
||||
}
|
||||
if(StringUtils.isNotBlank(name)) {
|
||||
query.addFilter(FieldFilters.eq("aname", name));
|
||||
query.addFilter(FieldFilters.like("aname", name));
|
||||
}
|
||||
int pageIndex2 = pageIndex-1;
|
||||
if(status!=null) {
|
||||
if(status==3) {
|
||||
query.addFilter(FieldFilters.eq("status", 2));
|
||||
query.addFilter(FieldFilters.like("aname", name));
|
||||
return scItemDao.findPage(query.builder());
|
||||
}else if(status==2){
|
||||
query.addFilter(FieldFilters.eq("status",9));
|
||||
query.addFilter(FieldFilters.like("aname", name));
|
||||
return scItemDao.findPage(query.builder());
|
||||
}else if (status == 1) {
|
||||
String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " +
|
||||
" left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" +
|
||||
" where bsc.course_id = '"+courseId+"' and bsc.id not in(" +
|
||||
" where bsc.course_id = '"+courseId+"' and bsc.aname like '%"+name+"%' and bsc.id not in(" +
|
||||
" select item.study_id from boe_study_course_item item " +
|
||||
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" +
|
||||
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.aname like '%"+name+"%' group by item.study_id" +
|
||||
" ) group by bsc.id limit "+ pageIndex2+","+ pageSize+";";
|
||||
|
||||
String sql2 = "select count(*) as total from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " +
|
||||
" left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" +
|
||||
" where bsc.course_id = '"+courseId+"' and bsc.id not in(" +
|
||||
" where bsc.course_id = '"+courseId+"' and bsc.aname like '%"+name+"%' and bsc.id not in(" +
|
||||
" select item.study_id from boe_study_course_item item " +
|
||||
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" +
|
||||
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.aname like '%"+name+"%' group by item.study_id" +
|
||||
" ) group by bsc.id) as total";
|
||||
log.info("资源完成情况未开始sql"+sql);
|
||||
List<Object[]> list = scDao.sqlFindList(sql);
|
||||
@@ -224,46 +226,22 @@ public class StudyServiceImpl implements IStudyService{
|
||||
return pageList;
|
||||
}
|
||||
}
|
||||
// String sql = "select * from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status 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.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id " +
|
||||
// " UNION ALL " +
|
||||
// " select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " +
|
||||
// " LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " +
|
||||
// " where bsc.course_id = '"+courseId+"' and bsc.id not in (" +
|
||||
// " select 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+"' group by bsc.id" +
|
||||
// " )group by bsc.id) a group by a.id limit "+ pageIndex+","+ pageSize+";";
|
||||
|
||||
// String sql2 = "select count(*) from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status 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.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id " +
|
||||
// " UNION ALL " +
|
||||
// " select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " +
|
||||
// " LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " +
|
||||
// " where bsc.course_id = '"+courseId+"' and bsc.id not in (" +
|
||||
// " select 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+"' group by bsc.id" +
|
||||
// " )group by bsc.id) a group by a.id";
|
||||
|
||||
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 " +
|
||||
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') 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 " +
|
||||
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
|
||||
"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 + "' 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 " +
|
||||
"group by a.id limit "+ pageIndex2+","+ pageSize+";";
|
||||
String sql2 = "select count(*) as total from (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 " +
|
||||
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') 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 " +
|
||||
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
|
||||
"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 + "' 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 " +
|
||||
"group by a.id) as total";
|
||||
log.info("资源完成情况全部sql"+sql);
|
||||
|
||||
Reference in New Issue
Block a user