瀏覽代碼

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

yonge 5 年之前
父節點
當前提交
507fb09d00

+ 2 - 3
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamSongDao.java

@@ -4,11 +4,9 @@ import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.entity.ExamSong;
 import com.keao.edu.user.enums.SongTypeEnum;
 import org.apache.ibatis.annotations.Param;
-import org.springframework.security.core.parameters.P;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Map;
 
 public interface ExamSongDao extends BaseDAO<Integer, ExamSong> {
 
@@ -27,7 +25,8 @@ public interface ExamSongDao extends BaseDAO<Integer, ExamSong> {
      * @param subjectId:
      * @return java.util.List<com.keao.edu.user.entity.ExamSong>
      */
-    List<ExamSong> getWithSubject(@Param("subjectId") Integer subjectId);
+    List<ExamSong> getWithSubject(@Param("subjectId") Integer subjectId,
+                                  @Param("tenantId") String tenantId);
 
     /**
      * @describe 根据级别和类型获取曲库

+ 2 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamSongServiceImpl.java

@@ -7,6 +7,7 @@ import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.dao.ExamRegistrationDao;
 import com.keao.edu.user.dao.ExamSongDao;
 import com.keao.edu.user.entity.ExamSong;
@@ -71,7 +72,7 @@ public class ExamSongServiceImpl extends BaseServiceImpl<Integer, ExamSong> impl
 	    if(Objects.isNull(subjectId)){
 	        throw new BizException("请选择专业");
         }
-        return examSongDao.getWithSubject(subjectId);
+        return examSongDao.getWithSubject(subjectId, TenantContextHolder.getTenantId());
     }
 
     @Override

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

@@ -258,6 +258,9 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
 
+        List<Integer> childOrganIds = organizationService.getChildOrganIds(queryInfo.getOrganId(), true);
+        params.put("organIds", childOrganIds);
+
         List<ExaminationBasicDto> dataList = new ArrayList<>();
         int count = examinationBasicDao.countExaminationBasics(params);
         if (count > 0) {
@@ -267,7 +270,6 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
             List<Long> examIds = dataList.stream().map(ExaminationBasicDto::getId).collect(Collectors.toList());
             List<ExamOrganizationRelation> examOrgans = new ArrayList<>();
             if (!CollectionUtils.isEmpty(examIds)) {
-                List<Integer> childOrganIds = organizationService.getChildOrganIds(queryInfo.getOrganId(), true);
                 examOrgans = examOrganizationRelationDao.getWithExamsAndOrgans(examIds, childOrganIds);
             }
             Map<Integer, List<ExamOrganizationRelation>> examOrgansMap = new HashMap<>();

+ 1 - 0
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRegistrationPaymentMapper.xml

@@ -238,6 +238,7 @@
         WHERE
             examination_basic_id_ = #{examId}
             AND DATE_FORMAT( create_time_, '%Y-%m-%d' ) = #{day}
+            AND trans_status_ IN ('SUCCESS')
             AND organ_id_ IN
             <foreach collection="organIds" item="organId" separator="," open="(" close=")">
                 #{organId}

+ 1 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamSongMapper.xml

@@ -116,7 +116,7 @@
 		SELECT * FROM exam_song WHERE FIND_IN_SET(id_,#{ids})
 	</select>
 	<select id="getWithSubject" resultMap="ExamSong">
-		SELECT * FROM exam_song WHERE FIND_IN_SET(#{subjectId}, subject_list_) AND del_flag_=0
+		SELECT * FROM exam_song WHERE FIND_IN_SET(#{subjectId}, subject_list_) AND del_flag_=0 AND tenant_id_ = #{tenantId}
 	</select>
 
     <select id="getWithLevelAndType" resultMap="ExamSong">

+ 6 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExaminationBasicMapper.xml

@@ -210,7 +210,12 @@
 		<where>
 			eb.status_!='DELETE'
 			<if test="organId!=null">
-				AND eor.organ_id_ = #{organId}
+				AND (eor.organ_id_ = #{organId}
+					OR eb.organ_id_ IN
+					<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+						  #{organId}
+					</foreach>
+				)
 			</if>
 			<if test="examStatus!=null">
 				AND eb.status_=#{examStatus}