Joburgess 5 lat temu
rodzic
commit
e73c6aab45

+ 0 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysConfigDao.java

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.SysConfig;
-import com.ym.mec.biz.dal.entity.SysConfigRealType;
 import com.ym.mec.common.dal.BaseDAO;
 
 public interface SysConfigDao extends BaseDAO<Long, SysConfig> {
@@ -16,15 +15,6 @@ public interface SysConfigDao extends BaseDAO<Long, SysConfig> {
     SysConfig findByParamName(String paramName);
 
     /**
-     * @Author: Joburgess
-     * @Date: 2019/10/9
-     * @params [paramName]
-     * @return com.ym.mec.biz.dal.entity.SysConfig
-     * @describe 根据配置名称获取配置信息
-     */
-    SysConfigRealType findRealValueByParamName(String paramName);
-
-    /**
      * 获取value
      * @param paramName
      * @return

+ 8 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysConfig.java

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
 import io.swagger.annotations.ApiModelProperty;
-
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
@@ -56,6 +55,14 @@ public class SysConfig {
 	public String getParanValue(){
 		return this.paranValue;
 	}
+
+	public <T> T getParanValue(Class<T> cla){
+		try {
+			return cla.cast(cla.getMethod("valueOf", String.class).invoke(cla.getInterfaces(),this.paranValue));
+		} catch (Exception e) {
+			return (T)this.paranValue.getClass();
+		}
+	}
 			
 	public void setDescription(String description){
 		this.description = description;

+ 0 - 21
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysConfigRealType.java

@@ -1,21 +0,0 @@
-package com.ym.mec.biz.dal.entity;
-
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 对应数据库表(sys_config):
- */
-public class SysConfigRealType<T> extends SysConfig{
-	
-	/** 参数值 */
-	@ApiModelProperty(value = "参数值", required = true)
-	private T realTypeValue;
-
-	public T getRealTypeValue() {
-		return realTypeValue;
-	}
-
-	public void setRealTypeValue(T realTypeValue) {
-		this.realTypeValue = realTypeValue;
-	}
-}

+ 0 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.entity.SysConfig;
-import com.ym.mec.biz.dal.entity.SysConfigRealType;
 import com.ym.mec.common.service.BaseService;
 
 public interface SysConfigService extends BaseService<Long, SysConfig> {
@@ -88,13 +87,4 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
      * @describe 根据配置名称获取配置信息
      */
     SysConfig findByParamName(String paramName);
-
-    /**
-     * @describe 根据配置名称获取配置信息
-     * @author Joburgess
-     * @date 2019/12/25
-     * @param paramName:
-     * @return com.ym.mec.biz.dal.entity.SysConfigRealType
-     */
-    SysConfigRealType findRealValueByParamName(String paramName);
 }

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -113,16 +113,16 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		if(Objects.isNull(currentCourseDetail)){
 		    throw new BizException("课程不存在");
         }
-		SysConfigRealType<Integer> realValueByParamName = sysConfigService.findRealValueByParamName(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE);
+		SysConfig sysConfig = sysConfigService.findByParamName(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE);
 		YesOrNoEnum yesOrNoEnum = enableOnlyNormalAttendance(currentCourseDetail.getStartClassTime(),
 				user.getId().longValue(),
 				true,
 				currentCourseDetail.getSchoolId().intValue());
 		currentCourseDetail.setOnlyNormal(yesOrNoEnum);
 		currentCourseDetail.setCurrentClassTimes(courseScheduleDao.countClassGroupOverCourseNum(currentCourseDetail.getClassId()));
-//		currentCourseDetail.setEnableStudentAttendanceTimeRange(realValueByParamName.getRealTypeValue());
-//		int i = studentAttendanceDao.countByCourseSchedule(courseID);
-//		currentCourseDetail.setStudentAttendanceIsFirstTime(i>0?0:1);
+		currentCourseDetail.setEnableStudentAttendanceTimeRange(sysConfig.getParanValue(Integer.class));
+		int i = studentAttendanceDao.countByCourseSchedule(courseID);
+		currentCourseDetail.setStudentAttendanceIsFirstTime(i>0?0:1);
 
 		currentCourseDetail.setCurrentTime(new Date());
 		currentCourseDetail.setAdvanceSignInMinutes(Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ADVANCE_SIGN_IN_MINUTES)));

+ 0 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysConfigServiceImpl.java

@@ -1,6 +1,5 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.entity.SysConfigRealType;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -25,9 +24,4 @@ public class SysConfigServiceImpl extends BaseServiceImpl<Long, SysConfig>  impl
 	public SysConfig findByParamName(String paramName) {
 		return sysConfigDao.findByParamName(paramName);
 	}
-
-	@Override
-	public SysConfigRealType findRealValueByParamName(String paramName) {
-		return sysConfigDao.findRealValueByParamName(toString());
-	}
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1563,7 +1563,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         studentRecoverInfoDto.setIsPause(vipGroup.getStatus().equals(VipGroupStatusEnum.PAUSE)?1:0);
         studentRecoverInfoDto.setTotalCourseTimes(coursePrices.size());
 		Map<BigDecimal, Long> collect = coursePrices.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
-		studentRecoverInfoDto.setGiveCourseTimes(Objects.isNull(collect.get(new BigDecimal(0.00)))?0:collect.get(new BigDecimal(0.00)).intValue());
+		studentRecoverInfoDto.setGiveCourseTimes(Objects.isNull(collect.get(new BigDecimal("0.00")))?0:collect.get(new BigDecimal("0.00")).intValue());
 		return studentRecoverInfoDto;
     }
 

+ 0 - 7
mec-biz/src/main/resources/config/mybatis/SysConfigMapper.xml

@@ -13,10 +13,6 @@
 		<result column="group_" property="group" />
 	</resultMap>
 
-	<resultMap id="SysConfigRealType" type="com.ym.mec.biz.dal.entity.SysConfigRealType" extends="SysConfig">
-		<result column="paran_value_" property="realTypeValue"/>
-	</resultMap>
-
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="SysConfig">
 		SELECT * FROM sys_config WHERE id_ = #{id}
@@ -83,9 +79,6 @@
 	<select id="findByParamName" resultMap="SysConfig">
 		SELECT * FROM sys_config WHERE param_name_ = #{paramName}
 	</select>
-	<select id="findRealValueByParamName" resultMap="SysConfigRealType">
-		SELECT * FROM sys_config WHERE param_name_ = #{paramName}
-	</select>
     <select id="findConfigValue" resultType="java.lang.String">
 		SELECT paran_value_ FROM sys_config WHERE param_name_ = #{paramName}
 	</select>

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -299,7 +299,7 @@
             LEFT JOIN sys_user su ON t.id_ = su.id_
         WHERE
             FIND_IN_SET(t.subject_id_, #{subjectIds})
-            AND INTE_ARRAY ( t.flow_organ_range_, #{organIds} )
+            AND INTE_ARRAY ( CONCAT(t.organ_id_,',',t.flow_organ_range_), #{organIds} )
     </select>
     <select id="countCloses" resultType="java.lang.Integer">
         SELECT COUNT(cs.id_)