diff --git a/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java b/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java index 4971a51..26b0387 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java +++ b/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java @@ -5,6 +5,8 @@ import cn.teammodel.config.exception.ServiceException; import cn.teammodel.controller.admin.service.ExamService; import cn.teammodel.model.dto.admin.common.RGroupList; import cn.teammodel.model.dto.admin.exam.OverViewDto; +import cn.teammodel.model.entity.common.Exam; +import cn.teammodel.repository.ExamRepository; import cn.teammodel.utils.GroupUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; @@ -12,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.*; @@ -20,6 +23,8 @@ public class ExamServiceImpl implements ExamService { @Autowired private Environment env; + @Resource + private ExamRepository examRepository; @Override public Map getAnalysis(OverViewDto overViewDto, HttpServletRequest request) { @@ -27,6 +32,9 @@ public class ExamServiceImpl implements ExamService { String url = env.getProperty("ies.server-url-overview"); try { overView = GroupUtil.getGroupId(overViewDto,new GroupUtil(env), request,url); + //获取所有考试数据 + //List exams = examRepository.findExamByClassId("Exam-"+overViewDto.getSchool(),overViewDto.getClassId(),overViewDto.getPeriodId()); + //List rMembers = new ArrayList<>(); /*for (Map.Entry entry : groupId.entrySet()) { String key = entry.getKey(); diff --git a/src/main/java/cn/teammodel/model/dto/admin/exam/OverViewDto.java b/src/main/java/cn/teammodel/model/dto/admin/exam/OverViewDto.java index 57c3661..60dcc02 100644 --- a/src/main/java/cn/teammodel/model/dto/admin/exam/OverViewDto.java +++ b/src/main/java/cn/teammodel/model/dto/admin/exam/OverViewDto.java @@ -3,6 +3,8 @@ package cn.teammodel.model.dto.admin.exam; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + @Data public class OverViewDto { @ApiModelProperty("指定学年") @@ -13,4 +15,7 @@ public class OverViewDto { private String periodId; @ApiModelProperty("学生入学年") private int studentYear; + private List classIds; + private Long startTime; + private Long endTime; } diff --git a/src/main/java/cn/teammodel/model/entity/common/Exam.java b/src/main/java/cn/teammodel/model/entity/common/Exam.java new file mode 100644 index 0000000..d78bd4b --- /dev/null +++ b/src/main/java/cn/teammodel/model/entity/common/Exam.java @@ -0,0 +1,197 @@ +package cn.teammodel.model.entity.common; + +import cn.teammodel.model.entity.BaseItem; +import com.azure.spring.data.cosmos.core.mapping.Container; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + + +@EqualsAndHashCode(callSuper = true) +@Container(containerName = "Common") +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Exam extends BaseItem { + public String owner; + public String name; + public String school; + public String creatorId; + public int stuCount; + /* //实际考试人数 + public int realCount; + //平均分 + public double piont;*/ + //指标 + //public double index; + public long createTime; + public long updateTime; + //public String examCode; + + /// + /// 施测起始时间 + /// + public long startTime; + /// + /// 施测结束时间 + /// + public long endTime; + /// + /// 施测对象 + /// + // public List target; + /// + /// 发布 + /// + //public String publish; + + + public int year; + //public String range; + /// + /// 评测类型 + /// + public String source; + /// + /// 書面問答類型 0:書面問答 1:紙本測驗 2:艺术评测3:多分同步活动 + /// + public int qamode; + + /// + ///class行政班/teach教学班 + /// + //public String classType; + public List classes; + public List stuLists; + + public List papers; + ///考试类型 段考 stage 联考 union 平常考 normal 其他 other + /// + public String type; + public PeriodSimple period; + public List grades; + public List subjects; + + //public Condition conditions; + //public List blobUrl; + public String progress; + public String scope; + public Custom examType; + /// + /// 所有试卷阅卷状态 + /// + //public List marks; + /// + /// TTL删除改变状态使用 + /// + public int status; + public double average; + //得分率 + public double sRate; + //缺考率 + public double qRate; + //缺考人数 + public List lostStu; + public double standard; + //记录该评测内容下blob大小 + public long size; + //进线比列 + public int income; + //踩线比列 + public int touch; + public int publish; + //评分状态,0未评分,1已评分 + public int sStatus; + public int isCompletion; + + + //结束后账户统计 + public List staffIds; + //是否啟動cloudas計算 true:啟動 + public boolean cloudas; + //統測ID [測試中] + public String jointExamId; + public String moofenCode; + //不可重複作答 + public boolean overwriteDisable; + + @Data + public static class Custom { + public String id ; + public String name ; + } + + @Data + public static class ExamSubject + { + public String id ; + public String name ; + public int classCount ; + } + + @Data + public static class PaperSimple { + public String id ; + public String subjectId ; + public String code ; + //标记试卷来源学段 + public String periodId ; + public String name ; + public String blob ; + public String scope ; + public int multipleRule ; + //该试卷配分情况 + public List point ; + public List> answers ; + public List> knowledge ; + //题目类型 + public List type ; + public List field ; + public String sheet ; + public String sheetNo ; + + public String mode ; + //记录试卷作答时间 + public int time ; + + + } +@Data + public static class PeriodSimple + { + + public String id ; + public String name ; + } +@Data + public static class Grade + { + public String id ; + public String name ; + } +@Data + public static class FMember + { + /// + /// 账号id + /// + public String id ; + /// + /// 所在学校的学校id + /// + public String code ; + /// + /// 账户类型 + /// + public int type ; + /// + /// 分组id + /// + public String groupId ; + /// + /// 分组名称 + /// + public String groupName ; + } +} diff --git a/src/main/java/cn/teammodel/repository/ArtRepository.java b/src/main/java/cn/teammodel/repository/ArtRepository.java index 2a7f4d4..018ac01 100644 --- a/src/main/java/cn/teammodel/repository/ArtRepository.java +++ b/src/main/java/cn/teammodel/repository/ArtRepository.java @@ -9,10 +9,6 @@ import org.springframework.stereotype.Repository; import java.util.List; -/** - * @author winter - * @create 2023-11-28 17:39 - */ @Repository public interface ArtRepository extends CosmosRepository { /** diff --git a/src/main/java/cn/teammodel/repository/ExamRepository.java b/src/main/java/cn/teammodel/repository/ExamRepository.java new file mode 100644 index 0000000..31fb11e --- /dev/null +++ b/src/main/java/cn/teammodel/repository/ExamRepository.java @@ -0,0 +1,17 @@ +package cn.teammodel.repository; + +import cn.teammodel.model.entity.common.Exam; +import cn.teammodel.model.vo.admin.ArtElementsVo; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface ExamRepository extends CosmosRepository { + + @Query("select * from Exam as s where s.code = @code and array_contains(s.classes,@classId) and s.period.id = @periodId and s.progress = 'finish' order by s.createTime ") + List findExamByClassId(@Param("code")String code, @Param("classId")String classId, @Param("periodId")String periodId); +}