|
|
@@ -7,6 +7,7 @@ import com.xjrsoft.module.student.dto.EnrollmentStatisticsCalendarInfoDto;
|
|
|
import com.xjrsoft.module.student.dto.EnrollmentStatisticsGraduationInfoDto;
|
|
|
import com.xjrsoft.module.student.entity.*;
|
|
|
import com.xjrsoft.module.student.mapper.PbCseFeeobjupdateMapper;
|
|
|
+import com.xjrsoft.module.student.mapper.PbVXsxxsfytbMapper;
|
|
|
import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
|
|
|
import com.xjrsoft.module.student.service.IPbCseSpecplanService;
|
|
|
import com.xjrsoft.module.student.vo.*;
|
|
|
@@ -21,6 +22,7 @@ import java.text.DecimalFormat;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -38,6 +40,7 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
|
|
|
|
|
|
@Autowired
|
|
|
private final IPbCseSpecplanService pbCseSpecplanService;
|
|
|
+ private final PbVXsxxsfytbMapper pbVXsxxsfytbMapper;
|
|
|
|
|
|
@Override
|
|
|
public EnrollmentStatisticsInfoVo getEnrollmentStatisticsInfo(EnrollmentStatisticsInfoDto dto) {
|
|
|
@@ -61,13 +64,20 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
|
|
|
|
|
|
if(pbCseFeeobjupdateList != null && !pbCseFeeobjupdateList.isEmpty()){
|
|
|
//专业排行
|
|
|
- Map<String, Long> professionalHeadCount = pbCseFeeobjupdateList.stream().collect(Collectors.groupingBy(PbCseFeeobjupdate::getSpecname, Collectors.counting()));
|
|
|
+ Map<String, Long> professionalHeadCount = pbCseFeeobjupdateList.stream().filter(x -> x.getSpecname() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getSpecname, Collectors.counting()));
|
|
|
if(!professionalHeadCount.isEmpty()){
|
|
|
professionalHeadCount = professionalHeadCount.entrySet().stream()
|
|
|
.sorted(Map.Entry.<String, Long>comparingByValue().reversed())
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
|
|
|
(e1, e2) -> e1, LinkedHashMap::new));
|
|
|
}
|
|
|
+ //查询每个专业的缴费人数
|
|
|
+ List<PbVXsxxsfytbSpecnameCountVo> specnameCountVos = pbVXsxxsfytbMapper.getSpecnameCount(dto);
|
|
|
+ Map<String, Integer> specnameCountMap = new HashMap<>();
|
|
|
+ for (PbVXsxxsfytbSpecnameCountVo specnameCountVo : specnameCountVos) {
|
|
|
+ specnameCountMap.put(specnameCountVo.getSpecname(), specnameCountVo.getStudentCount());
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//专业计划人数,余数
|
|
|
MPJLambdaWrapper<PbCseSpecplan> pbCseSpecplanMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
|
|
@@ -93,6 +103,10 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
|
|
|
if(pbCseSpecplanSumMap.get(entry.getKey()) != null){
|
|
|
setPlannedNumber(pbCseSpecplanSumMap.get(entry.getKey()));
|
|
|
setRemainder(pbCseSpecplanSumMap.get(entry.getKey()) - entry.getValue());
|
|
|
+ setPaymentCount(specnameCountMap.get(entry.getKey()));
|
|
|
+ }
|
|
|
+ if(specnameCountMap.get(entry.getKey()) != null){
|
|
|
+ setPaymentCount(specnameCountMap.get(entry.getKey()));
|
|
|
}
|
|
|
}});
|
|
|
}
|
|
|
@@ -105,7 +119,7 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
|
|
|
}
|
|
|
|
|
|
//住宿类型
|
|
|
- Map<String, Long> accommodationType = pbCseFeeobjupdateList.stream().collect(Collectors.groupingBy(PbCseFeeobjupdate::getQuartername, Collectors.counting()));
|
|
|
+ Map<String, Long> accommodationType = pbCseFeeobjupdateList.stream().filter(x -> x.getQuartername() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getQuartername, Collectors.counting()));
|
|
|
List<EnrollmentStatisticsInfoKeyValue> accommodationTypeRes = new ArrayList<>();
|
|
|
for (Map.Entry<String, Long> entry : accommodationType.entrySet()) {
|
|
|
accommodationTypeRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
|