This commit is contained in:
bai 2023-12-08 09:43:58 +08:00
commit 5ece8ed303
13 changed files with 140 additions and 22 deletions

View File

@ -155,8 +155,8 @@ public class KcExportConfigTpkwcqkjzglxServiceImpl extends ServiceImpl<KcExportC
// 其他专任教师 10
if(StringUtils.equals("1",adminRole)){//获取当前人所在的学院
QueryWrapper<Xxhbuser> xxhbuserQueryWrapper = new QueryWrapper<>();
xxhbuserQueryWrapper.eq("username",sysUser.getUsername());
xxhbuserQueryWrapper.apply("limit 1");
xxhbuserQueryWrapper.eq("gh",sysUser.getUsername());
xxhbuserQueryWrapper.last("limit 1");
Xxhbuser xxhbuser = xxhbuserService.getOne(xxhbuserQueryWrapper);
if(xxhbuser==null){//如果没有查到则返回空什么也不显示
return null;

View File

@ -12,7 +12,9 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbshryxx;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbuser;
import org.jeecg.modules.kc.grab.imports.service.IXxhbshryxxService;
import org.jeecg.modules.kc.grab.imports.service.IXxhbuserService;
import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -35,6 +37,8 @@ import java.util.Arrays;
public class XxhbshryxxController extends JeecgController<Xxhbshryxx, IXxhbshryxxService> {
@Autowired
private IXxhbshryxxService xxhbshryxxService;
@Autowired
private IXxhbuserService xxhbuserService;
/**
* 分页列表查询
@ -163,11 +167,11 @@ public class XxhbshryxxController extends JeecgController<Xxhbshryxx, IXxhbshryx
@ApiOperation(value="获取教师信息", notes="获取教师信息")
@GetMapping(value = "/getTeacherinfo")
public Result<Xxhbshryxx> getTeacherinfo(Xxhbshryxx xxhbshryxx, HttpServletRequest req) {
QueryWrapper<Xxhbshryxx> queryWrapper = new QueryWrapper<>();
public Result<Xxhbuser> getTeacherinfo(Xxhbshryxx xxhbshryxx, HttpServletRequest req) {
QueryWrapper<Xxhbuser> queryWrapper = new QueryWrapper<>();
queryWrapper.like("xm",xxhbshryxx.getXm());
queryWrapper.last("limit 1");
Xxhbshryxx teacherinfo = xxhbshryxxService.getOne(queryWrapper);
Xxhbuser teacherinfo = xxhbuserService.getOne(queryWrapper);
return Result.OK(teacherinfo);
}
}

View File

@ -75,6 +75,11 @@ public class KcKechengtixingdingyueController extends JeecgController<KcKechengt
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<KcKechengtixingdingyue> queryWrapper = QueryGenerator.initQueryWrapper(kcKechengtixingdingyue, req.getParameterMap());
queryWrapper.eq(StringUtils.isNotBlank(kcKechengtixingdingyue.getDwmc()),"b.dwmc",kcKechengtixingdingyue.getDwmc());
if(StringUtils.isNotBlank(kcKechengtixingdingyue.getRjzy())){
queryWrapper.like("b.rjzy",kcKechengtixingdingyue.getRjzy());
}
queryWrapper.apply("username is not null");
Page<KcKechengtixingdingyue> page = new Page<KcKechengtixingdingyue>(pageNo, pageSize);
IPage<KcKechengtixingdingyue> pageList = kcKechengtixingdingyueService.page(page, queryWrapper);
@ -181,6 +186,11 @@ public class KcKechengtixingdingyueController extends JeecgController<KcKechengt
List<String> selectionList = Arrays.asList(selections.split(","));
queryWrapper.in("id",selectionList);
}
queryWrapper.eq(StringUtils.isNotBlank(object.getDwmc()),"b.dwmc",object.getDwmc());
if(StringUtils.isNotBlank(object.getRjzy())){
queryWrapper.like("b.rjzy",object.getRjzy());
}
// Step.2 获取导出数据
queryWrapper.apply("username is not null");
List<KcKechengtixingdingyue> exportList = service.list(queryWrapper);

View File

@ -126,10 +126,10 @@ public class KcWechatSendLogController extends JeecgController<KcWechatSendLog,
String url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + accessToken;
// 1xx老师你好您本学期2023秋听课要求为5次当前实际听课次数3次请尽快完成本学期的听课任务
// 如需听评课请点击课程信息中心链接
sendMag.put("thing2", new WeChatTemplateMsg(kcWechatSendLog.getTeacherName()));//授课老师
sendMag.put("time3", new WeChatTemplateMsg(DateUtils.formatDate(new Date(),"yyyy-MM-dd")));//上课时间
sendMag.put("const1", new WeChatTemplateMsg("应听"+kcWechatSendLog.getYtkcs()+"次,实际听课:"+kcWechatSendLog.getSjtkcs()+""));//课程名称
System.out.println("getSkjs : " + kcWechatSendLog.getTeacherName() + ", getSkrq: " );
sendMag.put("thing18", new WeChatTemplateMsg(kcWechatSendLog.getTeacherName()));//授课老师
sendMag.put("const14", new WeChatTemplateMsg(kcWechatSendLog.getXqxn()));//上课时间
sendMag.put("number4", new WeChatTemplateMsg(kcWechatSendLog.getYtkcs()));//应听课次数
sendMag.put("number9", new WeChatTemplateMsg(kcWechatSendLog.getSjtkcs()));//实际听课次数
RestTemplate restTemplate = new RestTemplate();
//拼接base参数
Map<String, Object> sendBody = new HashMap<>();
@ -137,7 +137,7 @@ public class KcWechatSendLogController extends JeecgController<KcWechatSendLog,
sendBody.put("url", domainTo); // 点击模板信息跳转地址
sendBody.put("topcolor", "#FF0000"); // 顶色
sendBody.put("data", sendMag); // 模板参数
sendBody.put("template_id", "zybkRmDuTePoC67FViLZGo3O2f5Q-t23M0ILnCH_0K8"); // 模板Id
sendBody.put("template_id", "ijrjginJ4RJGBMO0i1g0Ml-kO2bfDNXCchw1j_viJGE"); // 模板Id
ResponseEntity<String> forEntity = restTemplate.postForEntity(url, sendBody, String.class);
JSONObject jsonObject2 = JSONObject.parseObject(forEntity.getBody());
System.out.println("jsonObject2 : " + jsonObject2);

View File

@ -10,8 +10,10 @@ import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.date.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.grab.SynchronizationService.tools.ChangeTingKeTongJi;
import org.jeecg.modules.kc.kcAssessuser.entity.KcAssessuser;
@ -35,6 +37,7 @@ import org.jeecg.modules.kc.qa.service.IKcEvaluationansService;
import org.jeecg.modules.kc.qa.service.IKcEvaluationsService;
import org.jeecg.modules.kc.tktj.entity.KcTingke;
import org.jeecg.modules.kc.tktj.service.IKcTingkeService;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -80,6 +83,8 @@ public class KcZzThpjbController extends JeecgController<KcZzThpjb, IKcZzThpjbSe
@Autowired
private IKcTingkeService kcTingkeService;
@Autowired
private SysBaseApiImpl sysBaseApi;
/**
* 分页列表查询
*
@ -98,6 +103,21 @@ public class KcZzThpjbController extends JeecgController<KcZzThpjb, IKcZzThpjbSe
HttpServletRequest req) {
QueryWrapper<KcZzThpjb> queryWrapper = QueryGenerator.initQueryWrapper(kcZzThpjb, req.getParameterMap());
queryWrapper.eq(StringUtils.isNotBlank(kcZzThpjb.getXqxn()),"b.title",kcZzThpjb.getXqxn());
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
String adminRole = "1";//0 admin
for(String role :roleList){
if(StringUtils.equals("admin",role)){
adminRole = "0";
break;
}
}
if(StringUtils.equals("1",adminRole)){
queryWrapper.eq("d.gh",sysUser.getUsername());
}
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
Page<KcZzThpjb> page = new Page<KcZzThpjb>(pageNo, pageSize);
IPage<KcZzThpjb> pageList = kcZzThpjbService.page(page, queryWrapper);
return Result.OK(pageList);

View File

@ -5,6 +5,8 @@
<select id="selectPage" resultType="org.jeecg.modules.kc.kcZzThpjb.entity.KcZzThpjb">
select a.*,b.title as xqxn from kc_zz_thpjb a
LEFT JOIN kc_xqxn_history b on a.sksj >= b.start_time + '' and a.sksj &lt;= b.end_time +''
left join xxhbuser c on a.pkjsbh = c.gh
left join xxhbuser d on d.dwh = c.dwh
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -10,8 +10,10 @@ import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.date.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.grab.SynchronizationService.tools.ChangeTingKeTongJi;
import org.jeecg.modules.kc.kcZzXstkb.entity.KcZzXstkb;
@ -33,6 +35,7 @@ import org.jeecg.modules.kc.qa.service.IKcEvaluationansService;
import org.jeecg.modules.kc.qa.service.IKcEvaluationsService;
import org.jeecg.modules.kc.tktj.entity.KcTingke;
import org.jeecg.modules.kc.tktj.service.IKcTingkeService;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -76,6 +79,8 @@ public class KcZzXstkbController extends JeecgController<KcZzXstkb, IKcZzXstkbSe
private ChangeTingKeTongJi changeTingKeTongJi;
@Autowired
private IKcTingkeService kcTingkeService;
@Autowired
private SysBaseApiImpl sysBaseApi;
/**
* 分页列表查询
*
@ -94,6 +99,20 @@ public class KcZzXstkbController extends JeecgController<KcZzXstkb, IKcZzXstkbSe
HttpServletRequest req) {
QueryWrapper<KcZzXstkb> queryWrapper = QueryGenerator.initQueryWrapper(kcZzXstkb, req.getParameterMap());
queryWrapper.eq(StringUtils.isNotBlank(kcZzXstkb.getXqxn()),"b.title",kcZzXstkb.getXqxn());
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
String adminRole = "1";//0 admin
for(String role :roleList){
if(StringUtils.equals("admin",role)){
adminRole = "0";
break;
}
}
if(StringUtils.equals("1",adminRole)){
queryWrapper.eq("d.gh",sysUser.getUsername());
}
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
Page<KcZzXstkb> page = new Page<KcZzXstkb>(pageNo, pageSize);
IPage<KcZzXstkb> pageList = kcZzXstkbService.page(page, queryWrapper);
return Result.OK(pageList);

View File

@ -5,6 +5,8 @@
<select id="selectPage" resultType="org.jeecg.modules.kc.kcZzXstkb.entity.KcZzXstkb">
select a.*,b.title as xqxn from kc_zz_xstkb a
LEFT JOIN kc_xqxn_history b on a.sksj >= b.start_time + '' and a.sksj &lt;= b.end_time +''
left join xxhbuser c on a.tkjsgh = c.gh
left join xxhbuser d on d.dwh = c.dwh
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -10,8 +10,10 @@ import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.date.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.grab.SynchronizationService.tools.ChangeTingKeTongJi;
import org.jeecg.modules.kc.kcAssessuser.entity.KcAssessuser;
@ -36,6 +38,7 @@ import org.jeecg.modules.kc.qa.service.IKcEvaluationansService;
import org.jeecg.modules.kc.qa.service.IKcEvaluationsService;
import org.jeecg.modules.kc.tktj.entity.KcTingke;
import org.jeecg.modules.kc.tktj.service.IKcTingkeService;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -80,6 +83,8 @@ public class KcZzYbtkbController extends JeecgController<KcZzYbtkb, IKcZzYbtkbSe
private IKcAssessuserService kcAssessuserService;
@Autowired
private IKcTingkeService kcTingkeService;
@Autowired
private SysBaseApiImpl sysBaseApi;
/**
* 分页列表查询
@ -99,6 +104,20 @@ public class KcZzYbtkbController extends JeecgController<KcZzYbtkb, IKcZzYbtkbSe
HttpServletRequest req) {
QueryWrapper<KcZzYbtkb> queryWrapper = QueryGenerator.initQueryWrapper("a",kcZzYbtkb, req.getParameterMap());
queryWrapper.eq(StringUtils.isNotBlank(kcZzYbtkb.getXqxn()),"b.title",kcZzYbtkb.getXqxn());
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
String adminRole = "1";//0 admin
for(String role :roleList){
if(StringUtils.equals("admin",role)){
adminRole = "0";
break;
}
}
if(StringUtils.equals("1",adminRole)){
queryWrapper.eq("d.gh",sysUser.getUsername());
}
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
Page<KcZzYbtkb> page = new Page<KcZzYbtkb>(pageNo, pageSize);
IPage<KcZzYbtkb> pageList = kcZzYbtkbService.page(page, queryWrapper);
return Result.OK(pageList);

View File

@ -5,6 +5,8 @@
<select id="selectPage" resultType="org.jeecg.modules.kc.kcZzYbtkb.entity.KcZzYbtkb">
select a.*,b.title as xqxn from kc_zz_ybtkb a
LEFT JOIN kc_xqxn_history b on a.SKRQ >= b.start_time + '' and a.SKRQ &lt;= b.end_time +''
left join xxhbuser c on a.tkjsbh = c.gh
left join xxhbuser d on d.dwh = c.dwh
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -376,6 +376,20 @@ public class KcEvaluationController extends JeecgController<KcEvaluation, IKcEva
// 过滤选中数据
// Step.2 获取导出数据
String xnxq = kcEvaluationPkmx.getXnxq();
if(org.apache.commons.lang3.StringUtils.isNotBlank(xnxq)){
QueryWrapper<KcXqxnHistory> kcXqxnHistoryQueryWrapper = new QueryWrapper<>();
kcXqxnHistoryQueryWrapper.eq("title",xnxq);
kcXqxnHistoryQueryWrapper.last("limit 1");
KcXqxnHistory kcXqxnHistory =kcXqxnHistoryService.getOne(kcXqxnHistoryQueryWrapper);
kcEvaluationPkmx.setStartTime(DateUtil.format(kcXqxnHistory.getStartTime(),"yyyy-MM-dd"));
kcEvaluationPkmx.setEndTime(DateUtil.format(kcXqxnHistory.getEndTime(),"yyyy-MM-dd"));
}
if(org.apache.commons.lang3.StringUtils.equals("",kcEvaluationPkmx.getSzkc())){
kcEvaluationPkmx.setSzkc("1");
}else if(org.apache.commons.lang3.StringUtils.equals("",kcEvaluationPkmx.getSzkc())){
kcEvaluationPkmx.setSzkc("0");
}
List<KcEvaluationPkmx> exportList = kcEvaluationService.selectPkmxExportList(kcEvaluationPkmx);
Map<Integer,String> sourceDictMap = Maps.newHashMap();

View File

@ -80,4 +80,7 @@ public class KcEvaluationPkmx implements Serializable {
private String pjlblx;
private String szkc;
private String xnxq;
}

View File

@ -35,12 +35,15 @@
</if>
GROUP BY ev.upuserid, cu.dwh
) tk left join
( SELECT usercode, username, GROUP_CONCAT( assess1 SEPARATOR ',' ) tksf1, GROUP_CONCAT( assess2 SEPARATOR ',' ) tksf2, max( tkyq ) tkyq
FROM kc_assessuser WHERE 1 = 1
(
select gh as usercode,xm as username,GROUP_CONCAT( b.item_text SEPARATOR ',' ) as tksf1 ,max(ytkcs) as tkyq from kc_export_config_tpkwcqkjzglx a
LEFT JOIN sys_dict_item b on a.tklx = b.item_value and dict_id = '1682386362753224705'
and a.xqxn = (select flag1 from kc_sys_config where id = 1)
<if test="kcEvaluation.tksf != null and kcEvaluation.tksf != ''">
AND assesscode = #{kcEvaluation.tksf}
AND b.item_value = #{kcEvaluation.tksf}
</if>
GROUP BY usercode, username ) au
GROUP BY gh,xm
) au
on tk.upuserid = au.usercode
ORDER BY sjtksl DESC
</select>
@ -285,9 +288,11 @@
SELECT ev.upuserid, cu.xm as upuser, count( ev.id ) sjtksl, count( CASE WHEN kt.kkdw = '马列教研室' THEN 1 END ) mltksl, cu.dwmc AS tkdw,kt.skrq
FROM
kc_evaluation ev,
kc_ketangbiao kt,
xxhbuser cu
WHERE ev.minkcid = kt.id AND ev.upuserid = cu.gh
left join kc_ketangbiao kt on ev.minkcid = kt.id
left join xxhbuser cu on ev.upuserid = cu.gh
left join kc_kechengbiao kcb on pk.kechengbiaoid = kcb.id
WHERE 1=1
<if test="startTime != null and startTime != ''">
<!-- and ev.up_date &gt;= #{kcEvaluation.startTime}-->
and kt.skrq &gt;= #{startTime}
@ -307,17 +312,26 @@
and cu.dwmc = #{szdw}
</if>
<if test="szkc != null and szkc != ''">
<if test='szkc == "1"'>
AND kcb.szkc = #{szkc}
</if>
<if test='szkc == "0"'>
AND (kcb.szkc = #{szkc} or kcb.szkc is null )
</if>
</if>
<if test="username != null and username != ''">
and (cu.xm like concat('%',#{username},'%') or cu.gh like concat('%',#{username},'%'))
</if>
GROUP BY ev.upuserid, cu.dwh
) tk left join
( SELECT usercode, username, GROUP_CONCAT( assess1 SEPARATOR ',' ) tksf1, GROUP_CONCAT( assess2 SEPARATOR ',' ) tksf2, max( tkyq ) tkyq
FROM kc_assessuser WHERE 1 = 1
<if test="tksf != null and tksf != ''">
AND assesscode = #{tksf}
( select gh as usercode,xm as username,GROUP_CONCAT( b.item_text SEPARATOR ',' ) as tksf1 ,max(ytkcs) as tkyq from kc_export_config_tpkwcqkjzglx a
LEFT JOIN sys_dict_item b on a.tklx = b.item_value and dict_id = '1682386362753224705'
and a.xqxn = (select flag1 from kc_sys_config where id = 1)
<if test="kcEvaluation.tksf != null and kcEvaluation.tksf != ''">
AND b.item_value = #{kcEvaluation.tksf}
</if>
GROUP BY usercode, username ) au
GROUP BY gh,xm) au
on tk.upuserid = au.usercode
ORDER BY sjtksl DESC
</select>
@ -344,6 +358,7 @@
) AS pk
LEFT JOIN kc_assessuser au ON pk.userid = au.usercode
left join zongtipingjiapingjunfen fen on fen.kechengbiaoid = pk.kechengbiaoid
left join kc_kechengbiao kcb on pk.kechengbiaoid = kcb.id
<where>
<if test="kcxz != null and kcxz != ''">
and pk.kcxz = #{kcxz}
@ -357,6 +372,14 @@
<if test="tksf != null and tksf != ''">
AND au.assesscode = #{tksf}
</if>
<if test="szkc != null and szkc != ''">
<if test='szkc == "1"'>
AND kcb.szkc = #{szkc}
</if>
<if test='szkc == "0"'>
AND (kcb.szkc = #{szkc} or kcb.szkc is null )
</if>
</if>
</where>
ORDER BY
up_date DESC,