排课增加属性

beetlsql3-dev
Mlxa0324 2 years ago
parent da52f11374
commit b4e755629f

@ -355,3 +355,7 @@ ALTER TABLE course_info ADD COLUMN order_index bigint(20) COMMENT '同级排序'
ALTER TABLE resources_info ADD COLUMN resources_info_files varchar(4000) COMMENT '文件集合';
ALTER TABLE teacher_open_course_merge_resources_info ADD COLUMN resources_info_files varchar(4000) COMMENT '文件集合';
ALTER TABLE teacher_open_course_merge_schedule_session ADD COLUMN teacher_open_course_schedule_session_open_on_holidays tinyint(1) COMMENT '节假日是否排课';
ALTER TABLE teacher_open_course_merge_schedule_session ADD COLUMN teacher_open_course_schedule_session_class_list varchar(4000) COMMENT '开课节次和班级的组合JSON格式';

@ -1,6 +1,7 @@
package com.ibeetl.jlw.dao;
import com.ibeetl.jlw.entity.UniversitiesColleges;
import com.ibeetl.jlw.entity.UniversitiesCollegesRuleInfo;
import com.ibeetl.jlw.web.query.UniversitiesCollegesQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper;
@ -29,4 +30,11 @@ public interface UniversitiesCollegesDao extends BaseMapper<UniversitiesColleges
Integer refreshUniversitiesCollegesAuthCode(Boolean isOnlyUpdateAuthCodeNullValue);
UniversitiesColleges getByUserId(Long userId);
/**
*
* @param userId
* @return
*/
UniversitiesCollegesRuleInfo getUniversitiesCollegesRuleInfoByUserId(Long userId);
}

@ -91,6 +91,15 @@ public class TeacherOpenCourseScheduleSession extends BaseEntity{
private Integer teacherOpenCourseScheduleSessionWeekNum;
// 节假日是否排课
private Boolean teacherOpenCourseScheduleSessionOpenOnHolidays;
// 开课节次和班级的组合JSON格式
// [{班级ID[节次ID]}]
private String teacherOpenCourseScheduleSessionClassList;
//组织ID
private Long orgId ;

@ -0,0 +1,28 @@
package com.ibeetl.jlw.entity;
import lombok.Data;
/**
* --
* @author mlx
*/
@Data
public class UniversitiesCollegesRuleInfo {
/**
*
*/
private Integer courseInfoCount;
/**
*
*/
private Integer applicationCount;
/**
*
*/
private Integer teacherCount;
/**
*
*/
private Integer studentCount;
}

@ -0,0 +1,29 @@
package com.ibeetl.jlw.entity;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.admin.core.entity.CoreUser;
import lombok.Data;
/**
* -
* @author mlx
*/
@Data
public class UniversitiesCollegesUserInfo extends BaseEntity {
/**
*
*/
private CoreUser coreUser;
/**
*
*/
private UniversitiesColleges universitiesColleges;
/**
*
*/
private UniversitiesCollegesRuleInfo universitiesCollegesRuleInfo;
}

@ -6,6 +6,7 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import cn.jlw.util.ToolUtils;
import cn.jlw.validate.ValidateConfig;
import com.alibaba.fastjson.JSON;
@ -155,6 +156,8 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<Tea
public JsonResult add(TeacherOpenCourseScheduleSessionQuery teacherOpenCourseScheduleSessionQuery) {
String msg = "";
TeacherOpenCourseScheduleSession teacherOpenCourseScheduleSession = teacherOpenCourseScheduleSessionQuery.pojo();
boolean typeJSON = JSONUtil.isTypeJSON(teacherOpenCourseScheduleSession.getTeacherOpenCourseScheduleSessionClassList());
Assert.isTrue(typeJSON, "不正确的开课课次格式,支持格式:[{班级ID[节次ID]}]");
teacherOpenCourseScheduleSessionDao.insert(teacherOpenCourseScheduleSession);
teacherOpenCourseScheduleSessionQuery.setTeacherOpenCourseScheduleSessionId(teacherOpenCourseScheduleSession.getTeacherOpenCourseScheduleSessionId());
JsonResult jsonResult = new JsonResult();
@ -254,6 +257,8 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<Tea
tocss.setTeacherOpenCourseScheduleSessionAddTime(DateUtil.beginOfHour(DateUtil.date()));
tocss.setTeacherOpenCourseId(options.getTeacherOpenCourseId());
tocss.setSchoolClassIds(options.getSchoolClassIdPlural());
tocss.setTeacherOpenCourseScheduleSessionClassList(JSONUtil.toJsonStr(options.getSessionClassList()));
tocss.setTeacherOpenCourseScheduleSessionOpenOnHolidays(options.getOpenOnHolidays());
tocss.setTeacherId(options.getTeacherId());
tocss.setTeacherOpenCourseScheduleSessionStatus(1);
tocss.setTeacherOpenCourseScheduleSessionStartDate(startTime.toDateStr());

@ -1,16 +1,19 @@
package com.ibeetl.jlw.service;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.extra.validation.BeanValidationResult;
import cn.hutool.extra.validation.ValidationUtil;
import com.ibeetl.admin.console.service.OrgConsoleService;
import com.ibeetl.admin.core.entity.CoreOrg;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.service.CoreUserService;
import com.ibeetl.jlw.dao.UniversitiesCollegesDao;
import com.ibeetl.jlw.entity.SchoolClass;
import com.ibeetl.jlw.entity.UniversitiesColleges;
import com.ibeetl.jlw.entity.UniversitiesCollegesUserInfo;
import com.ibeetl.jlw.entity.dto.CreateUserDTO;
import com.ibeetl.jlw.web.query.SchoolClassQuery;
import com.ibeetl.jlw.web.query.UniversitiesCollegesQuery;
@ -29,6 +32,7 @@ import java.util.stream.Collectors;
import static com.ibeetl.admin.core.enums.MenuEnums.JT_01;
import static com.ibeetl.admin.core.enums.MenuEnums.JT_S_04;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
/**
* UniversitiesColleges Service
@ -45,6 +49,7 @@ public class UniversitiesCollegesService extends CoreBaseService<UniversitiesCol
@Autowired private OrgConsoleService orgConsoleService;
@Autowired private CoreUserService coreUserService;
@Autowired private WebPlatformService webPlatformService;
public PageQuery<UniversitiesColleges>queryByCondition(PageQuery query){
PageQuery ret = universitiesCollegesDao.queryByCondition(query);
@ -182,4 +187,21 @@ public class UniversitiesCollegesService extends CoreBaseService<UniversitiesCol
public UniversitiesColleges getByUserId(@NotNull(message = "用户ID不能为空") Long userId) {
return universitiesCollegesDao.getByUserId(userId);
}
/**
*
* @return
*/
public UniversitiesCollegesUserInfo info() {
CoreUser user = getUser();
Assert.isTrue(user.isUniAdmin(), "该接口只有学校管理管理员可以使用!");
UniversitiesColleges universitiesColleges = (UniversitiesColleges) webPlatformService.getUserInfoFromSessionByIdentity(user);
UniversitiesCollegesUserInfo universitiesCollegesUserInfo = new UniversitiesCollegesUserInfo();
universitiesCollegesUserInfo.setCoreUser(user);
universitiesCollegesUserInfo.setUniversitiesColleges(universitiesColleges);
return universitiesCollegesUserInfo;
// UniversitiesCollegesRuleInfo
// universitiesCollegesUserInfo.setUniversitiesCollegesRuleInfo();
}
}

@ -1,6 +1,7 @@
package com.ibeetl.jlw.web;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.jlw.Interceptor.SCoreUser;
import cn.jlw.validate.ValidateConfig;
@ -38,6 +39,7 @@ import java.util.Map;
import static com.ibeetl.admin.core.util.BeanCopyUtil.BaseEntity2MapWithParallel;
import static com.ibeetl.admin.core.util.ExcelUtil.convertData;
import static com.ibeetl.admin.core.util.ExcelUtil.write;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
/**
* UniversitiesColleges
@ -234,8 +236,10 @@ public class UniversitiesCollegesController{
}
@PostMapping(MODEL + "/info.json")
@Function("universitiesColleges.query")
@ResponseBody
public void info(UniversitiesCollegesQuery param, @SCoreUser CoreUser coreUser) {
public JsonResult info() {
Assert.notNull(getUser(), "getUser请登录后再操作");
return JsonResult.success(universitiesCollegesService.info());
}
}

@ -35,6 +35,15 @@ public class TeacherOpenCourseScheduleSessionQuery extends PageParam {
private String teacherOpenCourseScheduleSessionEndDate;
@Query(name = "周次", display = false)
private Integer teacherOpenCourseScheduleSessionWeekNum;
@Query(name = "节假日是否排课", display = false)
private Boolean teacherOpenCourseScheduleSessionOpenOnHolidays;
// 开课节次和班级的组合JSON格式
// [{班级ID[节次ID]}]
@Query(name = "开课节次", display = false)
private String teacherOpenCourseScheduleSessionClassList;
/**
*
* T1,T2,T3
@ -184,4 +193,20 @@ public class TeacherOpenCourseScheduleSessionQuery extends PageParam {
public void setTeacherOpenCourseScheduleSessionStatusWeekDetail(String teacherOpenCourseScheduleSessionStatusWeekDetail) {
this.teacherOpenCourseScheduleSessionStatusWeekDetail = teacherOpenCourseScheduleSessionStatusWeekDetail;
}
public Boolean getTeacherOpenCourseScheduleSessionOpenOnHolidays() {
return teacherOpenCourseScheduleSessionOpenOnHolidays;
}
public void setTeacherOpenCourseScheduleSessionOpenOnHolidays(Boolean teacherOpenCourseScheduleSessionOpenOnHolidays) {
this.teacherOpenCourseScheduleSessionOpenOnHolidays = teacherOpenCourseScheduleSessionOpenOnHolidays;
}
public String getTeacherOpenCourseScheduleSessionClassList() {
return teacherOpenCourseScheduleSessionClassList;
}
public void setTeacherOpenCourseScheduleSessionClassList(String teacherOpenCourseScheduleSessionClassList) {
this.teacherOpenCourseScheduleSessionClassList = teacherOpenCourseScheduleSessionClassList;
}
}

@ -29,6 +29,12 @@ queryByCondition
@}
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionOpenOnHolidays)){
and t.teacher_open_course_schedule_session_open_on_holidays =#teacherOpenCourseScheduleSessionOpenOnHolidays#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionClassList)){
and t.teacher_open_course_schedule_session_class_list like #'%'+teacherOpenCourseScheduleSessionClassList+'%'#
@}
@if(!isEmpty(teacherOpenCourseIdPlural)){
and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#)
@ -126,6 +132,12 @@ queryByConditionGroup
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionOpenOnHolidays)){
and t.teacher_open_course_schedule_session_open_on_holidays =#teacherOpenCourseScheduleSessionOpenOnHolidays#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionClassList)){
and t.teacher_open_course_schedule_session_class_list like #'%'+teacherOpenCourseScheduleSessionClassList+'%'#
@}
@if(!isEmpty(teacherOpenCourseIdPlural)){
and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#)
@}
@ -206,6 +218,12 @@ queryByConditionQuery
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionOpenOnHolidays)){
and t.teacher_open_course_schedule_session_open_on_holidays =#teacherOpenCourseScheduleSessionOpenOnHolidays#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionClassList)){
and t.teacher_open_course_schedule_session_class_list like #'%'+teacherOpenCourseScheduleSessionClassList+'%'#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionStatusWeekDetail)){
and t.teacher_open_course_schedule_session_status_week_detail like #"%"+teacherOpenCourseScheduleSessionStatusWeekDetail+"%"#
@}
@ -284,6 +302,20 @@ updateGivenByIds
teacher_open_course_id = null ,
@}else{
teacher_open_course_id = #teacherOpenCourseId# ,
@}
@}
@if(contain("teacherOpenCourseScheduleSessionOpenOnHolidays",_given)){
@if(isEmpty(teacherOpenCourseScheduleSessionOpenOnHolidays)){
teacher_open_course_schedule_session_open_on_holidays = null ,
@}else{
teacher_open_course_schedule_session_open_on_holidays = #teacherOpenCourseScheduleSessionOpenOnHolidays# ,
@}
@}
@if(contain("teacherOpenCourseScheduleSessionClassList",_given)){
@if(isEmpty(teacherOpenCourseScheduleSessionClassList)){
teacher_open_course_schedule_session_class_list = null ,
@}else{
teacher_open_course_schedule_session_class_list = #teacherOpenCourseScheduleSessionClassList# ,
@}
@}
@if(contain("teacherOpenCourseScheduleSessionStatusWeekDetail",_given)){
@ -366,6 +398,12 @@ getTeacherOpenCourseScheduleSessionValues
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionOpenOnHolidays)){
and t.teacher_open_course_schedule_session_open_on_holidays =#teacherOpenCourseScheduleSessionOpenOnHolidays#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionClassList)){
and t.teacher_open_course_schedule_session_class_list like #'%'+teacherOpenCourseScheduleSessionClassList+'%'#
@}
@if(!isEmpty(teacherId)){
and t.teacher_id =#teacherId#
@}
@ -419,6 +457,12 @@ getValuesByQuery
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionOpenOnHolidays)){
and t.teacher_open_course_schedule_session_open_on_holidays =#teacherOpenCourseScheduleSessionOpenOnHolidays#
@}
@if(!isEmpty(teacherOpenCourseScheduleSessionClassList)){
and t.teacher_open_course_schedule_session_class_list like #'%'+teacherOpenCourseScheduleSessionClassList+'%'#
@}
@if(!isEmpty(teacherOpenCourseIdPlural)){
and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#)
@}

Loading…
Cancel
Save