yonge 5 vuotta sitten
vanhempi
commit
d9f1effe80

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -19,6 +19,7 @@ import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 import com.ym.mec.util.collection.MapUtil;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
@@ -80,6 +81,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 	
 	@Autowired
 	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
+	
+    @Autowired
+    private StudentPaymentOrderService studentPaymentOrderService;
+    
+    @Autowired
+    private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
 
 	@Autowired
 	private PayService payService;
@@ -372,6 +379,29 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 			amount = musicGroupStudentFee.getCourseFee();
 		}
 
+		Date date = new Date();
+		StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
+		studentPaymentOrder.setUserId(userId);
+		studentPaymentOrder.setOrderNo(idGeneratorService.generatorId("RENEW") + "");
+		studentPaymentOrder.setType(OrderTypeEnum.RENEW);
+		studentPaymentOrder.setExpectAmount(amount);
+		studentPaymentOrder.setActualAmount(amount);
+		studentPaymentOrder.setStatus(DealStatusEnum.ING);
+		studentPaymentOrder.setPaymentChannel("银联");
+		studentPaymentOrder.setMusicGroupId(musicGroupId);
+		studentPaymentOrderService.insert(studentPaymentOrder);
+
+		ArrayList<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
+		StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
+		studentPaymentOrderDetail.setType(OrderDetailTypeEnum.COURSE);
+		studentPaymentOrderDetail.setPrice(amount);
+		studentPaymentOrderDetail.setCreateTime(date);
+		studentPaymentOrderDetail.setUpdateTime(date);
+		studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
+		studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
+
+		studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetailList);
+
 		try {
 			return payService.getPayMap(amount, idGeneratorService.generatorId("payment") + "", "https://pay.dayaedu.com/api/yqpay/notify",
 					"http://dev.dayaedu.com", "测试订单", "测试订单");

+ 12 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherLeaveRecordServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -10,9 +11,11 @@ import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.ym.mec.biz.dal.dao.TeacherLeaveRecordDao;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.TeacherLeaveRecord;
 import com.ym.mec.biz.dal.entity.TeacherLeaveRecord.CoursesScheduleHistory;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.TeacherLeaveRecordService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
@@ -26,6 +29,9 @@ public class TeacherLeaveRecordServiceImpl extends BaseServiceImpl<Long, Teacher
 	@Autowired
 	private TeacherLeaveRecordDao teacherLeaveRecordDao;
 
+	@Autowired
+	private CourseScheduleService courseScheduleService;
+
 	@Override
 	public BaseDAO<Long, TeacherLeaveRecord> getDAO() {
 		return teacherLeaveRecordDao;
@@ -70,10 +76,14 @@ public class TeacherLeaveRecordServiceImpl extends BaseServiceImpl<Long, Teacher
 					CoursesScheduleHistory.class);
 
 			if (coursesScheduleHistoryList != null && coursesScheduleHistoryList.size() > 0) {
+
+				List<CourseSchedule> list = new ArrayList<CourseSchedule>();
+
 				for (CoursesScheduleHistory his : coursesScheduleHistoryList) {
-					//课时调整
-					
+					list.add(his.getAfter());
 				}
+				// 课时调整
+				courseScheduleService.classStartDateAdjust(list);
 			}
 		}