2023年11月17日 修复导出的问题
This commit is contained in:
parent
82712c79b7
commit
2478826355
|
@ -14,9 +14,12 @@ 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.kcXqxnHistory.entity.KcXqxnHistory;
|
||||
import org.jeecg.modules.kc.kcZwtksfInfo.entity.KcZwtksfInfo;
|
||||
import org.jeecg.modules.kc.kcZwtksfInfo.service.IKcZwtksfInfoService;
|
||||
import org.jeecg.modules.kc.tksf.kctkcstj.entity.KcTkcstj;
|
||||
import org.jeecg.modules.kc.tksf.kctkcstj.service.IKcTkcstjService;
|
||||
import org.jeecg.modules.system.service.ISysDictService;
|
||||
import org.jeecg.modules.tools.DictUtils;
|
||||
import org.jeecg.modules.tools.word.BaseExport;
|
||||
import org.jeecg.modules.tools.word.ExportWord;
|
||||
import org.jeecg.modules.tools.word.WordOperator;
|
||||
|
@ -54,6 +57,10 @@ public class Export extends BaseExport {
|
|||
|
||||
private ChangeTingKeTongJi changeTingKeTongJi = SpringContextHolder.getBean(ChangeTingKeTongJi.class);
|
||||
|
||||
private IKcZwtksfInfoService kcZwtksfInfoService = SpringContextHolder.getBean(IKcZwtksfInfoService.class);
|
||||
|
||||
private DictUtils dictUtil = SpringContextHolder.getBean(DictUtils.class);
|
||||
|
||||
@Data
|
||||
public class GroupConfig{
|
||||
private String key;//唯组合到这个键里
|
||||
|
@ -84,14 +91,26 @@ public class Export extends BaseExport {
|
|||
|
||||
private void initGroupConfigMap(){
|
||||
groupConfigMap = Maps.newLinkedHashMap();
|
||||
GroupConfig config;
|
||||
config = genConfig("oneList","学院(部)教务委员会委员","340"); putGroupConfigMap(config.getKey(),config);
|
||||
config = genConfig("twoList","行政负责人、教学副院(部)长及系(专业)负责人","220"); putGroupConfigMap(config.getKey(),config);
|
||||
config = genConfig("threeList","其他党政领导及辅导员","110"); putGroupConfigMap(config.getKey(),config);
|
||||
config = genConfig("threeList","其他党政领导及辅导员","210"); putGroupConfigMap(config.getKey(),config);
|
||||
config = genConfig("threeList","其他党政领导及辅导员","270"); putGroupConfigMap(config.getKey(),config);
|
||||
config = genConfig("threeList","其他党政领导及辅导员","280"); putGroupConfigMap(config.getKey(),config);
|
||||
config = genConfig("fourList","其他专任教师","10"); putGroupConfigMap(config.getKey(),config);
|
||||
//从数据库查询
|
||||
List<KcZwtksfInfo> list = kcZwtksfInfoService.list();
|
||||
|
||||
list.forEach(x -> {
|
||||
String[] tksfs = StringUtils.split(x.getTksf(),",");
|
||||
//tksfs
|
||||
for (String tksf : tksfs) {
|
||||
GroupConfig config;
|
||||
config = genConfig(x.getZw(), dictUtil.translateDictValue("pdfzw", x.getZw()), tksf);
|
||||
putGroupConfigMap(config.getKey(), config);
|
||||
}
|
||||
});
|
||||
|
||||
// config = genConfig("oneList","学院(部)教务委员会委员","340"); putGroupConfigMap(config.getKey(),config);
|
||||
// config = genConfig("twoList","行政负责人、教学副院(部)长及系(专业)负责人","220"); putGroupConfigMap(config.getKey(),config);
|
||||
// config = genConfig("threeList","其他党政领导及辅导员","110"); putGroupConfigMap(config.getKey(),config);
|
||||
// config = genConfig("threeList","其他党政领导及辅导员","210"); putGroupConfigMap(config.getKey(),config);
|
||||
// config = genConfig("threeList","其他党政领导及辅导员","270"); putGroupConfigMap(config.getKey(),config);
|
||||
// config = genConfig("threeList","其他党政领导及辅导员","280"); putGroupConfigMap(config.getKey(),config);
|
||||
// config = genConfig("fourList","其他专任教师","10"); putGroupConfigMap(config.getKey(),config);
|
||||
}
|
||||
// /**
|
||||
// *
|
||||
|
@ -100,7 +119,7 @@ public class Export extends BaseExport {
|
|||
// * 修改日期 : 2018年9月26日
|
||||
// * @param
|
||||
// * @return 文档片段的list对象
|
||||
// * @throws Exception
|
||||
// * @throws Exceptionz
|
||||
// */
|
||||
// public List<WordOperator> exportAll(QnCustomerHetong customerHetong, SysUser user, Date now) throws Exception{
|
||||
// List<WordOperator> list = Lists.newArrayList();
|
||||
|
|
|
@ -27,10 +27,7 @@ import org.quartz.JobExecutionContext;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
|
@ -149,9 +146,16 @@ public class RefreshLiveServer extends BaseSync {
|
|||
});
|
||||
|
||||
}
|
||||
UpdateWrapper<KcZhihuijiaoshi> allOutUw = new UpdateWrapper<>();
|
||||
allOutUw.set("sfyx", 1);//关闭
|
||||
allOutUw.set("update_by","system");
|
||||
allOutUw.set("update_time",new Date());
|
||||
//allOutUw.notIn("jsbh", Arrays.asList(onList.toArray(), outList.toArray()));
|
||||
kcZhihuijiaoshiService.update(allOutUw);
|
||||
|
||||
if(!onList.isEmpty()){
|
||||
UpdateWrapper<KcZhihuijiaoshi> onUw = new UpdateWrapper<>();
|
||||
onUw.set("sfyx",0);
|
||||
onUw.set("sfyx",0);//打开
|
||||
onUw.set("update_by","system");
|
||||
onUw.set("update_time",new Date());
|
||||
onUw.in("jsbh",onList);
|
||||
|
@ -160,7 +164,7 @@ public class RefreshLiveServer extends BaseSync {
|
|||
|
||||
if(!outList.isEmpty()) {
|
||||
UpdateWrapper<KcZhihuijiaoshi> outUw = new UpdateWrapper<>();
|
||||
outUw.set("sfyx", 1);
|
||||
outUw.set("sfyx", 1);//关闭
|
||||
outUw.set("update_by","system");
|
||||
outUw.set("update_time",new Date());
|
||||
outUw.in("jsbh", outList);
|
||||
|
|
|
@ -289,6 +289,7 @@ public class Export extends BaseExport {
|
|||
}
|
||||
//01 聚合数据,
|
||||
Map<String, KcZhihuijiaoshiMonitorLog> mainLogMap = Maps.newHashMap();
|
||||
// Map<String, TwoListClass> jsNumMap = Maps.newHashMap();
|
||||
for(KcZhihuijiaoshiMonitorLog mainLog: mainLogList){
|
||||
String day = formatDate(mainLog.getCreateTime(), "yyyy-MM-dd");
|
||||
String key = day + "-" + mainLog.getHh() + "-" + mainLog.getKtId();
|
||||
|
@ -301,8 +302,40 @@ public class Export extends BaseExport {
|
|||
}else{
|
||||
mainLogMap.put(key,mainLog);
|
||||
}
|
||||
//先行计算每个教室的课堂数,成功,失败数
|
||||
//TwoListClass
|
||||
// String key2 = mainLog.getJsmc();
|
||||
// if(jsNumMap.containsKey(key2)){
|
||||
// TwoListClass o = jsNumMap.get(key2);
|
||||
//
|
||||
// }else{
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
//先行计算每个教室的课堂数,成功,失败数
|
||||
Map<String, TwoListClass> jsNumMap = Maps.newHashMap();
|
||||
for (KcZhihuijiaoshiMonitorLog miniLog: mainLogMap.values()){
|
||||
String key = miniLog.getJsmc();
|
||||
TwoListClass o = null;
|
||||
if(jsNumMap.containsKey(key)){
|
||||
o = jsNumMap.get(key);
|
||||
}else{
|
||||
o = new TwoListClass();
|
||||
o.setKfkts(0);//开放数
|
||||
o.setZckts(0);//正常
|
||||
o.setYckts(0);//异常
|
||||
jsNumMap.put(key,o);
|
||||
}
|
||||
o.addKfkts(1);
|
||||
if(miniLog.getLogType() == null || miniLog.getLogType() != 1){
|
||||
o.addYckts(1);
|
||||
}else{
|
||||
o.addZckts(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//折腾数据
|
||||
int jxls = 0;
|
||||
int jss = 0;
|
||||
|
@ -644,6 +677,22 @@ public class Export extends BaseExport {
|
|||
|
||||
Map<String, Object> result2 = Maps.newHashMap();
|
||||
//result2.put("教学楼数", "0");
|
||||
Map<String, Integer> jxlMap = Maps.newHashMap();
|
||||
for (String key: mainLogMap.keySet()) {
|
||||
KcZhihuijiaoshiMonitorLog o = mainLogMap.get(key);
|
||||
String skey = o.getJsmc();
|
||||
if(jxlMap.containsKey(skey)){
|
||||
Integer num = jxlMap.get(skey);
|
||||
num = num+1;
|
||||
jxlMap.put(skey,num);
|
||||
}else{
|
||||
jxlMap.put(skey,1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int rowIndex = 1;
|
||||
for (String key: twoListMap.keySet()){
|
||||
TwoListClass o = twoListMap.get(key);
|
||||
|
@ -651,10 +700,13 @@ public class Export extends BaseExport {
|
|||
//教学楼 教室名称 开放课堂数 正常课堂率 正常课堂数 异常课堂数 异常情况说明
|
||||
list.add(o.getJxl());
|
||||
list.add(o.getJsmc());
|
||||
list.add(StringUtils.defaultString(String.valueOf(o.getKfkts()),"0"));
|
||||
list.add(StringUtils.defaultString(String.valueOf(o.getZcktl().toString()),"0"));
|
||||
list.add(StringUtils.defaultString(String.valueOf(o.getZckts()),"0"));
|
||||
list.add(StringUtils.defaultString(String.valueOf(o.getYckts()),"0"));
|
||||
|
||||
TwoListClass numO = jsNumMap.get(o.getJsmc());
|
||||
if(numO == null) numO = new TwoListClass();
|
||||
list.add(StringUtils.defaultString(String.valueOf(numO.getKfkts()),"0"));
|
||||
list.add(StringUtils.defaultString(String.valueOf(numO.getZcktl().toString()),"0"));
|
||||
list.add(StringUtils.defaultString(String.valueOf(numO.getZckts()),"0"));
|
||||
list.add(StringUtils.defaultString(String.valueOf(numO.getYckts()),"0"));
|
||||
//1.异常节次: 异常课程: 监测次数: 异常次数: 异常率:
|
||||
// Integer jccs = 0;
|
||||
//
|
||||
|
|
|
@ -904,10 +904,11 @@ public class WordOperator {
|
|||
// 取出这一行对应的数据,数据与单元格角标位置是一致的,一一替换文本
|
||||
List<String> colList = dataList.get(i);
|
||||
for (int j = 0; j < cellList.size(); j++) {
|
||||
if(StringUtils.contains(colList.get(j),"\n")){
|
||||
setCellMultiLineText(cellList.get(j), colList, j);
|
||||
}
|
||||
setCellText(cellList.get(j), colList, j);
|
||||
// if(StringUtils.contains(colList.get(j),"\n")){
|
||||
// setCellMultiLineText(cellList.get(j), colList, j);
|
||||
// }else{
|
||||
setCellText(cellList.get(j), colList, j);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue