2023年6月9日 新增任教课程模块

This commit is contained in:
bai 2023-06-09 02:11:20 +08:00
parent 72874cbac1
commit 63bb3a1a79
7 changed files with 537 additions and 10 deletions

View File

@ -15,7 +15,6 @@ import org.jeecg.modules.kc.ktgl.service.IKcKetangbiaoService;
import org.jeecg.modules.kc.qa.service.IKcEvaluationService;
import org.jeecg.modules.kc.qa.service.IKcEvaluationsService;
import org.jeecg.modules.quartz.entity.QuartzJob;
import org.jeecg.modules.quartz.mapper.QuartzJobMapper;
import org.jeecg.modules.quartz.service.IQuartzJobService;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -5,9 +5,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.kc.grab.exports.entity.TFwdtBkjxtkpj;
import org.jeecg.modules.kc.grab.exports.mapper.TFwdtBkjxtkpjMapper;
import org.jeecg.modules.kc.grab.exports.service.ITFwdtBkjxtkpjService;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbkjxtkpj;
import org.jeecg.modules.kc.grab.imports.mapper.XxhbbkjxtkpjMapper;
import org.jeecg.modules.kc.grab.imports.service.IXxhbbkjxtkpjService;
import org.springframework.stereotype.Service;
/**

View File

@ -1,6 +1,7 @@
package org.jeecg.modules.kc.ktgl.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -10,6 +11,9 @@ import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.CommonAPI;
@ -425,5 +429,168 @@ public class KcKetangbiaoController extends JeecgController<KcKetangbiao, IKcKet
// ------------------------------yangjun------------------------------
//按照时间取得即将上课的节次条件大于课前15分钟小于上课开始时间
//统计用
public String getJieciBytimejjsk(String time) {
int $time = Integer.parseInt(time);
String $str;
if ($time <= 800 && $time >= 745) {
$str = "kt.hh in ('01、02','01','02')";
} else if ($time <= 1000 && $time >= 945) {
$str = "kt.hh in ('03、04','03','04')";
} else if ($time <= 1330 && $time >= 1315) {
$str = "kt.hh in ('05、06','05','06')";
} else if ($time <= 1530 && $time >= 1515) {
$str = "kt.hh in ('07、08','07','08')";
} else if ($time <= 1730 && $time >= 1715) {
$str = "kt.hh in ('09、10','09','10')";
} else if ($time <= 1930 && $time >= 1915) {
$str = "kt.hh in ('11、12','11','12')";
} else {
$str = "1<>1 ";
}
return $str;
}
//按照时间取得正在上课信息节次条件大于上课开始时间小于课程结束时间
//统计用
public String getJieciBytimezzsk(String time) {
int $time = Integer.parseInt(time);
String $str;
if ($time <= 930 && $time >= 800) {
$str = "kt.hh in ('01、02','01','02')";
} else if ($time <= 1130 && $time >= 1000) {
$str = "kt.hh in ('03、04','03','04')";
} else if ($time <= 1500 && $time >= 1330) {
$str = "kt.hh in ('05、06','05','06')";
} else if ($time <= 1700 && $time >= 1530) {
$str = "kt.hh in ('07、08','07','08')";
} else if ($time <= 1900 && $time >= 1730) {
$str = "kt.hh in ('09、10','09','10')";
} else if ($time <= 2100 && $time >= 1930) {
$str = "kt.hh in ('11、12','11','12')";
} else {
$str = "1<>1 ";
}
return $str;
}
//按照时间取得正在上课节次条件大于课前30分钟小于课程结束时间
public String getJieciBytime(String time) {
int $time = Integer.parseInt(time);
String $str;
if ($time <= 930 && $time >= 730) {
$str = "kt.hh in ('01、02','01','02')";
} else if ($time <= 1130 && $time >= 930) {
$str = "kt.hh in ('03、04','03','04')";
} else if ($time <= 1500 && $time >= 1300) {
$str = "kt.hh in ('05、06','05','06')";
} else if ($time <= 1700 && $time >= 1500) {
$str = "kt.hh in ('07、08','07','08')";
} else if ($time <= 1900 && $time >= 1700) {
$str = "kt.hh in ('09、10','09','20')";
} else if ($time <= 2100 && $time >= 1900) {
$str = "kt.hh in ('11、12','11','12')";
} else {
$str = "1<>1 ";
}
return $str;
}
//按照时间取得下一节课节次大于上课开始30分钟小于上课结束时间30分钟
public String getNextJieciBytime(String time) {
int $time = Integer.parseInt(time);
String $str;
//根据时间获得下一课节次
if ($time <= 730 && $time >= 0) {
$str = "kt.hh in ('01、02','01')";
} else if ($time <= 900 && $time >= 730) {
$str = "kt.hh in ('03、04','03')";
} else if ($time <= 1300 && $time >= 900) {
$str = "kt.hh in ('05、06','05')";
} else if ($time <= 1500 && $time >= 1300) {
$str = "kt.hh in ('07、08','07')";
} else if ($time <= 1700 && $time >= 1500) {
$str = "kt.hh in ('09、10','09')";
} else if ($time <= 1830 && $time > 1700) {
$str = "kt.hh in ('11、12','11')";
} else if ($time > 1900) {
$str = "kt.hh in ('01、02','01')";
} else {
$str = "true ";
}
return $str;
}
@ApiOperation(value="首页任教课程-即将上课", notes="首页任教课程-即将上课")
@GetMapping(value = "/getTeacherjjsk")
public Result<List<Map<String, Object>>> getTeacherjjsk(KcKetangbiao kcKetangbiao){
Date now = new Date();
String currDate = DateUtil.format(now,"yyyy-MM-dd");
String currTime = DateUtil.format(now,"HHmm");
Map<String,String> queryMap = Maps.newHashMap();
queryMap.put("jieciSql",getJieciBytimejjsk(currTime));
queryMap.put("currDate",currDate);
queryMap.put("userid",kcKetangbiao.getUserid());
return Result.OK(kcKetangbiaoService.getTeacherjjsk(queryMap));
}
@ApiOperation(value="首页任教课程-正在上课", notes="首页任教课程-正在上课")
@GetMapping(value = "/getTeacherzzsk")
public Result<List<Map<String, Object>>> getTeacherzzsk(KcKetangbiao kcKetangbiao){
Date now = new Date();
String currDate = DateUtil.format(now,"yyyy-MM-dd");
String currTime = DateUtil.format(now,"HHmm");
Map<String,String> queryMap = Maps.newHashMap();
queryMap.put("jieciSql",getJieciBytimezzsk(currTime));
queryMap.put("currDate",currDate);
queryMap.put("userid",kcKetangbiao.getUserid());
return Result.OK(kcKetangbiaoService.getTeacherzzsk(queryMap));
}
@ApiOperation(value="首页任教课程-待上课程", notes="首页任教课程-待上课程")
@GetMapping(value = "/getTeacherdskc")
public Result<List<Map<String, Object>>> getTeacherdskc(KcKetangbiao kcKetangbiao){
Date now = new Date();
String currDate = DateUtil.format(now,"yyyy-MM-dd");
String currTime = DateUtil.format(now,"HH:mm");
Map<String,String> queryMap = Maps.newHashMap();
queryMap.put("currDate",currDate);
queryMap.put("currTime",currTime);
queryMap.put("userid",kcKetangbiao.getUserid());
return Result.OK(kcKetangbiaoService.getTeacherdskc(queryMap));
}
@ApiOperation(value="首页任教课程-已上课程", notes="首页任教课程-已上课程")
@GetMapping(value = "/getTeacheryskc")
public Result<List<Map<String, Object>>> getTeacheryskc(KcKetangbiao kcKetangbiao){
Date now = new Date();
String currDate = DateUtil.format(now,"yyyy-MM-dd");
String currTime = DateUtil.format(now,"HH:mm");
Map<String,String> queryMap = Maps.newHashMap();
queryMap.put("currDate",currDate);
queryMap.put("currTime",currTime);
queryMap.put("userid",kcKetangbiao.getUserid());
return Result.OK(kcKetangbiaoService.getTeacheryskc(queryMap));
}
@ApiOperation(value="首页任教课程-近6日课程表", notes="首页任教课程-近6日课程表")
@GetMapping(value = "/getTeacherjlrkcb")
public Result<List<Map<String, Object>>> getTeacherjlrkcb(KcKetangbiao kcKetangbiao){
Date now = new Date();
String currDate = DateUtil.format(now,"yyyy-MM-dd");
String currTime = DateUtil.format(now,"HHmm");
DateTime currDate7d = DateUtil.offset(now, DateField.DAY_OF_MONTH, 7);
String currDate7 = DateUtil.format(currDate7d,"yyyy-MM-dd");
Map<String,String> queryMap = Maps.newHashMap();
// queryMap.put("jieciSql",getJieciBytimejjsk(currTime));
queryMap.put("currDate",currDate);
queryMap.put("currDate7",currDate7);
queryMap.put("userid",kcKetangbiao.getUserid());
return Result.OK(kcKetangbiaoService.getTeacherjlrkcb(queryMap));
}
}

View File

@ -1,16 +1,14 @@
package org.jeecg.modules.kc.ktgl.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
* @Description: 课堂管理-子表
@ -39,4 +37,14 @@ public interface KcKetangbiaoMapper extends BaseMapper<KcKetangbiao> {
List<Map<String, Object>> selectJrTkJrtkktsList(Page<Map<String, Object>> page, @Param("skrq") String skrq);
List<Map<String, Object>> selectJrTkJrtktkrcList(Page<Map<String, Object>> page, @Param("skrq") String skrq);
List<Map<String, Object>> getTeacherjjsk(Map<String, String> queryMap);
List<Map<String, Object>> getTeacherzzsk(Map<String, String> queryMap);
List<Map<String, Object>> getTeacherdskc(Map<String, String> queryMap);
List<Map<String, Object>> getTeacheryskc(Map<String, String> queryMap);
List<Map<String, Object>> getTeacherjlrkcb(Map<String, String> queryMap);
}

View File

@ -191,4 +191,325 @@
insert into kc_ketangbiao_his select *,#{ts} from kc_ketangbiao
</insert>
<select id="getTeacherjjsk" resultType="java.util.Map">
SELECT
a.*,b.avgscore
FROM
(
SELECT
kt.id,
kc.id AS kechengbiaoid,
kt.skrq,
kt.WEEK,
kt.hh,
kt.kcmc,
kt.skdd,
kt.xkrs,
kt.zbpx,
kt.zbfs,
kt.kclj,
kc.jsbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,
kc.stars
FROM
kc_ketangbiao kt,
(
SELECT
*
FROM
kc_kechengbiao kc
LEFT JOIN (
SELECT
kechengbiaoid,
AVG( stars ) stars
FROM
kc_evaluationstudent ev,
kc_ketangbiao kt
WHERE
ev.ketangbiaoid = kt.id
<if test="jieciSql != null and jieciSql != ''">
and ${jieciSql}
</if>
<if test="currDate != null and currDate != ''">
AND kt.skrq = #{ currDate }
</if>
<if test="userid != null and userid != ''">
AND kt.jgh = #{ userid }
</if>
GROUP BY
kechengbiaoid,
skjs
) ev ON kc.id = ev.kechengbiaoid
) kc
<where>
<if test="jieciSql != null and jieciSql != ''">
and ${jieciSql}
</if>
<if test="currDate != null and currDate != ''">
AND kt.skrq = #{ currDate }
</if>
<if test="userid != null and userid != ''">
AND kc.jgh = #{ userid }
</if>
AND kt.kechengbiaoid = kc.id
</where>
) a
LEFT JOIN zongtipingjiapingjunfen b ON a.kechengbiaoid = b.kechengbiaoid
</select>
<select id="getTeacherzzsk" resultType="java.util.Map">
SELECT
a.*,b.avgscore
FROM
(
SELECT
kt.id,
kc.id AS kechengbiaoid,
kt.skrq,
kt.WEEK,
kt.hh,
kt.kcmc,
kt.skdd,
kt.xkrs,
kt.zbpx,
kt.zbfs,
kt.kclj,
kc.jsbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,
kc.stars
FROM
kc_ketangbiao kt,
(
SELECT
*
FROM
kc_kechengbiao kc
LEFT JOIN (
SELECT
kechengbiaoid,
AVG( stars ) stars
FROM
kc_evaluationstudent ev,
kc_ketangbiao kt
WHERE
ev.ketangbiaoid = kt.id
<if test="jieciSql != null and jieciSql != ''">
and ${jieciSql}
</if>
<if test="currDate != null and currDate != ''">
AND kt.skrq = #{ currDate }
</if>
<if test="userid != null and userid != ''">
AND kt.jgh = #{ userid }
</if>
GROUP BY kechengbiaoid, skjs
) ev ON kc.id = ev.kechengbiaoid
) kc
<where>
<if test="jieciSql != null and jieciSql != ''">
and ${jieciSql}
</if>
<if test="currDate != null and currDate != ''">
AND kt.skrq = #{ currDate }
</if>
<if test="userid != null and userid != ''">
AND kc.jgh = #{ userid }
</if>
AND kt.kechengbiaoid = kc.id
</where>
) a
LEFT JOIN zongtipingjiapingjunfen b ON a.kechengbiaoid = b.kechengbiaoid
</select>
<select id="getTeacherdskc" resultType="java.util.Map">
SELECT
a.*,b.avgscore
FROM
(
SELECT
kt.id,
kc.id AS kechengbiaoid,
kt.skrq,
kt.WEEK,
kt.hh,
kt.kcmc,
kt.skdd,
kt.xkrs,
kt.zbpx,
kt.zbfs,
kt.kclj,
kc.jsbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,
kc.stars
FROM
kc_ketangbiao kt,
(
SELECT
*
FROM
kc_kechengbiao kc
LEFT JOIN (
SELECT
kechengbiaoid,
AVG( stars ) stars
FROM
kc_evaluationstudent ev,
kc_ketangbiao kt
WHERE
ev.ketangbiaoid = kt.id
<if test="currTime != null and currTime != '' and currDate != null and currDate != ''">
AND #{ currTime } <![CDATA[ < ]]> kt.skrq and kt.skrq = #{ currDate }
</if>
<if test="userid != null and userid != ''">
AND kt.jgh = #{ userid }
</if>
GROUP BY
kechengbiaoid,
skjs
) ev ON kc.id = ev.kechengbiaoid
) kc
<where>
<if test="currTime != null and currTime != '' and currDate != null and currDate != ''">
AND #{ currTime } <![CDATA[ < ]]> kt.hhks and kt.skrq = #{ currDate }
</if>
<if test="userid != null and userid != ''">
AND kc.jgh = #{ userid }
</if>
AND kt.kechengbiaoid = kc.id
</where>
) a
LEFT JOIN zongtipingjiapingjunfen b ON a.kechengbiaoid = b.kechengbiaoid
</select>
<select id="getTeacheryskc" resultType="java.util.Map">
SELECT
a.*,b.avgscore
FROM
(
SELECT
kt.id,
kc.id AS kechengbiaoid,
kt.skrq,
kt.WEEK,
kt.hh,
kt.kcmc,
kt.skdd,
kt.xkrs,
kt.zbpx,
kt.zbfs,
kt.kclj,
kc.jsbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,
kc.stars
FROM
kc_ketangbiao kt,
(
SELECT
*
FROM
kc_kechengbiao kc
LEFT JOIN (
SELECT
kechengbiaoid,
AVG( stars ) stars
FROM
kc_evaluationstudent ev,
kc_ketangbiao kt
WHERE
ev.ketangbiaoid = kt.id
<if test="currTime != null and currTime != '' and currDate != null and currDate != ''">
AND #{ currTime } <![CDATA[ < ]]> kt.hhjs and kt.skrq = #{ currDate }
</if>
<if test="userid != null and userid != ''">
AND kt.jgh = #{ userid }
</if>
GROUP BY
kechengbiaoid,
skjs
) ev ON kc.id = ev.kechengbiaoid
) kc
<where>
<if test="currTime != null and currTime != '' and currDate != null and currDate != ''">
AND #{ currTime } <![CDATA[ < ]]> kt.hhjs and kt.skrq = #{ currDate }
</if>
<if test="userid != null and userid != ''">
AND kc.jgh = #{ userid }
</if>
AND kt.kechengbiaoid = kc.id
</where>
) a
LEFT JOIN zongtipingjiapingjunfen b ON a.kechengbiaoid = b.kechengbiaoid
</select>
<select id="getTeacherjlrkcb" resultType="java.util.Map">
SELECT
a.*,b.avgscore
FROM
(
SELECT
kt.id,
kc.id AS kechengbiaoid,
kt.skrq,
kt.WEEK,
kt.hh,
kt.kcmc,
kt.skdd,
kt.xkrs,
kt.zbpx,
kt.zbfs,
kt.kclj,
kc.jsbh,
DATEDIFF(
kt.skrq,
CURDATE()) AS nth,
kc.stars
FROM
kc_ketangbiao kt,
(
SELECT
*
FROM
kc_kechengbiao kc
LEFT JOIN (
SELECT
kechengbiaoid,
AVG( stars ) stars
FROM
kc_evaluationstudent ev,
kc_ketangbiao kt
WHERE
ev.ketangbiaoid = kt.id
<if test="currDate != null and currDate != '' and currDate7 != null and currDate7 != ''">
AND skrq > #{ currDate } and skrq <![CDATA[ < ]]> #{ currDate7 }
</if>
<if test="userid != null and userid != ''">
AND kt.jgh = #{ userid }
</if>
GROUP BY
kechengbiaoid,
skjs
) ev ON kc.id = ev.kechengbiaoid
) kc
<where>
<if test="currDate != null and currDate != '' and currDate7 != null and currDate7 != ''">
AND skrq > #{ currDate } and skrq <![CDATA[ < ]]> #{ currDate7 }
</if>
<if test="userid != null and userid != ''">
AND kc.jgh = #{ userid }
</if>
AND kt.kechengbiaoid = kc.id
</where>
) a
LEFT JOIN zongtipingjiapingjunfen b ON a.kechengbiaoid = b.kechengbiaoid
</select>
</mapper>

View File

@ -40,4 +40,14 @@ public interface IKcKetangbiaoService extends IService<KcKetangbiao> {
IPage<Map<String, Object>> selectJrTkJrtkktsList(Page<Map<String, Object>> page,String skrq);
IPage<Map<String, Object>> selectJrTkJrtktkrcList(Page<Map<String, Object>> page,String skrq);
List<Map<String, Object>> getTeacherjjsk(Map<String, String> queryMap);
List<Map<String, Object>> getTeacherzzsk(Map<String, String> queryMap);
List<Map<String, Object>> getTeacherdskc(Map<String, String> queryMap);
List<Map<String, Object>> getTeacheryskc(Map<String, String> queryMap);
List<Map<String, Object>> getTeacherjlrkcb(Map<String, String> queryMap);
}

View File

@ -71,4 +71,29 @@ public class KcKetangbiaoServiceImpl extends ServiceImpl<KcKetangbiaoMapper, KcK
public IPage<Map<String, Object>> selectJrTkJrtktkrcList(Page<Map<String, Object>> page, String skrq) {
return page.setRecords(baseMapper.selectJrTkJrtktkrcList(page, skrq));
}
@Override
public List<Map<String, Object>> getTeacherjjsk(Map<String, String> queryMap) {
return baseMapper.getTeacherjjsk(queryMap);
}
@Override
public List<Map<String, Object>> getTeacherzzsk(Map<String, String> queryMap) {
return baseMapper.getTeacherzzsk(queryMap);
}
@Override
public List<Map<String, Object>> getTeacherdskc(Map<String, String> queryMap) {
return baseMapper.getTeacherdskc(queryMap);
}
@Override
public List<Map<String, Object>> getTeacheryskc(Map<String, String> queryMap) {
return baseMapper.getTeacheryskc(queryMap);
}
@Override
public List<Map<String, Object>> getTeacherjlrkcb(Map<String, String> queryMap) {
return baseMapper.getTeacherjlrkcb(queryMap);
}
}