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
caee0a043a

+ 13 - 1
edu-auth/edu-auth-server/pom.xml

@@ -83,7 +83,6 @@
         <dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-openfeign-core</artifactId>
-            <version>2.1.2.RELEASE</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
@@ -97,4 +96,17 @@
             <artifactId>edu-user-client-api</artifactId>
         </dependency>
     </dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
 </project>

+ 13 - 0
edu-cms/pom.xml

@@ -46,4 +46,17 @@
 			<artifactId>mysql-connector-java</artifactId>
 		</dependency>
 	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
 </project>

+ 13 - 0
edu-eureka/pom.xml

@@ -22,4 +22,17 @@
 			<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
 		</dependency>
 	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
 </project>

+ 13 - 0
edu-im/edu-im-server/pom.xml

@@ -98,4 +98,17 @@
             <artifactId>edu-user-client-api</artifactId>
         </dependency>
     </dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
 </project>

+ 13 - 0
edu-task/pom.xml

@@ -58,4 +58,17 @@
 			<artifactId>edu-common</artifactId>
 		</dependency>
 	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
 </project>

+ 13 - 2
edu-user/edu-user-server/pom.xml

@@ -27,7 +27,6 @@
 		<dependency>
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-commons</artifactId>
-			<version>2.1.2.RELEASE</version>
 			<scope>compile</scope>
 		</dependency>
 		<dependency>
@@ -37,7 +36,6 @@
 		<dependency>
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-openfeign-core</artifactId>
-			<version>2.1.2.RELEASE</version>
 			<scope>compile</scope>
 		</dependency>
 		<dependency>
@@ -89,4 +87,17 @@
             <artifactId>edu-user-client-api</artifactId>
         </dependency>
     </dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
 </project>

+ 13 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java

@@ -3,8 +3,20 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.entity.ExamRegistration;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {
 
-	
+    /**
+     * @describe 统计无教室学员
+     * @author Joburgess
+     * @date 2020.06.29
+     * @param organIds:
+     * @return int
+     */
+    int countWithoutExamRoomStudentNum(@Param("organIds")List<Integer> organIds,
+                                       @Param("examId") Integer examId);
+
 }

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

@@ -34,4 +34,6 @@ public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {
      * @return int
      */
     int batchDeleteExamRooms(@Param("examRoomIds") List<Long> examRoomIds);
+
+//    int batchUpdateExamRoomPushStatus(@Param())
 }

+ 8 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomService.java

@@ -42,4 +42,12 @@ public interface ExamRoomService extends BaseService<Long, ExamRoom> {
      * @return void
      */
     void deleteExamRooms(String examRoomIds);
+
+    /**
+     * @describe 发送考试安排
+     * @author Joburgess
+     * @date 2020.06.29
+     * @return void
+     */
+    void sendExamPlan(Integer organId, Integer examId);
 }

+ 14 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -7,6 +7,7 @@ import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.api.entity.ExamRoom;
+import com.keao.edu.user.dao.ExamRegistrationDao;
 import com.keao.edu.user.dao.ExamRoomDao;
 import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
 import com.keao.edu.user.dto.ExamRoomDto;
@@ -14,6 +15,7 @@ import com.keao.edu.user.enums.ExamModeEnum;
 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.user.service.StudentService;
 import com.keao.edu.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,6 +33,8 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
 	@Autowired
 	private OrganizationService organizationService;
+	@Autowired
+	private ExamRegistrationDao examRegistrationDao;
 
 	@Override
 	public BaseDAO<Long, ExamRoom> getDAO() {
@@ -100,4 +104,14 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 		examRoomDao.batchDeleteExamRooms(examRoomIds);
 		examRoomStudentRelationDao.deleteWithExamRooms(examRoomIds);
 	}
+
+	@Override
+	public void sendExamPlan(Integer organId, Integer examId) {
+		List<Integer> nextLevelOrganIds = organizationService.getNextLevelOrganIds(organId, true);
+		int withoutExamRoomStudentNum = examRegistrationDao.countWithoutExamRoomStudentNum(nextLevelOrganIds, examId);
+		if(withoutExamRoomStudentNum>0){
+			throw new BizException("存在未安排教室的学员");
+		}
+
+	}
 }

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

@@ -148,4 +148,17 @@
 		SELECT COUNT(*) FROM exam_registration
 		<include refid="queryCondition"/>
 	</select>
+    <select id="countWithoutExamRoomStudentNum" resultType="int">
+		SELECT
+			COUNT(ersr.id_)
+		FROM
+			exam_registration er
+		LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_
+		ersr.organ_id_ IN
+		<foreach collection="organIds" item="organI" separator="," open="(" close=")">
+			#{organI}
+		</foreach>
+		AND er.examination_basic_id_ = #{examId}
+		AND ersr.id_ IS NULL
+	</select>
 </mapper>

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

@@ -17,7 +17,7 @@
 		<result column="exam_time_" property="examTime" />
 		<result column="del_flag_" property="delFlag" />
 		<result column="organ_id_" property="organId"/>
-		<result column="exam_plan_push_flag_" property="examPlanPushFlag"/>
+		<result column="exam_plan_push_flag_" property="examPlanPushFlag" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -38,7 +38,7 @@
 		INSERT INTO exam_room (id_,examination_basic_id_,exam_mode_,exam_location_id_,subject_id_list_,main_teacher_user_id_,
 		assistant_teacher_user_id_list_,exam_time_,del_flag_,organ_id_,exam_plan_push_flag_,create_time_,update_time_,tenant_id_)
 		VALUES(#{id},#{examinationBasicId},#{examMode},#{examLocationId},#{subjectIdList},#{mainTeacherUserId},#{assistantTeacherUserIdList},
-		#{examTime},#{delFlag},#{organId},#{examPlanPushFlag},NOW(),NOW(),#{tenantId})
+		#{examTime},#{delFlag},#{organId},#{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -76,7 +76,7 @@
 				organ_id_ = #{organId},
 			</if>
 			<if test="examPlanPushFlag != null">
-				exam_plan_push_flag_ = #{examPlanPushFlag},
+				exam_plan_push_flag_ = #{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
@@ -88,7 +88,7 @@
 	</delete>
 
 	<delete id="batchDeleteExamRooms">
-		DELETE FROM exam_room WHERE id_ IN
+		DELETE FROM exam_room WHERE exam_plan_push_flag_=0 AND id_ IN
 		<foreach collection="examRoomIds" item="examRoomId" separator="," open="(" close=")">
 			#{examRoomId}
 		</foreach>

+ 1 - 10
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -107,8 +107,6 @@
 		SELECT COUNT(*) FROM exam_room_student_relation
 	</select>
 
-
-
 	<sql id="queryCondition">
 		<where>
 			ersr.organ_id_ IN
@@ -143,11 +141,7 @@
 
 	<select id="countExamRoomStudents" resultType="int">
 		SELECT
-		ersr.id_,
-		ersr.student_id_,
-		er.subject_id_,
-		er.level_,
-		er.create_time_
+			COUNT(ersr.id_)
 		FROM
 		exam_registration er
 		LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_
@@ -157,7 +151,4 @@
 	<select id="findStudentsWithExamRoom" resultMap="ExamRoomStudentRelation">
 		SELECT id_, examination_basic_id_, exam_room_id_, student_id_ FROM exam_room_student_relation WHERE exam_room_id_=#{examRoomId}
 	</select>
-	<select id="findByBasicIdAndStudentId">
-
-	</select>
 </mapper>

+ 13 - 0
edu-zuul/pom.xml

@@ -42,4 +42,17 @@
 			<artifactId>spring-boot-starter-security</artifactId>
 		</dependency>
 	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
 </project>

+ 7 - 0
edu-zuul/src/main/resources/application.yml

@@ -68,6 +68,13 @@ zuul:
       #url: http://localhost:8001/
       ##加上下面参数,可将header信息传递至下游
       #sensitiveHeaders:
+    api-im:
+      ### 以 /api-auth/访问转发到会员服务
+      path: /api-im/**
+      serviceId: im-server
+      #url: http://localhost:8001/
+      ##加上下面参数,可将header信息传递至下游
+      #sensitiveHeaders:
   #忽略某个微服务
   ignored-services: eureka-server
   #重试