Quellcode durchsuchen

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

zouxuan vor 5 Jahren
Ursprung
Commit
f54f28e6e6

+ 1 - 1
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/AuthServerApplication.java

@@ -16,7 +16,7 @@ import org.springframework.web.client.RestTemplate;
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableFeignClients({"com.keao.edu"})
-@MapperScan("com.keao.edu.auth.dal.dao")
+@MapperScan({"com.keao.edu.auth.dal.dao", "com.keao.edu.common.dao"})
 @ComponentScan(basePackages="com.keao.edu")
 @Configuration
 @EnableSwagger2Doc

+ 2 - 1
edu-auth/edu-auth-server/src/main/resources/application.yml

@@ -65,7 +65,8 @@ spring:
         min-idle: 1
 
 mybatis:
-  mapperLocations: classpath:config/mybatis/*.xml
+  mapperLocations: classpath*:config/mybatis/*.xml
+  typeAliasesPackage: com.keao.edu.*.entity
 
 swagger:
   base-package: 'com.keao.edu.auth.web.controller'

+ 1 - 1
edu-cms/src/main/java/com/keao/edu/cms/CmsServerApplication.java

@@ -17,7 +17,7 @@ import com.spring4all.swagger.EnableSwagger2Doc;
 @EnableDiscoveryClient
 @EnableFeignClients("com.keao.edu")
 @ComponentScan("com.keao.edu")
-@MapperScan("com.keao.edu.cms.dal.dao")
+@MapperScan({"com.keao.edu.cms.dal.dao", "com.keao.edu.common.dao"})
 @Configuration
 @EnableSwagger2Doc
 public class CmsServerApplication {

+ 2 - 1
edu-cms/src/main/resources/application.yml

@@ -65,7 +65,8 @@ spring:
         min-idle: 1
 
 mybatis:
-    mapperLocations: classpath:config/config/*.xml
+  mapperLocations: classpath*:config/mybatis/*.xml
+  typeAliasesPackage: com.keao.edu.*.entity
     
 swagger:
   base-package: com.keao.edu.cms.controller

+ 13 - 9
edu-datasource/src/main/java/com/keao/edu/datasource/DataSourceConfig.java

@@ -1,12 +1,9 @@
 package com.keao.edu.datasource;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.sql.DataSource;
-
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
 import org.mybatis.spring.SqlSessionFactoryBean;
 import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -16,13 +13,20 @@ import org.springframework.jdbc.datasource.DataSourceTransactionManager;
 import org.springframework.transaction.PlatformTransactionManager;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 
-import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
+import javax.sql.DataSource;
+import java.util.HashMap;
+import java.util.Map;
 
 @EnableTransactionManagement
 @Configuration
-@MapperScan("com.keao.edu.*.dao")
+@MapperScan("com.keao.edu.datasource.dao")
 public class DataSourceConfig {
 
+	@Value("${mybatis.mapperLocations}")
+	private String resourcePath;
+	@Value("${mybatis.typeAliasesPackage}")
+	private String typeAliasesPackage;
+
 	@Bean("master")
 	@Primary
 	@ConfigurationProperties(prefix = "spring.datasource") // application.yml中对应属性的前缀
@@ -45,8 +49,8 @@ public class DataSourceConfig {
 		SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
 		// 配置动态数据源,如果没有将 dynamicDataSource 作为数据源则不能实现切换
 		sqlSessionFactoryBean.setDataSource(dynamicDataSource());
-		sqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:config/mybatis/*.xml"));
-		sqlSessionFactoryBean.setTypeAliasesPackage("com.keao.edu.*.entity");
+		sqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(resourcePath));
+		sqlSessionFactoryBean.setTypeAliasesPackage(typeAliasesPackage);
 
 		return sqlSessionFactoryBean;
 	}

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExaminationBasic.java

@@ -58,6 +58,9 @@ public class ExaminationBasic {
 	@ApiModelProperty(value = "背景图")
 	private String posterBackgroundImg;
 
+	@ApiModelProperty(value = "自定义简章")
+	private String customPoster;
+
 	@ApiModelProperty(value = "合作单位编号")
 	private Integer organId;
 
@@ -139,6 +142,14 @@ public class ExaminationBasic {
 		this.status = status;
 	}
 
+	public String getCustomPoster() {
+		return customPoster;
+	}
+
+	public void setCustomPoster(String customPoster) {
+		this.customPoster = customPoster;
+	}
+
 	public void setEnrollStartTime(java.util.Date enrollStartTime){
 		this.enrollStartTime = enrollStartTime;
 	}

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

@@ -100,9 +100,9 @@ public class ExamSubjectSongServiceImpl extends BaseServiceImpl<Long, ExamSubjec
 				throw new BizException("参数错误");
 			}
 
-			if(!praNull){
+			if(!praNull&&perNull){
 				examSubjectSong.setPerformNum(0);
-			}else if(!perNull){
+			}else if(!perNull&&praNull){
 				examSubjectSong.setPracticeNum(0);
 			}
 

+ 2 - 1
edu-user/edu-user-server/src/main/resources/application.yml

@@ -75,7 +75,8 @@ spring:
         min-idle: 1
 
 mybatis:
-  mapperLocations: classpath:config/mybatis/*.xml
+  mapperLocations: classpath*:config/mybatis/*.xml
+  typeAliasesPackage: com.keao.edu.*.entity
   configuration:
     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 

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

@@ -147,7 +147,7 @@
                 </foreach>
             </if>
             <if test="search!=null">
-                AND (erp.student_id_=#{serch} OR ec.card_no_ LIKE CONCAT('%', #{serch}, '%') OR su.real_name_ LIKE CONCAT('%', #{serch}, '%'))
+                AND (erp.student_id_=#{search} OR eb.name_ LIKE CONCAT('%', #{search}, '%') OR ec.card_no_ LIKE CONCAT('%', #{search}, '%') OR su.real_name_ LIKE CONCAT('%', #{search}, '%'))
             </if>
         </where>
     </sql>

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

@@ -22,6 +22,7 @@
 		<result column="poster_title_" property="posterTitle" />
 		<result column="poster_profile_" property="posterProfile" />
 		<result column="poster_background_img_" property="posterBackgroundImg" />
+		<result column="custom_poster_" property="customPoster"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -51,11 +52,11 @@
 	<insert id="insert" parameterType="com.keao.edu.user.entity.ExaminationBasic" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO examination_basic (id_,name_,exam_mode_,exam_location_id_list_,exam_location_name_list_,status_,enroll_start_time_,enroll_end_time_,
 		expect_exam_start_time_,expect_exam_end_time_,actual_exam_start_time_,actual_exam_end_time_,
-		poster_title_,poster_profile_,poster_background_img_,creator_id_,create_time_,update_time_,tenant_id_,memo_,organ_id_)
+		poster_title_,poster_profile_,poster_background_img_,custom_poster_,creator_id_,create_time_,update_time_,tenant_id_,memo_,organ_id_)
 		VALUES(#{id},#{name},#{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examLocationIdList},#{examLocationNameList},
 		#{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{enrollStartTime},#{enrollEndTime},
 		#{expectExamStartTime},#{expectExamEndTime},#{actualExamStartTime},#{actualExamEndTime},
-		#{posterTitle},#{posterProfile},#{posterBackgroundImg},#{creatorId},NOW(),NOW(),#{tenantId},#{memo},#{organId})
+		#{posterTitle},#{posterProfile},#{posterBackgroundImg},#{customPoster},#{creatorId},NOW(),NOW(),#{tenantId},#{memo},#{organId})
 	</insert>
 
 	<update id="update" parameterType="com.keao.edu.user.entity.ExamOrganizationRelation">
@@ -99,6 +100,9 @@
 			<if test="posterBackgroundImg != null">
 				poster_background_img_ = #{posterBackgroundImg},
 			</if>
+			<if test="customPoster != null">
+				custom_poster_ = #{customPoster},
+			</if>
 			<if test="tenantId != null">
 				tenant_id_ = #{tenantId},
 			</if>
@@ -154,6 +158,9 @@
 				<if test="exam.posterBackgroundImg != null">
 					poster_background_img_ = #{exam.posterBackgroundImg},
 				</if>
+				<if test="exam.customPoster != null">
+					custom_poster_ = #{exam.customPoster},
+				</if>
 				<if test="exam.tenantId != null">
 					tenant_id_ = #{exam.tenantId},
 				</if>