Browse Source

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

zouxuan 5 years ago
parent
commit
aba2740ccd

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

@@ -82,7 +82,7 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 
 
 	/**
 	/**
 	 * 学生注册缴费订单
 	 * 学生注册缴费订单
-	 * @param userId
+	 * @param studentRegistration
 	 * @param amount
 	 * @param amount
 	 * @param courseFee
 	 * @param courseFee
 	 * @param goodsGroups
 	 * @param goodsGroups

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

@@ -253,7 +253,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
         studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
         studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
         studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
         //乐器及打包辅件
         //乐器及打包辅件
-        if (goodsGroups != null &&goodsGroups.size() >0) {
+        if (goodsGroups != null && goodsGroups.size() > 0) {
             for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
             for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
                 OrderDetailTypeEnum type = null;
                 OrderDetailTypeEnum type = null;
@@ -275,7 +275,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         }
         }
 
 
         //单独辅件
         //单独辅件
-        if (goodsList != null) {
+        if (goodsList != null && goodsList.size() > 0) {
             for (Goods goods : goodsList) {
             for (Goods goods : goodsList) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goods = new StudentPaymentOrderDetail();
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goods = new StudentPaymentOrderDetail();
                 OrderDetailTypeEnum orderDetailType = goods.getType().equals(GoodsType.INSTRUMENT) ? OrderDetailTypeEnum.MUSICAL : OrderDetailTypeEnum.ACCESSORIES;
                 OrderDetailTypeEnum orderDetailType = goods.getType().equals(GoodsType.INSTRUMENT) ? OrderDetailTypeEnum.MUSICAL : OrderDetailTypeEnum.ACCESSORIES;
@@ -289,7 +289,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             }
             }
         }
         }
         //单独教谱
         //单独教谱
-        if (otherGoodsList != null) {
+        if (otherGoodsList != null && otherGoodsList.size() > 0) {
             for (Goods goods : otherGoodsList) {
             for (Goods goods : otherGoodsList) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4otherGoods = new StudentPaymentOrderDetail();
                 StudentPaymentOrderDetail studentPaymentOrderDetail4otherGoods = new StudentPaymentOrderDetail();
                 studentPaymentOrderDetail4otherGoods.setType(OrderDetailTypeEnum.TEACHING);
                 studentPaymentOrderDetail4otherGoods.setType(OrderDetailTypeEnum.TEACHING);
@@ -343,7 +343,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
         studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
         studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
         studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
         //乐器及打包辅件
         //乐器及打包辅件
-        if (goodsGroups != null &&goodsGroups.size() >0) {
+        if (goodsGroups != null && goodsGroups.size() > 0) {
             for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
             for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
                 OrderDetailTypeEnum type = null;
                 OrderDetailTypeEnum type = null;
@@ -365,7 +365,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         }
         }
 
 
         //单独辅件
         //单独辅件
-        if (goodsList != null) {
+        if (goodsList != null && goodsList.size() > 0) {
             for (Goods goods : goodsList) {
             for (Goods goods : goodsList) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goods = new StudentPaymentOrderDetail();
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goods = new StudentPaymentOrderDetail();
                 OrderDetailTypeEnum orderDetailType = goods.getType().equals(GoodsType.INSTRUMENT) ? OrderDetailTypeEnum.MUSICAL : OrderDetailTypeEnum.ACCESSORIES;
                 OrderDetailTypeEnum orderDetailType = goods.getType().equals(GoodsType.INSTRUMENT) ? OrderDetailTypeEnum.MUSICAL : OrderDetailTypeEnum.ACCESSORIES;
@@ -380,7 +380,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             }
             }
         }
         }
         //单独教谱
         //单独教谱
-        if (otherGoodsList != null) {
+        if (otherGoodsList != null && otherGoodsList.size() > 0) {
             for (Goods goods : otherGoodsList) {
             for (Goods goods : otherGoodsList) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4otherGoods = new StudentPaymentOrderDetail();
                 StudentPaymentOrderDetail studentPaymentOrderDetail4otherGoods = new StudentPaymentOrderDetail();
                 studentPaymentOrderDetail4otherGoods.setType(OrderDetailTypeEnum.TEACHING);
                 studentPaymentOrderDetail4otherGoods.setType(OrderDetailTypeEnum.TEACHING);
@@ -513,7 +513,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentPaymentOrderService.insert(studentPaymentOrder);
                 studentPaymentOrderService.insert(studentPaymentOrder);
                 //生成订单明细
                 //生成订单明细
                 List<StudentPaymentOrderDetail> studentPaymentOrderDetails = studentAddDto.getStudentPaymentOrderDetails();
                 List<StudentPaymentOrderDetail> studentPaymentOrderDetails = studentAddDto.getStudentPaymentOrderDetails();
-                if(studentPaymentOrderDetails != null && studentPaymentOrderDetails.size() > 0){
+                if (studentPaymentOrderDetails != null && studentPaymentOrderDetails.size() > 0) {
                     studentPaymentOrderDetails.forEach(e -> {
                     studentPaymentOrderDetails.forEach(e -> {
                         e.setPaymentOrderId(studentPaymentOrder.getId());
                         e.setPaymentOrderId(studentPaymentOrder.getId());
                     });
                     });
@@ -558,7 +558,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 waitPayOrder.setStatus(DealStatusEnum.CLOSE);
                 waitPayOrder.setStatus(DealStatusEnum.CLOSE);
                 studentPaymentOrderService.update(waitPayOrder);
                 studentPaymentOrderService.update(waitPayOrder);
                 //添加学生
                 //添加学生
-                classGroupStudentMapperService.addStudents(studentRegistration.getClassGroupId(),studentRegistration.getUserId().toString(),GroupType.MUSIC);
+                classGroupStudentMapperService.addStudents(waitPayOrder.getClassGroupId(), studentRegistration.getUserId().toString(), GroupType.MUSIC);
             }
             }
 
 
             if (studentRegistration.getTemporaryCourseFee() == null) {
             if (studentRegistration.getTemporaryCourseFee() == null) {
@@ -736,7 +736,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         update(student);
         update(student);
         studentRegistrationDao.updateUser(student.getUserId(), student.getParentsName(), student.getIdCardNo());
         studentRegistrationDao.updateUser(student.getUserId(), student.getParentsName(), student.getIdCardNo());
         // 添加用户电子签章账户
         // 添加用户电子签章账户
-        contractService.register(student.getUserId(),student.getParentsName(), student.getIdCardNo(), student.getParentsPhone());
+        contractService.register(student.getUserId(), student.getParentsName(), student.getIdCardNo(), student.getParentsPhone());
         return student;
         return student;
     }
     }
 }
 }

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

@@ -774,7 +774,7 @@
         FROM
         FROM
         student_attendance sa
         student_attendance sa
         LEFT JOIN sys_user su ON sa.user_id_=su.id_
         LEFT JOIN sys_user su ON sa.user_id_=su.id_
-        WHERE sa.course_schedule_id_=#{courseScheduleId}
+        WHERE sa.course_schedule_id_=#{courseScheduleId} AND status_ = 'NORMAL'
     </select>
     </select>
     <select id="findVipGroupCourseSchedules" resultMap="CourseSchedule">
     <select id="findVipGroupCourseSchedules" resultMap="CourseSchedule">
         SELECT
         SELECT

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

@@ -183,7 +183,7 @@
             <if test="actualSubjectId != null">
             <if test="actualSubjectId != null">
             actual_subject_id_ = #{actualSubjectId},
             actual_subject_id_ = #{actualSubjectId},
             </if>
             </if>
-            <if test="actualSubjectId != null">
+            <if test="classGroupId != null">
                 class_group_id_ = #{classGroupId},
                 class_group_id_ = #{classGroupId},
             </if>
             </if>
             <if test="temporaryCourseFee != null">
             <if test="temporaryCourseFee != null">

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

@@ -43,7 +43,7 @@ public class ClassGroupController extends BaseController {
     @Autowired
     @Autowired
     private StudentRegistrationService studentRegistrationService;
     private StudentRegistrationService studentRegistrationService;
 
 
-    @ApiOperation(value = "小班课报名")
+    @ApiOperation(value = "基础提高班报名")
     @PostMapping("/highReg")
     @PostMapping("/highReg")
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
     public HttpResponseResult highReg(Integer classGroupId) {
     public HttpResponseResult highReg(Integer classGroupId) {

+ 10 - 0
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -130,6 +130,10 @@ public class MusicGroupController extends BaseController {
             return failed("您已缴费,请等待乐团开启");
             return failed("您已缴费,请等待乐团开启");
         }
         }
 
 
+        if (studentRegistration.getTemporaryCourseFee() == null && !musicGroup.getStatus().equals(MusicGroupStatusEnum.PAY)) {
+            return failed("乐团已截止缴费");
+        }
+
         if (!studentRegistration.getPaymentStatus().equals(PaymentStatusEnum.OPEN)) {
         if (!studentRegistration.getPaymentStatus().equals(PaymentStatusEnum.OPEN)) {
             return failed("乐团还未开启缴费,请等待通知");
             return failed("乐团还未开启缴费,请等待通知");
         }
         }
@@ -233,6 +237,9 @@ public class MusicGroupController extends BaseController {
         if (studentRegistration.getTemporaryCourseFee() != null) {
         if (studentRegistration.getTemporaryCourseFee() != null) {
             List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.findUserApplyOrder(studentRegistration.getUserId(), DealStatusEnum.WAIT_PAY);
             List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.findUserApplyOrder(studentRegistration.getUserId(), DealStatusEnum.WAIT_PAY);
             for (StudentPaymentOrderDetail orderDetail : orderDetails) {
             for (StudentPaymentOrderDetail orderDetail : orderDetails) {
+                if (orderDetail == null || orderDetail.getPrice() == null){
+                    continue;
+                }
                 MusicGroupSubjectGoodsGroup musicGroupSubjectGoodsGroup = new MusicGroupSubjectGoodsGroup();
                 MusicGroupSubjectGoodsGroup musicGroupSubjectGoodsGroup = new MusicGroupSubjectGoodsGroup();
                 GoodsType goodsType = orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL) ? GoodsType.INSTRUMENT : GoodsType.ACCESSORIES;
                 GoodsType goodsType = orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL) ? GoodsType.INSTRUMENT : GoodsType.ACCESSORIES;
                 musicGroupSubjectGoodsGroup.setType(goodsType);
                 musicGroupSubjectGoodsGroup.setType(goodsType);
@@ -337,6 +344,9 @@ public class MusicGroupController extends BaseController {
         if (studentRegistration.getTemporaryCourseFee() != null) {
         if (studentRegistration.getTemporaryCourseFee() != null) {
             List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.findUserApplyOrder(studentRegistration.getUserId(), DealStatusEnum.WAIT_PAY);
             List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.findUserApplyOrder(studentRegistration.getUserId(), DealStatusEnum.WAIT_PAY);
             for (StudentPaymentOrderDetail orderDetail : orderDetails) {
             for (StudentPaymentOrderDetail orderDetail : orderDetails) {
+                if (orderDetail == null || orderDetail.getPrice() == null){
+                    continue;
+                }
                 MusicGroupSubjectGoodsGroup musicGroupSubjectGoodsGroup = new MusicGroupSubjectGoodsGroup();
                 MusicGroupSubjectGoodsGroup musicGroupSubjectGoodsGroup = new MusicGroupSubjectGoodsGroup();
                 GoodsType goodsType = orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL) ? GoodsType.INSTRUMENT : GoodsType.ACCESSORIES;
                 GoodsType goodsType = orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL) ? GoodsType.INSTRUMENT : GoodsType.ACCESSORIES;
                 musicGroupSubjectGoodsGroup.setType(goodsType);
                 musicGroupSubjectGoodsGroup.setType(goodsType);