添加学生日历查询功能

This commit is contained in:
yangjun 2024-12-19 15:02:14 +08:00
parent f200616a86
commit 6f5c2e2a27
13 changed files with 138 additions and 19 deletions

View File

@ -215,6 +215,14 @@ public class SyncKcktStat extends BaseSync {
//--------------------20241204添加修改课堂表的kechengbiaoid字段-------------------------
//--------------------20241219修改课程表及课堂表为思政课程-------------------------
try {
kcKechengbiaoService.updateSzkc();
} catch (Exception e){
e.printStackTrace();
}
//--------------------20241219修改课程表及课堂表为思政课程-------------------------
//---------------------20240416新增手动调停课逻辑------------------
try {
editTtkxx();

View File

@ -213,27 +213,65 @@ public class KcEvaluationsStatController extends JeecgController<KcEvaluationsSt
return exportXls(request, kcEvaluationsStat, KcEvaluationsStat.class, "全量评价表");
}
// protected ModelAndView exportXls(HttpServletRequest request, KcEvaluationsStat object, Class<KcEvaluationsStat> clazz, String title) {
// // Step.1 组装查询条件
// QueryWrapper<KcEvaluationsStat> queryWrapper = QueryGenerator.initQueryWrapper("a",object, request.getParameterMap());
protected ModelAndView exportXls(HttpServletRequest request, KcEvaluationsStat kcEvaluationsStat, Class<KcEvaluationsStat> clazz, String title) {
// Step.1 组装查询条件
QueryWrapper<KcEvaluationsStat> queryWrapper = QueryGenerator.initQueryWrapper("a",kcEvaluationsStat, request.getParameterMap());
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// queryWrapper.eq(StringUtils.isNotBlank(object.getSzkc()),"c.szkc",object.getSzkc());
// // Step.2 获取导出数据
// List<KcEvaluationsStat> exportList = service.list(queryWrapper);
// queryWrapper.eq(StringUtils.isNotBlank(object.getSzkc()),"a.col59",object.getSzkc());
// queryWrapper.eq(StringUtils.isNotBlank(object.getSzkc()),"b.dwmc",object.getSkjsdw());
//
// // Step.3 AutoPoi 导出Excel
// ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
// //此处设置的filename无效 ,前端会重更新设置一下
// mv.addObject(NormalExcelConstants.FILE_NAME, title);
// mv.addObject(NormalExcelConstants.CLASS, clazz);
// //update-begin--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置--------------------
// ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
// exportParams.setImageBasePath(upLoadPath);
// //update-end--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置----------------------
// mv.addObject(NormalExcelConstants.PARAMS,exportParams);
// mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
// return mv;
// }
// if(StringUtils.isNotBlank(kcEvaluationsStat.getCol13())){
// kcEvaluationsStat.setCol13("*"+kcEvaluationsStat.getCol13()+"*");
// }
//
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
String adminRole = "1";//0 admin 1教务秘书
for(String role :roleList){
if(org.apache.commons.lang.StringUtils.equals("admin",role)){
adminRole = "0";
break;
}
}
// QueryWrapper<KcEvaluationsStat> queryWrapper = QueryGenerator.initQueryWrapper("a",kcEvaluationsStat, request.getParameterMap());
if(StringUtils.isNotBlank(kcEvaluationsStat.getSzkc())){
String szkc = kcEvaluationsStat.getSzkc();
if(StringUtils.equals("1",szkc)){
queryWrapper.eq("col59","");
}else if(StringUtils.equals("0",szkc)){
queryWrapper.eq("col59","");
}
}
if(StringUtils.equals("1",adminRole)){
QueryWrapper<Xxhbuser> xxhbuserQueryWrapper = new QueryWrapper<>();
xxhbuserQueryWrapper.eq("gh",sysUser.getUsername());
xxhbuserQueryWrapper.last("limit 1");
Xxhbuser xxhbuser = xxhbuserService.getOne(xxhbuserQueryWrapper);
queryWrapper.eq("col10",xxhbuser.getDwmc());
}
queryWrapper.eq(StringUtils.isNotBlank(kcEvaluationsStat.getSkjsdw()),"b.dwmc",kcEvaluationsStat.getSkjsdw());
// queryWrapper.eq(StringUtils.isNotBlank(kcEvaluationsStat.getSzkc()),"c.szkc",kcEvaluationsStat.getSzkc());
// Page<KcEvaluationsStat> page = new Page<KcEvaluationsStat>(pageNo, pageSize);
// IPage<KcEvaluationsStat> pageList = kcEvaluationsStatService.page(page, queryWrapper);
// Step.2 获取导出数据
List<KcEvaluationsStat> exportList = kcEvaluationsStatService.list(queryWrapper);
// Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
//此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.FILE_NAME, title);
mv.addObject(NormalExcelConstants.CLASS, clazz);
//update-begin--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置--------------------
ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
exportParams.setImageBasePath(upLoadPath);
//update-end--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置----------------------
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv;
}
/**
* 通过excel导入数据

View File

@ -1481,4 +1481,11 @@ select max(id) as id,gh,xqxn from KC_EXPORT_CONFIG_TPKWCQKJZGLX where xqxn = #{x
${ew.customSqlSegment}
</select>
<select id="selectList" resultType="org.jeecg.modules.kc.kcEvaluationsStat.entity.KcEvaluationsStat">
select a.*,b.dwmc as skjsdw from kc_evaluations_stat a
left join xxhbuser b on a.col05 = b.gh
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -22,6 +22,7 @@ import org.jeecg.modules.kc.kcSysConfig.service.IKcSysConfigService;
import org.jeecg.modules.kc.kcSzkc.entity.KcSzkc;
import org.jeecg.modules.kc.kcSzkc.service.IKcSzkcService;
import org.jeecg.modules.kc.ktgl.entity.KcKechengbiao;
import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao;
import org.jeecg.modules.kc.ktgl.service.IKcKechengbiaoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -334,4 +335,6 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
return Result.OK(kcKechengbiao);
}
}

View File

@ -1090,4 +1090,28 @@ public class KcKetangbiaoController extends JeecgController<KcKetangbiao, IKcKet
return mv;
}
/**
* 学生日历课程
* @param kcKetangbiao
* @param req
* @return
*/
@GetMapping(value = "/getStudentRiliKclist")
public Result<List<KcKetangbiao>> getStudentRiliKclist(KcKetangbiao kcKetangbiao,
HttpServletRequest req) {
QueryWrapper<KcKetangbiao> queryWrapper = QueryGenerator.initQueryWrapper(kcKetangbiao, req.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
kcKetangbiao.setXnxq(kcSysConfig.getFlag1());
kcKetangbiao.setXh(sysUser.getUsername());
List pageList = kcKechengbiaoService.getStudentRiliKclist(kcKetangbiao);
return Result.OK(pageList);
}
}

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.ktgl.entity.KcKechengbiao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao;
/**
* @Description: 课程管理-主表
@ -45,4 +46,8 @@ public interface KcKechengbiaoMapper extends BaseMapper<KcKechengbiao> {
IPage<KcKechengbiao> getStudentKclist(Page<KcKechengbiao> page,@Param(Constants.WRAPPER) QueryWrapper<KcKechengbiao> queryWrapper);
KcKechengbiao getKcbhByRwbh(KcKechengbiao kcKechengbiao);
List getStudentRiliKclist(KcKetangbiao kcKetangbiao);
void updateSzkc();
}

View File

@ -73,4 +73,5 @@ public interface KcKetangbiaoMapper extends BaseMapper<KcKetangbiao> {
List<KcKetangbiaoNum> getKccountExportList(KcKetangbiaoNum kcKetangbiao);
void updateKechengbiaoid( @Param("skrq") String skrq);
}

View File

@ -228,4 +228,14 @@
limit 1
</select>
<select id="getStudentRiliKclist" resultType="org.jeecg.modules.kc.ktgl.entity.KcKetangbiao">
select b.rwbh,b.kcmc,GROUP_CONCAT(DISTINCT b.skjs ) as skjs,b.skrq from xxhbxsxkb a , kc_ketangbiao b
where a.KCAPZBBH = b.rwbh and a.xh = #{xh} and b.xnxq = #{xnxq}
and b.skrq like concat(DATE_FORMAT(NOW(),'%Y-%m'),'%')
GROUP BY b.rwbh,b.kcmc,b.skrq
</select>
<update id="updateSzkc">
update kc_kechengbiao set szkc = '1' where kkdw = '马列教研室'
</update>
</mapper>

View File

@ -814,4 +814,8 @@
LEFT JOIN kc_kechengbiao b on a.kcmc = b.kcmc and a.rwbh = b.rwbh and a.skjs = b.skjs and a.hh = b.hh
set a.kechengbiao1 = b.id , a.kechengbiaoid = b.id where skrq = #{skrq} and b.flag = 0
</update>
</mapper>

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.kc.ktgl.entity.KcKechengbiao;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao;
import java.util.List;
@ -43,4 +44,8 @@ public interface IKcKechengbiaoService extends IService<KcKechengbiao> {
IPage<KcKechengbiao> getStudentKclist(Page<KcKechengbiao> page, QueryWrapper<KcKechengbiao> queryWrapper);
public KcKechengbiao getKcbhByRwbh(KcKechengbiao kcKechengbiao);
List getStudentRiliKclist(KcKetangbiao kcKetangbiao);
void updateSzkc();
}

View File

@ -75,4 +75,5 @@ public interface IKcKetangbiaoService extends IService<KcKetangbiao> {
List<KcKetangbiaoNum> getKccountExportList(KcKetangbiaoNum object);
void updateKechengbiaoid(String skrq);
}

View File

@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.kc.ktgl.entity.KcKechengbiao;
import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao;
import org.jeecg.modules.kc.ktgl.mapper.KcKechengbiaoMapper;
import org.jeecg.modules.kc.ktgl.service.IKcKechengbiaoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Collections;
import java.util.List;
/**
@ -90,4 +92,14 @@ public class KcKechengbiaoServiceImpl extends ServiceImpl<KcKechengbiaoMapper, K
return baseMapper.getKcbhByRwbh(kcKechengbiao);
}
@Override
public List getStudentRiliKclist(KcKetangbiao kcKetangbiao) {
return baseMapper.getStudentRiliKclist(kcKetangbiao);
}
@Override
public void updateSzkc() {
baseMapper.updateSzkc();
}
}

View File

@ -191,4 +191,5 @@ public class KcKetangbiaoServiceImpl extends ServiceImpl<KcKetangbiaoMapper, KcK
baseMapper.updateKechengbiaoid(skrq);
}
}