Joburgess 5 rokov pred
rodič
commit
c77385e02c

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysConfigDao.java

@@ -1,6 +1,7 @@
 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> {
@@ -15,10 +16,19 @@ 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
      */
     String findConfigValue(String paramName);
 	
-}
+}

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendanceDto.java

@@ -83,6 +83,28 @@ public class TeacherAttendanceDto {
     @ApiModelProperty(value = "学生数量")
     private Integer studentNum;
 
+    @ApiModelProperty(value = "可更新学生签到信息限制时间")
+    private Integer enableStudentAttendanceTimeRange;
+
+    @ApiModelProperty(value = "是否是第一次进行学生点名")
+    private int studentAttendanceIsFirstTime;
+
+    public Integer getEnableStudentAttendanceTimeRange() {
+        return enableStudentAttendanceTimeRange;
+    }
+
+    public void setEnableStudentAttendanceTimeRange(Integer enableStudentAttendanceTimeRange) {
+        this.enableStudentAttendanceTimeRange = enableStudentAttendanceTimeRange;
+    }
+
+    public int getStudentAttendanceIsFirstTime() {
+        return studentAttendanceIsFirstTime;
+    }
+
+    public void setStudentAttendanceIsFirstTime(int studentAttendanceIsFirstTime) {
+        this.studentAttendanceIsFirstTime = studentAttendanceIsFirstTime;
+    }
+
     public Integer getStudentNum() {
         return studentNum;
     }

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

@@ -0,0 +1,21 @@
+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;
+	}
+}

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

@@ -1,6 +1,7 @@
 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,4 +89,12 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
      */
     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);
 }

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

@@ -89,6 +89,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	private VipGroupService vipGroupService;
 	@Autowired
 	private MusicGroupService musicGroupService;
+	@Autowired
+	private SysConfigService sysConfigService;
 
 	private final Logger LOGGER = LoggerFactory
 			.getLogger(this.getClass());
@@ -111,12 +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);
 		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.setCurrentTime(new Date());
 		currentCourseDetail.setAdvanceSignInMinutes(Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ADVANCE_SIGN_IN_MINUTES)));

+ 7 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysConfigServiceImpl.java

@@ -1,5 +1,6 @@
 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;
 
@@ -24,5 +25,9 @@ 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

@@ -1510,7 +1510,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			courseScheduleStudentPayment.setUpdateTime(now);
 			courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
 			courseScheduleStudentPaymentList.add(courseScheduleStudentPayment);
-			surplusCourseFee.add(coursePrices.get(i));
+			surplusCourseFee=surplusCourseFee.add(coursePrices.get(i));
 		}
 		if(!CollectionUtils.isEmpty(courseScheduleStudentPaymentList)){
 			courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPaymentList);

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

@@ -13,6 +13,10 @@
 		<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}
@@ -79,6 +83,9 @@
 	<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>