Joburgess há 5 anos atrás
pai
commit
02f321a32e

+ 10 - 9
edu-common/src/main/java/com/keao/edu/common/service/impl/BaseServiceImpl.java

@@ -14,7 +14,6 @@ import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.common.service.BaseService;
 import com.keao.edu.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.ibatis.session.ExecutorType;
 import org.apache.ibatis.session.SqlSession;
 import org.apache.ibatis.session.SqlSessionFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -156,8 +155,8 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 			if(ps!=null){
 				ps.close();
 			}
-			if(connection!=null){
-				connection.close();
+			if(sqlSession!=null){
+				sqlSession.close();
 			}
 		} catch (Exception e) {
 			e.printStackTrace();
@@ -171,7 +170,8 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 		StringBuffer sql=new StringBuffer();
 		Map<Y,Z> result = new HashMap();
 		try {
-			Connection connection = sqlSessionFactory.openSession(ExecutorType.BATCH).getConnection();
+			SqlSession sqlSession = sqlSessionFactory.openSession();
+			Connection connection = sqlSession.getConnection();
 			sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE ");
 			boolean resultFlag = false;
 			for (Map.Entry<String, Object> entry : paramMap.entrySet()) {
@@ -217,8 +217,8 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 			if(ps!=null){
 				ps.close();
 			}
-			if(connection!=null){
-				connection.close();
+			if(sqlSession!=null){
+				sqlSession.close();
 			}
 		} catch (Exception e) {
 			e.printStackTrace();
@@ -235,7 +235,8 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 		StringBuffer sql=new StringBuffer();
 		Map<String, String> result=new HashMap();
 		try {
-			Connection connection = sqlSessionFactory.openSession(ExecutorType.BATCH).getConnection();
+			SqlSession sqlSession = sqlSessionFactory.openSession();
+			Connection connection = sqlSession.getConnection();
 			sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE ").append(columnKey).append(" IN (").append(StringUtils.join(ids, ",")).append(")");
 			PreparedStatement ps = connection.prepareStatement(sql.toString());
 			ResultSet resultSet = ps.executeQuery();
@@ -248,8 +249,8 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 			if(ps!=null){
 				ps.close();
 			}
-			if(connection!=null){
-				connection.close();
+			if(sqlSession!=null){
+				sqlSession.close();
 			}
 		} catch (Exception e) {
 			e.printStackTrace();

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

@@ -260,8 +260,8 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 		if(Objects.isNull(selfOrgan)){
 			throw new BizException("操作异常");
 		}
-		if(selfOrgan.getIsAllowArrangeExam()==0){
-			examOrganizationRelation.setIsAllowArrangeExam(0);
+		if(selfOrgan.getIsAllowArrangeExam()==0&&examOrganizationRelation.getIsAllowArrangeExam()==1){
+			throw new BizException("暂无权限");
 		}
 		examOrganizationRelationDao.update(examOrganizationRelation);
 	}

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

@@ -1,5 +1,6 @@
 package com.keao.edu.user.service.impl;
 
+import com.alibaba.druid.pool.DruidDataSource;
 import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.exception.BizException;