修改bug

This commit is contained in:
yangjun 2023-11-09 23:26:25 +08:00
parent e48d8ae254
commit 707d65ad96
7 changed files with 266 additions and 3 deletions

View File

@ -323,6 +323,7 @@ public class KcExportConfigTpkwcqkjzglxController extends JeecgController<KcExpo
List<String> selectionList = Arrays.asList(selections.split(","));
queryWrapper.in("id",selectionList);
}
queryWrapper.eq("zt","在职");
// Step.2 获取导出数据
List<KcExportConfigTpkwcqkjzglx> exportList = service.list(queryWrapper);
@ -446,4 +447,14 @@ public class KcExportConfigTpkwcqkjzglxController extends JeecgController<KcExpo
return Result.OK(kcExportConfigTpkwcqkjzglx);
}
@ApiOperation(value="听课人员统计图表", notes="听课人员统计图表")
@GetMapping(value = "/getTjlist")
public Result<List<Map<String, Object>>> getTjlist(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx,HttpServletRequest req) {
List<Map<String, Object>> pageList = kcExportConfigTpkwcqkjzglxService.getTjlist(kcExportConfigTpkwcqkjzglx);
return Result.OK(pageList);
}
}

View File

@ -119,4 +119,11 @@ public class KcExportConfigTpkwcqkjzglx implements Serializable {
@TableField(exist = false)
private String findGh;
@TableField(exist = false)
private String znum;
@TableField(exist = false)
private String sjtkcs;
}

View File

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx;
import java.util.List;
/**
* @Description: kc_export_config_tpkwcqkjzglx
* @Author: jeecg-boot
@ -21,4 +23,10 @@ public interface KcExportConfigTpkwcqkjzglxMapper extends BaseMapper<KcExportCon
KcExportConfigTpkwcqkjzglx getByGh(String gh);
KcExportConfigTpkwcqkjzglx queryBytklx(String tklx);
List<KcExportConfigTpkwcqkjzglx> getTjlist(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx);
List<KcExportConfigTpkwcqkjzglx> getTjinfoList(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx1);
void updateJzgzzzt(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx);
}

View File

@ -43,4 +43,28 @@
where tklx = #{tklx} limit 1
</select>
<select id="getTjlist" resultType="org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx">
select count(tklx) as znum from kc_export_config_tpkwcqkjzglx where xqxn = #{xqxn} and zt = '在职'
and tklx in (${tklx})
<if test="dwmc != null and dwmc != ''">
and dwmc = #{dwmc}
</if>
</select>
<select id="getTjinfoList" resultType="org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx">
select a.tklx,a.gh,a.xm,a.dwmc,a.ytkcs,a.rjzy,count(c.upuserid) as sjtkcs from kc_export_config_tpkwcqkjzglx a
LEFT JOIN kc_xqxn_history b on a.xqxn = b.title
LEFT JOIN kc_evaluation c on a.gh = c.upuserid and c.up_date BETWEEN b.start_time and b.end_time
where xqxn = #{xqxn} and zt = '在职' and tklx in (${tklx})
<if test="dwmc != null and dwmc != ''">
and dwmc = #{dwmc}
</if>
GROUP BY a.tklx,a.gh,a.xm,a.dwmc,a.ytkcs,a.rjzy
</select>
<update id="updateJzgzzzt">
update kc_export_config_tpkwcqkjzglx t,(select gh,zzzt,mc from (select t1.gh,t1.xm,t1.zzzt,t2.mc from xxhbuser t1 left join xxhbjzgdqzt t2 on t1.ZZZT = t2.dm)a)b set t.zt = b.mc where t.gh = b.gh and t.xqxn = #{xqxn}
</update>
</mapper>

View File

@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx;
import java.util.List;
import java.util.Map;
/**
* @Description: kc_export_config_tpkwcqkjzglx
* @Author: jeecg-boot
@ -21,4 +24,8 @@ public interface IKcExportConfigTpkwcqkjzglxService extends IService<KcExportCon
KcExportConfigTpkwcqkjzglx getByGh(String gh);
KcExportConfigTpkwcqkjzglx queryBytklx(String tklx);
List<Map<String, Object>> getTjlist(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx);
void updateJzgzzzt(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx);
}

View File

@ -6,19 +6,25 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx;
import org.jeecg.modules.kc.config.mapper.KcExportConfigTpkwcqkjzglxMapper;
import org.jeecg.modules.kc.config.service.IKcExportConfigTpkwcqkjzglxService;
import org.jeecg.modules.kc.grab.SynchronizationService.tools.ChangeTingKeTongJi;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbuser;
import org.jeecg.modules.kc.grab.imports.service.IXxhbuserService;
import org.jeecg.modules.kc.kcSysConfig.entity.KcSysConfig;
import org.jeecg.modules.kc.kcSysConfig.service.IKcSysConfigService;
import org.jeecg.modules.kc.kcXqxnHistory.entity.KcXqxnHistory;
import org.jeecg.modules.kc.tksf.kctksfyq.entity.KcTksfyq;
import org.jeecg.modules.kc.tksf.kctksfyq.service.IKcTksfyqService;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
import org.jeecg.modules.tools.DictUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
* @Description: kc_export_config_tpkwcqkjzglx
@ -34,6 +40,15 @@ public class KcExportConfigTpkwcqkjzglxServiceImpl extends ServiceImpl<KcExportC
@Autowired
private ChangeTingKeTongJi changeTingKeTongJi;
@Autowired
private SysBaseApiImpl sysBaseApi;
@Autowired
private IXxhbuserService xxhbuserService;
@Autowired
private IKcSysConfigService kcSysConfigService;
@Autowired
private DictUtils dictUtils;
@Override
public void editAll(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx) {
@ -100,4 +115,144 @@ public class KcExportConfigTpkwcqkjzglxServiceImpl extends ServiceImpl<KcExportC
public KcExportConfigTpkwcqkjzglx queryBytklx(String tklx) {
return baseMapper.queryBytklx(tklx);
}
@Override
public List<Map<String, Object>> getTjlist(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx) {
List<Map<String, Object>> resMapList = new ArrayList<>();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
String adminRole = "1";//0 admin 1教务秘书
for(String role :roleList){
if(StringUtils.equals("admin",role)){
adminRole = "0";
break;
}
}
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
//-------------如果是教务秘书获取是哪个学校的---------------------------
String schoolname = "";
List<String> tklxList = new ArrayList<>();
tklxList.add("30");
tklxList.add("20");
tklxList.add("330");
tklxList.add("60");
tklxList.add("210,270,280");
tklxList.add("110");
tklxList.add("10");
// 学校教务委员会 70
// 学校督学 100
// 校领导 160
// 学院教务委员会 30
// 系主任专业负责人 20
// 教学副院长 330
// 行政负责人 60
// 其他党政领导 210 270 280
// 辅导员 110
// 其他专任教师 10
if(StringUtils.equals("1",adminRole)){//获取当前人所在的学院
QueryWrapper<Xxhbuser> xxhbuserQueryWrapper = new QueryWrapper<>();
xxhbuserQueryWrapper.eq("username",sysUser.getUsername());
xxhbuserQueryWrapper.apply("limit 1");
Xxhbuser xxhbuser = xxhbuserService.getOne(xxhbuserQueryWrapper);
if(xxhbuser==null){//如果没有查到则返回空什么也不显示
return null;
}else{
schoolname = xxhbuser.getDwmc();
}
}else{//管理员还需要查这几个
tklxList.add("70");
tklxList.add("100");
tklxList.add("160");
}
//-------------如果是教务秘书获取是哪个学校的---------------------------
//------------------获取统计数据------------------------------------
for(String tklx:tklxList){
// KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
Map<String, Object> resMap = new HashMap<>();
if(StringUtils.equals("70",tklx)){
resMap.put("title", "学校教务委员会");
resMap.put("code", "70");
resMap.put("type","0");//0代表管理员 1代表教务秘书
}else if(StringUtils.equals("100",tklx)){
resMap.put("title", "学校督学");
resMap.put("code", "100");
resMap.put("type","0");
}else if(StringUtils.equals("160",tklx)){
resMap.put("title", "校领导");
resMap.put("code", "160");
resMap.put("type","0");
}else if(StringUtils.equals("30",tklx)){
resMap.put("title", "学院教务委员会");
resMap.put("code", "30");
resMap.put("type","1");
}else if(StringUtils.equals("20",tklx)){
resMap.put("title", "系主任(专业负责人)");
resMap.put("code", "20");
resMap.put("type","1");
}else if(StringUtils.equals("330",tklx)){
resMap.put("title", "教学副院长");
resMap.put("code", "330");
resMap.put("type","1");
}else if(StringUtils.equals("60",tklx)){
resMap.put("title", "行政负责人");
resMap.put("code", "60");
resMap.put("type","1");
}else if(StringUtils.equals("210,270,280",tklx)){
resMap.put("title", "其他党政领导");
resMap.put("code", "210,270,280");
resMap.put("type","1");
}else if(StringUtils.equals("110",tklx)){
resMap.put("title", "辅导员");
resMap.put("code", "110");
resMap.put("type","1");
}else if(StringUtils.equals("10",tklx)){
resMap.put("title", "其他专任教师");
resMap.put("code", "10");
resMap.put("type","1");
}
KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx1 = new KcExportConfigTpkwcqkjzglx();
kcExportConfigTpkwcqkjzglx1.setDwmc(schoolname);
kcExportConfigTpkwcqkjzglx1.setTklx(tklx);
kcExportConfigTpkwcqkjzglx1.setXqxn(kcExportConfigTpkwcqkjzglx.getXqxn());
List<KcExportConfigTpkwcqkjzglx> infolist = baseMapper.getTjinfoList(kcExportConfigTpkwcqkjzglx1);
int ywcrs = 0;//已完成人数
int wwcrs = 0;//未完成人数
int ypkcs = 0;//应评课次数
int sjpkcs = 0;//实际评课次数
for(int i=0;i<infolist.size();i++){
KcExportConfigTpkwcqkjzglx KcExportConfigTpkwcqkjzglx2 = infolist.get(i);
if(KcExportConfigTpkwcqkjzglx2!=null){
int a1= Integer.parseInt(KcExportConfigTpkwcqkjzglx2.getYtkcs());
int a2= Integer.parseInt(KcExportConfigTpkwcqkjzglx2.getSjtkcs());
if(a1<=a2){
ywcrs++;
}else{
wwcrs++;
}
ypkcs = ypkcs+Integer.parseInt(KcExportConfigTpkwcqkjzglx2.getYtkcs());
sjpkcs = sjpkcs+Integer.parseInt(KcExportConfigTpkwcqkjzglx2.getSjtkcs());
}
}
resMap.put("zrs",ywcrs+wwcrs);//总人数
resMap.put("ywcrs",ywcrs);//已完成人数
resMap.put("wwcrs",wwcrs);//未完成人数
resMap.put("ypkcs",ypkcs);//应评课次数
resMap.put("sjpkcs",sjpkcs);//实际评课次数
resMapList.add(resMap);
}
//------------------获取统计数据------------------------------------
return resMapList;
}
@Override
public void updateJzgzzzt(KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx) {
baseMapper.updateJzgzzzt(kcExportConfigTpkwcqkjzglx);
}
}

View File

@ -0,0 +1,51 @@
package org.jeecg.modules.kc.grab.SynchronizationService;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx;
import org.jeecg.modules.kc.config.service.IKcExportConfigTpkwcqkjzglxService;
import org.jeecg.modules.kc.grab.SynchronizationService.base.BaseSync;
import org.jeecg.modules.kc.kcGongkaike.entity.KcGongkaike;
import org.jeecg.modules.kc.kcGongkaike.service.IKcGongkaikeService;
import org.jeecg.modules.kc.kcSysConfig.entity.KcSysConfig;
import org.jeecg.modules.kc.kcSysConfig.service.IKcSysConfigService;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 同步教职工在职状态
*/
@Slf4j
public class JzgzzztTask extends BaseSync {
@Autowired
private IKcExportConfigTpkwcqkjzglxService kcExportConfigTpkwcqkjzglxService;
@Autowired
private IKcSysConfigService kcSysConfigService;
@Override
public void execute(JobExecutionContext jobExecutionContext) {
start();
run(getParamMap());
end();
}
public void run(Map<String, Object> param){
KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx = new KcExportConfigTpkwcqkjzglx();
kcExportConfigTpkwcqkjzglx.setXqxn(kcSysConfig.getFlag1());
kcExportConfigTpkwcqkjzglxService.updateJzgzzzt(kcExportConfigTpkwcqkjzglx);
}
public void run(){
run(null);
}
}