|
@@ -48,6 +48,7 @@ import com.xjrsoft.module.system.entity.File;
|
|
|
import com.xjrsoft.module.system.service.IFileService;
|
|
|
import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -55,6 +56,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import javax.script.ScriptEngine;
|
|
|
import javax.script.ScriptEngineManager;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.temporal.TemporalAdjusters;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -187,8 +190,9 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
|
|
|
//获取需要导出的子表
|
|
|
List<Long> baseStudentAssessmentCategoryIdList = new ArrayList<>();
|
|
|
- baseStudentAssessmentCategoryIdList.add(1727155216239882240L);
|
|
|
- baseStudentAssessmentCategoryIdList.add(1727154864019009536L);
|
|
|
+ baseStudentAssessmentCategoryIdList.add(1768178717588197377L);
|
|
|
+ baseStudentAssessmentCategoryIdList.add(1768179375900987394L);
|
|
|
+ baseStudentAssessmentCategoryIdList.add(1769927649167151105L);
|
|
|
|
|
|
LambdaQueryWrapper<BaseStudentAssessmentCategory> baseStudentAssessmentCategoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
baseStudentAssessmentCategoryLambdaQueryWrapper
|
|
@@ -203,7 +207,7 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
|
|
|
//开始处理写入
|
|
|
try (ExcelWriter excelWriter = EasyExcel.write(bot, QuantitativeAssessmentSubTableExcelVo.class).registerWriteHandler(excelFillCellMergeStrategy).build()) {
|
|
|
- int no = 0;
|
|
|
+ int no = 1;
|
|
|
for (BaseStudentAssessmentCategory bsac : baseStudentAssessmentCategorieList) {
|
|
|
dto.setBaseStudentAssessmentCategoryId(bsac.getId());
|
|
|
//sheet名
|
|
@@ -217,7 +221,107 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
excelWriter.write(quantitativeAssessmentSubTableExcelVoList, writeSheet);
|
|
|
}
|
|
|
//TODO 班级量化考核统计表总
|
|
|
+ //以班级为数据的基础进行数据的填充
|
|
|
+ MPJLambdaWrapper<BaseClass> baseClassMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
|
|
+ baseClassMPJLambdaWrapper
|
|
|
+ .selectAs(BaseClass::getTeacherId, CalssQuantitativeAssessmentPageVo::getHeadTeacherId)
|
|
|
+ .selectAs(XjrUser::getUserName, CalssQuantitativeAssessmentPageVo::getOa)
|
|
|
+ .selectAs(XjrUser::getName, CalssQuantitativeAssessmentPageVo::getHeadTeacherName)
|
|
|
+ .selectAs(BaseClass::getId, CalssQuantitativeAssessmentPageVo::getClassId)
|
|
|
+ .selectAs(BaseClass::getName, CalssQuantitativeAssessmentPageVo::getClassName)
|
|
|
+ .selectAs(BaseClassMajorSet::getTotalStudent, CalssQuantitativeAssessmentPageVo::getStudentNum)
|
|
|
+ .selectAs(BaseClass::getIsGraduate, CalssQuantitativeAssessmentPageVo::getClassStatus)
|
|
|
+ .leftJoin(XjrUser.class, XjrUser::getId, BaseClass::getTeacherId)
|
|
|
+ .leftJoin(BaseClassMajorSet.class, BaseClassMajorSet::getClassId, BaseClass::getId)
|
|
|
+ .eq(dto.getGradeId() != null, BaseClass::getGradeId, dto.getGradeId())
|
|
|
+ .eq(dto.getClassId() != null, BaseClass::getId, dto.getClassId())
|
|
|
+ .eq(dto.getClassStatus() != null, BaseClass::getIsGraduate, dto.getClassStatus())
|
|
|
+ .like(dto.getName() != null && !dto.getName().equals(""), XjrUser::getName, dto.getName())
|
|
|
+ .disableSubLogicDel();
|
|
|
+
|
|
|
+ List<CalssQuantitativeAssessmentPageVo> resultList = baseClassMapper.selectJoinList(CalssQuantitativeAssessmentPageVo.class, baseClassMPJLambdaWrapper);
|
|
|
+
|
|
|
+ //当前数据记录班级id
|
|
|
+ List<Long> classIdList = new ArrayList<>();
|
|
|
+ for(CalssQuantitativeAssessmentPageVo c: resultList){
|
|
|
+ classIdList.add(Long.parseLong(c.getClassId()));
|
|
|
+ }
|
|
|
+ dto.setClassIdList(classIdList);
|
|
|
+
|
|
|
+ if(dto.getStartTime() != null){
|
|
|
+ // 获取上个月的最后一秒
|
|
|
+ LocalDateTime lastMonthEnd = dto.getStartTime().minusMonths(1).with(TemporalAdjusters.lastDayOfMonth()).withHour(23).withMinute(59).withSecond(59);
|
|
|
+
|
|
|
+ // 获取下个月的第一秒
|
|
|
+ LocalDateTime nextMonthStart = dto.getStartTime().plusMonths(1).with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0);
|
|
|
+ dto.setStartTime(lastMonthEnd);
|
|
|
+ dto.setEndTime(nextMonthStart);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!classIdList.isEmpty()){
|
|
|
+ CalssQuantitativeAssessmentPageDto calssQuantitativeAssessmentPageDto = new CalssQuantitativeAssessmentPageDto();
|
|
|
+ BeanUtils.copyProperties(dto, calssQuantitativeAssessmentPageDto);
|
|
|
+
|
|
|
|
|
|
+ //学生个人行为
|
|
|
+ dto.setBaseStudentAssessmentCategoryId(1768178717588197377L);
|
|
|
+ Map<Long , QuantitativeAssessmentSingleScoreVo> individualBehaviorMap = getQuantitativeAssessmentSingleScoreMap(calssQuantitativeAssessmentPageDto);
|
|
|
+
|
|
|
+ //常规管理
|
|
|
+ dto.setBaseStudentAssessmentCategoryId(1769927649167151105L);
|
|
|
+ Map<Long , QuantitativeAssessmentSingleScoreVo> conventionalManagementMap = getQuantitativeAssessmentSingleScoreMap(calssQuantitativeAssessmentPageDto);
|
|
|
+
|
|
|
+ //获奖及荣誉奖彰
|
|
|
+ dto.setBaseStudentAssessmentCategoryId(1768179375900987394L);
|
|
|
+ Map<Long , QuantitativeAssessmentSingleScoreVo> awardsAndHonorableMap = getQuantitativeAssessmentSingleScoreMap(calssQuantitativeAssessmentPageDto);
|
|
|
+
|
|
|
+ //准军事化考核
|
|
|
+ List<QuantitativeAssessmentSingleScoreVo> paramilitaryList = assessmentInspectionMapper.getParamilitaryList(new QuantitativeAssessmentSingleScoreDto(){{
|
|
|
+ setClassIdList(classIdList);
|
|
|
+ }});
|
|
|
+ Map<Long , QuantitativeAssessmentSingleScoreVo> paramilitaryMap = new HashMap<>();
|
|
|
+ for (QuantitativeAssessmentSingleScoreVo q : paramilitaryList) {
|
|
|
+ awardsAndHonorableMap.put(q.getClassId(), q);
|
|
|
+ }
|
|
|
+
|
|
|
+ //将结果写进对应的班级里
|
|
|
+ for(CalssQuantitativeAssessmentPageVo c: resultList){
|
|
|
+ Long classId = Long.parseLong(c.getClassId());
|
|
|
+ if(individualBehaviorMap.get(classId) != null){
|
|
|
+ c.setStuPersonalBehaviorSubScore(individualBehaviorMap.get(classId).getSumScore());
|
|
|
+ c.setStuPersonalBehaviorScore((100 + individualBehaviorMap.get(classId).getSumScore())/100*25);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(conventionalManagementMap.get(classId) != null){
|
|
|
+ c.setClassConventionalManageSubScore(conventionalManagementMap.get(classId).getSumScore());
|
|
|
+ c.setClassConventionalManageScore((100 + conventionalManagementMap.get(classId).getSumScore())/100*25);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(awardsAndHonorableMap.get(classId) != null){
|
|
|
+ c.setHonorSumScore(awardsAndHonorableMap.get(classId).getSumScore());
|
|
|
+ if(awardsAndHonorableMap.get(classId).getSumScore() < 10){
|
|
|
+ c.setHonorScore(awardsAndHonorableMap.get(classId).getSumScore());
|
|
|
+ }else {
|
|
|
+ c.setHonorScore(10D);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(c.getClassStatus() != null){
|
|
|
+ if(c.getClassStatus() == 1){
|
|
|
+ c.setClassStatusCn("在读");
|
|
|
+ }
|
|
|
+ if(c.getClassStatus() == 2){
|
|
|
+ c.setClassStatusCn("毕业");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //sheet名
|
|
|
+ String sheetName = "量化考核总表";
|
|
|
+
|
|
|
+// WriteSheet writeSheet = EasyExcel.writerSheet(0, sheetName ).build();
|
|
|
+//
|
|
|
+// excelWriter.write(resultList, writeSheet);
|
|
|
}
|
|
|
/*for (BaseStudentAssessmentCategory bsac : baseStudentAssessmentCategorieList) {
|
|
|
dto.setBaseStudentAssessmentCategoryId(bsac.getId());
|
|
@@ -271,6 +375,16 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
}
|
|
|
dto.setClassIdList(classIdList);
|
|
|
|
|
|
+ if(dto.getStartTime() != null){
|
|
|
+ // 获取上个月的最后一秒
|
|
|
+ LocalDateTime lastMonthEnd = dto.getStartTime().minusMonths(1).with(TemporalAdjusters.lastDayOfMonth()).withHour(23).withMinute(59).withSecond(59);
|
|
|
+
|
|
|
+ // 获取下个月的第一秒
|
|
|
+ LocalDateTime nextMonthStart = dto.getStartTime().plusMonths(1).with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0);
|
|
|
+ dto.setStartTime(lastMonthEnd);
|
|
|
+ dto.setEndTime(nextMonthStart);
|
|
|
+ }
|
|
|
+
|
|
|
if(!classIdList.isEmpty()){
|
|
|
//学生个人行为
|
|
|
dto.setBaseStudentAssessmentCategoryId(1768178717588197377L);
|