mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 11:26:50 +08:00
Merge branch 'master' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/baseservers
This commit is contained in:
@@ -817,13 +817,20 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//@PostMapping("/copy")
|
//@PostMapping("/copy")
|
||||||
|
/**
|
||||||
|
* 后续做的调整,增加反向关联
|
||||||
|
* @param id
|
||||||
|
* @param refId
|
||||||
|
* @param refType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@RequestMapping(value="/copy",method = {RequestMethod.GET,RequestMethod.POST})
|
@RequestMapping(value="/copy",method = {RequestMethod.GET,RequestMethod.POST})
|
||||||
public JsonResponse<Boolean> copyCourse(String id){
|
public JsonResponse<Boolean> copyCourse(String id,String refId,String refType){
|
||||||
if(StringUtils.isBlank(id)){
|
if(StringUtils.isBlank(id)){
|
||||||
return badRequest("参数错误");
|
return badRequest("参数错误");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String mess = courseService.copyCourse(id);
|
String mess = courseService.copyCourse(id,refId,refType);
|
||||||
if(StringUtils.isBlank(mess)){
|
if(StringUtils.isBlank(mess)){
|
||||||
return success(true);
|
return success(true);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -109,4 +109,9 @@ public class CourseQueryDto {
|
|||||||
* 是否是超级管理员
|
* 是否是超级管理员
|
||||||
*/
|
*/
|
||||||
private Boolean isSystemAdmin;
|
private Boolean isSystemAdmin;
|
||||||
|
|
||||||
|
private Boolean visible;
|
||||||
|
|
||||||
|
private String refId;
|
||||||
|
private String refType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -349,6 +349,18 @@ public class Course extends BaseEntity {
|
|||||||
@Column(name = "open_course", length = 1,columnDefinition = "int comment '是否公开课,0表非公开课,1表公开课'")
|
@Column(name = "open_course", length = 1,columnDefinition = "int comment '是否公开课,0表非公开课,1表公开课'")
|
||||||
private Integer openCourse;
|
private Integer openCourse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可见
|
||||||
|
*/
|
||||||
|
@Column(name = "visible",columnDefinition = "bit comment '是否可见'")
|
||||||
|
private Boolean visible;
|
||||||
|
|
||||||
|
@Column(name = "ref_id",length=32,columnDefinition="varchar(32) comment '反向关联的id'")
|
||||||
|
private String refId;
|
||||||
|
|
||||||
|
@Column(name = "ref_type",length=32,columnDefinition="varchar(32) comment '反向关联的类型'")
|
||||||
|
private String refType;
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
private String orgName;
|
private String orgName;
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public interface ICourseService {
|
|||||||
* 复制课程
|
* 复制课程
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
String copyCourse(String id);
|
String copyCourse(String id,String refId,String refType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新课程内容,是否记录修改日志
|
* 更新课程内容,是否记录修改日志
|
||||||
|
|||||||
@@ -147,6 +147,16 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
if(StringUtils.isNotBlank(dto.getResOwner1())){
|
if(StringUtils.isNotBlank(dto.getResOwner1())){
|
||||||
filters.add(FieldFilters.eq("resOwner1",dto.getResOwner1()));
|
filters.add(FieldFilters.eq("resOwner1",dto.getResOwner1()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(dto.getRefId())){
|
||||||
|
filters.add(FieldFilters.eq("refId",dto.getRefId()));
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(dto.getRefType())){
|
||||||
|
filters.add(FieldFilters.eq("refType",dto.getRefType()));
|
||||||
|
}
|
||||||
|
// if(dto.getVisible()!=null) {
|
||||||
|
// filters.add(FieldFilters.eq("visible",dto.getVisible()));
|
||||||
|
// }
|
||||||
|
|
||||||
if(dto.getDevice()!=null){
|
if(dto.getDevice()!=null){
|
||||||
if(dto.getDevice()==Course.DEVICE_PC) {
|
if(dto.getDevice()==Course.DEVICE_PC) {
|
||||||
@@ -244,22 +254,24 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
List<IFieldFilter> filters = createFilters(dto);
|
List<IFieldFilter> filters = createFilters(dto);
|
||||||
|
|
||||||
//有权限的查询,也同时查询出创建人的数据,在权限上
|
//有权限的查询,也同时查询出创建人的数据,在权限上
|
||||||
if(TempFilterConfig.Manager_CourseFile_ByOrgIds && StringUtils.isNotBlank(dto.getOrgAid())) {
|
|
||||||
if(StringUtil.isNotBlank(dto.getOrgIds())){
|
if(TempFilterConfig.Manager_CourseFile_ByOrgIds) {
|
||||||
if(dto.getOrgIds().contains(",")){
|
if(dto.getIsSystemAdmin()==null || !dto.getIsSystemAdmin()) {
|
||||||
String[] split = dto.getOrgIds().split(",");
|
|
||||||
List<String> strings = Arrays.asList(split);
|
if(StringUtil.isNotBlank(dto.getOrgIds())){
|
||||||
//filters.add(FieldFilters.in("orgId",strings));
|
if(dto.getOrgIds().contains(",")){
|
||||||
filters.add(FieldFilters.or(FieldFilters.in("orgId",strings),FieldFilters.eq("sysCreateAid",dto.getOrgAid())));
|
String[] split = dto.getOrgIds().split(",");
|
||||||
}else {
|
List<String> strings = Arrays.asList(split);
|
||||||
//filters.add(FieldFilters.eq("orgId",dto.getOrgIds()));
|
filters.add(FieldFilters.or(FieldFilters.in("orgId",strings),FieldFilters.eq("sysCreateAid",dto.getOrgAid())));
|
||||||
filters.add(FieldFilters.or(FieldFilters.eq("orgId",dto.getOrgIds()),FieldFilters.eq("sysCreateAid",dto.getOrgAid())));
|
}else {
|
||||||
}
|
filters.add(FieldFilters.or(FieldFilters.eq("orgId",dto.getOrgIds()),FieldFilters.eq("sysCreateAid",dto.getOrgAid())));
|
||||||
}else {
|
}
|
||||||
//没有机构权限,只能查出自己创建的
|
}else {
|
||||||
filters.add(FieldFilters.eq("sysCreateAid",dto.getOrgAid()));
|
//没有机构权限,只能查出自己创建的
|
||||||
}
|
filters.add(FieldFilters.eq("sysCreateAid",dto.getOrgAid()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//自动添加过滤已删除
|
//自动添加过滤已删除
|
||||||
filters.add(FieldFilters.eq("deleted",false));
|
filters.add(FieldFilters.eq("deleted",false));
|
||||||
@@ -461,6 +473,9 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
if(course.getSource()==null) {
|
if(course.getSource()==null) {
|
||||||
course.setSource(1);//来源内部
|
course.setSource(1);//来源内部
|
||||||
}
|
}
|
||||||
|
if(course.getVisible()==null) {
|
||||||
|
course.setVisible(true);
|
||||||
|
}
|
||||||
courseDao.save(course);
|
courseDao.save(course);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -638,7 +653,9 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
updateLog.setLogData(strJson);
|
updateLog.setLogData(strJson);
|
||||||
updateLogDao.save(updateLog);
|
updateLogDao.save(updateLog);
|
||||||
}
|
}
|
||||||
|
if(c.getVisible()==null) {
|
||||||
|
c.setVisible(true);
|
||||||
|
}
|
||||||
courseDao.update(c);
|
courseDao.update(c);
|
||||||
c.setSysVersion(courseDao.getVersion(c.getId()));
|
c.setSysVersion(courseDao.getVersion(c.getId()));
|
||||||
full.getCourse().setSysVersion(c.getSysVersion());
|
full.getCourse().setSysVersion(c.getSysVersion());
|
||||||
@@ -672,6 +689,9 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
public void submit(CourseFullDto full) throws Exception {
|
public void submit(CourseFullDto full) throws Exception {
|
||||||
|
|
||||||
Course c=full.getCourse();//当前的课程信息
|
Course c=full.getCourse();//当前的课程信息
|
||||||
|
if(c.getVisible()==null) {
|
||||||
|
c.setVisible(true);
|
||||||
|
}
|
||||||
//提交审核,不再记录修改日志
|
//提交审核,不再记录修改日志
|
||||||
// Course nowCourse=courseDao.get(c.getId());//修改之前的课程信息
|
// Course nowCourse=courseDao.get(c.getId());//修改之前的课程信息
|
||||||
// //审核不保存日志了
|
// //审核不保存日志了
|
||||||
@@ -948,7 +968,6 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
courseDao.updateMultiFieldById(id,UpdateBuilder.create("published", pass));
|
courseDao.updateMultiFieldById(id,UpdateBuilder.create("published", pass));
|
||||||
|
|
||||||
if(this.fullTextSearch!=null) {
|
if(this.fullTextSearch!=null) {
|
||||||
Object fullId=courseDao.findField("fullTextId", FieldFilters.eq("id", id));
|
Object fullId=courseDao.findField("fullTextId", FieldFilters.eq("id", id));
|
||||||
if(fullId!=null) {
|
if(fullId!=null) {
|
||||||
@@ -1471,30 +1490,40 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRED)
|
@Transactional(propagation = Propagation.REQUIRED)
|
||||||
@Override
|
@Override
|
||||||
public String copyCourse(String id) {
|
public String copyCourse(String id,String refId,String refType) {
|
||||||
//复制课程,boe_course,boe_course_content,boe_course_homework,boe_course_section,boe_course_teacher,boe_course_exam
|
//复制课程,boe_course,boe_course_content,boe_course_homework,boe_course_section,boe_course_teacher,boe_course_exam
|
||||||
// insert info select
|
// insert info select
|
||||||
List<CourseSection> sectionList = courseSectionDao.findList("courseId", id);
|
List<CourseSection> sectionList = courseSectionDao.findList("courseId", id);
|
||||||
|
if(refId==null) {
|
||||||
|
refId="";
|
||||||
|
}
|
||||||
|
if(refType==null) {
|
||||||
|
refType="";
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean visible=true;
|
||||||
|
if(StringUtils.isNotBlank(refId)) {
|
||||||
|
visible=false;
|
||||||
|
}
|
||||||
|
|
||||||
String newId = IDGenerator.generate();
|
String newId = IDGenerator.generate();
|
||||||
String courseName = this.courseName(id);
|
String courseName = this.courseName(id);
|
||||||
String mess=null;
|
String mess=null;
|
||||||
if(courseName.length()<96) {
|
if(courseName.length()<96) {
|
||||||
LocalDateTime time = LocalDateTime.now();
|
LocalDateTime time = LocalDateTime.now();
|
||||||
String sql = "insert into boe_course(id,sys_create_aid,sys_create_by,sys_create_time,deleted,sys_update_by," +
|
String sql = "insert into boe_course(id,ref_id,ref_type,visible,sys_create_aid,sys_create_by,sys_create_time,deleted,sys_update_by," +
|
||||||
"sys_update_time,sys_version,comments,cover_img,dead_time,device,enable_remark,enabled," +
|
"sys_update_time,sys_version,comments,cover_img,dead_time,device,enable_remark,enabled," +
|
||||||
"erasable,favorites,for_scene,for_users,is_top,keywords,name,open_object," +
|
"erasable,favorites,for_scene,for_users,is_top,keywords,name,open_object," +
|
||||||
"overview,pass_formula,praises,publish_time,published,res_owner1,res_owner2," +
|
"overview,pass_formula,praises,publish_time,published,res_owner1,res_owner2," +
|
||||||
"res_owner3,score,score_formula,shares,source,study_time,studys,summary," +
|
"res_owner3,score,score_formula,shares,source,study_time,studys,summary," +
|
||||||
"sys_type1,sys_type2,sys_type3,tags,top_time,trample_count,type,value,views," +
|
"sys_type1,sys_type2,sys_type3,tags,top_time,trample_count,type,value,views," +
|
||||||
"order_study,status)" +
|
"order_study,status)" +
|
||||||
"select '" + newId + "',sys_create_aid,sys_create_by,'" + time + "',deleted,sys_update_by," +
|
"select '" + newId + "','"+refId+"','"+refType+"',"+visible+",sys_create_aid,sys_create_by,'" + time + "',deleted,sys_update_by," +
|
||||||
"'" + time + "',sys_version,comments,cover_img,dead_time,device,enable_remark,enabled," +
|
"'" + time + "',sys_version,comments,cover_img,dead_time,device,enable_remark,enabled," +
|
||||||
"erasable,favorites,for_scene,for_users,0,keywords,'" + courseName + "(1)" + "',open_object," +
|
"erasable,0,for_scene,for_users,0,keywords,'" + courseName + "(1)" + "',open_object," +
|
||||||
"overview,pass_formula,praises,publish_time,0,res_owner1,res_owner2," +
|
"overview,pass_formula,0,publish_time,0,res_owner1,res_owner2," +
|
||||||
"res_owner3,score,score_formula,shares,source,study_time,studys,summary," +
|
"res_owner3,score,score_formula,0,source,study_time,0,summary," +
|
||||||
"sys_type1,sys_type2,sys_type3,tags,top_time,trample_count,type,value,views," +
|
"sys_type1,sys_type2,sys_type3,tags,top_time,trample_count,type,value,0," +
|
||||||
"order_study,1 from boe_course where id=?1";
|
"order_study,1 from boe_course where id=?1";
|
||||||
courseDao.sqlUpdate(sql, id);
|
courseDao.sqlUpdate(sql, id);
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,10 @@ public class PublishCourseUtil {
|
|||||||
CourseFullText cft=CourseToCourseFullText.convert(c);
|
CourseFullText cft=CourseToCourseFullText.convert(c);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//不可见的,不会对课程发布到ES中
|
||||||
|
if(c.getVisible()!=null && !c.getVisible()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
//计算课程时长
|
//计算课程时长
|
||||||
int duration=courseContentDao.sumDurationByCourseId(c.getId());
|
int duration=courseContentDao.sumDurationByCourseId(c.getId());
|
||||||
cft.setDuration(duration);
|
cft.setDuration(duration);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.xboe.school.study.api;
|
package com.xboe.school.study.api;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.ZoneOffset;
|
import java.time.ZoneOffset;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -143,7 +142,6 @@ public class StudyCourseESApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.xboe.school.study.api;
|
package com.xboe.school.study.api;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -17,9 +18,12 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import com.xboe.common.OrderCondition;
|
import com.xboe.common.OrderCondition;
|
||||||
import com.xboe.common.PageList;
|
import com.xboe.common.PageList;
|
||||||
import com.xboe.common.Pagination;
|
import com.xboe.common.Pagination;
|
||||||
|
import com.xboe.common.beans.IdName;
|
||||||
|
import com.xboe.common.beans.KeyValue;
|
||||||
import com.xboe.core.CurrentUser;
|
import com.xboe.core.CurrentUser;
|
||||||
import com.xboe.core.JsonResponse;
|
import com.xboe.core.JsonResponse;
|
||||||
import com.xboe.core.api.ApiBaseController;
|
import com.xboe.core.api.ApiBaseController;
|
||||||
|
import com.xboe.school.study.dto.BatchSignup;
|
||||||
import com.xboe.school.study.entity.StudySignup;
|
import com.xboe.school.study.entity.StudySignup;
|
||||||
import com.xboe.school.study.service.IStudySignupService;
|
import com.xboe.school.study.service.IStudySignupService;
|
||||||
|
|
||||||
@@ -96,8 +100,75 @@ public class StudySignupApi extends ApiBaseController{
|
|||||||
signup.setSignTime(LocalDateTime.now());
|
signup.setSignTime(LocalDateTime.now());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
signupService.selfSignup(signup);
|
|
||||||
return success(signup);
|
StudySignup has=signupService.getByCidAndAid(signup.getCourseId(), signup.getAid());
|
||||||
|
if(has!=null) {
|
||||||
|
return success(has);
|
||||||
|
}else {
|
||||||
|
signupService.selfSignup(signup);
|
||||||
|
return success(signup);
|
||||||
|
}
|
||||||
|
}catch(Exception e) {
|
||||||
|
log.error("报名处理失败",e);
|
||||||
|
return error("报名失败,请与管理员联系",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量添加学员
|
||||||
|
* @param signup
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/batch-add")
|
||||||
|
public JsonResponse<Integer> BatchAdd(@RequestBody BatchSignup batch){
|
||||||
|
if(StringUtils.isBlank(batch.getCourseId())){
|
||||||
|
return error("无课程信息");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(batch.getCourseName())){
|
||||||
|
return error("无课程名称信息");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(batch.getUsers()==null || batch.getUsers().isEmpty()) {
|
||||||
|
return error("无报名人员信息");
|
||||||
|
}
|
||||||
|
//如果没有,就直接设置为录播课
|
||||||
|
if(batch.getCourseType()==null) {
|
||||||
|
batch.setCourseType(20);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
List<String> aids=new ArrayList<String>();
|
||||||
|
for(IdName u : batch.getUsers()) {
|
||||||
|
aids.add(u.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<KeyValue> hasList=signupService.findByCourseAndUsers(batch.getCourseId(), aids);
|
||||||
|
Map<String,String> hasMap=new HashMap<String,String>();
|
||||||
|
for(KeyValue has : hasList) {
|
||||||
|
hasMap.put((String)has.getValue(),has.getKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<StudySignup> list=new ArrayList<StudySignup>();
|
||||||
|
int n=0;
|
||||||
|
for(IdName u : batch.getUsers()) {
|
||||||
|
//如果报名已经存在,就不再添加
|
||||||
|
if(hasMap.containsKey(u.getId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
StudySignup signup =new StudySignup();
|
||||||
|
signup.setAid(u.getId());
|
||||||
|
signup.setCourseId(batch.getCourseId());
|
||||||
|
signup.setCourseName(batch.getCourseName());
|
||||||
|
signup.setCourseType(batch.getCourseType());
|
||||||
|
signup.setName(u.getName());
|
||||||
|
signup.setSignTime(LocalDateTime.now());
|
||||||
|
signup.setSignType(StudySignup.SIGNTYPE_ADD);
|
||||||
|
signup.setSignInfo("");
|
||||||
|
list.add(signup);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
signupService.addList(list);
|
||||||
|
return success(n);
|
||||||
}catch(Exception e) {
|
}catch(Exception e) {
|
||||||
log.error("报名处理失败",e);
|
log.error("报名处理失败",e);
|
||||||
return error("报名失败,请与管理员联系",e.getMessage());
|
return error("报名失败,请与管理员联系",e.getMessage());
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.xboe.school.study.dto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.xboe.common.beans.IdName;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量报名
|
||||||
|
* @author seastar
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BatchSignup {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程id
|
||||||
|
*/
|
||||||
|
private String courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
private String courseName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类型
|
||||||
|
*/
|
||||||
|
private Integer courseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报名说明
|
||||||
|
*/
|
||||||
|
private String signInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报名人员
|
||||||
|
*/
|
||||||
|
private List<IdName> users;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -122,5 +122,15 @@ public class StudySignup extends IdEntity {
|
|||||||
@Transient
|
@Transient
|
||||||
private String studyId;
|
private String studyId;
|
||||||
|
|
||||||
|
public StudySignup() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public StudySignup(String id,String courseId,String aid) {
|
||||||
|
this.setId(id);
|
||||||
|
this.courseId=courseId;
|
||||||
|
this.aid=aid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.xboe.common.OrderCondition;
|
import com.xboe.common.OrderCondition;
|
||||||
import com.xboe.common.PageList;
|
import com.xboe.common.PageList;
|
||||||
|
import com.xboe.common.beans.KeyValue;
|
||||||
import com.xboe.school.study.entity.StudySignup;
|
import com.xboe.school.study.entity.StudySignup;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,6 +26,14 @@ public interface IStudySignupService {
|
|||||||
*/
|
*/
|
||||||
StudySignup getByCidAndAid(String cid,String aid);
|
StudySignup getByCidAndAid(String cid,String aid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据课程的用户查询
|
||||||
|
* @param cid
|
||||||
|
* @param aid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<KeyValue> findByCourseAndUsers(String cid,List<String> aids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计报名人数及未通过人数
|
* 统计报名人数及未通过人数
|
||||||
* @param courseId
|
* @param courseId
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import com.xboe.common.OrderCondition;
|
import com.xboe.common.OrderCondition;
|
||||||
import com.xboe.common.PageList;
|
import com.xboe.common.PageList;
|
||||||
|
import com.xboe.common.beans.KeyValue;
|
||||||
import com.xboe.core.orm.FieldFilters;
|
import com.xboe.core.orm.FieldFilters;
|
||||||
import com.xboe.core.orm.FieldUpdateType;
|
import com.xboe.core.orm.FieldUpdateType;
|
||||||
import com.xboe.core.orm.QueryBuilder;
|
import com.xboe.core.orm.QueryBuilder;
|
||||||
@@ -85,7 +86,7 @@ public class StudySignupServiceImpl implements IStudySignupService{
|
|||||||
LocalDateTime now=LocalDateTime.now();
|
LocalDateTime now=LocalDateTime.now();
|
||||||
|
|
||||||
StudyCourse sc=new StudyCourse();
|
StudyCourse sc=new StudyCourse();
|
||||||
sc.setAddTime(LocalDateTime.now());
|
sc.setAddTime(now);
|
||||||
sc.setAid(signup.getAid());
|
sc.setAid(signup.getAid());
|
||||||
sc.setAname(signup.getName());
|
sc.setAname(signup.getName());
|
||||||
sc.setCourseId(signup.getCourseId());
|
sc.setCourseId(signup.getCourseId());
|
||||||
@@ -100,6 +101,7 @@ public class StudySignupServiceImpl implements IStudySignupService{
|
|||||||
sc.setLastTime(sc.getAddTime());
|
sc.setLastTime(sc.getAddTime());
|
||||||
sc.setTotalDuration(0);
|
sc.setTotalDuration(0);
|
||||||
studyCourseDao.save(sc);
|
studyCourseDao.save(sc);
|
||||||
|
//courseDao.updateMultiFieldById(signup.getCourseId(),UpdateBuilder.create("studys", "studys+1",FieldUpdateType.EXPRESSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -108,7 +110,6 @@ public class StudySignupServiceImpl implements IStudySignupService{
|
|||||||
for(StudySignup ss : list) {
|
for(StudySignup ss : list) {
|
||||||
addSignup(ss);
|
addSignup(ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -200,4 +201,10 @@ public class StudySignupServiceImpl implements IStudySignupService{
|
|||||||
return rs;
|
return rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<KeyValue> findByCourseAndUsers(String cid,List<String> aids){
|
||||||
|
|
||||||
|
return signupDao.findKeyValueList("id","aid",FieldFilters.eq("courseId",cid),FieldFilters.in("aid",aids));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user