Jelajahi Sumber

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

yonge 5 tahun lalu
induk
melakukan
4e0b6d4a10

+ 8 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupStudentFeeDao.java

@@ -2,8 +2,15 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
 
 public interface MusicGroupStudentFeeDao extends BaseDAO<Long, MusicGroupStudentFee> {
 
-	
+
+    /**
+     * 根据乐团编号和学员编号获取乐团费用信息
+     * @param userId
+     * @return
+     */
+    MusicGroupStudentFee findByUser(@Param("userId") Integer userId,@Param("musicGroupId") String musicGroupId);
 }

+ 26 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupStudentFee.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * 对应数据库表(music_group_student_fee_):
@@ -24,13 +25,37 @@ public class MusicGroupStudentFee {
 	/** 课程费用 */
 	@ApiModelProperty(value = "课程费用",required = false)
 	private BigDecimal courseFee;
+
+	/** 课程费用 */
+	@ApiModelProperty(value = "下次缴费日期",required = false)
+	private Date nextPaymentDate;
+
+	/** 课程费用 */
+	@ApiModelProperty(value = "最近缴费时间",required = false)
+	private Date latestPaidTime;
 	
 	/**  */
 	private java.util.Date createTime;
 	
 	/**  */
 	private java.util.Date updateTime;
-	
+
+	public Date getNextPaymentDate() {
+		return nextPaymentDate;
+	}
+
+	public void setNextPaymentDate(Date nextPaymentDate) {
+		this.nextPaymentDate = nextPaymentDate;
+	}
+
+	public Date getLatestPaidTime() {
+		return latestPaidTime;
+	}
+
+	public void setLatestPaidTime(Date latestPaidTime) {
+		this.latestPaidTime = latestPaidTime;
+	}
+
 	public void setId(Long id){
 		this.id = id;
 	}

+ 10 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1,7 +1,9 @@
 package com.ym.mec.biz.service.impl;
 
+import com.aliyun.oss.common.utils.DateUtil;
 import com.ym.mec.biz.dal.dao.ClassGroupDao;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
@@ -12,6 +14,7 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.utils.DateUtils;
 import com.ym.mec.util.collection.MapUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -46,6 +49,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     private StudentRegistrationService studentRegistrationService;
     @Autowired
     private ClassGroupTeacherSalaryService classGroupTeacherSalaryService;
+    @Autowired
+    private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 
     @Override
     public BaseDAO<Integer, ClassGroup> getDAO() {
@@ -336,8 +341,11 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
                 //获取当前乐团缴费周期
                 List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByMusicGroupId(e.getMusicGroupId());
-
-
+                //获取下次缴费时间
+                MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId,e.getMusicGroupId());
+                if(musicGroupStudentFee != null){
+                    
+                }
             }
         });
         return classGroupDao.queryCoursePage(userId);

+ 14 - 2
mec-biz/src/main/resources/config/mybatis/MusicGroupStudentFeeMapper.xml

@@ -11,6 +11,8 @@
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="user_id_" property="userId"/>
         <result column="course_fee_" property="courseFee"/>
+        <result column="next_payment_date_" property="nextPaymentDate"/>
+        <result column="latest_paid_time_" property="latestPaidTime"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
     </resultMap>
@@ -28,8 +30,8 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentFee" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
-		INSERT INTO music_group_student_fee_ (id_,music_group_id_,user_id_,course_fee_,create_time_,update_time_)
-		VALUES(#{id},#{musicGroupId},#{userId},#{courseFee},now(),now())
+		INSERT INTO music_group_student_fee_ (id_,music_group_id_,user_id_,course_fee_,create_time_,update_time_,next_payment_date_,latest_paid_time_)
+		VALUES(#{id},#{musicGroupId},#{userId},#{courseFee},now(),now(),#{nextPaymentDate},#{latestPaidTime})
 	</insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -48,6 +50,12 @@
             <if test="musicGroupId != null">
                 music_group_id_ = #{musicGroupId},
             </if>
+            <if test="nextPaymentDate != null">
+                next_payment_date_ = #{nextPaymentDate},
+            </if>
+            <if test="latestPaidTime != null">
+                latest_paid_time_ = #{latestPaidTime},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>
@@ -67,4 +75,8 @@
     <select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM music_group_student_fee_
 	</select>
+
+    <select id="findByUser" resultMap="MusicGroupStudentFee">
+        SELECT * FROM music_group_student_fee_ WHERE music_group_id_ = #{musicGroupId} AND user_id_ = #{userId}
+    </select>
 </mapper>