فهرست منبع

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

yonge 5 سال پیش
والد
کامیت
fc788c9b5c

+ 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);
 	
-}
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentOrderExportDto.java

@@ -29,6 +29,8 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrder {
     private String schoolName;
     private String subjectName;
 
+    private Integer chargeType;
+
     private List<StudentPaymentOrderDetail> orderDetailList;
 
     public BigDecimal getSporadicAmount() {
@@ -110,4 +112,12 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrder {
     public void setOrderDetailList(List<StudentPaymentOrderDetail> orderDetailList) {
         this.orderDetailList = orderDetailList;
     }
+
+    public Integer getChargeType() {
+        return chargeType;
+    }
+
+    public void setChargeType(Integer chargeType) {
+        this.chargeType = chargeType;
+    }
 }

+ 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;
     }

+ 5 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java

@@ -103,7 +103,7 @@ public class StudentRegistration {
 
     private String schoolName;
 
-    private KitPurchaseMethodEnum KitType;
+    private String kitType;
 
     public BigDecimal getBalance() {
         return balance;
@@ -352,11 +352,11 @@ public class StudentRegistration {
         this.schoolName = schoolName;
     }
 
-    public KitPurchaseMethodEnum getKitType() {
-        return KitType;
+    public String getKitType() {
+        return kitType;
     }
 
-    public void setKitType(KitPurchaseMethodEnum kitType) {
-        KitType = kitType;
+    public void setKitType(String kitType) {
+        this.kitType = kitType;
     }
 }

+ 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);

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

@@ -409,6 +409,7 @@
                extends="StudentPaymentOrder">
         <result column="organ_name" property="organName"/>
         <result column="username_" property="user.username"/>
+        <result column="charge_type_" property="chargeType"/>
         <collection property="orderDetailList" ofType="com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail">
             <result column="detail_type_" property="type"/>
             <result column="detail_price_" property="price"/>
@@ -417,11 +418,12 @@
 
     <!-- 分页查询 -->
     <select id="ExportQueryPage" resultMap="orderAndDetail" parameterType="map">
-        SELECT spo.*,u.username_,spod.type_ detail_type_,spod.price_ detail_price_,o.name_ organ_name
+        SELECT spo.*,u.username_,spod.type_ detail_type_,spod.price_ detail_price_,o.name_ organ_name,sci.charge_type_
         FROM student_payment_order spo
         LEFT JOIN sys_user u on spo.user_id_ = u.id_
         LEFT JOIN student_payment_order_detail spod on spo.id_ = spod.payment_order_id_
         LEFT JOIN organization o on spo.organ_id_ = o.id_
+        LEFT JOIN sporadic_charge_info sci on spo.music_group_id_ = sci.id_
         <include refid="queryPaymentOrder"/>
         ORDER BY spo.id_ ASC
     </select>

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -591,9 +591,9 @@
     <select id="findStudentByMusicGroupIdAndUserId" resultMap="StudentRegistration">
         SELECT sr.*,s.name_ school_name_,s2.name_ subject_name_,mgsp.kit_group_purchase_type_ kit_group_purchase_type_ FROM student_registration sr
         LEFT JOIN music_group mg ON mg.id_ =sr.music_group_id_
-        LEFT JOIN school s on mg.school_id_ = s.id_
-        LEFT JOIN subject s2 on sr.subject_id_ = s2.id_
-        LEFT JOIN music_group_subject_plan mgsp on mg.id_ = sr.subject_id_
+        LEFT JOIN school s ON mg.school_id_ = s.id_
+        LEFT JOIN subject s2 ON sr.subject_id_ = s2.id_
+        LEFT JOIN music_group_subject_plan mgsp ON mgsp.subject_id_ = sr.subject_id_ AND mgsp.music_group_id_ = sr.music_group_id_
         WHERE sr.music_group_id_ = #{musicGroupId} AND sr.user_id_ = #{userId} AND sr.music_group_status_ != 'QUIT' LIMIT 1
     </select>
 </mapper>

+ 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>

+ 6 - 8
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -206,7 +206,7 @@ public class ExportController extends BaseController {
                 if (studentRegistration != null) {
                     row.setSubjectName(studentRegistration.getSubjectName());
                     row.setSchoolName(studentRegistration.getSchoolName());
-                    if (studentRegistration.getKitType() != null && studentRegistration.getKitType().equals(KitPurchaseMethodEnum.LEASE)) {
+                    if (studentRegistration.getKitType() != null && studentRegistration.getKitType().equals("LEASE")) {
                         row.setLeaseFee(musicalFee);
                         row.setMusicalFee(BigDecimal.ZERO);
                     }
@@ -219,22 +219,20 @@ public class ExportController extends BaseController {
                 }
 
             } else if (row.getGroupType().equals(GroupType.SPORADIC)) {
-                SporadicChargeInfo sporadicChargeInfo = sporadicChargeInfoDao.findInfoById(Integer.parseInt(row.getMusicGroupId()));
                 row.setSporadicAmount(row.getActualAmount());
                 row.setMusicalFee(BigDecimal.ZERO);
                 row.setTeachingFee(BigDecimal.ZERO);
                 row.setTeachingFee(BigDecimal.ZERO);
-                if (sporadicChargeInfo != null) {
-                    if (sporadicChargeInfo.getChargeType().equals("1")) {
+                if (row.getChargeType() != null) {
+                    if (row.getChargeType().equals(1)) {
                         row.setSporadicType("考级");
-                    } else if (sporadicChargeInfo.getChargeType().equals("2")) {
+                    } else if (row.getChargeType().equals(2)) {
                         row.setSporadicType("缴费");
-                    } else if (sporadicChargeInfo.getChargeType().equals("3")) {
+                    } else if (row.getChargeType().equals(3)) {
                         row.setSporadicType("声部更改");
-                    } else if (sporadicChargeInfo.getChargeType().equals("4")) {
+                    } else if (row.getChargeType().equals(4)) {
                         row.setSporadicType("乐器更换");
                     }
-                    row.setOrganName(sporadicChargeInfo.getOrganName());
                 }
             }
             String paymentChannel = "";