|
|
@ -8,6 +8,9 @@ import cn.teammodel.common.IdRequest;
|
|
|
|
import cn.teammodel.common.PK;
|
|
|
|
import cn.teammodel.common.PK;
|
|
|
|
import cn.teammodel.config.exception.ServiceException;
|
|
|
|
import cn.teammodel.config.exception.ServiceException;
|
|
|
|
import cn.teammodel.model.dto.Appraise.*;
|
|
|
|
import cn.teammodel.model.dto.Appraise.*;
|
|
|
|
|
|
|
|
import cn.teammodel.model.dto.admin.common.GroupDto;
|
|
|
|
|
|
|
|
import cn.teammodel.model.dto.admin.common.RGroupList;
|
|
|
|
|
|
|
|
import cn.teammodel.model.dto.admin.common.RMember;
|
|
|
|
import cn.teammodel.model.entity.User;
|
|
|
|
import cn.teammodel.model.entity.User;
|
|
|
|
import cn.teammodel.model.entity.appraise.*;
|
|
|
|
import cn.teammodel.model.entity.appraise.*;
|
|
|
|
import cn.teammodel.model.entity.school.ClassInfo;
|
|
|
|
import cn.teammodel.model.entity.school.ClassInfo;
|
|
|
@ -18,10 +21,9 @@ import cn.teammodel.model.vo.appraise.StudentReportVo;
|
|
|
|
import cn.teammodel.repository.*;
|
|
|
|
import cn.teammodel.repository.*;
|
|
|
|
import cn.teammodel.security.utils.SecurityUtil;
|
|
|
|
import cn.teammodel.security.utils.SecurityUtil;
|
|
|
|
import cn.teammodel.service.EvaluationService;
|
|
|
|
import cn.teammodel.service.EvaluationService;
|
|
|
|
import cn.teammodel.utils.ChartUtil;
|
|
|
|
import cn.teammodel.utils.*;
|
|
|
|
import cn.teammodel.utils.PdfUtil;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import cn.teammodel.utils.RepositoryUtil;
|
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
|
import cn.teammodel.utils.SchoolDateUtil;
|
|
|
|
|
|
|
|
import com.azure.cosmos.models.CosmosPatchOperations;
|
|
|
|
import com.azure.cosmos.models.CosmosPatchOperations;
|
|
|
|
import com.azure.spring.data.cosmos.core.query.CosmosPageRequest;
|
|
|
|
import com.azure.spring.data.cosmos.core.query.CosmosPageRequest;
|
|
|
|
import com.itextpdf.text.DocumentException;
|
|
|
|
import com.itextpdf.text.DocumentException;
|
|
|
@ -32,6 +34,8 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.jfree.chart.ChartUtils;
|
|
|
|
import org.jfree.chart.ChartUtils;
|
|
|
|
import org.jfree.chart.JFreeChart;
|
|
|
|
import org.jfree.chart.JFreeChart;
|
|
|
|
import org.jfree.data.general.DefaultPieDataset;
|
|
|
|
import org.jfree.data.general.DefaultPieDataset;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
@ -40,6 +44,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
@ -430,14 +435,14 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<AppraiseRecordVo> findVoteRecord(FindVoteRecordDto findVoteRecordDto) {
|
|
|
|
public List<AppraiseRecordVo> findVoteRecord(FindVoteRecordDto findVoteRecordDto, HttpServletRequest request) {
|
|
|
|
String periodId = findVoteRecordDto.getPeriodId();
|
|
|
|
String periodId = findVoteRecordDto.getPeriodId();
|
|
|
|
String targetId = StringUtils.isBlank(findVoteRecordDto.getTargetId()) ? null : findVoteRecordDto.getTargetId();
|
|
|
|
String targetId = StringUtils.isBlank(findVoteRecordDto.getTargetId()) ? null : findVoteRecordDto.getTargetId();
|
|
|
|
String targetType = StringUtils.isBlank(findVoteRecordDto.getTargetType()) ? null : findVoteRecordDto.getTargetType();
|
|
|
|
String targetType = StringUtils.isBlank(findVoteRecordDto.getTargetType()) ? null : findVoteRecordDto.getTargetType();
|
|
|
|
String classId = StringUtils.isBlank(findVoteRecordDto.getClassId()) ? null : findVoteRecordDto.getClassId();
|
|
|
|
String classId = StringUtils.isBlank(findVoteRecordDto.getClassId()) ? null : findVoteRecordDto.getClassId();
|
|
|
|
Boolean isPraise = findVoteRecordDto.getIsPraise();
|
|
|
|
Boolean isPraise = findVoteRecordDto.getIsPraise();
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
String teacherId = loginUser.getId();
|
|
|
|
String teacherId = "1530782422";
|
|
|
|
String schoolId = loginUser.getSchoolId();
|
|
|
|
String schoolId = loginUser.getSchoolId();
|
|
|
|
|
|
|
|
|
|
|
|
List<School.Semester> semesters = schoolRepository.findSemestersById(schoolId, periodId);
|
|
|
|
List<School.Semester> semesters = schoolRepository.findSemestersById(schoolId, periodId);
|
|
|
@ -457,6 +462,41 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
List<AppraiseRecordVo> content = appraiseRecordItemPage.getContent();
|
|
|
|
List<AppraiseRecordVo> content = appraiseRecordItemPage.getContent();
|
|
|
|
|
|
|
|
//提取学生ID 查询学生个人信息
|
|
|
|
|
|
|
|
Set<String> studentIds = content.stream().map(AppraiseRecordVo::getTargetId).collect(Collectors.toSet());
|
|
|
|
|
|
|
|
if (studentIds.isEmpty()) throw new ServiceException(ErrorCode.PARAM_ERROR.getCode(), "没有对应学生信息");
|
|
|
|
|
|
|
|
List<Student> students = studentRepository.findAllByCodeAndIdIn(String.format(PK.STUDENT, schoolId), studentIds);
|
|
|
|
|
|
|
|
Set<String> classIds = students.stream().map(Student::getClassId).filter(Objects::nonNull).collect(Collectors.toSet());
|
|
|
|
|
|
|
|
List<ClassInfo> classes = classRepository.findAllByCodeAndIdIn(String.format(PK.CLASS, schoolId), classIds);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//以防万一 其他成员名单
|
|
|
|
|
|
|
|
/*GroupDto groupDto = new GroupDto();
|
|
|
|
|
|
|
|
groupDto.setIds(new ArrayList<>(classIds));
|
|
|
|
|
|
|
|
groupDto.setSchoolId(schoolId);
|
|
|
|
|
|
|
|
String url = env.getProperty("ies.server-url-group");
|
|
|
|
|
|
|
|
Map<String, Object> groupId = GroupUtil.getGroupId(groupDto,new GroupUtil(env), request,url);
|
|
|
|
|
|
|
|
List<RGroupList> rGroupList = new ArrayList<>();
|
|
|
|
|
|
|
|
List<RMember> rMembers = new ArrayList<>();
|
|
|
|
|
|
|
|
for (Map.Entry<String, Object> entry : groupId.entrySet()) {
|
|
|
|
|
|
|
|
String key = entry.getKey();
|
|
|
|
|
|
|
|
Object value = entry.getValue();
|
|
|
|
|
|
|
|
if (key.equals("groups")) {
|
|
|
|
|
|
|
|
String jsonGroups = JSON.toJSONString(value);
|
|
|
|
|
|
|
|
rGroupList = JSON.parseObject(jsonGroups, new TypeReference<List<RGroupList>>() {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
for(AppraiseRecordVo appraiseRecordVo : content) {
|
|
|
|
|
|
|
|
students.stream().filter(student -> student.getId().equals(appraiseRecordVo.getTargetId()))
|
|
|
|
|
|
|
|
.findFirst()
|
|
|
|
|
|
|
|
.ifPresent(student -> {
|
|
|
|
|
|
|
|
appraiseRecordVo.setClassId(student.getClassId());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
classes.stream().filter(classInfo -> classInfo.getId().equals(appraiseRecordVo.getClassId()))
|
|
|
|
|
|
|
|
.findFirst()
|
|
|
|
|
|
|
|
.ifPresent(classInfo -> {
|
|
|
|
|
|
|
|
appraiseRecordVo.setClassName(classInfo.getName());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
return content;
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|