2023年11月19日 更改导出
This commit is contained in:
parent
0aecd76384
commit
303889b070
|
@ -1,6 +1,7 @@
|
||||||
package org.jeecg.modules.kc.config.export;
|
package org.jeecg.modules.kc.config.export;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.beust.jcommander.internal.Sets;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -29,6 +30,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,9 +165,17 @@ public class Export extends BaseExport {
|
||||||
Xxhbuser xxhbUser = xxhbuserService.getOne(uqw);
|
Xxhbuser xxhbUser = xxhbuserService.getOne(uqw);
|
||||||
if(xxhbUser == null) {
|
if(xxhbUser == null) {
|
||||||
queryWrapper.eq("dwmc ",-1);
|
queryWrapper.eq("dwmc ",-1);
|
||||||
|
}else{
|
||||||
|
queryWrapper.eq("dwmc ",xxhbUser.getDwmc());
|
||||||
}
|
}
|
||||||
queryWrapper.eq("dwmc ",xxhbUser.getDwmc());
|
|
||||||
}
|
}
|
||||||
|
// Set<GroupConfig> conSet = Sets.newHashSet();
|
||||||
|
// if(!groupConfigMap.isEmpty()){
|
||||||
|
// groupConfigMap.forEach((k,v) -> conSet.addAll(v));
|
||||||
|
// }
|
||||||
|
// if(!conSet.isEmpty()){
|
||||||
|
// queryWrapper.in("", conSet);
|
||||||
|
// }
|
||||||
|
|
||||||
List<KcExportConfigTpkwcqkjzglx> KcExportConfigTpkwcqkjzglxList = kcExportConfigTpkwcqkjzglxService.list(queryWrapper);
|
List<KcExportConfigTpkwcqkjzglx> KcExportConfigTpkwcqkjzglxList = kcExportConfigTpkwcqkjzglxService.list(queryWrapper);
|
||||||
Map<String, List<KcExportConfigTpkwcqkjzglx>> ghMap = KcExportConfigTpkwcqkjzglxList.stream().filter(x -> StringUtils.isNotBlank(x.getGh())).collect(Collectors.groupingBy(KcExportConfigTpkwcqkjzglx::getGh));
|
Map<String, List<KcExportConfigTpkwcqkjzglx>> ghMap = KcExportConfigTpkwcqkjzglxList.stream().filter(x -> StringUtils.isNotBlank(x.getGh())).collect(Collectors.groupingBy(KcExportConfigTpkwcqkjzglx::getGh));
|
||||||
|
@ -204,7 +214,7 @@ public class Export extends BaseExport {
|
||||||
|
|
||||||
Map<String,List<KcExportConfigTpkwcqkjzglx>> allListMap = Maps.newLinkedHashMap();
|
Map<String,List<KcExportConfigTpkwcqkjzglx>> allListMap = Maps.newLinkedHashMap();
|
||||||
|
|
||||||
groupConfigMap.forEach((k,v) -> {
|
groupConfigMap.forEach((k,v) ->
|
||||||
v.forEach(x -> {
|
v.forEach(x -> {
|
||||||
if(typeMap.containsKey(x.getDictKey())){
|
if(typeMap.containsKey(x.getDictKey())){
|
||||||
// allListMap.put(k,typeMap.get(x.getDictKey()));
|
// allListMap.put(k,typeMap.get(x.getDictKey()));
|
||||||
|
@ -219,8 +229,8 @@ public class Export extends BaseExport {
|
||||||
}else{
|
}else{
|
||||||
allListMap.put(k,Lists.newArrayList());
|
allListMap.put(k,Lists.newArrayList());
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
});
|
);
|
||||||
|
|
||||||
|
|
||||||
// List<KcExportConfigTpkwcqkjzglx> oneList = typeMap.get("1");
|
// List<KcExportConfigTpkwcqkjzglx> oneList = typeMap.get("1");
|
||||||
|
@ -256,9 +266,7 @@ public class Export extends BaseExport {
|
||||||
result.put("xym",kcExportConfigTpkwcqkjzglx.getDwmc());//学院名称
|
result.put("xym",kcExportConfigTpkwcqkjzglx.getDwmc());//学院名称
|
||||||
result.put("xqxn",xqxnParam);//学期学年
|
result.put("xqxn",xqxnParam);//学期学年
|
||||||
//填进去数量
|
//填进去数量
|
||||||
allListMap.forEach((k,v) -> {
|
allListMap.forEach((k,v) -> result.put(k + "Size", StringUtils.defaultString(String.valueOf(v.size()),"0")));
|
||||||
result.put(k + "Size", StringUtils.defaultString(String.valueOf(v.size()),"0"));
|
|
||||||
});
|
|
||||||
// result.put("oneListSize", StringUtils.defaultString(String.valueOf(oneList.size()),"0"));
|
// result.put("oneListSize", StringUtils.defaultString(String.valueOf(oneList.size()),"0"));
|
||||||
// result.put("twoListSize", StringUtils.defaultString(String.valueOf(twoList.size()),"0"));
|
// result.put("twoListSize", StringUtils.defaultString(String.valueOf(twoList.size()),"0"));
|
||||||
// result.put("threeListSize", StringUtils.defaultString(String.valueOf(threeList.size()),"0"));
|
// result.put("threeListSize", StringUtils.defaultString(String.valueOf(threeList.size()),"0"));
|
||||||
|
@ -278,14 +286,27 @@ public class Export extends BaseExport {
|
||||||
mainList.add(tmpList);
|
mainList.add(tmpList);
|
||||||
KcTkcstj tkcstj = tktjMap.get(x.getGh());
|
KcTkcstj tkcstj = tktjMap.get(x.getGh());
|
||||||
// tmpList.add(null);
|
// tmpList.add(null);
|
||||||
int ytkcs = Integer.parseInt(StringUtils.defaultString(x.getYtkcs(),"0"));
|
// int ytkcs = Integer.parseInt(StringUtils.defaultString(x.getYtkcs(),"0"));
|
||||||
|
int ytkcs = 0;
|
||||||
if(ghMap.containsKey(x.getGh())){
|
if(ghMap.containsKey(x.getGh())){
|
||||||
List<KcExportConfigTpkwcqkjzglx> list = ghMap.get(x.getGh());
|
List<GroupConfig> confList = groupConfigMap.get(k);
|
||||||
if(list != null && !list.isEmpty()){
|
if(!confList.isEmpty()){
|
||||||
for(KcExportConfigTpkwcqkjzglx e : list){
|
List<KcExportConfigTpkwcqkjzglx> list = ghMap.get(x.getGh());
|
||||||
int c = Integer.parseInt(StringUtils.defaultString(e.getYtkcs(),"0"));
|
List<KcExportConfigTpkwcqkjzglx> flist = Lists.newArrayList();
|
||||||
if(c > ytkcs) {
|
for (GroupConfig config: confList){
|
||||||
ytkcs = c;
|
for(KcExportConfigTpkwcqkjzglx l: list){
|
||||||
|
if(StringUtils.equals(l.getTklx(),config.getDictKey())){
|
||||||
|
flist.add(l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(flist != null && !flist.isEmpty()){
|
||||||
|
for(KcExportConfigTpkwcqkjzglx e : flist){
|
||||||
|
int c = Integer.parseInt(StringUtils.defaultString(e.getYtkcs(),"0"));
|
||||||
|
if(c > ytkcs) {
|
||||||
|
ytkcs = c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue