Browse Source

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

zouxuan 5 năm trước cách đây
mục cha
commit
d7d254b432
18 tập tin đã thay đổi với 158 bổ sung47 xóa
  1. 0 6
      .idea/httpRequests/2020-07-10T043131.200.json
  2. 0 6
      .idea/httpRequests/http-requests-log.http
  3. 0 5
      edu-cms/pom.xml
  4. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamTeacherSalaryController.java
  5. 2 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamLifecycleLogDao.java
  6. 12 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamOrganizationRelationDao.java
  7. 20 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamLifecycleLogDto.java
  8. 3 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamOrganStatisticsDto.java
  9. 9 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamTeacherSalaryService.java
  10. 6 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/NotifyCallback.java
  11. 19 3
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java
  12. 47 9
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java
  13. 17 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamTeacherSalaryServiceImpl.java
  14. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExaminationBasicServiceImpl.java
  15. 9 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamLifecycleLogMapper.xml
  16. 9 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamOrganizationRelationMapper.xml
  17. 2 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml
  18. 1 5
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml

+ 0 - 6
.idea/httpRequests/2020-07-10T043131.200.json

@@ -1,6 +0,0 @@
-{
-  "status": false,
-  "msg": "Full authentication is required to access this resource",
-  "data": null,
-  "code": 403
-}

+ 0 - 6
.idea/httpRequests/http-requests-log.http

@@ -1,6 +0,0 @@
-POST http://localhost:8005/examReview/update
-
-<> 2020-07-10T043131.200.json
-
-###
-

+ 0 - 5
edu-cms/pom.xml

@@ -17,11 +17,6 @@
 	<dependencies>
 		<dependency>
 			<groupId>com.keao.edu</groupId>
-			<artifactId>edu-common</artifactId>
-		</dependency>
-		
-		<dependency>
-			<groupId>com.keao.edu</groupId>
 			<artifactId>edu-datasource</artifactId>
 		</dependency>
 		

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamTeacherSalaryController.java

@@ -67,7 +67,7 @@ public class ExamTeacherSalaryController extends BaseController {
     @PostMapping(value = "/update")
     public HttpResponseResult update(ExamTeacherSalary examTeacherSalary) {
         examTeacherSalary.setUpdateTime(new Date());
-        examTeacherSalaryService.update(examTeacherSalary);
+        examTeacherSalaryService.updateExamTeacherSalary(examTeacherSalary);
         return succeed();
     }
 

+ 2 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamLifecycleLogDao.java

@@ -1,6 +1,7 @@
 package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.dto.ExamLifecycleLogDto;
 import com.keao.edu.user.entity.ExamLifecycleLog;
 import org.apache.ibatis.annotations.Param;
 
@@ -8,6 +9,6 @@ import java.util.List;
 
 public interface ExamLifecycleLogDao extends BaseDAO<Long, ExamLifecycleLog> {
 
-    List<ExamLifecycleLog> findWithExam(@Param("examId") Long examId);
+    List<ExamLifecycleLogDto> findWithExam(@Param("examId") Long examId);
 	
 }

+ 12 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamOrganizationRelationDao.java

@@ -38,6 +38,18 @@ public interface ExamOrganizationRelationDao extends BaseDAO<Long, ExamOrganizat
     int batchUpdate(@Param("examOrganizationRelations") List<ExamOrganizationRelation> examOrganizationRelations);
 
     /**
+     * @describe 更新考级项目下指定合作单位的可排考状态
+     * @author Joburgess
+     * @date 2020.07.17
+     * @param examId:
+     * @param organIds:
+     * @return int
+     */
+    int updateOrganAllowArrangeExamStatus(@Param("examId") Long examId,
+                                          @Param("isAllowArrangeExam") Integer isAllowArrangeExam,
+                                          @Param("organIds") List<Integer> organIds);
+
+    /**
      * @param examId:      考级项目编号
      * @param organIds:    合作单位编号列表
      * @param sendUrlFlag: 链接发送状态

+ 20 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamLifecycleLogDto.java

@@ -0,0 +1,20 @@
+package com.keao.edu.user.dto;
+
+import com.keao.edu.user.entity.ExamLifecycleLog;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.07.17
+ */
+public class ExamLifecycleLogDto extends ExamLifecycleLog {
+
+    private String operatorName;
+
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+}

+ 3 - 4
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamOrganStatisticsDto.java

@@ -1,6 +1,5 @@
 package com.keao.edu.user.dto;
 
-import com.keao.edu.user.entity.ExamLifecycleLog;
 import com.keao.edu.user.entity.ExamOrganizationRelation;
 
 import java.math.BigDecimal;
@@ -13,17 +12,17 @@ import java.util.Map;
  */
 public class ExamOrganStatisticsDto extends ExamOrganizationRelation {
 
-    private List<ExamLifecycleLog> examLifecycleLogs;
+    private List<ExamLifecycleLogDto> examLifecycleLogs;
 
     private Map<String, BigDecimal> dayTransAmount;
 
     private Map<String, BigDecimal> dayPaymentAmount;
 
-    public List<ExamLifecycleLog> getExamLifecycleLogs() {
+    public List<ExamLifecycleLogDto> getExamLifecycleLogs() {
         return examLifecycleLogs;
     }
 
-    public void setExamLifecycleLogs(List<ExamLifecycleLog> examLifecycleLogs) {
+    public void setExamLifecycleLogs(List<ExamLifecycleLogDto> examLifecycleLogs) {
         this.examLifecycleLogs = examLifecycleLogs;
     }
 

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamTeacherSalaryService.java

@@ -51,6 +51,15 @@ public interface ExamTeacherSalaryService extends BaseService<Long, ExamTeacherS
     void addExamTeacherSalary(Long examId, String teacherIdsStr);
 
     /**
+     * @describe 更新
+     * @author Joburgess
+     * @date 2020.07.20
+     * @param examTeacherSalary:
+     * @return void
+     */
+    void updateExamTeacherSalary(ExamTeacherSalary examTeacherSalary);
+
+    /**
      * @describe 获取指定考级项目可排考教师
      * @author Joburgess
      * @date 2020.07.02

+ 6 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/NotifyCallback.java

@@ -2,8 +2,10 @@ package com.keao.edu.user.service;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.huifu.adapay.Adapay;
 import com.huifu.adapay.notify.MQTTCallbackHandler;
 import com.keao.edu.thirdparty.adapay.ConfigInit;
+import com.keao.edu.user.dao.SysConfigDao;
 import com.keao.edu.user.entity.ExamRegistrationPayment;
 import com.keao.edu.user.enums.TransStatusEnum;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,6 +21,8 @@ public class NotifyCallback implements MQTTCallbackHandler {
 
     @Autowired
     private ExamRegistrationPaymentService examRegistrationPaymentService;
+    @Autowired
+    private SysConfigDao sysConfigDao;
 
 
     private static NotifyCallback notifyCallback;
@@ -26,6 +30,8 @@ public class NotifyCallback implements MQTTCallbackHandler {
     @PostConstruct
     public void init() {
         notifyCallback = this;
+        String baseApiUrl = notifyCallback.sysConfigDao.findConfigValue("base_api_url");
+        Adapay.setDeviceID(baseApiUrl);
     }
 
     /**

+ 19 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java

@@ -105,7 +105,7 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 
 	@Override
 	public List<ExamOrganizationRelationExtraDto> getChildOrgans(Long examId, Integer organId) {
-		List<Integer> childOrganIds = organizationService.getChildOrganIds(organId, false);
+		List<Integer> childOrganIds = organizationService.getChildOrganIds(organId, true);
 		return examOrganizationRelationDao.getExamChildOrgans(examId,childOrganIds);
 	}
 
@@ -154,7 +154,7 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 			if(Objects.isNull(organization)){
 				throw new BizException("合作单位信息错误");
 			}
-			og.setSendUrlFlag(0);
+			og.setSendUrlFlag(1);
 			og.setIsAllowArrangeExam(1);
 			og.setSettlementType(organization.getSettlementType());
 			og.setShareProfitAmount(organization.getShareProfitAmount());
@@ -252,6 +252,10 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 		if(selfOrgan.getIsAllowArrangeExam()==0&&examOrganizationRelation.getIsAllowArrangeExam()==1){
 			throw new BizException("暂无权限");
 		}
+		if(Objects.nonNull(examOrganizationRelation.getIsAllowArrangeExam())&&examOrganizationRelation.getIsAllowArrangeExam()==0){
+			List<Integer> childOrganIds = organizationService.getChildOrganIds(organizationRelation.getOrganId(), false);
+			examOrganizationRelationDao.updateOrganAllowArrangeExamStatus(organizationRelation.getExaminationBasicId().longValue(), 0, childOrganIds);
+		}
 		examOrganizationRelationDao.update(examOrganizationRelation);
 	}
 
@@ -281,7 +285,15 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 			throw new BizException("请指定考级项目");
 		}
 
-		List<Integer> childOrganIds = organizationService.getChildOrganIds(selfOrganId, true);
+		List<Integer> childOrganIds = organizationService.getNextLevelOrganIds(selfOrganId, false);
+
+		ExamOrganStatisticsDto examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(examId.longValue(), selfOrganId);
+		if(Objects.isNull(examOrganizationRelation)){
+			throw new BizException("数据异常");
+		}
+		if(examOrganizationRelation.getSendUrlFlag()==0){
+			throw new BizException("发送失败");
+		}
 
 		List<ExamOrganizationRelation> examOrgans = examOrganizationRelationDao.getExamOrganizationRelations(examId.longValue(), childOrganIds);
 		Set<Integer> existOrganizationIds = examOrgans.stream().map(ExamOrganizationRelation::getOrganId).collect(Collectors.toSet());
@@ -358,6 +370,10 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 			examOrganStatistics=new ExamOrganStatisticsDto();
 		}
 
+		if(Objects.isNull(examOrganStatistics.getSettlementType())){
+			examOrganStatistics.setIsAllowArrangeExam(1);
+		}
+
 		examOrganStatistics.setExamLifecycleLogs(examLifecycleLogDao.findWithExam(examId));
 
 		Map<String, BigDecimal> dayTransAmount=new LinkedHashMap<>();

+ 47 - 9
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -153,6 +153,10 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			throw new BizException("请指定考试时间");
 		}
 
+		if(ExamModeEnum.ONLINE.equals(examRoom.getExamMode())){
+			examRoom.setExamLocationId(null);
+		}
+
 		ExamOrganizationRelation examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(examinationBasic.getId(), examRoom.getOrganId());
 		if(Objects.isNull(examOrganizationRelation)||examOrganizationRelation.getIsAllowArrangeExam()==0){
 			throw new BizException("无权操作");
@@ -170,6 +174,10 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 		teacherIds.add(examRoom.getMainTeacherUserId());
 		if(StringUtils.isNotBlank(examRoom.getAssistantTeacherUserIdList())){
 			teacherIds.addAll(Arrays.stream(examRoom.getAssistantTeacherUserIdList().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList()));
+			HashSet<Integer> noRepeatTeacherIds = new HashSet<>(teacherIds);
+			if(teacherIds.size()!=noRepeatTeacherIds.size()){
+				throw new BizException("主考老师与监考老师不可重复");
+			}
 		}
 
 		Map<Integer, String> teacherIdNameMap = this.getMap("sys_user", "id_", "real_name_", teacherIds, Integer.class, String.class);
@@ -236,10 +244,20 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			throw new BizException("请指定教室");
 		}
 
+		ExamRoom existExamRoom = examRoomDao.get(examRoom.getId());
+
+		if(ExamModeEnum.ONLINE.equals(examRoom.getExamMode())){
+			examRoom.setExamLocationId(null);
+		}
+
 		List<Integer> teacherIds=new ArrayList<>();
 		teacherIds.add(examRoom.getMainTeacherUserId());
 		if(StringUtils.isNotBlank(examRoom.getAssistantTeacherUserIdList())){
 			teacherIds.addAll(Arrays.stream(examRoom.getAssistantTeacherUserIdList().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList()));
+			HashSet<Integer> noRepeatTeacherIds = new HashSet<>(teacherIds);
+			if(teacherIds.size()!=noRepeatTeacherIds.size()){
+				throw new BizException("主考老师与监考老师不可重复");
+			}
 		}
 
 		Map<Integer, String> teacherIdNameMap = this.getMap("sys_user", "id_", "real_name_", teacherIds, Integer.class, String.class);
@@ -253,7 +271,23 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			}
 			examRoom.setAssistantTeacherUserNameList(StringUtils.join(assistantTeacherNames, ","));
 		}
+
+		List<Integer> subjectIds = Arrays.stream(examRoom.getSubjectIdList().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+		Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
+		examRoom.setSubjectNameList(StringUtils.join(subjectIdNameMap.values(),","));
+
+		if(Objects.isNull(examRoom.getExamStartTime())){
+			examRoom.setExamStartTime(existExamRoom.getExamStartTime());
+		}
+		if(Objects.isNull(examRoom.getExamEndTime())){
+			examRoom.setExamEndTime(existExamRoom.getExamEndTime());
+		}
+
+		List<ExamRoom> examRooms=new ArrayList<>(Arrays.asList(examRoom));
+		checkRoomTeachers(examRooms);
+
 		examRoomDao.update(examRoom);
+		examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
 		return examRoom;
 	}
 
@@ -272,13 +306,13 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 
 		examRoomStudentRelationService.deleteWithExamRooms(examRoomIds);
 
-		examCertificationDao.deleteWithRegist(registIds);
-
-		studentExamResultDao.deleteWithRegists(registIds);
-
-		examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
+		if(!CollectionUtils.isEmpty(registIds)){
+			examCertificationDao.deleteWithRegist(registIds);
+			studentExamResultDao.deleteWithRegists(registIds);
+		}
 
 		examRoomDao.batchDeleteExamRooms(examRoomIds);
+		examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
 	}
 
 	@Override
@@ -306,16 +340,17 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			examRoomStatisticsInfo.setExamRoomNum(examRooms.size());
 			examRoomStatisticsInfo.setFirstExamTime(examRooms.stream().min(Comparator.comparing(ExamRoom::getExamStartTime)).get().getExamStartTime());
 			examRoomStatisticsInfo.setLastExamTime(examRooms.stream().max(Comparator.comparing(ExamRoom::getExamStartTime)).get().getExamStartTime());
-			int teacherNum=0;
+			Set<Integer> teacherIds=new HashSet<>();
 			for (ExamRoom examRoom : examRooms) {
 				if(Objects.nonNull(examRoom.getMainTeacherUserId())){
-					teacherNum+=1;
+					teacherIds.add(examRoom.getMainTeacherUserId());
 				}
 				if(StringUtils.isNotBlank(examRoom.getAssistantTeacherUserIdList())){
-					teacherNum = teacherNum + StringUtils.countMatches(examRoom.getAssistantTeacherUserIdList(), ",") + 1;
+					Set<Integer> assistantTeacherIds = Arrays.stream(examRoom.getAssistantTeacherUserIdList().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toSet());
+					teacherIds.addAll(assistantTeacherIds);
 				}
 			}
-			examRoomStatisticsInfo.setExamRoomTeacherNum(teacherNum);
+			examRoomStatisticsInfo.setExamRoomTeacherNum(teacherIds.size());
 		}
 
         return examRoomStatisticsInfo;
@@ -385,6 +420,9 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 				}
 				ExamRoom preExamRoom=teacherRooms.get(i-1);
 				ExamRoom currentExamRoom = teacherRooms.get(i);
+				if(Objects.nonNull(preExamRoom.getId())&&preExamRoom.getId().equals(currentExamRoom.getId())){
+					continue;
+				}
 				if(preExamRoom.getExamEndTime().compareTo(currentExamRoom.getExamStartTime())>0){
 					SysUser sysUser = sysUserDao.get(teacherRoomEntry.getKey());
 					throw new BizException("{}教师时间存在冲突", sysUser.getRealName());

+ 17 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamTeacherSalaryServiceImpl.java

@@ -48,7 +48,7 @@ public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeac
 	public void teacherSalarySettlementWithExam(Long examId) {
 		List<ExamRoom> examRooms = examRoomDao.getWithExam(null, examId);
 		if(CollectionUtils.isEmpty(examRooms)){
-			return;
+			examRooms=Collections.EMPTY_LIST;
 		}
 
 		Map<Integer, List<ExamRoom>> teacherExamRoomMap=new HashMap<>();
@@ -85,7 +85,9 @@ public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeac
 			examTeacherSalary.setTotalInvigilationStudentNum((int) studentNum);
 			examTeacherSalary.setTotalSettlementCost(examTeacherSalary.getShareProfitAmount().multiply(new BigDecimal(studentNum)));
 		}
-		examTeacherSalaryDao.batchUpdate(examTeacherSalaries);
+		if(!CollectionUtils.isEmpty(examTeacherSalaries)){
+			examTeacherSalaryDao.batchUpdate(examTeacherSalaries);
+		}
 	}
 
 	@Override
@@ -161,6 +163,19 @@ public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeac
 	}
 
 	@Override
+	public void updateExamTeacherSalary(ExamTeacherSalary examTeacherSalary) {
+		if(Objects.isNull(examTeacherSalary.getId())){
+			throw new BizException("参数错误");
+		}
+		ExamTeacherSalary exist = examTeacherSalaryDao.get(examTeacherSalary.getId());
+		if(Objects.isNull(exist)){
+			throw new BizException("参数错误");
+		}
+		examTeacherSalaryDao.update(examTeacherSalary);
+		teacherSalarySettlementWithExam(exist.getExaminationBasicId());
+	}
+
+	@Override
 	public List<BaseUserInfoDto> getExamTeachers(Integer examId) {
 		if(Objects.isNull(examId)){
 			throw new BizException("请指定考级项目");

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExaminationBasicServiceImpl.java

@@ -296,7 +296,7 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
             if(examinationBasic.getEnrollStartTime().compareTo(now)>0){
                 examinationBasic.setStatus(ExamStatusEnum.NOT_START);
             }else if(examinationBasic.getEnrollEndTime().compareTo(now)<0){
-                examinationBasic.setStatus(ExamStatusEnum.CLOSE);
+                examinationBasic.setStatus(ExamStatusEnum.APPLIED);
             }else{
                 examinationBasic.setStatus(ExamStatusEnum.APPLYING);
             }

+ 9 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamLifecycleLogMapper.xml

@@ -14,6 +14,10 @@
 		<result column="memo_" property="memo" />
 		<result column="create_time_" property="createTime" />
 	</resultMap>
+
+	<resultMap id="ExamLifecycleLogDto" type="com.keao.edu.user.dto.ExamLifecycleLogDto" extends="ExamLifecycleLog">
+		<result column="real_name_" property="operatorName"/>
+	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="ExamLifecycleLog" >
@@ -73,7 +77,10 @@
 		SELECT COUNT(*) FROM exam_lifecycle_log
 	</select>
 
-    <select id="findWithExam" resultMap="ExamLifecycleLog">
-		SELECT * FROM exam_lifecycle_log WHERE examination_basic_id_=#{examId} ORDER BY id_ DESC
+    <select id="findWithExam" resultMap="ExamLifecycleLogDto">
+		SELECT elo.*,su.real_name_ FROM exam_lifecycle_log elo
+		LEFT JOIN sys_user su ON  elo.operator_user_id_=su.id_
+		WHERE examination_basic_id_=#{examId}
+		ORDER BY id_ DESC
 	</select>
 </mapper>

+ 9 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamOrganizationRelationMapper.xml

@@ -182,6 +182,15 @@
 		</if>
 	</update>
 
+	<update id="updateOrganAllowArrangeExamStatus">
+		UPDATE exam_organization_relation SET is_allow_arrange_exam_=#{isAllowArrangeExam}
+		WHERE examination_basic_id_=#{examId}
+		AND organ_id_ IN
+		<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+			#{organId}
+		</foreach>
+	</update>
+
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM exam_organization_relation WHERE id_ = #{id} 

+ 2 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -398,7 +398,7 @@
 		FROM
 			exam_registration er
 		WHERE
-			er.status_ IN ('AUDIT_PASS', 'AUDIT_WAIT')
+			er.status_ NOT IN ('CANCEL', 'PAY_WAIT')
 			AND er.examination_basic_id_ = #{examId}
 			<if test="organIds!=null">
 				AND er.organ_id_ IN
@@ -414,7 +414,7 @@
 		FROM
 		exam_registration er
 		WHERE 1=1
-		AND er.status_ IN ('AUDIT_PASS', 'AUDIT_WAIT')
+		AND er.status_ IN ('AUDIT_PASS')
 		<if test="organIds!=null">
 			AND er.organ_id_ IN
 			<foreach collection="organIds" item="organI" separator="," open="(" close=")">

+ 1 - 5
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml

@@ -93,9 +93,7 @@
 			<if test="examMode != null">
 				exam_mode_ = #{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
-			<if test="examLocationId != null">
-				exam_location_id_ = #{examLocationId},
-			</if>
+			exam_location_id_ = #{examLocationId},
 			<if test="mainTeacherUserId != null">
 				main_teacher_user_id_ = #{mainTeacherUserId},
 			</if>
@@ -148,9 +146,7 @@
 			<if test="examMode != null">
 				exam_mode_ = #{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
-			<if test="examLocationId != null">
 				exam_location_id_ = #{examLocationId},
-			</if>
 			<if test="mainTeacherUserId != null">
 				main_teacher_user_id_ = #{mainTeacherUserId},
 			</if>