Compare commits

...

2 Commits

Author SHA1 Message Date
rong.liu 7ffecba80c 考核评阅 3 weeks ago
rong.liu 7a55ddd28e 考核评阅 3 weeks ago
  1. 8
      competition/src/main/java/com/huoran/competition/entity/vo/CompetitionReviewListVO.java
  2. 196
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml
  3. 14
      nakadai/src/main/java/com/huoran/nakadai/controller/EvaluationController.java
  4. 4
      nakadai/src/main/java/com/huoran/nakadai/entity/EvaluationReportReviewSummary.java
  5. 3
      nakadai/src/main/java/com/huoran/nakadai/entity/MyReadingAssignmentResp.java
  6. 4
      nakadai/src/main/java/com/huoran/nakadai/entity/req/MyReviewTaskByReviewListReq.java
  7. 4
      nakadai/src/main/java/com/huoran/nakadai/mapper/EvaluationMapper.java
  8. 4
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EvaluationAssignmentsMapper.xml
  9. 186
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EvaluationMapper.xml
  10. 2
      nakadai/src/main/java/com/huoran/nakadai/service/EvaluationService.java
  11. 4
      nakadai/src/main/java/com/huoran/nakadai/service/impl/CurriculumServiceImpl.java
  12. 2
      nakadai/src/main/java/com/huoran/nakadai/service/impl/EvaluationAssignmentsServiceImpl.java
  13. 17
      nakadai/src/main/java/com/huoran/nakadai/service/impl/EvaluationServiceImpl.java

@ -114,4 +114,12 @@ public class CompetitionReviewListVO implements Serializable {
//评阅设置应分配人数
@ApiModelProperty(value = "评阅设置应分配人数")
private Integer shouldAllocation;
@ApiModelProperty(value = "考核开始时间")
private String assessmentStartTime;
@ApiModelProperty(value = "考核结束时间")
private String assessmentEndTime;
}

@ -1183,22 +1183,147 @@
</select>
<select id="assessmentReviewSettingList"
resultType="com.huoran.competition.entity.vo.CompetitionReviewListVO">
select * from (SELECT
CASE
WHEN
t1.evaluation_id IS NULL THEN
'-'
WHEN ( t1.totalAnswer = 0 ) THEN
'-'
WHEN ( t1.unReviewedAnswer ) > 0 THEN
'未完成'
WHEN ( t1.unReviewedAnswer + t1.reviewedAnswer = t1.totalAnswer ) THEN
'已完成'
WHEN ( t1.unReviewedAnswer + t1.reviewedAnswer != t1.totalAnswer ) THEN
'未完成'
END AS reviewStatus,
CASE
WHEN t1.evaluation_id IS NULL THEN
'-'
WHEN t1.totalAnswer = 0 THEN
'-'
WHEN (
(
SELECT
COUNT( 1 )
FROM
(
SELECT DISTINCT
us.report_id,
r.evaluation_id,
r.reviewers_per_question AS theAssignedNumberOfPeople,
(
SELECT
COUNT( 1 )
FROM
nakadai.r_evaluation_assignments a
WHERE
a.evaluation_id = r.evaluation_id
AND a.report_id = us.report_id
) AS currentExperimentalReportHasAssignedNumber
FROM
exam.exam_paper_question_user_answer us
LEFT JOIN nakadai.r_evaluation r ON r.assessment_id = us.assessment_id
WHERE
us.assessment_id = t1.id
AND us.is_del = 0
) t
WHERE
t.currentExperimentalReportHasAssignedNumber != t.theAssignedNumberOfPeople
) > 0
)
OR ( ( SELECT count( 1 ) FROM nakadai.r_evaluation_assignments a WHERE a.evaluation_id = t1.evaluation_id ) = 0 )
OR ( SELECT count( DISTINCT a.report_id ) FROM nakadai.r_evaluation_assignments a WHERE a.evaluation_id = t1.evaluation_id ) != t1.totalAnswer THEN
'未完成' ELSE '已完成'
END AS taskAllocationStatus,
t1.*
FROM
(
SELECT
ass.id ,
ass.experimental_name AS competitionName,
ass.project_id,
ass.paper_id,
IFNULL( m.project_name, p.NAME ) AS competitionContent,
p.question_type,
CASE
WHEN p.question_type LIKE '%问答题%' THEN
1 ELSE 0
END AS hasManualScoreType,
CASE
WHEN p.question_type LIKE '%问答题%' THEN
CASE
WHEN p.question_type LIKE '%单选题%'
OR p.question_type LIKE '%多选题%'
OR p.question_type LIKE '%判断题%'
OR p.question_type LIKE '%填空题%' THEN
1 ELSE 0
END ELSE 1
END AS hasAutoScoreType,
ass.start_time AS assessmentStartTime,
ass.stop_time AS assessmentEndTime,
rv.start_time AS startTime,
rv.end_time AS endTime,
rv.evaluation_id,
rv.is_timed,
(
SELECT
COUNT( 1 )
FROM
occupationlab.ol_experimental_report r
INNER JOIN nakadai.hr_user_account ua ON ua.id = r.account_id
WHERE
ua.type = 1
AND r.is_del = 0
AND r.assessment_id = ass.id
) AS totalAnswer,
(
SELECT
ass.id,
ass.experimental_name AS competitionName,
ass.project_id,
ass.paper_id,
IFNULL( m.project_name, p.NAME ) AS competitionContent,
COUNT( r.assessment_id ) AS totalAnswer
COUNT( DISTINCT r.report_id )
FROM
occupationlab.ol_assessment ass
LEFT JOIN occupationlab.ol_project_manage m ON m.project_id = ass.project_id
LEFT JOIN exam.exam_paper p ON p.paper_id = ass.paper_id
LEFT JOIN occupationlab.ol_experimental_report r ON r.assessment_id = ass.id
AND r.is_del = 0
nakadai.r_evaluation_report_review_summary r
WHERE
ass.is_del = 0
AND ass.school_id = #{req.schoolId}
r.evaluation_id = rv.evaluation_id
AND r.is_fully_reviewed = 0
) AS unReviewedAnswer,
(
SELECT
COUNT( DISTINCT r.report_id )
FROM
nakadai.r_evaluation_report_review_summary r
WHERE
r.evaluation_id = rv.evaluation_id
AND r.is_fully_reviewed = 1
) AS reviewedAnswer ,
CASE
WHEN rv.evaluation_id IS NULL THEN
'-'
WHEN rv.is_timed = 0 THEN
'进行中'
WHEN NOW( ) &lt; rv.start_time THEN
'未开始'
WHEN NOW( ) BETWEEN rv.start_time
AND COALESCE ( rv.end_time, '9999-12-31' ) THEN
'进行中'
WHEN NOW( ) > rv.end_time THEN
'已结束'
END AS reviewStage,rv.allow_manual_grading AS allowManualGrading
FROM
occupationlab.ol_assessment ass
LEFT JOIN occupationlab.ol_project_manage m ON m.project_id = ass.project_id
LEFT JOIN exam.exam_paper p ON p.paper_id = ass.paper_id
LEFT JOIN occupationlab.ol_experimental_report r ON r.assessment_id = ass.id
AND r.is_del = 0
LEFT JOIN nakadai.r_evaluation rv ON rv.assessment_id = ass.id
WHERE
ass.is_del = 0
AND ass.school_id = #{req.schoolId}
<if test="req.keyWord!=null and req.keyWord!=''">
and (
ass.experimental_name LIKE CONCAT('%',#{req.keyWord},'%')
@ -1206,8 +1331,49 @@
OR p.NAME LIKE CONCAT('%',#{req.keyWord},'%')
)
</if>
GROUP BY
ass.id
ass.id
) t1) t2
WHERE
1=1
<if test="req.reviewStage == 0">
and t2.reviewStage = '未开始'
</if>
<if test="req.reviewStage == 1">
and t2.reviewStage = '进行中'
</if>
<if test="req.reviewStage == 2">
and t2.reviewStage = '已结束'
</if>
<if test="req.reviewStatus == 1">
and t2.reviewStatus = '已完成'
</if>
<if test="req.reviewStatus == 0">
and t2.reviewStatus = '未完成'
</if>
<if test="req.taskAllocationStatus==1">
AND t2.taskAllocationStatus = '已完成'
</if>
<if test="req.taskAllocationStatus==0">
AND t2.taskAllocationStatus = '未完成'
</if>
<if test="req.isTimed!=null">
AND is_timed = 0
</if>
ORDER BY
t2.id DESC
</select>
</mapper>

@ -149,7 +149,7 @@ public class EvaluationController {
@ApiOperation(value = "我的评阅任务", response = MyReadingAssignmentResp.class)
@ApiOperation(value = "我的评阅任务(大赛)", response = MyReadingAssignmentResp.class)
@PostMapping("/myReviewTask")
public R myReviewTask(@RequestBody MyReviewTaskListReq req, HttpServletRequest request) {
/*req.setAccountId(Integer.valueOf(TokenUtils.getAccountId()));*/
@ -162,6 +162,18 @@ public class EvaluationController {
}
@ApiOperation(value = "我的评阅任务(考核)", response = MyReadingAssignmentResp.class)
@PostMapping("/myReviewTaskForAssessment")
public R myReviewTaskForAssessment(@RequestBody MyReviewTaskListReq req, HttpServletRequest request) {
String accountId = TokenUtils.getIdByJwtToken(request);
req.setAccountId(Integer.valueOf(accountId));
req.setSchoolId(userClient.getSchoolIdByAccountId(accountId));
return service.myReviewTaskForAssessment(req);
}
@ApiOperation(value = "我的评阅任务-评阅列表", response = CompetitionUserReportVO.class)
@PostMapping("/myReviewTaskByReviewList")
public R myReviewTaskByReviewList(@RequestBody MyReviewTaskByReviewListReq req) {

@ -53,5 +53,9 @@ public class EvaluationReportReviewSummary implements Serializable {
@ApiModelProperty(value = "记录更新时间")
private Date updateTime;
//考核id
@ApiModelProperty(value = "考核id")
private Integer assessmentId;
}

@ -75,4 +75,7 @@ public class MyReadingAssignmentResp {
private String stageEndTime;
//考核id
@ApiModelProperty(value = "考核id")
private Integer assessmentId;
}

@ -42,5 +42,9 @@ public class MyReviewTaskByReviewListReq extends PageReq {
@ApiModelProperty(value = "任务状态(待评阅/已批阅)")
private String status;
//考核id
@ApiModelProperty(value = "考核id")
private Integer assessmentId;
}

@ -70,4 +70,8 @@ public interface EvaluationMapper extends BaseMapper<Evaluation> {
boolean hasUnjudgedQuestions(@Param("paperId")Integer paperId);
IPage<CompetitionUserReportVO> competitionUserReportByAssessment(Page<CompetitionUserReportVO> page, @Param("req") PageReviewTheListOfResultsReq req);
IPage<MyReadingAssignmentResp> myReviewTaskForAssessment(Page<MyReadingAssignmentResp> page,@Param("req") MyReviewTaskListReq req);
IPage<CompetitionUserReportVO> myReviewTaskByReviewListByAssessment(Page<CompetitionUserReportVO> page,@Param("req") MyReviewTaskByReviewListReq req);
}

@ -5,11 +5,11 @@
<insert id="batchInsertAssignments" keyColumn="assignment_id" useGeneratedKeys="true" keyProperty="assignmentId">
INSERT INTO `nakadai`.`r_evaluation_assignments`
(`account_id`, `paper_id`, `report_id`, `status`, `task_type`,
`create_time`,competition_id,stage_id,school_id,evaluation_id)
`create_time`,competition_id,stage_id,school_id,evaluation_id,assessment_id)
VALUES
<foreach collection="list" item="item" index="index" open="(" close=")" separator="),(">
#{item.accountId}, #{item.paperId}, #{item.reportId}, '待评阅', #{item.taskType},
now(),#{item.competitionId},#{item.stageId},#{item.schoolId},#{item.evaluationId}
now(),#{item.competitionId},#{item.stageId},#{item.schoolId},#{item.evaluationId},#{item.assessmentId}
</foreach>
</insert>

@ -519,44 +519,176 @@
</select>
<select id="competitionUserReportByAssessment"
resultType="com.huoran.nakadai.entity.res.CompetitionUserReportVO">
WITH EvaluatorCTE AS (
SELECT
ra.evaluation_id,
COUNT( DISTINCT account_id ) AS evaluator_count,
GROUP_CONCAT( u.user_name ORDER BY u.user_name SEPARATOR ', ' ) AS evaluators,
ra.report_id
FROM
nakadai.r_evaluation_assignments ra
LEFT JOIN nakadai.hr_user_account a ON a.id = ra.account_id
LEFT JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
GROUP BY
ra.report_id
) SELECT
r.paper_id,
p.province_name,
c.city_name,
p.province_id,
c.city_id,
r.report_id,
u.user_name,
a.work_number,
r.account_id,
r.time_sum,
r.score,
r.submit_time,
s.school_name AS realSchool,
a.school_id AS realSchoolId,
paper.NAME AS submitName,
v.allocate_time AS latestDistributionTime,
v.latest_assignor AS latestDistributionUser,
COALESCE ( e.evaluators, '' ) AS evaluator,
CASE
WHEN ( SELECT count( 1 ) FROM nakadai.r_evaluation_assignments a WHERE a.report_id = r.report_id ) = v.reviewers_per_question THEN
1 ELSE 0
END AS isDistribution,
e.evaluator_count,
e1.any_pending,
CASE
WHEN e1.any_pending = 1 THEN
'待评阅'
WHEN e1.any_pending IS NULL THEN
'待评阅' ELSE '已评阅'
END AS evaluationStatus
FROM
occupationlab.ol_experimental_report r
LEFT JOIN nakadai.hr_user_account a ON a.id = r.account_id
LEFT JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
LEFT JOIN nakadai.school s ON s.school_id = a.school_id
LEFT JOIN nakadai.province p ON p.province_id = s.province_id
LEFT JOIN nakadai.city c ON c.province_id = s.province_id
AND c.city_id = s.city_id
LEFT JOIN exam.exam_paper paper ON paper.paper_id = r.paper_id
LEFT JOIN nakadai.r_evaluation v ON v.assessment_id = r.assessment_id
LEFT JOIN EvaluatorCTE e ON e.evaluation_id = v.evaluation_id and e.report_id = r.report_id
LEFT JOIN ( SELECT report_id, MAX( CASE WHEN STATUS = '待评阅' THEN 1 ELSE 0 END ) AS any_pending FROM r_evaluation_assignments GROUP BY report_id ) e1 ON e1.report_id = r.report_id
WHERE
r.assessment_id = #{req.assessmentId}
AND a.type = 1
AND r.is_del = 0
<if test="req.keyword != null and req.keyword != ''">
AND (
u.user_name LIKE CONCAT( '%', #{req.keyword}, '%' )
OR a.work_number LIKE CONCAT( '%', #{req.keyword}, '%' )
)
</if>
ORDER by r.submit_time asc
</select>
<select id="myReviewTaskForAssessment" resultType="com.huoran.nakadai.entity.MyReadingAssignmentResp">
WITH ReportCounts AS (
SELECT
r.assessment_id,
COUNT( * ) AS totalAnswer
FROM
occupationlab.ol_experimental_report r
INNER JOIN nakadai.hr_user_account ua ON ua.id = r.account_id
WHERE
ua.type = 1
GROUP BY
r.assessment_id
),
AssignmentCounts AS (
SELECT
assessment_id,
account_id,
SUM( CASE WHEN STATUS = '待评阅' THEN 1 ELSE 0 END ) AS unReviewedAnswer,
SUM( CASE WHEN STATUS = '已评阅' THEN 1 ELSE 0 END ) AS reviewedAnswer
FROM
nakadai.r_evaluation_assignments
GROUP BY
assessment_id,
account_id
) SELECT
ass.experimental_name AS competitionName,
p.NAME AS competitionContent,
a.account_id,
a.paper_id,
a.report_id,
a.task_type,
a.STATUS,
a.assessment_id,
e.start_time,
e.end_time,
rc.totalAnswer,
ac.unReviewedAnswer,
ac.reviewedAnswer,
CASE
WHEN rc.totalAnswer != ( ac.unReviewedAnswer + ac.reviewedAnswer ) THEN
0
WHEN ac.unReviewedAnswer = 0 THEN
1 ELSE 0
END AS reviewStatus,
CASE
WHEN e.is_timed = 0 THEN
'1'
WHEN CURRENT_TIMESTAMP <![CDATA[ <]]> e.start_time THEN '0' WHEN CURRENT_TIMESTAMP BETWEEN e.start_time AND e.end_time THEN '1' WHEN CURRENT_TIMESTAMP > e.end_time THEN
'2' ELSE NULL
END AS reviewStage
FROM
nakadai.r_evaluation_assignments a
INNER JOIN occupationlab.ol_assessment ass ON ass.id = a.assessment_id
LEFT JOIN exam.exam_paper p ON p.paper_id = a.paper_id
LEFT JOIN nakadai.r_evaluation e ON e.evaluation_id = a.evaluation_id
LEFT JOIN ReportCounts rc ON rc.assessment_id = a.assessment_id
LEFT JOIN AssignmentCounts ac ON ac.assessment_id = a.assessment_id
AND ac.account_id = a.account_id
WHERE
a.account_id = #{req.accountId}
and ass.is_del = 0
GROUP BY a.assessment_id
</select>
<select id="myReviewTaskByReviewListByAssessment"
resultType="com.huoran.nakadai.entity.res.CompetitionUserReportVO">
SELECT
p.province_name,
c.city_name,
p.province_id,
c.city_id,
r.report_id,
u.user_name,
a.work_number,
r.account_id,
p.province_name,
c.city_name,
r.time_sum,
r.score,
r.submit_time,
s.school_name,
r.score,
s.school_name AS realSchool,
s.province_id,
s.city_id,
paper.paper_id,
paper.NAME AS submitName,
0 as isDistribution,
'测试_Rong' as evaluator,
1 as evaluatorCount,
now() as latestDistributionTime,
'测试_Rong' as latestDistributionUser
ea.STATUS,
ea.evaluation_id,
ea.assignment_id
FROM
occupationlab.ol_experimental_report r
LEFT JOIN nakadai.hr_user_account a ON a.id = r.account_id
LEFT JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
r_evaluation_assignments ea
LEFT JOIN occupationlab.ol_experimental_report r ON r.report_id = ea.report_id
LEFT JOIN hr_user_account a ON a.id = r.account_id
LEFT JOIN hr_user_info u ON u.user_id = a.user_id
LEFT JOIN nakadai.school s ON s.school_id = a.school_id
LEFT JOIN nakadai.province p ON p.province_id = s.province_id
LEFT JOIN nakadai.city c ON c.province_id = s.province_id
AND c.city_id = s.city_id
LEFT JOIN exam.exam_paper paper ON paper.paper_id = r.paper_id
LEFT JOIN nakadai.city c ON c.city_id = s.city_id
AND c.province_id = s.province_id
LEFT JOIN nakadai.province p ON p.province_id = c.province_id
LEFT JOIN exam.exam_paper paper ON paper.paper_id = ea.paper_id
LEFT JOIN r_evaluation_assigned_questions_details d ON d.assignment_id = ea.assignment_id
AND d.is_manual_score = 1
WHERE
r.assessment_id = #{req.assessmentId}
ea.assessment_id = #{req.assessmentId}
AND ea.account_id = #{req.accountId}
AND r.is_del = 0
<if test="req.keyword != null and req.keyword != ''">
AND (
u.user_name LIKE CONCAT( '%', #{req.keyword}, '%' )
OR a.work_number LIKE CONCAT( '%', #{req.keyword}, '%' )
)
</if>
</select>

@ -37,4 +37,6 @@ public interface EvaluationService extends IService<Evaluation> {
R getTheLabReportIdUpAndDown(MyReviewTaskByReviewListReq req);
void recalculateTheGrades(Integer evaluationId, Integer scoreAggregationRule);
R myReviewTaskForAssessment(MyReviewTaskListReq req);
}

@ -501,11 +501,11 @@ public class CurriculumServiceImpl extends ServiceImpl<CurriculumMapper, Curricu
}
try {
/*// 首先查询是否有订单
// 首先查询是否有订单
Integer count = orderMapper.whetherToRenewTheFeeCount(schoolId, mallId);
if (count == null || count == 0) {
return buildResponse(-1); // 没有下过订单,应为试用
}*/
}
SchoolCourseRes res = orderMapper.whetherToRenewTheFee(schoolId, mallId); // 返回是否续费 0表示没有该月订单的课程(显示续约按钮)
// 1表示正常显示课程

@ -422,6 +422,7 @@ public class EvaluationAssignmentsServiceImpl extends ServiceImpl<EvaluationAssi
summary.setIsFullyReviewed(1);
summary.setCompetitionId(evaluation.getCompetitionId());
summary.setStageId(evaluation.getStageId());
summary.setAssessmentId(evaluation.getAssessmentId());
summaryService.save(summary);//这里主要是用于自动判分题的时候也能正确获取到待评、已评的值
}
@ -432,6 +433,7 @@ public class EvaluationAssignmentsServiceImpl extends ServiceImpl<EvaluationAssi
assignment.setCreateTime(new Date());
assignment.setCompetitionId(evaluation.getCompetitionId());
assignment.setStageId(evaluation.getStageId());
assignment.setAssessmentId(evaluation.getAssessmentId());
assignment.setSchoolId(TokenUtils.getSchoolId());
assignment.setEvaluationId(evaluation.getEvaluationId());
return assignment;

@ -133,7 +133,14 @@ public class EvaluationServiceImpl extends ServiceImpl<EvaluationMapper, Evaluat
}
Page<CompetitionUserReportVO> page = new Page<>(req.getPageNum(), req.getPageSize());
IPage<CompetitionUserReportVO> pageList = baseMapper.myReviewTaskByReviewList(page, req);
IPage<CompetitionUserReportVO> pageList =null;
if(req.getAssessmentId()!=null){
pageList = baseMapper.myReviewTaskByReviewListByAssessment(page, req);
}else{
pageList = baseMapper.myReviewTaskByReviewList(page, req);
}
// 过滤返回的结果中的敏感信息
if (evaluation != null && evaluation.getAnonymizeStudents() == 1) {
@ -318,6 +325,7 @@ public class EvaluationServiceImpl extends ServiceImpl<EvaluationMapper, Evaluat
summary.setUpdateTime(new Date());
summary.setCompetitionId(evaluation.getCompetitionId());
summary.setStageId(evaluation.getStageId());
summary.setAssessmentId(evaluation.getAssessmentId());
QueryWrapper<EvaluationReportReviewSummary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("report_id", assignments.getReportId());
@ -495,6 +503,13 @@ public class EvaluationServiceImpl extends ServiceImpl<EvaluationMapper, Evaluat
}
}
@Override
public R myReviewTaskForAssessment(MyReviewTaskListReq req) {
Page<MyReadingAssignmentResp> page = new Page<>(req.getPageNum(), req.getPageSize());
IPage<MyReadingAssignmentResp> pageList = baseMapper.myReviewTaskForAssessment(page, req);
return R.ok().put("page", pageList);
}
private Double chooseScore(int scoreAggregationRule, RuleRecalculationResp resp) {
if (scoreAggregationRule == 0) { //

Loading…
Cancel
Save