|
@@ -1,19 +1,24 @@
|
|
|
package com.keao.edu.user.service.impl;
|
|
|
|
|
|
|
|
|
+import com.keao.edu.auth.api.client.SysUserFeignService;
|
|
|
import com.keao.edu.auth.api.entity.SysUser;
|
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
|
import com.keao.edu.common.exception.BizException;
|
|
|
import com.keao.edu.common.page.PageInfo;
|
|
|
import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
|
+import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
|
|
|
import com.keao.edu.user.dao.ExamReviewDao;
|
|
|
import com.keao.edu.user.dto.ExamReviewDto;
|
|
|
+import com.keao.edu.user.dto.ExamReviewRecordDto;
|
|
|
import com.keao.edu.user.entity.ExamReview;
|
|
|
import com.keao.edu.user.entity.ExaminationBasic;
|
|
|
import com.keao.edu.user.entity.Subject;
|
|
|
import com.keao.edu.user.enums.YesOrNoEnum;
|
|
|
import com.keao.edu.user.page.ExamReviewQueryInfo;
|
|
|
+import com.keao.edu.user.page.ExamReviewRecordQueryInfo;
|
|
|
import com.keao.edu.user.service.ExamReviewService;
|
|
|
+import com.keao.edu.user.service.ExamRoomStudentRelationService;
|
|
|
import com.keao.edu.util.collection.MapUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -31,7 +36,9 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
|
|
|
@Autowired
|
|
|
private ExamReviewDao examReviewDao;
|
|
|
@Autowired
|
|
|
- private OrganizationServiceImpl organizationService;
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private ExamRoomStudentRelationService examRoomStudentRelationService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExamReview> getDAO() {
|
|
@@ -73,6 +80,39 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public PageInfo<ExamReviewRecordDto> queryExamReviewRecordList(ExamReviewRecordQueryInfo queryInfo) {
|
|
|
+ PageInfo<ExamReviewRecordDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+ List<ExamReviewRecordDto> dataList = null;
|
|
|
+ int count = examReviewDao.countExamReviewRecordList(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = examReviewDao.queryExamReviewRecordList(params);
|
|
|
+ }
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void add(ExamReview examReview) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ Long examRegistrationId = examReview.getExamRegistrationId();
|
|
|
+ ExamReview byRegistrationId = examReviewDao.findByRegistrationId(examRegistrationId,sysUser.getId());
|
|
|
+ if(byRegistrationId != null){
|
|
|
+ throw new BizException("评审失败,请勿重复操作");
|
|
|
+ }
|
|
|
+ ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationService.getExamRoomStudentRelation(examRegistrationId);
|
|
|
+ examReview.setExaminationBasicId(examRoomStudentRelation.getExaminationBasicId());
|
|
|
+ examReview.setTeacherId(sysUser.getId());
|
|
|
+ examReview.setStudentId(examRoomStudentRelation.getStudentId());
|
|
|
+ examReview.setExamRoomId(examRoomStudentRelation.getExamRoomId());
|
|
|
+ examReview.setTeacherId(Integer.parseInt(examRoomStudentRelation.getTenantId()));
|
|
|
+ examReviewDao.insert(examReview);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public int update(ExamReview examReview) {
|
|
|
if(Objects.isNull(examReview.getId())){
|