Explorar o código

Merge remote-tracking branch 'origin/master'

周箭河 %!s(int64=5) %!d(string=hai) anos
pai
achega
040b661be3

+ 0 - 6
edu-auth/edu-auth-api/src/main/java/com/keao/edu/auth/api/client/SysMessageFeignService.java

@@ -3,19 +3,13 @@ package com.keao.edu.auth.api.client;
 import com.keao.edu.auth.api.client.fallback.SysMessageFeignServiceFallback;
 import com.keao.edu.auth.api.entity.SysMessageParams;
 import com.keao.edu.common.config.FeignConfiguration;
-import com.keao.edu.common.enums.MessageTypeEnum;
-import com.keao.edu.thirdparty.message.MessageSenderPluginContext;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.GetMapping;
 
-import java.util.Date;
-import java.util.Map;
-
 @FeignClient(contextId = "SysMessageFeignService", name = "auth-server", configuration = { FeignConfiguration.class }, fallback = SysMessageFeignServiceFallback.class)
 public interface SysMessageFeignService {
 
-
     @GetMapping(value = "sysMessage/batchSendMessage", consumes = MediaType.APPLICATION_JSON_VALUE)
     void batchSendMessage(SysMessageParams sysMessageParams);
 }

+ 1 - 1
edu-common/src/main/java/com/keao/edu/common/enums/MessageTypeEnum.java

@@ -3,7 +3,7 @@ package com.keao.edu.common.enums;
 public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
 
     SMS_VERIFY_CODE_LOGIN("SMS_VERIFY_CODE_LOGIN", "验证码登录"),
-    EXAM_REGISTRATION_URL_PUSH("EXAM_REGISTRATION_URL_PUSH", "报名连接推送"),
+    EXAM_REGISTRATION_URL_SMS("EXAM_REGISTRATION_URL_SMS", "报名连接推送"),
     STUDENT_EXAM_START("STUDENT_EXAM_START", "考试已开始");
 
     MessageTypeEnum(String code, String msg) {

+ 8 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamLocationController.java

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * @Author Joburgess
@@ -37,6 +38,12 @@ public class ExamLocationController extends BaseController {
         return succeed(examLocationService.queryPage(queryInfo));
     }
 
+    @ApiOperation("获取所在机构所有考点")
+    @GetMapping(value = "/getTenantAllLocations")
+    public HttpResponseResult<List<ExamLocation>> getTenantAllLocations(){
+        return succeed(examLocationService.getTenantAllLocations(TenantContextHolder.getTenantId()));
+    }
+
     @ApiOperation("查询考点详情")
     @ApiImplicitParam(name = "id", value = "机构ID", required = true, dataType = "Integer", paramType = "path")
     @GetMapping(value = "/query")
@@ -48,6 +55,7 @@ public class ExamLocationController extends BaseController {
     @PostMapping(value = "/add")
     public HttpResponseResult add(@RequestBody ExamLocation examLocation) {
         examLocation.setTenantId(TenantContextHolder.getTenantId());
+        examLocation.setIsAvailable(true);
         examLocationService.insert(examLocation);
         return succeed();
     }

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

@@ -114,7 +114,7 @@ public class ExamRoomController extends BaseController {
         return succeed(examRoomService.updateExamRoom(examRoom));
     }
 
-    @ApiOperation("教室状态变更")
+    @ApiOperation("教室状态变更(关闭教室,开启教室)")
     @PostMapping(value = "/openExamRoom")
     public HttpResponseResult<ExamRoom> openExamRoom(Long examRoomId,Integer openFlag){
         ExamRoom examRoom = new ExamRoom();

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

@@ -15,4 +15,6 @@ public interface ExamLocationDao extends BaseDAO<Integer, ExamLocation> {
      * @return
      */
     List<ExamLocation> getExamLocationByIds(@Param("ids") String ids);
+
+    List<ExamLocation> getTenantAllLocations(@Param("tenantId") String tenantId);
 }

+ 5 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamLocationService.java

@@ -3,7 +3,12 @@ package com.keao.edu.user.service;
 
 import com.keao.edu.common.service.BaseService;
 import com.keao.edu.user.entity.ExamLocation;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ExamLocationService extends BaseService<Integer, ExamLocation> {
 
+    List<ExamLocation> getTenantAllLocations(@Param("tenantId") String tenantId);
+
 }

+ 4 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/EmployeeServiceImpl.java

@@ -67,6 +67,7 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 					sysUser.setPassword(new BCryptPasswordEncoder().encode("123456"));
 				}
 				employee.setUserId(user.getId());
+				employee.setEmployeeType("EMPLOYEE");
 				employeeDao.insert(employee);
 				//新增用户角色
 				sysUserDao.batchAddEmployeeRole(user.getId(),sysUser.getRoles());
@@ -88,6 +89,7 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 				sysUserDao.update(sysUser);
 				employee.setUserId(sysUser1.getId());
 				employee.setDelFlag(false);
+				employee.setEmployeeType("EMPLOYEE");
 				employeeDao.update(employee);
 			}else{
 				throw new BizException("用户已存在");
@@ -100,6 +102,7 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 		sysUserDao.insert(sysUser);
 
 		employee.setUserId(sysUser.getId());
+		employee.setEmployeeType("EMPLOYEE");
 		employeeDao.insert(employee);
 		//新增用户角色
 		sysUserDao.batchAddEmployeeRole(sysUser.getId(),sysUser.getRoles());
@@ -123,6 +126,7 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 				throw new BizException("手机号已存在");
 			}
 		}
+		employee.setEmployeeType("EMPLOYEE");
 		employeeDao.update(employee);
 
 		Organization organization = organizationDao.findByUserId(employee.getUserId());

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

@@ -8,6 +8,8 @@ import com.keao.edu.user.service.ExamLocationService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class ExamLocationServiceImpl extends BaseServiceImpl<Integer, ExamLocation> implements ExamLocationService {
 	
@@ -18,5 +20,9 @@ public class ExamLocationServiceImpl extends BaseServiceImpl<Integer, ExamLocati
 	public BaseDAO<Integer, ExamLocation> getDAO() {
 		return examLocationDao;
 	}
-	
+
+	@Override
+	public List<ExamLocation> getTenantAllLocations(String tenantId) {
+		return examLocationDao.getTenantAllLocations(tenantId);
+	}
 }

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

@@ -287,7 +287,7 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 			Map<Integer, String> userPhoneMap = new HashMap<>();
 			userPhoneMap.put(examOrgan.getOrganId(), organUser.getPhone());
 
-			SysMessageParams sysMessageParams=new SysMessageParams(MessageTypeEnum.EXAM_REGISTRATION_URL_PUSH,
+			SysMessageParams sysMessageParams=new SysMessageParams(MessageTypeEnum.EXAM_REGISTRATION_URL_SMS,
 					userPhoneMap, null, 0, null, JiguangPushPlugin.PLUGIN_NAME,
 					tenantInfo.getName(), examinationBasic.getName(), expectRegistTime.toString(), examOrgan.getUrl());
 			sysMessageFeignService.batchSendMessage(sysMessageParams);

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

@@ -301,7 +301,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			//推送消息
 			Map<Integer, String> userPhoneMap = new HashMap<>();
 			userPhoneMap.put(studentId, studentId.toString());
-			SysMessageParams sysMessageParams=new SysMessageParams(MessageTypeEnum.EXAM_REGISTRATION_URL_PUSH,
+			SysMessageParams sysMessageParams=new SysMessageParams(MessageTypeEnum.EXAM_REGISTRATION_URL_SMS,
 					userPhoneMap, null, 0, null, null);
 			sysMessageFeignService.batchSendMessage(sysMessageParams);
 		}

+ 2 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/OrganizationServiceImpl.java

@@ -116,6 +116,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 				Employee employee = employeeDao.get(sysUser.getId());
 				employee.setDelFlag(false);
 				employee.setTenantId(organ.getTenantId());
+				employee.setEmployeeType("ORGAN");
 				employeeDao.update(employee);
 				organ.setDelFlag(YesOrNoEnum.NO);
 				organ.setId(organization.getId());
@@ -147,6 +148,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		employee.setOrganId(organ.getId());
 		employee.setUserId(sysUser.getId());
 		employee.setTenantId(organ.getTenantId());
+		employee.setEmployeeType("ORGAN");
 		employeeDao.insert(employee);
 
 		ImResult imResult = imFeignService.register(new ImUserModel(sysUser.getId().toString(), sysUser.getRealName(),null));

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

@@ -88,6 +88,7 @@ public class TenantInfoServiceImpl extends BaseServiceImpl<Integer, TenantInfo>
 		employee.setOrganId(organ.getId());
 		employee.setUserId(sysUser.getId());
 		employee.setTenantId(tenantInfo.getId().toString());
+		employee.setEmployeeType("ORGAN");
 		employeeDao.insert(employee);
 
 		ImResult imResult = imFeignService.register(new ImUserModel(sysUser.getId().toString(), sysUser.getRealName(),null));

+ 5 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamLocationMapper.xml

@@ -11,6 +11,7 @@
 		<result column="name_" property="name" />
 		<result column="contact_name_" property="contactName" />
 		<result column="contact_phone_" property="contactPhone" />
+		<result column="is_available_" property="isAvailable" />
 		<result column="address_" property="address" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -100,4 +101,8 @@
 	<select id="getExamLocationByIds" resultMap="ExamLocation">
 		SELECT * FROM exam_location WHERE FIND_IN_SET(id_,#{ids})
 	</select>
+
+	<select id="getTenantAllLocations" resultMap="ExamLocation">
+		SELECT * FROM exam_location WHERE tenant_id_ = #{tenantId} AND is_available_=1 ORDER BY id_
+	</select>
 </mapper>

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

@@ -11,7 +11,6 @@
 		<result column="certificate_photo_" property="certificatePhoto" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
-		<result column="organ_id_" property="organId" />
 		<association property="sysUser" resultMap="com.keao.edu.user.dao.SysUserDao.SysUser"/>
 	</resultMap>
 
@@ -28,8 +27,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.api.entity.Student" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO student (user_id_,certificate_photo_,create_time_,update_time_,organ_id_)
-		VALUES(#{userId},#{certificatePhoto},NOW(),NOW(),#{organId})
+		INSERT INTO student (user_id_,certificate_photo_,create_time_,update_time_)
+		VALUES(#{userId},#{certificatePhoto},NOW(),NOW())
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -39,9 +38,6 @@
 			<if test="certificatePhoto != null">
 				certificate_photo_ = #{certificatePhoto},
 			</if>
-			<if test="organId != null">
-				organ_id_ = #{organId},
-			</if>
 			update_time_ = NOW()
 		</set> WHERE user_id_ = #{userId}
 	</update>
@@ -52,9 +48,6 @@
 
 	<sql id="queryCondition">
 		<where>
-			<if test="tenantId != null and tenantId != 0">
-				AND stu.tenant_id_ = #{tenantId}
-			</if>
 			<if test="search != null and search != ''">
 				AND (stu.user_id_ = #{search} OR su.real_name_ LIKE CONCAT (#{search}, '%'))
 			</if>