Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

周箭河 5 anni fa
parent
commit
222324858b

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomDao.java

@@ -49,4 +49,13 @@ public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {
     int updateSL(ExamRoom examRoom);
 
     ExamRoom lockRoom(@Param("examRoomId") Long examRoomId);
+
+    /**
+     * @describe 根据日期获取教室
+     * @author Joburgess
+     * @date 2020.07.07
+     * @param days:
+     * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
+     */
+    List<ExamRoom> getWithDays(@Param("days") List<String> days);
 }

+ 7 - 5
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -2,7 +2,6 @@ package com.keao.edu.user.service.impl;
 
 
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.enums.YesOrNoEnum;
@@ -23,14 +22,13 @@ import com.keao.edu.user.page.ExamRoomQueryInfo;
 import com.keao.edu.user.service.ExamRoomService;
 import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.util.collection.MapUtil;
+import com.keao.edu.util.date.DateUtil;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.time.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
-import java.lang.reflect.InvocationTargetException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -184,11 +182,15 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 
 	@Override
 	public void checkRoomTeachers(List<ExamRoom> examRooms) {
-		List<String> days=new ArrayList<>();
+		Set<String> days=new HashSet<>();
 		for (ExamRoom examRoom : examRooms) {
 			if(Objects.nonNull(examRoom.getExamStartTime())){
-//				days.add(DateUtils)
+				days.add(DateUtil.dateToString(examRoom.getExamStartTime(), "yyyy-MM-dd"));
+			}
+			if(Objects.nonNull(examRoom.getExamEndTime())){
+				days.add(DateUtil.dateToString(examRoom.getExamEndTime(), "yyyy-MM-dd"));
 			}
 		}
+
 	}
 }

+ 0 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/TenantInfoServiceImpl.java

@@ -21,12 +21,10 @@ import com.keao.edu.user.enums.YesOrNoEnum;
 import com.keao.edu.user.service.TenantInfoService;
 import com.keao.edu.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -70,7 +68,6 @@ public class TenantInfoServiceImpl extends BaseServiceImpl<Integer, TenantInfo>
 		sysUser.setRealName(tenantInfo.getContactName());
 		sysUser.setAvatar(tenantInfo.getLogoUrl());
 		sysUser.setPhone(tenantInfo.getContactPhone());
-		sysUser.setRoles(tenantInfo.getSysUser().getRoles());
 		sysUserDao.insert(sysUser);
 		if(StringUtils.isNotBlank(tenantInfo.getRoleIds())){
 			List<Integer> roleIds = Arrays.stream(tenantInfo.getRoleIds().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());

+ 10 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml

@@ -240,4 +240,14 @@
 	<select id="lockRoom" resultType="com.keao.edu.user.api.entity.ExamRoom">
 		SELECT * FROM exam_room WHERE id_=#{examRoomId} FOR UPDATE
 	</select>
+    <select id="getWithDays" resultType="com.keao.edu.user.api.entity.ExamRoom">
+		SELECT
+			* 
+		FROM
+			exam_room 
+		WHERE
+			DATE_FORMAT( exam_start_time_, '%Y-%m-%d' ) IN 
+			<!--<foreach collection="" -->
+			<!--OR DATE_FORMAT( exam_end_time_, '%Y-%m-%d' ) IN ( )-->
+	</select>
 </mapper>