浏览代码

发放清单没有时处理

周箭河 5 年之前
父节点
当前提交
fb423002f2

+ 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());
         studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
         //乐器及打包辅件
-        if (goodsGroups != null &&goodsGroups.size() >0) {
+        if (goodsGroups != null && goodsGroups.size() > 0) {
             for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
                 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) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goods = new StudentPaymentOrderDetail();
                 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) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4otherGoods = new StudentPaymentOrderDetail();
                 studentPaymentOrderDetail4otherGoods.setType(OrderDetailTypeEnum.TEACHING);
@@ -343,7 +343,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
         studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
         //乐器及打包辅件
-        if (goodsGroups != null &&goodsGroups.size() >0) {
+        if (goodsGroups != null && goodsGroups.size() > 0) {
             for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
                 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) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4goods = new StudentPaymentOrderDetail();
                 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) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4otherGoods = new StudentPaymentOrderDetail();
                 studentPaymentOrderDetail4otherGoods.setType(OrderDetailTypeEnum.TEACHING);
@@ -513,7 +513,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentPaymentOrderService.insert(studentPaymentOrder);
                 //生成订单明细
                 List<StudentPaymentOrderDetail> studentPaymentOrderDetails = studentAddDto.getStudentPaymentOrderDetails();
-                if(studentPaymentOrderDetails != null && studentPaymentOrderDetails.size() > 0){
+                if (studentPaymentOrderDetails != null && studentPaymentOrderDetails.size() > 0) {
                     studentPaymentOrderDetails.forEach(e -> {
                         e.setPaymentOrderId(studentPaymentOrder.getId());
                     });
@@ -558,7 +558,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 waitPayOrder.setStatus(DealStatusEnum.CLOSE);
                 studentPaymentOrderService.update(waitPayOrder);
                 //添加学生
-                classGroupStudentMapperService.addStudents(studentRegistration.getClassGroupId(),studentRegistration.getUserId().toString(),GroupType.MUSIC);
+                classGroupStudentMapperService.addStudents(studentRegistration.getClassGroupId(), studentRegistration.getUserId().toString(), GroupType.MUSIC);
             }
 
             if (studentRegistration.getTemporaryCourseFee() == null) {
@@ -736,7 +736,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         update(student);
         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;
     }
 }

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

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