Browse Source

考试课程报表接口

xiatian 6 years ago
parent
commit
9ed2e43470

+ 76 - 2
examcloud-core-reports-api-provider/src/main/java/cn/com/qmth/examcloud/core/reports/api/controller/ExamCourseDataReportController.java

@@ -1,12 +1,26 @@
 package cn.com.qmth.examcloud.core.reports.api.controller;
 
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import cn.com.qmth.examcloud.api.commons.security.bean.User;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.core.reports.base.bean.ExamCourseMainTopTen;
+import cn.com.qmth.examcloud.core.reports.base.bean.ExamCourseReportMainBean;
+import cn.com.qmth.examcloud.core.reports.base.enums.ReportStatus;
+import cn.com.qmth.examcloud.core.reports.dao.entity.ProjectEntity;
 import cn.com.qmth.examcloud.core.reports.service.ExamCourseDataReportService;
+import cn.com.qmth.examcloud.core.reports.service.ProjectService;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 
 @RestController
 @Api(tags = "考试课程报表")
@@ -14,6 +28,66 @@ import io.swagger.annotations.Api;
 public class ExamCourseDataReportController extends ControllerSupport {
 	@Autowired
 	private ExamCourseDataReportService examCourseDataReportService;
-	
-
+	@Autowired
+	private ProjectService projectService;
+	//TODO 难度 标准差 差异系数 前十后十查询
+	@ApiOperation(value = "查询考试课程数据")
+	@GetMapping(value = "/getExamCourseMainList")
+	public List<ExamCourseReportMainBean> getExamCourseMainList(@RequestParam Long projectId,
+			@RequestParam(required = false) Long examId) {
+		if (projectId == null) {
+			throw new StatusException("100011", "projectId不能为空");
+		}
+		User user = getAccessUser();
+		ProjectEntity pe = projectService.findProjectById(projectId);
+		if (pe == null) {
+			throw new StatusException("100012", "未找到项目");
+		}
+		if (!user.getRootOrgId().equals(pe.getRootOrgId())) {
+			throw new StatusException("100013", "非法操作");
+		}
+		if (!ReportStatus.SUCCESS.equals(pe.getReportStatus())) {
+			throw new StatusException("100014", "只能查看报表计算成功的项目");
+		}
+		return examCourseDataReportService.getExamCourseMainList(projectId, examId);
+	}
+	@ApiOperation(value = "查询考试课程数据Top10")
+	@GetMapping(value = "/getExamCourseMainTop10")
+	public ExamCourseMainTopTen getExamCourseMainTop10(@RequestParam Long projectId,
+			@RequestParam(required = false) Long examId) {
+		if (projectId == null) {
+			throw new StatusException("100021", "projectId不能为空");
+		}
+		User user = getAccessUser();
+		ProjectEntity pe = projectService.findProjectById(projectId);
+		if (pe == null) {
+			throw new StatusException("100022", "未找到项目");
+		}
+		if (!user.getRootOrgId().equals(pe.getRootOrgId())) {
+			throw new StatusException("100023", "非法操作");
+		}
+		if (!ReportStatus.SUCCESS.equals(pe.getReportStatus())) {
+			throw new StatusException("100024", "只能查看报表计算成功的项目");
+		}
+		return examCourseDataReportService.getExamOrgMainTop10(projectId, examId);
+	}
+	@ApiOperation(value = "导出数据")
+	@GetMapping(value = "/export")
+	public void exportAll(@RequestParam Long projectId, @RequestParam(required = false) Long examId,HttpServletResponse response) {
+		if (projectId == null) {
+			throw new StatusException("100031", "projectId不能为空");
+		}
+		User user = getAccessUser();
+		ProjectEntity pe = projectService.findProjectById(projectId);
+		if (pe == null) {
+			throw new StatusException("100032", "未找到项目");
+		}
+		if (!user.getRootOrgId().equals(pe.getRootOrgId())) {
+			throw new StatusException("100033", "非法操作");
+		}
+		if (!ReportStatus.SUCCESS.equals(pe.getReportStatus())) {
+			throw new StatusException("100034", "只能导出报表计算成功的项目");
+		}
+		examCourseDataReportService.exportAll(pe,examId, response);
+	}
 }

+ 177 - 0
examcloud-core-reports-base/src/main/java/cn/com/qmth/examcloud/core/reports/base/bean/ExamCourseMainTopTen.java

@@ -0,0 +1,177 @@
+package cn.com.qmth.examcloud.core.reports.base.bean;
+
+import java.util.List;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class ExamCourseMainTopTen {
+	@ApiModelProperty(value = "调卷平均难度前十")
+	private List<ExamCourseReportMainBean> difficultyDegreeDesc;
+	@ApiModelProperty(value = "调卷平均难度后十")
+	private List<ExamCourseReportMainBean> difficultyDegree;
+	@ApiModelProperty(value = "标准差前十")
+	private List<ExamCourseReportMainBean> stdDesc;
+	@ApiModelProperty(value = "标准差后十")
+	private List<ExamCourseReportMainBean> std;
+	@ApiModelProperty(value = "差异系数前十")
+	private List<ExamCourseReportMainBean> cdiDesc;
+	@ApiModelProperty(value = "差异系数后十")
+	private List<ExamCourseReportMainBean> cdi;
+	@ApiModelProperty(value = "实考人数后十")
+	private List<ExamCourseReportMainBean> participant;
+	@ApiModelProperty(value = "实考人数前十")
+	private List<ExamCourseReportMainBean> participantDesc;
+	@ApiModelProperty(value = "实考比例后十")
+	private List<ExamCourseReportMainBean> participantRatio;
+	@ApiModelProperty(value = "实考比例前十")
+	private List<ExamCourseReportMainBean> participantRatioDesc;
+	@ApiModelProperty(value = "缺考人数后十")
+	private List<ExamCourseReportMainBean> miss;
+	@ApiModelProperty(value = "缺考人数前十")
+	private List<ExamCourseReportMainBean> missDesc;
+	@ApiModelProperty(value = "缺考比例数后十")
+	private List<ExamCourseReportMainBean> missRatio;
+	@ApiModelProperty(value = "缺考比例前十")
+	private List<ExamCourseReportMainBean> missRatioDesc;
+	@ApiModelProperty(value = "及格人数后十")
+	private List<ExamCourseReportMainBean> pass;
+	@ApiModelProperty(value = "及格人数前十")
+	private List<ExamCourseReportMainBean> passDesc;
+	@ApiModelProperty(value = "及格/报名人数比例后十")
+	private List<ExamCourseReportMainBean> passSignRatio;
+	@ApiModelProperty(value = "及格/报名人数比例前十")
+	private List<ExamCourseReportMainBean> passSignRatioDesc;
+	@ApiModelProperty(value = "及格/实考人数比例后十")
+	private List<ExamCourseReportMainBean> passParticipantRatio;
+	@ApiModelProperty(value = "及格/实考人数比例前十")
+	private List<ExamCourseReportMainBean> passParticipantRatioDesc;
+	@ApiModelProperty(value = "分段人数")
+	private List<PartitionTopTen<ExamCourseReportMainBean>> partition;
+	public List<ExamCourseReportMainBean> getParticipant() {
+		return participant;
+	}
+	public void setParticipant(List<ExamCourseReportMainBean> participant) {
+		this.participant = participant;
+	}
+	public List<ExamCourseReportMainBean> getParticipantDesc() {
+		return participantDesc;
+	}
+	public void setParticipantDesc(List<ExamCourseReportMainBean> participantDesc) {
+		this.participantDesc = participantDesc;
+	}
+	public List<ExamCourseReportMainBean> getMiss() {
+		return miss;
+	}
+	public void setMiss(List<ExamCourseReportMainBean> miss) {
+		this.miss = miss;
+	}
+	public List<ExamCourseReportMainBean> getMissDesc() {
+		return missDesc;
+	}
+	public void setMissDesc(List<ExamCourseReportMainBean> missDesc) {
+		this.missDesc = missDesc;
+	}
+	public List<ExamCourseReportMainBean> getPass() {
+		return pass;
+	}
+	public void setPass(List<ExamCourseReportMainBean> pass) {
+		this.pass = pass;
+	}
+	public List<ExamCourseReportMainBean> getPassDesc() {
+		return passDesc;
+	}
+	public void setPassDesc(List<ExamCourseReportMainBean> passDesc) {
+		this.passDesc = passDesc;
+	}
+	public List<PartitionTopTen<ExamCourseReportMainBean>> getPartition() {
+		return partition;
+	}
+	public void setPartition(List<PartitionTopTen<ExamCourseReportMainBean>> partition) {
+		this.partition = partition;
+	}
+	public List<ExamCourseReportMainBean> getParticipantRatio() {
+		return participantRatio;
+	}
+	public void setParticipantRatio(List<ExamCourseReportMainBean> participantRatio) {
+		this.participantRatio = participantRatio;
+	}
+	public List<ExamCourseReportMainBean> getParticipantRatioDesc() {
+		return participantRatioDesc;
+	}
+	public void setParticipantRatioDesc(List<ExamCourseReportMainBean> participantRatioDesc) {
+		this.participantRatioDesc = participantRatioDesc;
+	}
+	public List<ExamCourseReportMainBean> getMissRatio() {
+		return missRatio;
+	}
+	public void setMissRatio(List<ExamCourseReportMainBean> missRatio) {
+		this.missRatio = missRatio;
+	}
+	public List<ExamCourseReportMainBean> getMissRatioDesc() {
+		return missRatioDesc;
+	}
+	public void setMissRatioDesc(List<ExamCourseReportMainBean> missRatioDesc) {
+		this.missRatioDesc = missRatioDesc;
+	}
+	public List<ExamCourseReportMainBean> getPassSignRatio() {
+		return passSignRatio;
+	}
+	public void setPassSignRatio(List<ExamCourseReportMainBean> passSignRatio) {
+		this.passSignRatio = passSignRatio;
+	}
+	public List<ExamCourseReportMainBean> getPassSignRatioDesc() {
+		return passSignRatioDesc;
+	}
+	public void setPassSignRatioDesc(List<ExamCourseReportMainBean> passSignRatioDesc) {
+		this.passSignRatioDesc = passSignRatioDesc;
+	}
+	public List<ExamCourseReportMainBean> getPassParticipantRatio() {
+		return passParticipantRatio;
+	}
+	public void setPassParticipantRatio(List<ExamCourseReportMainBean> passParticipantRatio) {
+		this.passParticipantRatio = passParticipantRatio;
+	}
+	public List<ExamCourseReportMainBean> getPassParticipantRatioDesc() {
+		return passParticipantRatioDesc;
+	}
+	public void setPassParticipantRatioDesc(List<ExamCourseReportMainBean> passParticipantRatioDesc) {
+		this.passParticipantRatioDesc = passParticipantRatioDesc;
+	}
+	public List<ExamCourseReportMainBean> getDifficultyDegreeDesc() {
+		return difficultyDegreeDesc;
+	}
+	public void setDifficultyDegreeDesc(List<ExamCourseReportMainBean> difficultyDegreeDesc) {
+		this.difficultyDegreeDesc = difficultyDegreeDesc;
+	}
+	public List<ExamCourseReportMainBean> getDifficultyDegree() {
+		return difficultyDegree;
+	}
+	public void setDifficultyDegree(List<ExamCourseReportMainBean> difficultyDegree) {
+		this.difficultyDegree = difficultyDegree;
+	}
+	public List<ExamCourseReportMainBean> getStdDesc() {
+		return stdDesc;
+	}
+	public void setStdDesc(List<ExamCourseReportMainBean> stdDesc) {
+		this.stdDesc = stdDesc;
+	}
+	public List<ExamCourseReportMainBean> getStd() {
+		return std;
+	}
+	public void setStd(List<ExamCourseReportMainBean> std) {
+		this.std = std;
+	}
+	public List<ExamCourseReportMainBean> getCdiDesc() {
+		return cdiDesc;
+	}
+	public void setCdiDesc(List<ExamCourseReportMainBean> cdiDesc) {
+		this.cdiDesc = cdiDesc;
+	}
+	public List<ExamCourseReportMainBean> getCdi() {
+		return cdi;
+	}
+	public void setCdi(List<ExamCourseReportMainBean> cdi) {
+		this.cdi = cdi;
+	}
+	
+}

+ 224 - 0
examcloud-core-reports-base/src/main/java/cn/com/qmth/examcloud/core/reports/base/bean/ExamCourseReportMainBean.java

@@ -0,0 +1,224 @@
+package cn.com.qmth.examcloud.core.reports.base.bean;
+
+import java.util.List;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+import io.swagger.annotations.ApiModelProperty;
+
+public class ExamCourseReportMainBean implements JsonSerializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 3443224190555618785L;
+	@ApiModelProperty(value = "项目id")
+	private Long projectId;
+	@ApiModelProperty(value = "rootOrgId")
+	private Long rootOrgId;
+	@ApiModelProperty(value = "examId")
+	private Long examId;
+	@ApiModelProperty(value = "考试名称")
+	private String examName;
+	@ApiModelProperty(value = "考试code")
+	private String examCode;
+	@ApiModelProperty(value = "课程id")
+	private Long courseId;
+	@ApiModelProperty(value = "课程名称")
+	private String courseName;
+	@ApiModelProperty(value = "课程code")
+	private String courseCode;
+	@ApiModelProperty(value = "满分")
+	private Double totalScore;
+	@ApiModelProperty(value = "最高分")
+	private Double maxScore;
+	@ApiModelProperty(value = "最低分")
+	private Double minScore;
+	@ApiModelProperty(value = "平均分")
+	private Double avgScore;
+	@ApiModelProperty(value = "标准差")
+	private Double std;
+	@ApiModelProperty(value = "平均调卷难度")
+    private Double avgDifficultyDegree;
+	@ApiModelProperty(value = "差异系数")
+    private Double cdi;
+	@ApiModelProperty(value = "报名人数")
+	private Long signCount;
+	@ApiModelProperty(value = "考试人数")
+    private Long participantCount;
+	@ApiModelProperty(value = "考试人数/报名人数比率(%)")
+	private Double participantRatio;
+	@ApiModelProperty(value = "缺考人数")
+	private Long missCount;
+	@ApiModelProperty(value = "缺考率(%)")
+	private Double missRatio;
+	@ApiModelProperty(value = "满分人数")
+    private Long fullCount;
+	@ApiModelProperty(value = "零分人数")
+    private Long zeroCount;
+	@ApiModelProperty(value = "及格人数")
+    private Long passCount;
+	@ApiModelProperty(value = "及格报名人数占比(%)")
+	private Double passSignRatio;
+	@ApiModelProperty(value = "及格实考人数占比(%)")
+	private Double passParticipantRatio;
+	@ApiModelProperty(value = "分段人数数据")
+	private List<PartitionDataBean> partitionData;
+	public Long getProjectId() {
+		return projectId;
+	}
+	public void setProjectId(Long projectId) {
+		this.projectId = projectId;
+	}
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+	public Long getExamId() {
+		return examId;
+	}
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+	public String getExamName() {
+		return examName;
+	}
+	public void setExamName(String examName) {
+		this.examName = examName;
+	}
+	public String getExamCode() {
+		return examCode;
+	}
+	public void setExamCode(String examCode) {
+		this.examCode = examCode;
+	}
+	public Long getSignCount() {
+		return signCount;
+	}
+	public void setSignCount(Long signCount) {
+		this.signCount = signCount;
+	}
+	public Long getParticipantCount() {
+		return participantCount;
+	}
+	public void setParticipantCount(Long participantCount) {
+		this.participantCount = participantCount;
+	}
+	public Long getMissCount() {
+		return missCount;
+	}
+	public void setMissCount(Long missCount) {
+		this.missCount = missCount;
+	}
+	public Double getMissRatio() {
+		return missRatio;
+	}
+	public void setMissRatio(Double missRatio) {
+		this.missRatio = missRatio;
+	}
+	public Long getPassCount() {
+		return passCount;
+	}
+	public void setPassCount(Long passCount) {
+		this.passCount = passCount;
+	}
+	public Double getPassSignRatio() {
+		return passSignRatio;
+	}
+	public void setPassSignRatio(Double passSignRatio) {
+		this.passSignRatio = passSignRatio;
+	}
+	public List<PartitionDataBean> getPartitionData() {
+		return partitionData;
+	}
+	public void setPartitionData(List<PartitionDataBean> partitionData) {
+		this.partitionData = partitionData;
+	}
+	public Double getPassParticipantRatio() {
+		return passParticipantRatio;
+	}
+	public void setPassParticipantRatio(Double passParticipantRatio) {
+		this.passParticipantRatio = passParticipantRatio;
+	}
+	public Double getParticipantRatio() {
+		return participantRatio;
+	}
+	public void setParticipantRatio(Double participantRatio) {
+		this.participantRatio = participantRatio;
+	}
+	public Long getCourseId() {
+		return courseId;
+	}
+	public void setCourseId(Long courseId) {
+		this.courseId = courseId;
+	}
+	public String getCourseName() {
+		return courseName;
+	}
+	public void setCourseName(String courseName) {
+		this.courseName = courseName;
+	}
+	public String getCourseCode() {
+		return courseCode;
+	}
+	public void setCourseCode(String courseCode) {
+		this.courseCode = courseCode;
+	}
+	public Double getTotalScore() {
+		return totalScore;
+	}
+	public void setTotalScore(Double totalScore) {
+		this.totalScore = totalScore;
+	}
+	public Double getMaxScore() {
+		return maxScore;
+	}
+	public void setMaxScore(Double maxScore) {
+		this.maxScore = maxScore;
+	}
+	public Double getMinScore() {
+		return minScore;
+	}
+	public void setMinScore(Double minScore) {
+		this.minScore = minScore;
+	}
+	public Double getAvgScore() {
+		return avgScore;
+	}
+	public void setAvgScore(Double avgScore) {
+		this.avgScore = avgScore;
+	}
+	public Double getStd() {
+		return std;
+	}
+	public void setStd(Double std) {
+		this.std = std;
+	}
+	public Double getAvgDifficultyDegree() {
+		return avgDifficultyDegree;
+	}
+	public void setAvgDifficultyDegree(Double avgDifficultyDegree) {
+		this.avgDifficultyDegree = avgDifficultyDegree;
+	}
+	public Double getCdi() {
+		return cdi;
+	}
+	public void setCdi(Double cdi) {
+		this.cdi = cdi;
+	}
+	public Long getFullCount() {
+		return fullCount;
+	}
+	public void setFullCount(Long fullCount) {
+		this.fullCount = fullCount;
+	}
+	public Long getZeroCount() {
+		return zeroCount;
+	}
+	public void setZeroCount(Long zeroCount) {
+		this.zeroCount = zeroCount;
+	}
+
+	
+}

+ 3 - 3
examcloud-core-reports-base/src/main/java/cn/com/qmth/examcloud/core/reports/base/bean/ExamOrgMainTopTen.java

@@ -34,7 +34,7 @@ public class ExamOrgMainTopTen {
 	@ApiModelProperty(value = "及格/实考人数比例前十")
 	private List<ExamOrgReportMainBean> passParticipantRatioDesc;
 	@ApiModelProperty(value = "分段人数")
-	private List<PartitionTopTen> partition;
+	private List<PartitionTopTen<ExamOrgReportMainBean>> partition;
 	public List<ExamOrgReportMainBean> getParticipant() {
 		return participant;
 	}
@@ -71,10 +71,10 @@ public class ExamOrgMainTopTen {
 	public void setPassDesc(List<ExamOrgReportMainBean> passDesc) {
 		this.passDesc = passDesc;
 	}
-	public List<PartitionTopTen> getPartition() {
+	public List<PartitionTopTen<ExamOrgReportMainBean>> getPartition() {
 		return partition;
 	}
-	public void setPartition(List<PartitionTopTen> partition) {
+	public void setPartition(List<PartitionTopTen<ExamOrgReportMainBean>> partition) {
 		this.partition = partition;
 	}
 	public List<ExamOrgReportMainBean> getParticipantRatio() {

+ 19 - 19
examcloud-core-reports-base/src/main/java/cn/com/qmth/examcloud/core/reports/base/bean/PartitionTopTen.java

@@ -4,53 +4,53 @@ import java.util.List;
 
 import io.swagger.annotations.ApiModelProperty;
 
-public class PartitionTopTen {
+public class PartitionTopTen<T> {
 	@ApiModelProperty(value = "分段人数后十")
-	private List<ExamOrgReportMainBean> countAsc;
+	private List<T> countAsc;
 	@ApiModelProperty(value = "分段人数前十")
-	private List<ExamOrgReportMainBean> countDesc;
+	private List<T> countDesc;
 	@ApiModelProperty(value = "分段人数/报名人数比例后十")
-	private List<ExamOrgReportMainBean> signRatioAsc;
+	private List<T> signRatioAsc;
 	@ApiModelProperty(value = "分段人数/报名人数比例前十")
-	private List<ExamOrgReportMainBean> signRatioDesc;
+	private List<T> signRatioDesc;
 	@ApiModelProperty(value = "分段人数/实考人数比例后十")
-	private List<ExamOrgReportMainBean> participantRatioAsc;
+	private List<T> participantRatioAsc;
 	@ApiModelProperty(value = "分段人数/实考人数比例前十")
-	private List<ExamOrgReportMainBean> participantRatioDesc;
-	public List<ExamOrgReportMainBean> getCountAsc() {
+	private List<T> participantRatioDesc;
+	public List<T> getCountAsc() {
 		return countAsc;
 	}
-	public void setCountAsc(List<ExamOrgReportMainBean> countAsc) {
+	public void setCountAsc(List<T> countAsc) {
 		this.countAsc = countAsc;
 	}
-	public List<ExamOrgReportMainBean> getCountDesc() {
+	public List<T> getCountDesc() {
 		return countDesc;
 	}
-	public void setCountDesc(List<ExamOrgReportMainBean> countDesc) {
+	public void setCountDesc(List<T> countDesc) {
 		this.countDesc = countDesc;
 	}
-	public List<ExamOrgReportMainBean> getSignRatioAsc() {
+	public List<T> getSignRatioAsc() {
 		return signRatioAsc;
 	}
-	public void setSignRatioAsc(List<ExamOrgReportMainBean> signRatioAsc) {
+	public void setSignRatioAsc(List<T> signRatioAsc) {
 		this.signRatioAsc = signRatioAsc;
 	}
-	public List<ExamOrgReportMainBean> getSignRatioDesc() {
+	public List<T> getSignRatioDesc() {
 		return signRatioDesc;
 	}
-	public void setSignRatioDesc(List<ExamOrgReportMainBean> signRatioDesc) {
+	public void setSignRatioDesc(List<T> signRatioDesc) {
 		this.signRatioDesc = signRatioDesc;
 	}
-	public List<ExamOrgReportMainBean> getParticipantRatioAsc() {
+	public List<T> getParticipantRatioAsc() {
 		return participantRatioAsc;
 	}
-	public void setParticipantRatioAsc(List<ExamOrgReportMainBean> participantRatioAsc) {
+	public void setParticipantRatioAsc(List<T> participantRatioAsc) {
 		this.participantRatioAsc = participantRatioAsc;
 	}
-	public List<ExamOrgReportMainBean> getParticipantRatioDesc() {
+	public List<T> getParticipantRatioDesc() {
 		return participantRatioDesc;
 	}
-	public void setParticipantRatioDesc(List<ExamOrgReportMainBean> participantRatioDesc) {
+	public void setParticipantRatioDesc(List<T> participantRatioDesc) {
 		this.participantRatioDesc = participantRatioDesc;
 	}
 	

+ 9 - 0
examcloud-core-reports-dao/src/main/java/cn/com/qmth/examcloud/core/reports/dao/entity/ExamCourseDataReportEntity.java

@@ -67,6 +67,9 @@ public class ExamCourseDataReportEntity extends IdEntity {
     //差异系数
     @NotNull
     private Double cdi;
+    //报名人数
+    @NotNull
+    private Long signCount;
     //考试人数
     @NotNull
     private Long participantCount;
@@ -202,5 +205,11 @@ public class ExamCourseDataReportEntity extends IdEntity {
 	public void setExamCode(String examCode) {
 		this.examCode = examCode;
 	}
+	public Long getSignCount() {
+		return signCount;
+	}
+	public void setSignCount(Long signCount) {
+		this.signCount = signCount;
+	}
     
 }

+ 8 - 0
examcloud-core-reports-service/src/main/java/cn/com/qmth/examcloud/core/reports/service/ExamCourseDataReportService.java

@@ -2,10 +2,18 @@ package cn.com.qmth.examcloud.core.reports.service;
 
 import java.util.List;
 
+import javax.servlet.http.HttpServletResponse;
+
 import cn.com.qmth.examcloud.core.reports.api.bean.ExamCourseDataReportBean;
+import cn.com.qmth.examcloud.core.reports.base.bean.ExamCourseMainTopTen;
+import cn.com.qmth.examcloud.core.reports.base.bean.ExamCourseReportMainBean;
+import cn.com.qmth.examcloud.core.reports.dao.entity.ProjectEntity;
 
 public interface ExamCourseDataReportService {
 
 	public void saveExamCourseDataReportList(List<ExamCourseDataReportBean> beans);
 	public void deleteByProject(Long projectId,Long rootOrgId);
+	public List<ExamCourseReportMainBean> getExamCourseMainList(Long projectId, Long examId);
+	public ExamCourseMainTopTen getExamOrgMainTop10(Long projectId, Long examId);
+	public void exportAll(ProjectEntity pe, Long examId, HttpServletResponse response);
 }

+ 3 - 0
examcloud-core-reports-service/src/main/java/cn/com/qmth/examcloud/core/reports/service/ExamOrgReportService.java

@@ -8,6 +8,7 @@ import cn.com.qmth.examcloud.core.reports.api.bean.ExamOrgReportBean;
 import cn.com.qmth.examcloud.core.reports.base.bean.ExamOrgMainTopTen;
 import cn.com.qmth.examcloud.core.reports.base.bean.ExamOrgReportMainBean;
 import cn.com.qmth.examcloud.core.reports.base.bean.ExamReportMainBean;
+import cn.com.qmth.examcloud.core.reports.base.util.excel.SheetData;
 import cn.com.qmth.examcloud.core.reports.dao.entity.ProjectEntity;
 
 public interface ExamOrgReportService {
@@ -18,4 +19,6 @@ public interface ExamOrgReportService {
 	public List<ExamReportMainBean> getExamMainList(Long projectId,Long examId);
 	public ExamOrgMainTopTen getExamOrgMainTop10(Long projectId, Long examId);
 	public void exportAll(ProjectEntity pe,Long examId,String items,HttpServletResponse response);
+	public void fillExamMainSheetdata(List<SheetData> sheets, List<ExamReportMainBean> list, List<String> header,
+			int partitionCount);
 }

+ 495 - 4
examcloud-core-reports-service/src/main/java/cn/com/qmth/examcloud/core/reports/service/impl/ExamCourseDataReportServiceImpl.java

@@ -1,30 +1,54 @@
 package cn.com.qmth.examcloud.core.reports.service.impl;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.persistence.criteria.Predicate;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.domain.Sort.Direction;
+import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import cn.com.qmth.examcloud.core.reports.api.bean.ExamCourseDataReportBean;
+import cn.com.qmth.examcloud.core.reports.base.bean.ExamCourseMainTopTen;
+import cn.com.qmth.examcloud.core.reports.base.bean.ExamCourseReportMainBean;
+import cn.com.qmth.examcloud.core.reports.base.bean.ExamReportMainBean;
+import cn.com.qmth.examcloud.core.reports.base.bean.PartitionDataBean;
+import cn.com.qmth.examcloud.core.reports.base.bean.PartitionTopTen;
+import cn.com.qmth.examcloud.core.reports.base.util.excel.ExportUtils;
+import cn.com.qmth.examcloud.core.reports.base.util.excel.SheetData;
 import cn.com.qmth.examcloud.core.reports.dao.ExamCourseDataReportRepo;
 import cn.com.qmth.examcloud.core.reports.dao.entity.ExamCourseDataReportEntity;
+import cn.com.qmth.examcloud.core.reports.dao.entity.ProjectEntity;
 import cn.com.qmth.examcloud.core.reports.service.ExamCourseDataReportService;
+import cn.com.qmth.examcloud.core.reports.service.ExamOrgReportService;
 
 @Service
 public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportService {
+	private final static int asc = 0;
+	private final static int desc = 2;
 	@Autowired
 	private ExamCourseDataReportRepo examCourseDataReportRepo;
-
+	@Autowired
+	private ExamOrgReportService examOrgReportService;
+	
 	@Transactional
 	@Override
 	public void saveExamCourseDataReportList(List<ExamCourseDataReportBean> beans) {
-		List<ExamCourseDataReportEntity> list=new ArrayList<ExamCourseDataReportEntity>();
-		for(ExamCourseDataReportBean bean:beans) {
-			ExamCourseDataReportEntity e=new ExamCourseDataReportEntity();
+		List<ExamCourseDataReportEntity> list = new ArrayList<ExamCourseDataReportEntity>();
+		for (ExamCourseDataReportBean bean : beans) {
+			ExamCourseDataReportEntity e = new ExamCourseDataReportEntity();
 			BeanUtils.copyProperties(bean, e);
 			e.setPartitionData(StringUtils.join(bean.getPartitionData().toArray(), ","));
 			list.add(e);
@@ -37,5 +61,472 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
 		examCourseDataReportRepo.deleteByProject(projectId, rootOrgId);
 	}
 
+	@Override
+	public List<ExamCourseReportMainBean> getExamCourseMainList(Long projectId, Long examId) {
+		Specification<ExamCourseDataReportEntity> specification = (root, query, cb) -> {
+			List<Predicate> predicates = new ArrayList<>();
+			predicates.add(cb.equal(root.get("projectId"), projectId));
+			if (examId != null) {
+				predicates.add(cb.equal(root.get("examId"), examId));
+			}
+			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
+		};
+
+		Sort sort = new Sort(Direction.ASC, "id");
+		List<ExamCourseDataReportEntity> entityList = examCourseDataReportRepo.findAll(specification, sort);
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>();
+		for (ExamCourseDataReportEntity e : entityList) {
+			ret.add(of(e));
+		}
+		return ret;
+	}
+
+	private ExamCourseReportMainBean of(ExamCourseDataReportEntity e) {
+		ExamCourseReportMainBean b = new ExamCourseReportMainBean();
+		BeanUtils.copyProperties(e, b);
+		b.setParticipantRatio(getPercentage(b.getParticipantCount(), b.getSignCount()));
+		b.setMissCount(e.getSignCount() - e.getParticipantCount());
+		b.setMissRatio(getPercentage(b.getMissCount(), b.getSignCount()));
+		b.setPassSignRatio(getPercentage(b.getPassCount(), b.getSignCount()));
+		b.setPassParticipantRatio(getPercentage(b.getPassCount(), b.getParticipantCount()));
+		List<Long> li = Arrays.asList(e.getPartitionData().split(",")).stream().map(str -> Long.parseLong(str))
+				.collect(Collectors.toList());
+		List<PartitionDataBean> partitionData = new ArrayList<PartitionDataBean>();
+		for (Long l : li) {
+			PartitionDataBean pb = new PartitionDataBean();
+			pb.setCount(l);
+			pb.setParticipantRatio(getPercentage(l, b.getParticipantCount()));
+			pb.setSignRatio(getPercentage(l, b.getSignCount()));
+			partitionData.add(pb);
+		}
+		b.setPartitionData(partitionData);
+		return b;
+	}
+
+	private Double getPercentage(Long a, Long b) {
+		if (b == 0) {
+			return null;
+		}
+		Double da = Double.valueOf(a);
+		Double db = Double.valueOf(b);
+		BigDecimal bd = new BigDecimal(da * 100 / db);
+		Double tem = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+		return tem;
+	}
+
+	@Override
+	public ExamCourseMainTopTen getExamOrgMainTop10(Long projectId, Long examId) {
+		ExamCourseMainTopTen ret = new ExamCourseMainTopTen();
+		List<ExamCourseReportMainBean> list = getExamCourseMainList(projectId, examId);
+		if (list != null && list.size() > 0) {
+			ret.setDifficultyDegree(getDifficultyDegreeSort(list, asc));
+			ret.setDifficultyDegreeDesc(getDifficultyDegreeSort(list, desc));
+			ret.setStd(getStdSort(list, asc));
+			ret.setStdDesc(getStdSort(list, desc));
+			ret.setCdi(getCdiSort(list, asc));
+			ret.setCdiDesc(getCdiSort(list, desc));
+			ret.setParticipant(getParticipantSort(list, asc));
+			ret.setParticipantDesc(getParticipantSort(list, desc));
+			ret.setParticipantRatio(getParticipantRatioSort(list, asc));
+			ret.setParticipantRatioDesc(getParticipantRatioSort(list, desc));
+			ret.setMiss(getMissSort(list, asc));
+			ret.setMissDesc(getMissSort(list, desc));
+			ret.setMissRatio(getMissRatioSort(list, asc));
+			ret.setMissRatioDesc(getMissRatioSort(list, desc));
+			ret.setPass(getPassSort(list, asc));
+			ret.setPassDesc(getPassSort(list, desc));
+			ret.setPassSignRatio(getPassSignRatioSort(list, asc));
+			ret.setPassSignRatioDesc(getPassSignRatioSort(list, desc));
+			ret.setPassParticipantRatio(getPassParticipantRatioSort(list, asc));
+			ret.setPassParticipantRatioDesc(getPassParticipantRatioSort(list, desc));
+			ret.setPartition(getPartitionSort(list));
+		}
+		return ret;
+	}
+
+	private List<ExamCourseReportMainBean> getParticipantSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getParticipantCount() > o2.getParticipantCount()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getParticipantCount() < o2.getParticipantCount()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<ExamCourseReportMainBean> getParticipantRatioSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getParticipantRatio() > o2.getParticipantRatio()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getParticipantRatio() < o2.getParticipantRatio()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<ExamCourseReportMainBean> getMissSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getMissCount() > o2.getMissCount()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getMissCount() < o2.getMissCount()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<ExamCourseReportMainBean> getMissRatioSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getMissRatio() > o2.getMissRatio()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getMissRatio() < o2.getMissRatio()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<ExamCourseReportMainBean> getPassSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getPassCount() > o2.getPassCount()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getPassCount() < o2.getPassCount()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<ExamCourseReportMainBean> getPassSignRatioSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getPassSignRatio() > o2.getPassSignRatio()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getPassSignRatio() < o2.getPassSignRatio()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<ExamCourseReportMainBean> getPassParticipantRatioSort(List<ExamCourseReportMainBean> list,
+			int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getPassParticipantRatio() > o2.getPassParticipantRatio()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getPassParticipantRatio() < o2.getPassParticipantRatio()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<PartitionTopTen<ExamCourseReportMainBean>> getPartitionSort(List<ExamCourseReportMainBean> list) {
+		List<PartitionTopTen<ExamCourseReportMainBean>> ret = new ArrayList<PartitionTopTen<ExamCourseReportMainBean>>();
+		int size = list.get(0).getPartitionData().size();
+		for (int i = 0; i < size; i++) {
+			PartitionTopTen<ExamCourseReportMainBean> pt = new PartitionTopTen<ExamCourseReportMainBean>();
+			pt.setCountAsc(getPartitionCountSort(list, i, asc));
+			pt.setCountDesc(getPartitionCountSort(list, i, desc));
+			pt.setSignRatioAsc(getPartitionSignRatioSort(list, i, asc));
+			pt.setSignRatioDesc(getPartitionSignRatioSort(list, i, desc));
+			pt.setParticipantRatioAsc(getPartitionParticipantRatioSort(list, i, asc));
+			pt.setParticipantRatioDesc(getPartitionParticipantRatioSort(list, i, desc));
+			ret.add(pt);
+		}
+		return ret;
+	}
+
+	private List<ExamCourseReportMainBean> getPartitionCountSort(List<ExamCourseReportMainBean> list, int index,
+			int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				Long c1 = o1.getPartitionData().get(index).getCount();
+				Long c2 = o2.getPartitionData().get(index).getCount();
+				if (c1 > c2) {
+					return 1 - ascOrDesc;
+				} else if (c1 < c2) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
 
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<ExamCourseReportMainBean> getPartitionSignRatioSort(List<ExamCourseReportMainBean> list, int index,
+			int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				Double c1 = o1.getPartitionData().get(index).getSignRatio();
+				Double c2 = o2.getPartitionData().get(index).getSignRatio();
+				if (c1 > c2) {
+					return 1 - ascOrDesc;
+				} else if (c1 < c2) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<ExamCourseReportMainBean> getPartitionParticipantRatioSort(List<ExamCourseReportMainBean> list,
+			int index, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				Double c1 = o1.getPartitionData().get(index).getParticipantRatio();
+				Double c2 = o2.getPartitionData().get(index).getParticipantRatio();
+				if (c1 > c2) {
+					return 1 - ascOrDesc;
+				} else if (c1 < c2) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	private List<ExamCourseReportMainBean> getDifficultyDegreeSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getAvgDifficultyDegree() > o2.getAvgDifficultyDegree()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getAvgDifficultyDegree() < o2.getAvgDifficultyDegree()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+	private List<ExamCourseReportMainBean> getStdSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getStd() > o2.getStd()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getStd() < o2.getStd()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+	private List<ExamCourseReportMainBean> getCdiSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
+		List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
+		Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
+
+			@Override
+			public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
+				if (o1.getCdi() > o2.getCdi()) {
+					return 1 - ascOrDesc;
+				} else if (o1.getCdi() < o2.getCdi()) {
+					return -1 + ascOrDesc;
+				} else {
+					return 0;
+				}
+			}
+
+		});
+		if (ret.size() > 10) {
+			return ret.subList(0, 10);
+		} else {
+			return ret;
+		}
+	}
+
+	@Override
+	public void exportAll(ProjectEntity pe, Long examId, HttpServletResponse response) {
+		Long projectId = pe.getId();
+		List<SheetData> sheets = new ArrayList<SheetData>();
+		List<String> examheader = new ArrayList<String>();
+		examheader.addAll(
+				Arrays.asList(new String[] { "考试名称", "报名人数", "实考人数","实考比例(%)", "缺考人数", "缺考率(%)", "及格人数", "及格报名人数占比(%)", "及格实考人数占比(%)" }));
+		int partitionCount = pe.getPartitionCount();
+		for (int i = 1; i <= partitionCount; i++) {
+			examheader.add("分段" + i + "人数");
+			examheader.add("分段" + i + "报名人数占比(%)");
+			examheader.add("分段" + i + "实考人数占比(%)");
+		}
+		List<String> header = new ArrayList<String>();
+		header.addAll(
+				Arrays.asList(new String[] { "考试名称","课程名称", "满分", "最高分","最低分", "平均分", "标准差", "调用试卷平均难度", "差异系数", "报名人数","考试人数" ,"满分人数","零分人数","及格人数","及格占比"}));
+		for (int i = 1; i <= partitionCount; i++) {
+			header.add("分段" + i + "人数");
+			header.add("分段" + i + "报名人数占比(%)");
+			header.add("分段" + i + "实考人数占比(%)");
+		}
+		List<ExamReportMainBean> list1 = examOrgReportService.getExamMainList(projectId, examId);
+		examOrgReportService.fillExamMainSheetdata(sheets,list1, examheader, partitionCount);
+		List<ExamCourseReportMainBean> list2 = getExamCourseMainList(projectId, examId);
+		fillExamCourseMainSheetdata(sheets, list2, header, partitionCount);
+		ExportUtils.exportExcel("考试课程分析结果", sheets, response);
+	}
+	private void fillExamCourseMainSheetdata(List<SheetData> sheets,List<ExamCourseReportMainBean> list, List<String> header, int partitionCount) {
+		SheetData sheet = new SheetData();
+		sheet.setHeader(header);
+		sheet.setName("考试课程数值分析");
+		fillSheetData(sheets,sheet, list, header.size(), partitionCount);
+	}
+	private void fillSheetData(List<SheetData> sheets,SheetData sheet, List<ExamCourseReportMainBean> list, int headerSize, int partitionCount) {
+		List<Object[]> data = new ArrayList<Object[]>();
+		for (ExamCourseReportMainBean b : list) {
+			Object[] ob = new Object[headerSize];
+			ob[0] = b.getExamName();
+			ob[1] = b.getCourseName();
+			ob[2] = b.getTotalScore();
+			ob[3] = b.getMaxScore();
+			ob[4] = b.getMinScore();
+			ob[5] = b.getAvgScore();
+			ob[6] = b.getStd();
+			ob[7] = b.getAvgDifficultyDegree();
+			ob[8] = b.getCdi();
+			ob[9] = b.getSignCount();
+			ob[10] = b.getParticipantCount();
+			ob[11] = b.getFullCount();
+			ob[12] = b.getZeroCount();
+			ob[13] = b.getPassCount();
+			ob[14] = b.getPassParticipantRatio();
+			for (int i = 0; i < partitionCount; i++) {
+				ob[15 + i*3] = b.getPartitionData().get(i).getCount();
+				ob[15 + i*3 + 1] = b.getPartitionData().get(i).getSignRatio();
+				ob[15 + i*3 + 2] = b.getPartitionData().get(i).getParticipantRatio();
+			}
+			data.add(ob);
+		}
+		sheet.setData(data);
+		sheets.add(sheet);
+	}
 }

+ 5 - 4
examcloud-core-reports-service/src/main/java/cn/com/qmth/examcloud/core/reports/service/impl/ExamOrgReportServiceImpl.java

@@ -354,11 +354,11 @@ public class ExamOrgReportServiceImpl implements ExamOrgReportService {
 		}
 	}
 
-	private List<PartitionTopTen> getPartitionSort(List<ExamOrgReportMainBean> list) {
-		List<PartitionTopTen> ret = new ArrayList<PartitionTopTen>();
+	private List<PartitionTopTen<ExamOrgReportMainBean>> getPartitionSort(List<ExamOrgReportMainBean> list) {
+		List<PartitionTopTen<ExamOrgReportMainBean>> ret = new ArrayList<PartitionTopTen<ExamOrgReportMainBean>>();
 		int size = list.get(0).getPartitionData().size();
 		for (int i = 0; i < size; i++) {
-			PartitionTopTen pt = new PartitionTopTen();
+			PartitionTopTen<ExamOrgReportMainBean> pt = new PartitionTopTen<ExamOrgReportMainBean>();
 			pt.setCountAsc(getPartitionCountSort(list, i,asc));
 			pt.setCountDesc(getPartitionCountSort(list, i,desc));
 			pt.setSignRatioAsc(getPartitionSignRatioSort(list, i, asc));
@@ -489,7 +489,8 @@ public class ExamOrgReportServiceImpl implements ExamOrgReportService {
 		ExportUtils.exportExcel("考试学习中心分析结果", sheets, response);
 	}
 
-	private void fillExamMainSheetdata(List<SheetData> sheets,List<ExamReportMainBean> list,List<String> header, int partitionCount) {
+	@Override
+	public void fillExamMainSheetdata(List<SheetData> sheets,List<ExamReportMainBean> list,List<String> header, int partitionCount) {
 		SheetData sheet = new SheetData();
 		sheet.setHeader(header);
 		sheet.setName("考试总体数值分析");