Compare commits

..

No commits in common. '33d945c59413507e05a2baa2efd9ac502f6a0419' and '7a32ec21d806913b417f0ca2568ea8e2ab1953a7' have entirely different histories.

@ -5,7 +5,6 @@ import cn.xluobo.business.sc.course.domain.resp.time.RespBusinessClaTimeCalendar
import cn.xluobo.business.sc.course.domain.resp.time.RespClaTime;
import cn.xluobo.business.sc.course.domain.resp.time.RespClaTimeCalendar;
import cn.xluobo.business.sc.course.repo.model.ScClaTime;
import cn.xluobo.business.sc.course.repo.model.ScClaTimeVo;
import cn.xluobo.business.sc.course.service.BusinessClaTimeService;
import cn.xluobo.business.sc.student.domain.req.ReqClaTimeAttend;
import cn.xluobo.core.api.APIResponse;
@ -90,7 +89,7 @@ public class ScClaTimeController {
* @return
*/
@PutMapping("/update/updateScClaTime")
public APIResponse updateScClaTime(@RequestBody ScClaTimeVo scClaTime) {
public APIResponse updateScClaTime(@RequestBody ScClaTime scClaTime) {
return claTimeService.updateClaTime(scClaTime);
}

@ -1,7 +1,6 @@
package cn.xluobo.business.sc.course.domain.req;
import cn.xluobo.core.page.ReqPageBase;
import com.ruoyi.common.utils.SecurityUtils;
import lombok.Data;
import java.io.Serializable;
@ -45,10 +44,4 @@ public class ReqSearchScCourse extends ReqPageBase implements Serializable {
*
*/
private Long studentId;
private String tenantId;
public String getTenantId(){
return SecurityUtils.getLoginUser().getNowTenantId();
}
}

@ -11,8 +11,8 @@ import java.io.Serializable;
*/
@Data
public class ReqSearchScCourseCla extends ReqPageBase implements Serializable {
private String courseId;
private String staffId;
private Long courseId;
private Long staffId;
private String claName;
private String courseTime;
private Long departId;
@ -20,6 +20,4 @@ public class ReqSearchScCourseCla extends ReqPageBase implements Serializable {
*
*/
private String chargeType;
private String tenantId;
}

@ -12,7 +12,7 @@ import java.math.BigDecimal;
@Data
public class ReqAddScCourseChargeItem {
private String chargeId;
private Long chargeId;
/**
* id

@ -1,7 +1,6 @@
package cn.xluobo.business.sc.course.domain.req.time;
import cn.xluobo.core.page.ReqPageBase;
import com.ruoyi.common.utils.SecurityUtils;
import lombok.Data;
import org.joda.time.DateTime;
@ -15,10 +14,10 @@ import java.io.Serializable;
public class ReqSearchClaTime extends ReqPageBase implements Serializable {
// 排课 编号
private String courseTimeId;
private Long courseTimeId;
// 课程
private String courseId;
private Long courseId;
// 校区
private Long deptId;
@ -27,10 +26,10 @@ public class ReqSearchClaTime extends ReqPageBase implements Serializable {
private String userId;
// 班级
private String claId;
private Long claId;
// 学生
private String studentId;
private Long studentId;
private Long teacherId;
@ -59,12 +58,6 @@ public class ReqSearchClaTime extends ReqPageBase implements Serializable {
*/
private String orderByType;
private String tenantId;
public String getTenantId(){
return SecurityUtils.getLoginUser().getNowTenantId();
}
public void setDiffNowDay(Integer diffNowDay) {
this.diffNowDay = diffNowDay;
if(null != diffNowDay) {

@ -1,7 +1,6 @@
package cn.xluobo.business.sc.course.domain.req.time;
import cn.xluobo.core.page.ReqPageBase;
import com.ruoyi.common.utils.SecurityUtils;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
@ -20,11 +19,6 @@ public class ReqSearchScClaTimeRule extends ReqPageBase implements Serializable
private Boolean filterHoliday;
private String beginDate;
private String endDate;
private String tenantId;
public String getTenantId(){
return SecurityUtils.getLoginUser().getNowTenantId();
}
public void setClaDate(String[] claDate) {
this.claDate = claDate;

@ -10,7 +10,7 @@ import lombok.Data;
@Data
public class RespCourseClaInfo {
private String claId;
private Long claId;
private String claName;
@ -24,13 +24,13 @@ public class RespCourseClaInfo {
private String openDate;
private String courseId;
private Long courseId;
private String courseName;
private Long staffId;
private String teacherName;
private String staffName;
private String deptName;

@ -3,8 +3,6 @@ package cn.xluobo.business.sc.course.domain.resp.cla;
import cn.xluobo.business.sc.course.domain.resp.RespBusinessChooseCourseCharge;
import cn.xluobo.business.sc.course.repo.model.ScCourse;
import cn.xluobo.business.sc.course.repo.model.ScCourseCla;
import cn.xluobo.business.sc.course.repo.model.ScCourseClaVo;
import cn.xluobo.business.sc.course.repo.model.ScCourseVo;
import lombok.Builder;
import lombok.Data;
@ -20,10 +18,10 @@ import java.util.List;
public class RespClaAllDetailInfo {
// 班级信息
private ScCourseClaVo courseCla;
private ScCourseCla courseCla;
// 课程信息
private ScCourseVo course;
private ScCourse course;
// 收费方式
private List<RespBusinessChooseCourseCharge> courseChargeList;

@ -12,7 +12,7 @@ import lombok.Data;
@Data
public class RespScCourseDetail extends ReqAddScCourse {
private String courseId;
private Long courseId;
private String courseTypeName;

@ -11,7 +11,7 @@ import lombok.Data;
@Data
public class ClaTimeCalendarItem {
private String courseTimeId;
private Long courseTimeId;
private String claName;
@ -40,7 +40,7 @@ public class ClaTimeCalendarItem {
private String claTimeStatus;
public ClaTimeCalendarItem transfer(RespClaTimeCalendar respClaTime) {
this.courseTimeId = respClaTime.getCourseTimeId()+"";
this.courseTimeId = respClaTime.getCourseTimeId();
this.claName = respClaTime.getClaName();
this.courseName = respClaTime.getCourseName();
this.claDate = respClaTime.getClaDate();

@ -13,13 +13,13 @@ import java.util.Date;
@Data
public class RespClaTime {
private String courseTimeId;
private Long courseTimeId;
private String claId;
private Long claId;
private String claName;
private String courseId;
private Long courseId;
private String courseName;

@ -1,21 +1,15 @@
package cn.xluobo.business.sc.course.domain.resp.time;
import cn.xluobo.business.sc.course.repo.model.ScClaTime;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*
* @author zhangbaoyu
* @date Created in 2020/9/18 14:50
*/
@Data
public class RespClaTimeCalendar {
public class RespClaTimeCalendar extends ScClaTime {
private String claColor;
@ -29,181 +23,4 @@ public class RespClaTimeCalendar {
private Integer studentCount;
/**
*
*/
@TableId(value = "course_time_id", type = IdType.ASSIGN_ID)
private String courseTimeId;
/**
*
*/
@TableField("rule_id")
private String ruleId;
/**
* id
*/
@TableField("cla_id")
private String claId;
/**
*
*/
@TableField("teacher_id")
private Long teacherId;
/**
*
*/
@TableField("room_id")
private String roomId;
/**
*
*/
@TableField("room_name")
private String roomName;
/**
*
*/
@TableField("class_theme")
private String classTheme;
/**
* :2020-02-05
*/
@TableField("cla_date")
private String claDate;
/**
*
*/
@TableField("start_time")
private String startTime;
/**
*
*/
@TableField("end_time")
private String endTime;
/**
*
*/
@TableField("real_cla_date")
private String realClaDate;
/**
*
*/
@TableField("real_start_time")
private String realStartTime;
/**
*
*/
@TableField("real_end_time")
private String realEndTime;
/**
*
*/
@TableField("pay_hour")
private BigDecimal payHour;
/**
*
*/
@TableField("pay_total_hour")
private BigDecimal payTotalHour;
/**
*
*/
@TableField("pay_total_fee")
private BigDecimal payTotalFee;
/**
* 1: 2: 3:
*/
@TableField("source")
private String source;
/**
* 1: 2:
*/
@TableField("status")
private String status;
/**
*
*/
@TableField("book_attend_cnt")
private Integer bookAttendCnt;
/**
*
*/
@TableField("real_attend_cnt")
private Integer realAttendCnt;
/**
*
*/
@TableField("at_class_cnt")
private Integer atClassCnt;
/**
*
*/
// @TableField("leave_cnt")
// private Integer leaveCnt;
/**
*
*/
@TableField("out_cnt")
private Integer outCnt;
/**
*
*/
@TableField("memo")
private String memo;
/**
*
*/
@TableField("create_user")
private Long createUser;
/**
*
*/
@TableField("create_time")
private Date createTime;
/**
*
*/
@TableField("last_update_user")
private Long lastUpdateUser;
/**
*
*/
@TableField("last_update_time")
private Date lastUpdateTime;
@TableField(exist = false)
private Long deptId;
@TableField(exist = false)
private String courseName;
@TableField(exist = false)
private String claName;
@TableField(exist = false)
private String deptName;
}

@ -1,16 +1,11 @@
package cn.xluobo.business.sc.course.domain.resp.time;
import cn.xluobo.business.sc.course.repo.model.ScClaTimeRule;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
*
* @author zhangbaoyu
@ -20,7 +15,7 @@ import java.util.Date;
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RespClaTimeRule {
public class RespClaTimeRule extends ScClaTimeRule {
private String courseName;
private String claName;
@ -31,130 +26,4 @@ public class RespClaTimeRule {
private String weekDayName;
/**
* id
*/
@TableId(value = "rule_id", type = IdType.ASSIGN_ID)
private String ruleId;
/**
*
*/
@TableField("cla_id")
private String claId;
/**
* 1 2
*/
@TableField("rule_type")
private String ruleType;
/**
*
*/
@TableField("begin_date")
private String beginDate;
/**
*
*/
@TableField("end_date")
private String endDate;
/**
*
*/
@TableField("once_date")
private String onceDate;
/**
* 1 2 3
*/
@TableField("repeat_type")
private String repeatType;
/**
*
*/
@TableField("week_day")
private String weekDay;
/**
* 1 0
*/
@TableField("filter_holiday")
private boolean filterHoliday;
/**
*
*/
@TableField("start_time")
private String startTime;
/**
*
*/
@TableField("end_time")
private String endTime;
/**
*
*/
@TableField("teacher_id")
private Long teacherId;
/**
*
*/
@TableField("room_id")
private String roomId;
/**
*
*/
@TableField("room_name")
private String roomName;
/**
*
*/
@TableField("class_theme")
private String classTheme;
/**
*
*/
@TableField("create_user")
private Long createUser;
/**
*
*/
@TableField("create_time")
private Date createTime;
/**
*
*/
@TableField("last_update_user")
private Long lastUpdateUser;
/**
*
*/
@TableField("last_update_time")
private Date lastUpdateTime;
/**
*
*/
@TableField(exist = false)
private String[] chooseDate;
/**
*
*/
@TableField(exist = false)
private Long deptId;
}

@ -68,7 +68,7 @@
left join sc_course course on cc.course_id=course.course_id,
sc_cla_time ct
left join sys_staff s on ct.teacher_id=s.staff_id
where cc.cla_id = ct.cla_id and cc.tenant_id=#{searchClaTime.tenantId}
where cc.cla_id = ct.cla_id
<if test="searchClaTime.beginDate != null and searchClaTime.beginDate != '' and searchClaTime.endDate != null and searchClaTime.endDate != ''">
and ct.cla_date between #{searchClaTime.beginDate} and #{searchClaTime.endDate}
</if>

@ -4,9 +4,9 @@
<select id="selectByCondition" resultType="cn.xluobo.business.sc.course.domain.resp.time.RespClaTimeRule">
select b.*,fcn_dict_name_list(b.week_day,'week_day') as week_day_name,
a.cla_name,c.course_name,d.nick_name staff_name
from sc_course_cla a, sc_cla_time_rule b, sc_course c, sys_user d
where a.cla_id = b.cla_id and a.course_id=c.course_id and b.teacher_id=d.user_id and a.tenant_id=#{reqSearchScClaTimeRule.tenantId}
a.cla_name,c.course_name,d.staff_name
from sc_course_cla a, sc_cla_time_rule b, sc_course c, sys_staff d
where a.cla_id = b.cla_id and a.course_id=c.course_id and b.teacher_id=d.staff_id
<if test="reqSearchScClaTimeRule.deptId != null">
and a.depart_id=#{reqSearchScClaTimeRule.deptId}
</if>

@ -8,7 +8,7 @@
(select count(1) from sc_student_course sc where sc.cla_id=a.cla_id and sc.status='1') as student_cnt,
a.capacity,a.recruit_status,a.open_date,
b.course_id,b.course_name,
a.staff_id,a.teacher_name,
c.staff_id,c.staff_name,
sd.dept_name,
(select group_concat(fcn_dict_name_list(r.week_day,'week_day'),' ',substr(r.start_time,1,5),'~',substr(r.end_time,1,5),' (',r.begin_date,'~',r.end_date,')' SEPARATOR ';')
from sc_cla_time_rule r
@ -18,8 +18,9 @@
and (date_format(now(),'%Y-%m-%d') between r.begin_date and r.end_date or date_format(now(),'%Y-%m-%d') <![CDATA[ < ]]> r.begin_date)) as week_day
from sc_course_cla a
left join sc_course b on a.course_id=b.course_id
left join sys_staff c on a.staff_id=c.staff_id
left join sys_dept sd on a.depart_id=sd.dept_id
where a.delete_flag='0' and a.tenant_id=#{reqSearchScCourseCla.tenantId}
where a.delete_flag='0'
<if test="reqSearchScCourseCla.courseId != null">
and a.course_id=#{reqSearchScCourseCla.courseId}
</if>
@ -43,7 +44,6 @@
and a.delete_flag='0'
order by a.create_time desc
</select>
<select id="selectForSelect" resultType="cn.xluobo.business.sc.course.domain.resp.RespCourseClaSelectInfo">
select a.cla_id,a.cla_name,b.course_id,b.course_name,c.staff_name,
dept.dept_id,

@ -14,7 +14,7 @@
a.course_intro
from sc_course a
left join sc_course_type b on a.course_type_id = b.course_type_id and b.in_use='1'
where a.delete_flag='0' and a.tenant_id=#{reqSearchScCourse.tenantId}
where a.delete_flag='0'
<if test="reqSearchScCourse.courseName != null and reqSearchScCourse.courseName != ''">
and a.course_name like concat('%',#{reqSearchScCourse.courseName} ,'%')
</if>

@ -175,10 +175,15 @@ public class ScClaTimeRule implements Serializable {
}
if (ClaTimeRepeatTypeEnums.EVERY_WEEK.getRepeatType().equals(repeatType)
|| ClaTimeRepeatTypeEnums.EVERY_SECOND_WEEK.getRepeatType().equals(repeatType)) {
return !StringUtils.isAnyEmpty(startTime, endTime, beginDate, endDate);
if (StringUtils.isAnyEmpty(weekDay, startTime, endTime, beginDate, endDate)) {
return false;
}
} else {
return !StringUtils.isAnyEmpty(startTime, endTime);
if (StringUtils.isAnyEmpty(startTime, endTime)) {
return false;
}
}
return true;
}

@ -1,185 +0,0 @@
package cn.xluobo.business.sc.course.repo.model;
import cn.xluobo.business.sc.course.repo.enums.ClaTimeRepeatTypeEnums;
import cn.xluobo.business.sc.course.repo.enums.ClaTimeRuleTypeEnums;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author zhangby
* @since 2020-09-14
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sc_cla_time_rule")
public class ScClaTimeRuleVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "rule_id", type = IdType.ASSIGN_ID)
private String ruleId;
/**
*
*/
@TableField("cla_id")
private String claId;
/**
* 1 2
*/
@TableField("rule_type")
private String ruleType;
/**
*
*/
@TableField("begin_date")
private String beginDate;
/**
*
*/
@TableField("end_date")
private String endDate;
/**
*
*/
@TableField("once_date")
private String onceDate;
/**
* 1 2 3
*/
@TableField("repeat_type")
private String repeatType;
/**
*
*/
@TableField("week_day")
private String weekDay;
/**
* 1 0
*/
@TableField("filter_holiday")
private boolean filterHoliday;
/**
*
*/
@TableField("start_time")
private String startTime;
/**
*
*/
@TableField("end_time")
private String endTime;
/**
*
*/
@TableField("teacher_id")
private Long teacherId;
/**
*
*/
@TableField("room_id")
private String roomId;
/**
*
*/
@TableField("room_name")
private String roomName;
/**
*
*/
@TableField("class_theme")
private String classTheme;
/**
*
*/
@TableField("create_user")
private Long createUser;
/**
*
*/
@TableField("create_time")
private Date createTime;
/**
*
*/
@TableField("last_update_user")
private Long lastUpdateUser;
/**
*
*/
@TableField("last_update_time")
private Date lastUpdateTime;
/**
*
*/
@TableField(exist = false)
private String[] chooseDate;
/**
*
*/
@TableField(exist = false)
private Long deptId;
public boolean checkParam() {
if (null == claId || null == teacherId) {
return false;
}
if (StringUtils.isAnyEmpty(ruleType)) {
return false;
}
if (ClaTimeRuleTypeEnums.ONCE_RULE.getRuleType().equals(ruleType)) {
if (StringUtils.isAnyEmpty(startTime, endTime)) {
return false;
} else if (null == chooseDate || chooseDate.length == 0) {
return false;
}
}
if ("1".equals(ruleType) && StringUtils.isAnyEmpty(repeatType)) {
return false;
}
if (ClaTimeRepeatTypeEnums.EVERY_WEEK.getRepeatType().equals(repeatType)
|| ClaTimeRepeatTypeEnums.EVERY_SECOND_WEEK.getRepeatType().equals(repeatType)) {
return !StringUtils.isAnyEmpty(startTime, endTime, beginDate, endDate);
} else {
return !StringUtils.isAnyEmpty(startTime, endTime);
}
}
}

@ -1,231 +0,0 @@
package cn.xluobo.business.sc.course.repo.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author zhangby
* @since 2020-09-16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sc_cla_time")
public class ScClaTimeVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "course_time_id", type = IdType.ASSIGN_ID)
private String courseTimeId;
/**
*
*/
@TableField("rule_id")
private String ruleId;
/**
* id
*/
@TableField("cla_id")
private String claId;
/**
*
*/
@TableField("teacher_id")
private Long teacherId;
/**
*
*/
@TableField("room_id")
private String roomId;
/**
*
*/
@TableField("room_name")
private String roomName;
/**
*
*/
@TableField("class_theme")
private String classTheme;
/**
* :2020-02-05
*/
@TableField("cla_date")
private String claDate;
/**
*
*/
@TableField("start_time")
private String startTime;
/**
*
*/
@TableField("end_time")
private String endTime;
/**
*
*/
@TableField("real_cla_date")
private String realClaDate;
/**
*
*/
@TableField("real_start_time")
private String realStartTime;
/**
*
*/
@TableField("real_end_time")
private String realEndTime;
/**
*
*/
@TableField("pay_hour")
private BigDecimal payHour;
/**
*
*/
@TableField("pay_total_hour")
private BigDecimal payTotalHour;
/**
*
*/
@TableField("pay_total_fee")
private BigDecimal payTotalFee;
/**
* 1: 2: 3:
*/
@TableField("source")
private String source;
/**
* 1: 2:
*/
@TableField("status")
private String status;
/**
*
*/
@TableField("book_attend_cnt")
private Integer bookAttendCnt;
/**
*
*/
@TableField("real_attend_cnt")
private Integer realAttendCnt;
/**
*
*/
@TableField("at_class_cnt")
private Integer atClassCnt;
/**
*
*/
// @TableField("leave_cnt")
// private Integer leaveCnt;
/**
*
*/
@TableField("out_cnt")
private Integer outCnt;
/**
*
*/
@TableField("memo")
private String memo;
/**
*
*/
@TableField("create_user")
private Long createUser;
/**
*
*/
@TableField("create_time")
private Date createTime;
/**
*
*/
@TableField("last_update_user")
private Long lastUpdateUser;
/**
*
*/
@TableField("last_update_time")
private Date lastUpdateTime;
@TableField(exist = false)
private Long deptId;
@TableField(exist = false)
private String courseName;
@TableField(exist = false)
private String claName;
@TableField(exist = false)
private String deptName;
public boolean checkUpdateParam() {
if (StringUtils.isAnyEmpty(claDate, startTime, endTime)) {
return false;
}
if (null == teacherId) {
return false;
}
return true;
}
public boolean checkAddParam() {
if(null == claId || null == teacherId) {
return false;
}
if (StringUtils.isAnyEmpty(claDate, startTime, endTime)) {
return false;
}
return true;
}
}

@ -4,7 +4,6 @@ import cn.xluobo.core.api.APIBaseResponse;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.utils.SecurityUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@ -147,16 +146,13 @@ public class ScCourseCla implements Serializable {
@TableField(exist = false)
private String deptName;
@TableField(exist = false)
private String teacherName;
// 当前班级人数
@TableField(exist = false)
private Integer studentCnt;
public String getTenantId(){
return SecurityUtils.getLoginUser().getNowTenantId();
}
/**
*
* @return

@ -1,175 +0,0 @@
package cn.xluobo.business.sc.course.repo.model;
import cn.xluobo.core.api.APIBaseResponse;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.utils.SecurityUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author zhangby
* @since 2020-08-07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sc_course_cla")
public class ScCourseClaVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "cla_id")
private String claId;
/**
*
*/
@TableField("tenant_id")
private String tenantId;
/**
* id
*/
@TableField("course_id")
private String courseId;
/**
*
*/
@TableField("depart_id")
private Long departId;
/**
* id
*/
@TableField("staff_id")
private Long staffId;
/**
*
*/
@TableField("cla_name")
private String claName;
/**
*
*/
@TableField("cla_color")
private String claColor;
/**
*
*/
@TableField("capacity")
private Integer capacity;
/**
* 1 2 0
*/
@TableField("recruit_status")
private String recruitStatus;
/**
*
*/
@TableField("every_stu_lose_hour")
private BigDecimal everyStuLoseHour;
/**
*
*/
@TableField("every_tea_get_hour")
private BigDecimal everyTeaGetHour;
/**
*
*/
@TableField("open_date")
private String openDate;
/**
*
*/
@TableField("close_date")
private String closeDate;
/**
*
*/
@TableField("memo")
private String memo;
/**
* 1 0
*/
@TableField("delete_flag")
private String deleteFlag;
/**
*
*/
@TableField("create_user")
private Long createUser;
/**
*
*/
@TableField("create_time")
private Date createTime;
/**
*
*/
@TableField("last_update_user")
private Long lastUpdateUser;
/**
*
*/
@TableField("last_update_time")
private Date lastUpdateTime;
@TableField(exist = false)
private String deptName;
@TableField(exist = false)
private String teacherName;
// 当前班级人数
@TableField(exist = false)
private Integer studentCnt;
public String getTenantId(){
return SecurityUtils.getLoginUser().getNowTenantId();
}
/**
*
* @return
*/
public APIBaseResponse checkParam(){
if(StringUtils.isAnyEmpty(claName,claColor,recruitStatus,openDate)){
return APIBaseResponse.fail("请求参数错误,请全部填写后,重新提交");
}
if(null == courseId || null == departId || null == staffId || null == capacity || null == everyStuLoseHour || null == everyTeaGetHour){
return APIBaseResponse.fail("请求参数错误,请全部填写后,重新提交");
}
return APIBaseResponse.success();
}
}

@ -1,111 +0,0 @@
package cn.xluobo.business.sc.course.repo.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author zhangby
* @since 2020-03-17 11:25:55
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sc_course")
public class ScCourseVo implements Serializable {
/**
* id
*/
@TableId(value = "course_id")
private String courseId;
/**
*
*/
@TableField("tenant_id")
private String tenantId;
/**
*
*/
@TableField("course_name")
private String courseName;
/**
*
*/
@TableField("course_type_id")
private String courseTypeId;
/**
* 1 2
*/
@TableField("teaching_mode")
private String teachingMode;
/**
*
*/
@TableField("course_intro")
private String courseIntro;
/**
* 1 0
*/
@TableField("sale")
private String sale;
/**
* 1 0
*/
@TableField("delete_flag")
@TableLogic
private String deleteFlag;
/**
*
*/
@TableField("create_user")
private String createUser;
/**
*
*/
@TableField("create_time")
private Date createTime;
/**
*
*/
@TableField("last_update_user")
@JsonIgnore
private Long lastUpdateUser;
/**
*
*/
@TableField("last_update_time")
@JsonIgnore
private Date lastUpdateTime;
/**
* id
*/
@TableField(value = "import_id")
@JsonIgnore
private Long importId;
}

@ -1,6 +1,5 @@
package cn.xluobo.business.sc.course.service;
import cn.hutool.core.bean.BeanUtil;
import cn.xluobo.business.sc.base.repo.model.ScRoom;
import cn.xluobo.business.sc.base.service.IScRoomService;
import cn.xluobo.business.sc.course.domain.req.time.ReqSearchScClaTimeRule;
@ -8,7 +7,6 @@ import cn.xluobo.business.sc.course.domain.resp.time.RespClaTimeRule;
import cn.xluobo.business.sc.course.repo.mapper.ScClaTimeRuleMapper;
import cn.xluobo.business.sc.course.repo.model.ScClaTime;
import cn.xluobo.business.sc.course.repo.model.ScClaTimeRule;
import cn.xluobo.business.sc.course.repo.model.ScClaTimeRuleVo;
import cn.xluobo.business.sc.course.repo.model.ScCourseCla;
import cn.xluobo.core.api.APIResponse;
import cn.xluobo.core.api.ApiResEnums;
@ -90,15 +88,12 @@ public class BusinessClaTimeRuleService {
return APIResponse.toAPIResponse(null);
}
ScClaTimeRule claTimeRule = claTimeRuleService.getById(ruleId);
ScClaTimeRuleVo scClaTimeRuleVo = new ScClaTimeRuleVo();
BeanUtil.copyProperties(claTimeRule,scClaTimeRuleVo);
// 设置deptId
Long claId = claTimeRule.getClaId();
ScCourseCla courseCla = courseClaService.getById(claId);
claTimeRule.setDeptId(courseCla.getDepartId());
scClaTimeRuleVo.setDeptId(courseCla.getDepartId());
return APIResponse.toAPIResponse(scClaTimeRuleVo);
return APIResponse.toAPIResponse(claTimeRule);
}

@ -1,13 +1,15 @@
package cn.xluobo.business.sc.course.service;
import cn.hutool.core.bean.BeanUtil;
import cn.xluobo.business.sc.base.repo.model.ScRoom;
import cn.xluobo.business.sc.base.service.IScRoomService;
import cn.xluobo.business.sc.course.domain.req.time.ReqSearchClaTime;
import cn.xluobo.business.sc.course.domain.resp.time.*;
import cn.xluobo.business.sc.course.repo.enums.ClaTimeStatusEnums;
import cn.xluobo.business.sc.course.repo.mapper.ScClaTimeMapper;
import cn.xluobo.business.sc.course.repo.model.*;
import cn.xluobo.business.sc.course.repo.model.ScClaTime;
import cn.xluobo.business.sc.course.repo.model.ScClaTimeAttend;
import cn.xluobo.business.sc.course.repo.model.ScCourse;
import cn.xluobo.business.sc.course.repo.model.ScCourseCla;
import cn.xluobo.business.sc.student.domain.req.ReqClaTimeAttend;
import cn.xluobo.business.sc.student.service.BusinessScStudentCourseService;
import cn.xluobo.business.sc.student.service.IScStudentCourseService;
@ -243,10 +245,7 @@ public class BusinessClaTimeService {
}
}
ScClaTimeVo scClaTimeVo = new ScClaTimeVo();
BeanUtil.copyProperties(claTime,scClaTimeVo);
return APIResponse.toAPIResponse(scClaTimeVo);
return APIResponse.toAPIResponse(claTime);
}
/**
@ -255,7 +254,7 @@ public class BusinessClaTimeService {
* @param claTime
* @return
*/
public APIResponse updateClaTime(ScClaTimeVo claTime) {
public APIResponse updateClaTime(ScClaTime claTime) {
if (null == claTime.getCourseTimeId()) {
return APIResponse.toExceptionResponse(ApiResEnums.PARAM_FAIL);
}

@ -1,13 +1,14 @@
package cn.xluobo.business.sc.course.service;
import cn.hutool.core.bean.BeanUtil;
import cn.xluobo.business.sc.course.domain.req.ReqAddScCourseCla;
import cn.xluobo.business.sc.course.domain.req.ReqSearchScCourseCla;
import cn.xluobo.business.sc.course.domain.resp.RespBusinessChooseCourseCharge;
import cn.xluobo.business.sc.course.domain.resp.RespCourseClaInfo;
import cn.xluobo.business.sc.course.domain.resp.cla.RespClaAllDetailInfo;
import cn.xluobo.business.sc.course.repo.mapper.ScCourseClaMapper;
import cn.xluobo.business.sc.course.repo.model.*;
import cn.xluobo.business.sc.course.repo.model.ScClaTime;
import cn.xluobo.business.sc.course.repo.model.ScCourse;
import cn.xluobo.business.sc.course.repo.model.ScCourseCla;
import cn.xluobo.business.sc.student.repo.mapper.ScStudentMapper;
import cn.xluobo.business.sc.student.repo.model.ScStudentCourse;
import cn.xluobo.business.sc.student.service.IScStudentCourseService;
@ -22,10 +23,8 @@ import cn.xluobo.core.page.RespPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -66,9 +65,6 @@ public class BusinessScCourseClaService {
@Autowired
private IScClaTimeService claTimeService;
@Autowired
private ISysUserService userService;
/**
*
*
@ -77,8 +73,6 @@ public class BusinessScCourseClaService {
*/
public APIResponse searchList(ReqSearchScCourseCla reqSearchScCourseCla) {
RespPage<RespCourseClaInfo> page = new RespPage(reqSearchScCourseCla.getPageNum(), reqSearchScCourseCla.getPageSize());
String nowTenantId = SecurityUtils.getLoginUser().getNowTenantId();
reqSearchScCourseCla.setTenantId(nowTenantId);
List<RespCourseClaInfo> claList = scCourseClaMapper.selectClaList(reqSearchScCourseCla, page);
page.setRows(claList);
return APIResponse.toAPIResponse(page);
@ -97,28 +91,17 @@ public class BusinessScCourseClaService {
Map<String, Object> resultMap = Maps.newHashMap();
// 班级信息
ScCourseCla detailInfo = scCourseClaService.getById(claId);
if (null == detailInfo) {
return APIResponse.toAPIResponse(null);
}
ScCourseClaVo scCourseCla = new ScCourseClaVo();
BeanUtil.copyProperties(detailInfo,scCourseCla);
scCourseCla.setClaId(detailInfo.getClaId().toString());
scCourseCla.setCourseId(detailInfo.getCourseId().toString());
// 课程信息
ScCourse scCourse = courseService.getById(detailInfo.getCourseId());
ScCourseVo scCourseVo = new ScCourseVo();
BeanUtil.copyProperties(scCourse,scCourseVo);
scCourseVo.setCourseId(scCourse.getCourseId().toString());
// 是否允许变更课程,有报名不允许变更课程
APIBaseResponse canChangeCourse = scCourseClaService.canChangeCourse(claId);
resultMap.put("canChangeCourse", canChangeCourse.isSuccess());
resultMap.put("claInfo", scCourseCla);
resultMap.put("claCourseInfo", scCourseVo);
resultMap.put("claInfo", detailInfo);
resultMap.put("claCourseInfo", scCourse);
return APIResponse.toAPIResponse(resultMap);
}
@ -135,25 +118,17 @@ public class BusinessScCourseClaService {
}
// 班级信息
ScCourseCla courseCla = scCourseClaService.getById(claId);
if (null == courseCla) {
return null;
}
ScCourseClaVo scCourseClaVo = new ScCourseClaVo();
BeanUtil.copyProperties(courseCla,scCourseClaVo);
scCourseClaVo.setClaId(courseCla.getClaId().toString());
// 班级当前学员数量
Integer studentCnt = scCourseClaService.selectStudentCnt(claId);
scCourseClaVo.setStudentCnt(studentCnt);
courseCla.setStudentCnt(studentCnt);
// 课程信息
ScCourse scCourse = courseService.getById(courseCla.getCourseId());
ScCourseVo scCourseVo = new ScCourseVo();
BeanUtil.copyProperties(scCourse,scCourseVo);
scCourseVo.setCourseId(scCourse.getCourseId().toString());
// 课程收费信息
List<RespBusinessChooseCourseCharge> courseChargeList = courseChargeService.courseChargeList(scCourse.getCourseId(), null);
@ -166,16 +141,16 @@ public class BusinessScCourseClaService {
// 教师
if (null != courseCla.getStaffId()) {
SysUser staff = userService.selectUserById(courseCla.getStaffId());
courseCla.setTeacherName(staff.getNickName());
SysStaff staff = teacherService.getById(courseCla.getStaffId());
courseCla.setTeacherName(staff.getStaffName());
}
// 上课时间
List<String> claTimeInfo = claTimeRuleService.selectClaTimeInfo(claId);
return RespClaAllDetailInfo.builder()
.courseCla(scCourseClaVo)
.course(scCourseVo)
.courseCla(courseCla)
.course(scCourse)
.courseChargeList(courseChargeList)
.claTimeList(claTimeInfo)
.build();
@ -198,14 +173,13 @@ public class BusinessScCourseClaService {
}
// 教师是否存在
SysUser teacher = userService.selectUserById(scCourseCla.getStaffId());
SysStaff teacher = teacherService.getById(scCourseCla.getStaffId());
if (null == teacher) {
return APIResponse.toExceptionResponse("教师不存在,请重新选择后提交。");
}
// 新建班级
ScCourseCla cla = scCourseCla.getScCourseCla(loginUser);
cla.setTeacherName(teacher.getNickName());
APIBaseResponse checkParam = cla.checkParam();
if (!checkParam.isSuccess()) {
return APIResponse.toExceptionResponse(checkParam.getRespMsg());
@ -239,7 +213,7 @@ public class BusinessScCourseClaService {
}
// 教师是否存在
SysUser teacher = userService.selectUserById(scCourseCla.getStaffId());
SysStaff teacher = teacherService.getById(scCourseCla.getStaffId());
if (null == teacher) {
return APIResponse.toExceptionResponse("教师不存在,请重新选择后提交。");
}
@ -253,7 +227,6 @@ public class BusinessScCourseClaService {
}
LoginUser loginUser = SecurityUtils.getLoginUser();
scCourseCla.setTeacherName(teacher.getNickName());
scCourseCla.setLastUpdateUser(loginUser.getUserId());
scCourseCla.setLastUpdateTime(new Date());
boolean updateScCourseCla = scCourseClaService.updateById(scCourseCla);

@ -133,7 +133,7 @@ public class BusinessScCourseService {
RespScCourseDetail respScCourseDetail = new RespScCourseDetail();
respScCourseDetail.setCourseId(detailInfo.getCourseId()+"");
respScCourseDetail.setCourseId(detailInfo.getCourseId());
respScCourseDetail.setCourseName(detailInfo.getCourseName());
respScCourseDetail.setCourseTypeId(detailInfo.getCourseTypeId());
respScCourseDetail.setTeachingMode(detailInfo.getTeachingMode());
@ -174,7 +174,7 @@ public class BusinessScCourseService {
partCampusList.add(departId.toString());
}
String chargeType = courseCharge.getChargeType();
chargeItem.setChargeId(courseCharge.getChargeId()+"");
chargeItem.setChargeId(courseCharge.getChargeId());
chargeItem.setCampusId(courseCharge.getDepartId());
chargeItem.setCampusName(campusMap.get(courseCharge.getDepartId()));
if ("hour".equals(chargeType)) {
@ -238,7 +238,6 @@ public class BusinessScCourseService {
scCourse.setCourseIntro(reqAddScCourse.getCourseIntro());
scCourse.setCreateUser(loginUser.getUserId());
scCourse.setLastUpdateUser(loginUser.getUserId());
scCourse.setTenantId(loginUser.getNowTenantId());
boolean addScCourse = scCourseService.save(scCourse);
// course_charge保存
@ -311,9 +310,6 @@ public class BusinessScCourseService {
updateCourse.setCourseIntro(reqChangeScCourse.getCourseIntro());
updateCourse.setLastUpdateUser(loginUser.getUserId());
updateCourse.setLastUpdateTime(new Date());
updateCourse.setTenantId(loginUser.getNowTenantId());
updateCourse.setSale("1");
updateCourse.setImportId(-1L);
boolean updateScCourse = scCourseService.updateById(updateCourse);
// course_charge 删除

@ -21,7 +21,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -86,7 +85,7 @@ public class ScClaTimeRuleServiceImpl extends ServiceImpl<ScClaTimeRuleMapper, S
// 节假日缓存
if (null == holidayMap) {
holidayMap = new HashMap<>();
holidayMap = holidayService.getHolidayMap();
}
@ -240,6 +239,18 @@ public class ScClaTimeRuleServiceImpl extends ServiceImpl<ScClaTimeRuleMapper, S
return resultClaTimeList;
}
@Override
public List<RespClaTimeRule> getClaTimeListByRule(ScClaTimeRule claTimeRule, Map<String, String> holidayMap) {
RespClaTimeRule respClaTime = RespClaTimeRule.builder()
.claTimeBegin(claTimeRule.getStartTime())
.claTimeEnd(claTimeRule.getEndTime())
.build();
BeanUtils.copyProperties(claTimeRule, respClaTime);
return this.getClaTimeListByRule(respClaTime, holidayMap);
}
@Override
public List<String> checkDayRepeat(Long claId, String[] day, Long notEqRuleId) {
if (null == claId || null == day || day.length == 0) {
@ -258,18 +269,6 @@ public class ScClaTimeRuleServiceImpl extends ServiceImpl<ScClaTimeRuleMapper, S
return list.stream().map(ScClaTime::getClaDate).collect(Collectors.toList());
}
@Override
public List<RespClaTimeRule> getClaTimeListByRule(ScClaTimeRule claTimeRule, Map<String, String> holidayMap) {
RespClaTimeRule respClaTime = RespClaTimeRule.builder()
.claTimeBegin(claTimeRule.getStartTime())
.claTimeEnd(claTimeRule.getEndTime())
.build();
BeanUtils.copyProperties(claTimeRule, respClaTime);
return this.getClaTimeListByRule(respClaTime, holidayMap);
}
@Override
public List<String> checkDayRepeat(ScClaTimeRule claTimeRule) {
Long claId = claTimeRule.getClaId();

@ -24,12 +24,14 @@ import java.util.List;
@Service
public class ScCourseServiceImpl extends ServiceImpl<ScCourseMapper, ScCourse> implements IScCourseService {
@Autowired
private ScCourseMapper courseMapper;
@Autowired
private ScCourseChargeMapper courseChargeMapper;
@Override
public RespPage<RespSearchCourse> searchCourse(ReqSearchScCourse reqSearchScCourse) {
RespPage<RespSearchCourse> respPage = new RespPage<>(reqSearchScCourse.getPageNum(),reqSearchScCourse.getPageSize());
RespPage respPage = new RespPage(reqSearchScCourse.getPageNum(),reqSearchScCourse.getPageSize());
List<RespSearchCourse> courseList = baseMapper.selectCourseList(reqSearchScCourse, respPage);
respPage.setRows(courseList);
return respPage;

@ -1,7 +1,6 @@
package cn.xluobo.business.sc.student.domain.req;
import cn.xluobo.core.page.ReqPageBase;
import com.ruoyi.common.utils.SecurityUtils;
import lombok.Data;
import java.io.Serializable;
@ -20,8 +19,4 @@ public class ReqSearchScStudent extends ReqPageBase implements Serializable {
private String sex;
private String phone;
public String getTenantId(){
return SecurityUtils.getLoginUser().getNowTenantId();
}
}

@ -16,7 +16,7 @@ import java.math.BigDecimal;
@Data
public class RespStudentCourse {
private String studentCourseId;
private Long studentCourseId;
private String courseName;

@ -7,7 +7,7 @@
b.school_name,
(select group_concat(sc.contact_nick,'(',fcn_dict_name(sc.contact_relation,'contact_relation'),') ',sc.contact_phone separator ';') from sc_student_contact sc where sc.student_id=a.student_id) as contact_info
from sc_student a left join sc_school b on a.school_id=b.school_id
where a.delete_flag='0' and a.tenant_id=#{reqSearchScStudent.tenantId}
where a.delete_flag='0'
<if test="reqSearchScStudent.schoolId != null and reqSearchScStudent.schoolId != ''">
and a.school_id = #{reqSearchScStudent.schoolId}
</if>

@ -5,9 +5,6 @@ import cn.xluobo.business.sys.staff.domain.req.ReqBusinessAddStaff;
import cn.xluobo.business.sys.staff.domain.req.ReqSearchStaff;
import cn.xluobo.business.sys.staff.service.BusinessSysStaffService;
import cn.xluobo.core.api.APIResponse;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -27,9 +24,6 @@ public class SysStaffController {
@Autowired
private BusinessSysStaffService sysStaffService;
@Autowired
private ISysUserService userService;
/**
*
*
@ -47,11 +41,8 @@ public class SysStaffController {
* @return
*/
@GetMapping("/list/teacherSelect")
public AjaxResult teacherSelect(ReqSelect reqSelect) {
SysUser sysUser = new SysUser();
sysUser.setTeacher(1);
List<SysUser> sysUsers = userService.selectUserList(sysUser);
return AjaxResult.success(sysUsers);
public APIResponse teacherSelect(ReqSelect reqSelect) {
return sysStaffService.teacherSelect(reqSelect);
}
/**

Loading…
Cancel
Save