Sfoglia il codice sorgente

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

yonge 5 anni fa
parent
commit
65af126225
35 ha cambiato i file con 735 aggiunte e 57 eliminazioni
  1. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupSubjectGoodsGroupDao.java
  2. 19 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  3. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterPayDto.java
  4. 18 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupSubjectGoodsGroup.java
  5. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectGoodsGroupService.java
  6. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  7. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectGoodsGroupServiceImpl.java
  8. 22 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  9. 11 3
      mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectGoodsGroupMapper.xml
  10. 13 11
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  11. 52 0
      mec-education/src/main/java/com/ym/mec/education/controller/AttendClassController.java
  12. 8 0
      mec-education/src/main/java/com/ym/mec/education/controller/CourseScheduleController.java
  13. 12 0
      mec-education/src/main/java/com/ym/mec/education/controller/HomeWorkController.java
  14. 10 0
      mec-education/src/main/java/com/ym/mec/education/entity/StudentAttendance.java
  15. 1 1
      mec-education/src/main/java/com/ym/mec/education/mapper/CourseHomeworkMapper.java
  16. 10 0
      mec-education/src/main/java/com/ym/mec/education/mapper/StudentAttendanceMapper.java
  17. 51 0
      mec-education/src/main/java/com/ym/mec/education/req/AttendClassReq.java
  18. 59 0
      mec-education/src/main/java/com/ym/mec/education/resp/AttendClassResp.java
  19. 70 0
      mec-education/src/main/java/com/ym/mec/education/resp/CourseHomeworkResp.java
  20. 45 0
      mec-education/src/main/java/com/ym/mec/education/resp/CourseInfoResp.java
  21. 2 0
      mec-education/src/main/java/com/ym/mec/education/resp/HomeWrokResp.java
  22. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/ICourseHomeworkService.java
  23. 10 0
      mec-education/src/main/java/com/ym/mec/education/service/ICourseScheduleService.java
  24. 7 0
      mec-education/src/main/java/com/ym/mec/education/service/IStudentAttendanceService.java
  25. 7 0
      mec-education/src/main/java/com/ym/mec/education/service/IStudentCourseHomeworkService.java
  26. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/CourseHomeworkServiceImpl.java
  27. 44 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java
  28. 27 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java
  29. 47 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/StudentCourseHomeworkServiceImpl.java
  30. 34 9
      mec-education/src/main/resources/mapper/StudentAttendanceMapper.xml
  31. 1 1
      mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java
  32. 62 4
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  33. 5 1
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java
  34. 48 6
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/YqPayUtil.java
  35. 4 0
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/payInfo.java

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupSubjectGoodsGroupDao.java

@@ -11,6 +11,7 @@ public interface MusicGroupSubjectGoodsGroupDao extends BaseDAO<Long, MusicGroup
 
     /**
      * 批量保存
+     *
      * @param musicGroupSubjectGoodsGroups
      * @return
      */
@@ -18,9 +19,17 @@ public interface MusicGroupSubjectGoodsGroupDao extends BaseDAO<Long, MusicGroup
 
     /**
      * 获取建团申请,声部设置已确认数据
+     *
      * @param musicGroupId
      * @param subId
      * @return
      */
     List<MusicGroupSubjectGoodsGroup> findGoodsGroup(@Param("musicGroupId") Integer musicGroupId, @Param("subId") Integer subId);
+
+    /**
+     * 根据ids获取打包商品
+     *
+     * @return
+     */
+    List<MusicGroupSubjectGoodsGroup> findGoodsGroupByIds(@Param("ids") String ids);
 }

+ 19 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -72,11 +72,29 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      */
     Integer updateByUserIdAndMusicGroupId(@Param("studentRegistration") StudentRegistration studentRegistration);
-    
+
+
+    /**
+     * 查询手机是否已注册
+     *
+     * @param musicGroupId
+     * @param parentsPhone
+     * @return
+     */
+    StudentRegistration getByPhoneAndMusicGroupId(@Param("musicGroupId") Integer musicGroupId, @Param("parentsPhone") String parentsPhone);
+
+    /**
+     * 查询用户是否存在
+     * @param phone
+     * @return
+     */
+    Map getSysUserByPhone(String phone);
+
     /**
      * 查询学生信息
      * @param userId
      * @return
      */
     StudentInfo queryStudentInfo(Integer userId);
+
 }

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterPayDto.java

@@ -19,11 +19,11 @@ public class RegisterPayDto {
         this.registerId = registerId;
     }
 
-    public String getGoodsGroupId() {
+    public String getGoodsGroupIds() {
         return goodsGroupIds;
     }
 
-    public void setGoodsGroupId(String goodsGroupIds) {
+    public void setGoodsGroupIds(String goodsGroupIds) {
         this.goodsGroupIds = goodsGroupIds;
     }
 

+ 18 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupSubjectGoodsGroup.java

@@ -41,7 +41,11 @@ public class MusicGroupSubjectGoodsGroup {
 	private List<String> goodsName;
 
 	private List<Goods> goodsList;
-	
+
+	//团购减免课程费用
+	private BigDecimal remissionCourseFee;
+
+
 	/**  */
 	private java.util.Date createTime;
 	
@@ -132,11 +136,6 @@ public class MusicGroupSubjectGoodsGroup {
 		this.price = price;
 	}
 
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
-	}
-
 	public List<Goods> getGoodsList() {
 		return goodsList;
 	}
@@ -144,4 +143,17 @@ public class MusicGroupSubjectGoodsGroup {
 	public void setGoodsList(List<Goods> goodsList) {
 		this.goodsList = goodsList;
 	}
+
+	public BigDecimal getRemissionCourseFee() {
+		return remissionCourseFee;
+	}
+
+	public void setRemissionCourseFee(BigDecimal remissionCourseFee) {
+		this.remissionCourseFee = remissionCourseFee;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
 }

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

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
 import com.ym.mec.common.service.BaseService;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -15,4 +16,12 @@ public interface MusicGroupSubjectGoodsGroupService extends BaseService<Long, Mu
      */
     List<MusicGroupSubjectGoodsGroup> findGoodsGroup(Integer musicGroupId, Integer subId);
 
+
+    /**
+     * 根据ids获取打包商品
+     *
+     * @return
+     */
+    List<MusicGroupSubjectGoodsGroup> findGoodsGroupByIds(String ids);
+
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -79,4 +79,12 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      */
     StudentInfo queryStudentInfo(Integer userId);
 
+    /**
+     * 查询手机是否已注册
+     * @param musicGroupId
+     * @param parentsPhone
+     * @return
+     */
+    StudentRegistration getByPhoneAndMusicGroupId(Integer musicGroupId,  String parentsPhone);
+
 }

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

@@ -26,4 +26,10 @@ public class MusicGroupSubjectGoodsGroupServiceImpl extends BaseServiceImpl<Long
     public List<MusicGroupSubjectGoodsGroup> findGoodsGroup(Integer musicGroupId, Integer subId) {
         return musicGroupSubjectGoodsGroupDao.findGoodsGroup(musicGroupId, subId);
     }
+
+    @Override
+    public List<MusicGroupSubjectGoodsGroup> findGoodsGroupByIds(String ids) {
+
+	    return musicGroupSubjectGoodsGroupDao.findGoodsGroupByIds(ids);
+    }
 }

+ 22 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -8,6 +8,8 @@ import java.util.Map;
 
 import javax.annotation.Resource;
 
+import com.ym.mec.biz.dal.dao.TeacherDao;
+import com.ym.mec.biz.dal.entity.Teacher;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -35,7 +37,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     @Resource
     private StudentRegistrationDao studentRegistrationDao;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private TeacherDao teacherDao;
 
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
@@ -103,9 +105,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     @Transactional(rollbackFor = Exception.class)
     public StudentRegistration addStudent(StudentRegistration studentRegistration) {
         Date date = new Date();
-        SysUser sysUser = sysUserFeignService.queryUserByMobile(studentRegistration.getParentsPhone());
-        if (sysUser == null) {
-            sysUser = new SysUser();
+        int userId = 0;
+        Map hasUser = studentRegistrationDao.getSysUserByPhone(studentRegistration.getParentsPhone());
+        if (hasUser == null) {
+            SysUser sysUser = new SysUser();
             sysUser.setPhone(studentRegistration.getParentsPhone());
             sysUser.setCreateTime(date);
             sysUser.setUpdateTime(date);
@@ -116,15 +119,24 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             sysUser.setOrganId(studentRegistration.getOrganId());
             sysUser.setRealName(studentRegistration.getName());
             sysUser.setIdCardNo(studentRegistration.getIdCardNo());
-            sysUserFeignService.addUser(sysUser);
+            teacherDao.addSysUser(sysUser);
+            userId = sysUser.getId();
+        } else {
+            userId = (int) hasUser.get("id_");
         }
-        studentRegistration.setUserId(sysUser.getId());
+        studentRegistration.setUserId(userId);
         studentRegistrationDao.insert(studentRegistration);
         return studentRegistration;
     }
 
-	@Override
-	public StudentInfo queryStudentInfo(Integer userId) {
-		return studentRegistrationDao.queryStudentInfo(userId);
-	}
+
+    @Override
+    public StudentRegistration getByPhoneAndMusicGroupId(Integer musicGroupId, String parentsPhone) {
+        return studentRegistrationDao.getByPhoneAndMusicGroupId(musicGroupId, parentsPhone);
+    }
+
+    @Override
+    public StudentInfo queryStudentInfo(Integer userId) {
+        return studentRegistrationDao.queryStudentInfo(userId);
+    }
 }

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

@@ -14,6 +14,7 @@
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="price_" property="price"/>
+        <result column="remission_course_fee_" property="remissionCourseFee"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -95,13 +96,20 @@
         FROM music_group_subject_goods_group
     </select>
 
-    <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup" extends="MusicGroupSubjectGoodsGroup" id="findGoodsGroupMap">
-        <collection property="goodsList" resultMap="com.ym.mec.biz.dal.dao.GoodsDao.Goods" columnPrefix="g_" />
+    <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup" extends="MusicGroupSubjectGoodsGroup"
+               id="findGoodsGroupMap">
+        <collection property="goodsList" resultMap="com.ym.mec.biz.dal.dao.GoodsDao.Goods" columnPrefix="g_"/>
     </resultMap>
     <select id="findGoodsGroup" resultMap="findGoodsGroupMap">
-        SELECT mgs.*, g.id_ g_id_,g.name_ g_name_,g.market_price_  g_market_price_,g.complement_goods_id_list_ g_complement_goods_id_list_
+        SELECT mgs.*, g.id_ g_id_,g.name_ g_name_,g.market_price_ g_market_price_,g.complement_goods_id_list_
+        g_complement_goods_id_list_
         FROM music_group_subject_goods_group mgs,goods g
         WHERE FIND_IN_SET (g.id_ ,mgs.goods_id_list_)
         AND mgs.music_group_id_ = #{musicGroupId} AND mgs.subject_id_ = #{subId}
     </select>
+
+    <!-- 根据ids获取对应分组商品 -->
+    <select id="findGoodsGroupByIds" resultMap="MusicGroupSubjectGoodsGroup">
+        SELECT * FROM music_group_subject_goods_group WHERE FIND_IN_SET(id_,#{ids})
+    </select>
 </mapper>

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

@@ -28,8 +28,6 @@
         <result column="parents_company_" property="parentsCompany"/>
         <result column="payment_status_" property="paymentStatus"
                 typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-        <result column="last_payment_date_" property="lastPaymentDate"/>
-        <result column="next_payment_date_" property="nextPaymentDate"/>
     </resultMap>
     
     <resultMap type="com.ym.mec.biz.dal.dto.StudentInfo" id="StudentInfo">
@@ -77,9 +75,9 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO student_registration
-        (parents_phone_,id_,user_id_,name_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,last_payment_date_,next_payment_date_,actual_subject_id_)
+        (parents_phone_,id_,user_id_,name_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,actual_subject_id_)
         VALUES(#{parentsPhone},#{id},#{userId},#{name},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},#{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate},#{subjectId})
+        #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{subjectId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -92,15 +90,9 @@
             <if test="subjectId != null">
                 subject_id_ = #{subjectId},
             </if>
-            <if test="nextPaymentDate != null">
-                next_payment_date_ = #{nextPaymentDate},
-            </if>
             <if test="currentGrade != null">
                 current_grade_ = #{currentGrade},
             </if>
-            <if test="lastPaymentDate != null">
-                last_payment_date_ = #{lastPaymentDate},
-            </if>
             <if test="currentClass != null">
                 current_class_ = #{currentClass},
             </if>
@@ -246,8 +238,18 @@
     </select>
 
     <update id="updateByUserIdAndMusicGroupId" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
-        UPDATE student_registration SET class_group_id_ = #{classGroupId} WHERE user_id_ = #{userId} AND music_group_id_ = #{musicGroupId}
+        UPDATE student_registration SET class_group_id_ = #{classGroupId} WHERE user_id_ = #{userId} AND music_group_id_
+        = #{musicGroupId}
     </update>
+
+    <!-- 根据乐团编号和手机号查询注册乐团注册信息-->
+    <select id="getByPhoneAndMusicGroupId" resultMap="StudentRegistration">
+        SELECT * FROM student_registration WHERE music_group_id_=#{musicGroupId} AND parents_phone_ = #{parentsPhone}
+    </select>
+
+    <select id="getSysUserByPhone" resultType="map">
+        SELECT * FROM sys_user WHERE phone_ = #{phone}
+    </select>
     
     <select id="queryStudentInfo" resultMap="StudentInfo">
         SELECT u.*,sr.name_,sr.current_class_,sr.current_grade_,sr.actual_subject_id_ FROM sys_user u left join student_registration  sr on u.id_ = sr.user_id_ where u.id_ = #{userId} order by sr.create_time_ desc limit 0,1

+ 52 - 0
mec-education/src/main/java/com/ym/mec/education/controller/AttendClassController.java

@@ -0,0 +1,52 @@
+package com.ym.mec.education.controller;
+
+import com.ym.mec.education.base.BaseResponse;
+import com.ym.mec.education.base.PageResponse;
+import com.ym.mec.education.req.AttendClassReq;
+import com.ym.mec.education.service.IStudentAttendanceService;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author : chengp
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年10月07日 10:08
+ */
+@RestController
+@RequestMapping("api/attendClass")
+@Api(tags = "上课记录")
+@Slf4j
+public class AttendClassController {
+
+    @Autowired
+    private IStudentAttendanceService studentAttendanceService;
+    /**
+     * 服务降级处理
+     *
+     * @return
+     */
+    private BaseResponse defaultFallback() {
+        BaseResponse response = new BaseResponse();
+        response.setReturnCode(500);
+        response.setMessage("太拥挤了, 请稍后再试!");
+        return response;
+    }
+
+
+    /**
+     *
+     * @param req
+     * @return
+     */
+    @PostMapping(value = "/attendRecord")
+    public PageResponse attendRecord(@RequestBody AttendClassReq req) {
+
+        return  studentAttendanceService.attendRecordList(req);
+    }
+}

+ 8 - 0
mec-education/src/main/java/com/ym/mec/education/controller/CourseScheduleController.java

@@ -49,4 +49,12 @@ public class CourseScheduleController {
     public BaseResponse getStatisticsInfo(@RequestBody ClassGroupReq classGroupReq) {
         return courseScheduleService.getStatisticsInfo(classGroupReq);
     }
+
+
+    @PostMapping("/courseInfo")
+    @ApiOperation("课程详情-头信息")
+    public BaseResponse<CourseScheduleResp> courseInfo(@RequestBody CourseScheduleReq courseScheduleReq) {
+        return courseScheduleService.courseInfo(courseScheduleReq);
+    }
+
 }

+ 12 - 0
mec-education/src/main/java/com/ym/mec/education/controller/HomeWorkController.java

@@ -86,4 +86,16 @@ public class HomeWorkController {
         }
         return studentCourseHomeworkService.getHomeWorkDetail(req);
     }
+
+
+    /**
+     *
+     * @param req
+     * @return
+     */
+    @PostMapping(value = "/homeWorkList")
+    public PageResponse homeWorkList(@RequestBody HomeWorkReq req) {
+
+       return studentCourseHomeworkService.homeWorkList(req);
+    }
 }

+ 10 - 0
mec-education/src/main/java/com/ym/mec/education/entity/StudentAttendance.java

@@ -58,6 +58,16 @@ public class StudentAttendance extends Model<StudentAttendance> {
     @TableField("remark_")
     private String remark;
 
+    @TableField("current_class_times_")
+    private Integer currentClassTimes;
+
+    public Integer getCurrentClassTimes() {
+        return currentClassTimes;
+    }
+
+    public void setCurrentClassTimes(Integer currentClassTimes) {
+        this.currentClassTimes = currentClassTimes;
+    }
 
     public Long getId() {
         return id;

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/CourseHomeworkMapper.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.education.entity.CourseHomework;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
 
 /**
  * <p>

+ 10 - 0
mec-education/src/main/java/com/ym/mec/education/mapper/StudentAttendanceMapper.java

@@ -1,7 +1,11 @@
 package com.ym.mec.education.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ym.mec.education.entity.StudentAttendance;
+import com.ym.mec.education.req.AttendClassReq;
+import com.ym.mec.education.resp.AttendClassResp;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -13,4 +17,10 @@ import com.ym.mec.education.entity.StudentAttendance;
  */
 public interface StudentAttendanceMapper extends BaseMapper<StudentAttendance> {
 
+    /**
+     *学生上课记录
+     * @param page
+     * @return
+     */
+    Page<AttendClassResp> selectPageByCondition(Page page, @Param("query") AttendClassReq req);
 }

+ 51 - 0
mec-education/src/main/java/com/ym/mec/education/req/AttendClassReq.java

@@ -0,0 +1,51 @@
+package com.ym.mec.education.req;
+
+/**
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年10月07日 9:43
+ */
+
+import com.ym.mec.education.base.BaseQuery;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * |上课记录
+ */
+@Data
+@ToString
+public class AttendClassReq extends BaseQuery implements Serializable {
+    @ApiModelProperty(value = "月份", required = false)
+    private String months;
+    @ApiModelProperty(value = "类型1.已上课,2 未上课", required = true)
+    private String type;
+    /**
+     * 	NORMAL("NORMAL", "普通班级"),
+     * 	MIX("MIX", "合奏班级"),
+     * 	HIGH("HIGH", "提高班"),
+     * 	VIP("VIP", "vip课"),
+     * 	DEMO("demo", "试听课");
+     */
+    @ApiModelProperty(value = "课程类型", required = false)
+    private String classType;
+
+    /**
+     * 到课状态
+     */
+    @ApiModelProperty(value = "到课情况", required = false)
+    /**
+     *     NOT_START("NOT_START","未开始"),
+     *     UNDERWAY("UNDERWAY","进行中"),
+     *     OVER("OVER","已结束");
+     */
+    private String status;
+
+    /**
+     * 学生id
+     */
+    private Integer userId;
+}

+ 59 - 0
mec-education/src/main/java/com/ym/mec/education/resp/AttendClassResp.java

@@ -0,0 +1,59 @@
+package com.ym.mec.education.resp;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author : chengp
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年10月07日 9:43
+ */
+
+@Data
+@ToString
+@ApiModel(description = "上课记录出参")
+public class AttendClassResp implements Serializable {
+
+    @ApiModelProperty(value = "剩余课程数")
+    private Integer subClassNum;
+    @ApiModelProperty(value = "上课状态")
+    private String status;
+    @ApiModelProperty(value = "日期")
+    private String dateStr;
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    @ApiModelProperty(value = "线上,线下")
+    private String teachMode;
+    @ApiModelProperty(value = "课程名")
+    private String className;
+    @ApiModelProperty(value = "星期")
+    private String week;
+
+    private Integer musicGroupId;
+    private Integer classGroupId;
+    private Integer userId;
+    private Integer teacherId;
+    private String type;//vip 普通课
+    private String name;//乐团名
+    private String courseName;//课程名
+    @ApiModelProperty(value = "老师名")
+    private String realName;
+
+
+    private Date startClassTime;
+    private Date endClassTime;
+    private Date classDate;//课表日期
+
+    private Integer totalClassTimes;
+
+    private Integer currentclassTimes;
+}

+ 70 - 0
mec-education/src/main/java/com/ym/mec/education/resp/CourseHomeworkResp.java

@@ -0,0 +1,70 @@
+package com.ym.mec.education.resp;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 课程作业表
+ * </p>
+ *
+ * @author lemeng
+ * @since 2019-09-25
+ */
+@ToString
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CourseHomeworkResp implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+    private Long courseScheduleId;
+    /**
+     * 附件地址(多个用逗号分隔)
+     */
+    private String attachments;
+    /**
+     * 作业内容
+     */
+    private String content;
+    private Date createTime;
+    private Date updateTime;
+    private Integer musicGroupId;
+    private Integer classGroupId;
+    /**
+     * 截止日期
+     */
+    private Date expiryDate;
+    /**
+     * 完成人数
+     */
+    private Integer completedNum;
+    /**
+     * 预计人数
+     */
+    private Integer expectNum;
+
+    private String courseName;
+
+    /**
+     * 总课时
+     */
+    private Integer totalClassTimes;
+    /**
+     * 当前
+     */
+    private Integer currentClassTimes;
+
+
+
+
+
+}

+ 45 - 0
mec-education/src/main/java/com/ym/mec/education/resp/CourseInfoResp.java

@@ -0,0 +1,45 @@
+package com.ym.mec.education.resp;
+
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 课程作业表
+ * </p>
+ *
+ * @author lemeng
+ * @since 2019-09-25
+ */
+@ToString
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CourseInfoResp implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+    private Long courseScheduleId;
+    //课程名s
+    private String courseName;
+    //老师名
+    private String realName;
+
+
+    private String startClassTime;
+    private String endClassTime;
+    //课表日期
+    private String classDate;
+
+    private String week;
+
+    private String schoolName;
+}

+ 2 - 0
mec-education/src/main/java/com/ym/mec/education/resp/HomeWrokResp.java

@@ -41,4 +41,6 @@ public class HomeWrokResp implements Serializable {
     private Long id;
 
     private Long courseHomeworkId;
+
+    private String content;
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/ICourseHomeworkService.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.entity.CourseHomework;
-import com.baomidou.mybatisplus.service.IService;
 
 /**
  * <p>

+ 10 - 0
mec-education/src/main/java/com/ym/mec/education/service/ICourseScheduleService.java

@@ -37,4 +37,14 @@ public interface ICourseScheduleService extends IService<CourseSchedule> {
      * @return
      */
     BaseResponse getStatisticsInfo(ClassGroupReq classGroupReq);
+
+
+    /**
+     * 根据课程计划id获取课程计划详情
+     * @param courseScheduleReq
+     * @return
+     */
+    BaseResponse courseInfo(CourseScheduleReq courseScheduleReq);
+
+
 }

+ 7 - 0
mec-education/src/main/java/com/ym/mec/education/service/IStudentAttendanceService.java

@@ -3,6 +3,7 @@ package com.ym.mec.education.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.entity.StudentAttendance;
+import com.ym.mec.education.req.AttendClassReq;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.CourseScheduleReq;
 
@@ -33,4 +34,10 @@ public interface IStudentAttendanceService extends IService<StudentAttendance> {
      */
     PageResponse statisticsList(ClassGroupReq classGroupReq);
 
+    /**
+     * 学员上课记录
+     * @param req
+     * @return
+     */
+    PageResponse attendRecordList(AttendClassReq req);
 }

+ 7 - 0
mec-education/src/main/java/com/ym/mec/education/service/IStudentCourseHomeworkService.java

@@ -20,4 +20,11 @@ public interface IStudentCourseHomeworkService extends IService<StudentCourseHom
     PageResponse workList(HomeWorkReq req);
 
     BaseResponse getHomeWorkDetail(HomeWorkDetailReq req);
+
+    /**
+     * 学员列表 作业列表
+     * @param req
+     * @return
+     */
+    PageResponse homeWorkList(HomeWorkReq req);
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/CourseHomeworkServiceImpl.java

@@ -1,9 +1,9 @@
 package com.ym.mec.education.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.education.entity.CourseHomework;
 import com.ym.mec.education.mapper.CourseHomeworkMapper;
 import com.ym.mec.education.service.ICourseHomeworkService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 /**

+ 44 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java

@@ -13,6 +13,7 @@ import com.ym.mec.education.enums.TeachTypeEnum;
 import com.ym.mec.education.mapper.CourseScheduleMapper;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.CourseScheduleReq;
+import com.ym.mec.education.resp.CourseInfoResp;
 import com.ym.mec.education.resp.CourseScheduleResp;
 import com.ym.mec.education.service.*;
 import com.ym.mec.education.utils.DateUtil;
@@ -52,6 +53,12 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
     @Autowired
     private IMusicGroupQuitService musicGroupQuitService;
 
+    @Autowired
+    private IMusicGroupService musicGroupService;
+
+    @Autowired
+    private ISchoolService schoolService;
+
     @Override
     public PageResponse getPage(ClassGroupReq classGroupReq) {
         if (Objects.isNull(classGroupReq.getGroupId())) {
@@ -172,4 +179,41 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
         }
         return BaseResponse.success(courseScheduleResp);
     }
+
+    @Override
+    public BaseResponse courseInfo(CourseScheduleReq courseScheduleReq) {
+
+
+        if(courseScheduleReq.getCourseScheduleId() == null){
+            return BaseResponse.failParams();
+        }
+        CourseInfoResp resp = new CourseInfoResp();
+        CourseSchedule courseSchedule = this.baseMapper.selectById(courseScheduleReq.getCourseScheduleId());
+        if(courseSchedule != null){
+            resp.setCourseName(courseSchedule.getName());
+            resp.setClassDate(DateUtil.date2String(courseSchedule.getClassDate(),DateUtil.DATE_FORMAT));
+            resp.setCourseScheduleId(courseSchedule.getId());
+            resp.setStartClassTime(DateUtil.date2String(courseSchedule.getStartClassTime(),DateUtil.TIME_FORMAT));
+            resp.setEndClassTime(DateUtil.date2String(courseSchedule.getEndClassTime(),DateUtil.TIME_FORMAT));
+            resp.setWeek(DateUtil.date2Week(courseSchedule.getClassDate()));
+
+            SysUser sysUser = sysUserService.getById(courseSchedule.getTeacherId());
+            if(sysUser != null){
+                resp.setRealName(sysUser.getRealName());
+            }
+            ClassGroup classGroup = groupService.getById(courseSchedule.getClassGroupId());
+            if(classGroup != null){
+                MusicGroup musicGroup = musicGroupService.getById(courseSchedule.getClassGroupId());
+                if(musicGroup != null && musicGroup.getSchoolId()!= null){
+                    School school = schoolService.getById(musicGroup.getSchoolId());
+                    if(school != null){
+                        resp.setSchoolName(school.getName());
+                    }
+                }
+            }
+
+
+        }
+        return BaseResponse.success(resp);
+    }
 }

+ 27 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java

@@ -9,8 +9,10 @@ import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.entity.*;
 import com.ym.mec.education.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.education.mapper.StudentAttendanceMapper;
+import com.ym.mec.education.req.AttendClassReq;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.CourseScheduleReq;
+import com.ym.mec.education.resp.AttendClassResp;
 import com.ym.mec.education.resp.StudentAttendanceResp;
 import com.ym.mec.education.resp.StudentAttendanceStatisticsResp;
 import com.ym.mec.education.service.*;
@@ -216,4 +218,29 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
         }
         return PageResponse.success(pageResult);
     }
+
+    @Override
+    public PageResponse attendRecordList(AttendClassReq req) {
+
+        PageResponse<AttendClassResp> response = new PageResponse();
+        Page<StudentAttendance> pageParam = new Page(req.getPageNo(), req.getPageSize());
+
+        Page<AttendClassResp>  attendClassRespPage = this.baseMapper.selectPageByCondition(pageParam,req);
+
+        List<AttendClassResp> respList = attendClassRespPage.getRecords();
+        if(!CollectionUtils.isEmpty(respList)){
+
+            respList.forEach(e->{
+
+                e.setDateStr(DateUtil.date2String(e.getClassDate(),DateUtil.DATE_FORMAT));
+                e.setStartTime(DateUtil.date2String(e.getStartClassTime(),DateUtil.TIME_FORMAT));
+                e.setEndTime(DateUtil.date2String(e.getEndClassTime(),DateUtil.TIME_FORMAT));
+                e.setWeek(DateUtil.date2Week(e.getClassDate()));
+            });
+
+
+        }
+        return PageResponse.success(pageParam);
+    }
+
 }

+ 47 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -11,6 +11,7 @@ import com.ym.mec.education.enums.ReturnCodeEnum;
 import com.ym.mec.education.mapper.StudentCourseHomeworkMapper;
 import com.ym.mec.education.req.HomeWorkDetailReq;
 import com.ym.mec.education.req.HomeWorkReq;
+import com.ym.mec.education.resp.CourseHomeworkResp;
 import com.ym.mec.education.resp.HomeWrokDetailResp;
 import com.ym.mec.education.resp.HomeWrokResp;
 import com.ym.mec.education.resp.HomeworkReplyResp;
@@ -49,6 +50,12 @@ public class StudentCourseHomeworkServiceImpl extends ServiceImpl<StudentCourseH
     @Autowired
     private IStudentCourseHomeworkReplyService studentCourseHomeworkReplyService;
 
+    @Autowired
+    private ICourseScheduleService courseScheduleService;
+
+    @Autowired
+    private ICourseHomeworkService courseHomeworkService;
+
     @Override
     public PageResponse workList(HomeWorkReq req) {
 
@@ -144,4 +151,44 @@ public class StudentCourseHomeworkServiceImpl extends ServiceImpl<StudentCourseH
         }
         return BaseResponse.success(resp);
     }
+
+    /**
+     * 作业列表
+     * @param req
+     * @return
+     */
+    @Override
+    public PageResponse homeWorkList(HomeWorkReq req) {
+        PageResponse response = new PageResponse();
+        IPage ipage = new Page(req.getPageNo() == null ? 1: req.getPageNo(),req.getPageSize() == null ? 10:req.getPageSize());
+        QueryWrapper<CourseHomework> queryWrapper = new QueryWrapper<>();
+        IPage<CourseHomework> courseScheduleIPage = courseHomeworkService.page(ipage,queryWrapper);
+
+        List<CourseHomework> courseSchedules = courseScheduleIPage.getRecords();
+        List<CourseHomeworkResp> courseHomeworkRespList = new ArrayList<>();
+        if(!CollectionUtils.isEmpty(courseSchedules)){
+            courseSchedules.forEach(e ->{
+                CourseHomeworkResp resp = new CourseHomeworkResp();
+                BeanUtils.copyProperties(e,resp);
+                CourseSchedule courseSchedule =  courseScheduleService.getById(e.getCourseScheduleId());
+                if(courseSchedule != null){
+                    resp.setCourseName(courseSchedule.getName());
+
+                }
+                ClassGroup classGroup = classGroupService.getById(e.getClassGroupId());
+                if(classGroup != null){
+                    resp.setTotalClassTimes(classGroup.getTotalClassTimes());
+                    resp.setCurrentClassTimes(classGroup.getCurrentClassTimes());
+                }
+                courseHomeworkRespList.add(resp);
+            });
+        }
+        response.setRecords(courseHomeworkRespList);
+        response.setTotal(Math.toIntExact(courseScheduleIPage.getTotal()));
+        response.setCurrent(Math.toIntExact(courseScheduleIPage.getCurrent()));
+        response.setSize(Math.toIntExact(courseScheduleIPage.getSize()));
+        response.setReturnCode(ReturnCodeEnum.CODE_200.getCode());
+        response.setMessage(ReturnCodeEnum.CODE_200.getValue());
+        return response;
+    }
 }

+ 34 - 9
mec-education/src/main/resources/mapper/StudentAttendanceMapper.xml

@@ -4,20 +4,45 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.ym.mec.education.entity.StudentAttendance">
-        <id column="id_" property="id" />
-        <result column="music_group_id_" property="musicGroupId" />
-        <result column="class_group_id_" property="classGroupId" />
-        <result column="course_schedule_id_" property="courseScheduleId" />
-        <result column="user_id_" property="userId" />
-        <result column="teacher_id_" property="teacherId" />
-        <result column="status_" property="status" />
-        <result column="create_time_" property="createTime" />
-        <result column="remark_" property="remark" />
+        <id column="id_" property="id"/>
+        <result column="music_group_id_" property="musicGroupId"/>
+        <result column="class_group_id_" property="classGroupId"/>
+        <result column="course_schedule_id_" property="courseScheduleId"/>
+        <result column="user_id_" property="userId"/>
+        <result column="teacher_id_" property="teacherId"/>
+        <result column="status_" property="status"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="remark_" property="remark"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id_, music_group_id_, class_group_id_, course_schedule_id_, user_id_, teacher_id_, status_, create_time_, remark_
     </sql>
+    <select id="selectPageByCondition" parameterType="com.ym.mec.education.req.AttendClassReq"
+            resultType="com.ym.mec.education.resp.AttendClassResp">
 
+     SELECT
+	s.music_group_id_,s.class_group_id_,s.user_id_,s.teacher_id_,s.current_class_times_,s.status_,g.name_,g.total_class_times_,g.type_,g.teach_mode_,u.real_name_,c.name_ as courseName,c.class_date_,c.start_class_time_,c.end_class_time_
+    FROM
+	student_attendance s
+    LEFT JOIN course_schedule c
+    ON s.course_schedule_id_ = c.id_
+    LEFT JOIN class_group g on g.id_ = s.class_group_id_
+    LEFT JOIN sys_user u on u.id_ = c.teacher_id_
+    LEFT JOIN class_group_student_mapper m ON m.class_group_id_ = g.id_
+        WHERE
+     m.user_id_ = #{query.userId}
+       <if test="query.months != null">
+          and DATE_FORMAT(s.create_time_, '%Y-%m') = #{query.months}
+        </if>
+        <if test="query.status != null">
+            AND c.status_ = #{query.status}
+        </if>
+
+        <if test="query.classType != null">
+            and g.type_ = #{query.classType}
+        </if>
+
+    </select>
 </mapper>

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java

@@ -22,7 +22,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/findSubByMusicGroupId","/register/findGoodsGroups").permitAll().anyRequest().authenticated().and().httpBasic();
+		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/getMusicGroupRegInfo","/register/add").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 62 - 4
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -4,8 +4,13 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
 import com.ym.mec.biz.dal.dto.RegisterPayDto;
-import com.ym.mec.biz.service.MusicGroupService;
-import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
+import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.enums.GoodsType;
+import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
@@ -14,12 +19,16 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
 import javax.xml.soap.Name;
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
 
 @RequestMapping("musicGroup")
@@ -27,12 +36,18 @@ import java.util.Map;
 @RestController
 public class MusicGroupController extends BaseController {
 
-    @Autowired
+    @Resource
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private MusicGroupService musicGroupService;
     @Autowired
     private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
+    @Autowired
+    private StudentRegistrationService studentRegistrationService;
+    @Autowired
+    private MusicGroupSubjectGoodsGroupService musicGroupSubjectGoodsGroupService;
+    @Autowired
+    private GoodsService goodsService;
 
     @ApiOperation("获取学生所在乐团列表")
     @GetMapping(value = "/queryUserMusicGroups")
@@ -78,7 +93,50 @@ public class MusicGroupController extends BaseController {
     @ApiOperation(value = "乐团报名支付")
     @GetMapping("/pay")
     @ApiImplicitParams({@ApiImplicitParam(name = "registerPayDto", value = "支付信息", required = true, dataType = "Integer")})
-    public HttpResponseResult pay(RegisterPayDto registerPayDto) {
+    public HttpResponseResult pay(@RequestBody RegisterPayDto registerPayDto) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        StudentRegistration studentRegistration = studentRegistrationService.get(registerPayDto.getRegisterId().longValue());
+        if (!studentRegistration.getUserId().equals(sysUser.getId())) {
+            return failed("报名信息有误,请核查");
+        }
+
+        BigDecimal amount = registerPayDto.getAmount();
+
+        BigDecimal orderAmount = new BigDecimal("0");
+
+        //获取课程价格
+        MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId());
+        orderAmount.add(musicOneSubjectClassPlan.getFee());
+
+
+        //乐器及打包辅件
+        if (registerPayDto.getGoodsGroupIds() != null) {
+            List<MusicGroupSubjectGoodsGroup> goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(registerPayDto.getGoodsGroupIds());
+            goodsGroups.forEach(goodsGroup -> {
+                //辅件价格
+                if (goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
+                    orderAmount.add(goodsGroup.getPrice());
+                    return;
+                }
+                if (musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {//租赁
+                    orderAmount.add(musicOneSubjectClassPlan.getDepositFee());
+                } else if (musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.GROUP)) {//团购
+                    orderAmount.add(goodsGroup.getPrice()).subtract(goodsGroup.getRemissionCourseFee());
+                }
+            });
+        }
+
+        //单独辅件
+        if (registerPayDto.getGoodsIds() != null) {
+            List<Goods> goodsList = goodsService.findGoodsByIds(registerPayDto.getGoodsIds());
+            goodsList.forEach(goods -> {
+                orderAmount.add(goods.getGroupPurchasePrice());
+            });
+        }
+        if (amount.compareTo(orderAmount) != 0) {
+            return failed("商品价格不符");
+        }
+
         Map<String, Object> rqMap = new LinkedHashMap<String, Object>();
         rqMap.put("merNo", "07654478");
         rqMap.put("version", "v1");

+ 5 - 1
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java

@@ -42,8 +42,12 @@ public class MusicGroupRegisterController extends BaseController {
 
     @ApiOperation(value = "新增学生报名信息")
     @PostMapping("/add")
-    public Object add(StudentRegistration studentRegistration) {
+    public Object add(@RequestBody StudentRegistration studentRegistration) {
         MusicGroup musicGroup = musicGroupService.get(studentRegistration.getMusicGroupId().toString());
+        StudentRegistration register = studentRegistrationService.getByPhoneAndMusicGroupId(studentRegistration.getMusicGroupId(), studentRegistration.getParentsPhone());
+        if (register != null) {
+            return failed("该乐团您已注册,请勿重复注册");
+        }
         studentRegistration.setOrganId(musicGroup.getOrganId());
         return succeed(studentRegistrationService.addStudent(studentRegistration));
     }

+ 48 - 6
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/YqPayUtil.java

@@ -2,8 +2,8 @@ package com.ym.mec.thirdparty.yqpay;
 
 import com.alibaba.fastjson.JSON;
 
-import java.util.LinkedHashMap;
-import java.util.Map;
+import java.math.BigDecimal;
+import java.util.*;
 
 public class YqPayUtil {
 
@@ -31,10 +31,6 @@ public class YqPayUtil {
         this.requestMap = rqMap;
     }
 
-    public Map<String, Object> getRequestMap() {
-        return this.requestMap;
-    }
-
     //验签
     public static boolean verify(Map<String, Object> rsMap) {
         String sign = (String) rsMap.get("sign");
@@ -47,4 +43,50 @@ public class YqPayUtil {
         }
     }
 
+    /**
+     * 返回订单提交数据
+     * @param amount 金额
+     * @param orderNo 订单编号
+     * @param notifyUrl 异步通知地址
+     * @param returnUrl 支付返回地址
+     * @param orderSubject 订单标题
+     * @param orderBody 订单内容
+     * @return
+     * @throws Exception
+     */
+    public Map getPayMap(BigDecimal amount,String orderNo,String notifyUrl,String returnUrl,String orderSubject,String orderBody) throws Exception {
+
+//        String notifyUrl = ""; //异步通知地址
+//        String returnUrl = ""; //还回地址
+//        String orderBody = "大雅乐盟培训课程";//订单内容
+//        String orderSubject = "培训订单";//订单标题
+//        String orderNo = "2019121263844";//订单编号
+//        BigDecimal amount = new BigDecimal("654369"); //订单金额
+
+        String payUrl = "https://qyfapi.95epay.com/api/api/hPay/toPayHtml";//支付提交地址
+        String payChannels = "{\"weChatPay\":true,\"weChatPayMobile\":false,\"aliPay\":true,\"fastpayXy\":true,\"aliPayMobile\":false,\"balancePay\":false}";//支付方式配置
+
+        List<Map> tempRoutingList = new ArrayList();
+//        Map<String, Object> routingList = new HashMap<>();
+//        routingList.put("routingMerNo", routingAccount.getSellerNo());//分佣账户
+//        routingList.put("routingFee", order.getAmount().subtract((order.getAmount().multiply(new BigDecimal(0.28)).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP))); //分佣金额
+//        tempRoutingList.add(routingList);
+
+        Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
+        resultMap.put("sellerNo", "0021677"); //收款商户号
+        resultMap.put("payChannels", payChannels); //支付方式
+        resultMap.put("orderBody", orderBody); //订单信息
+        resultMap.put("payAmount", amount); //支付金额
+        resultMap.put("apiPayType", "1"); //*API支付类型1-即时支付,2-担保支付,3-预授权支付*/
+        resultMap.put("tradeType", "0"); //*交易类型1—充值,0—收款*
+        resultMap.put("merMerOrderNo", orderNo); //商户订单号
+        resultMap.put("orderSubject", orderSubject); //订单标题
+        resultMap.put("returnUrl", returnUrl); //前台页面地址
+        resultMap.put("tempRoutingList", JSON.toJSONString(tempRoutingList));//分账设置
+        Map rqMap = new YqPayUtil(notifyUrl, resultMap).requestMap;
+        rqMap.put("host", payUrl);
+        return rqMap;
+    }
+
+
 }

+ 4 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/payInfo.java

@@ -0,0 +1,4 @@
+package com.ym.mec.thirdparty.yqpay;
+
+public class payInfo {
+}