yonge 3 years ago
parent
commit
0c8f441310

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

@@ -202,7 +202,7 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
      * @param practiceGroupBuyParams: 购买参数
      * @return void
      */
-    HttpResponseResult buyPracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams);
+    HttpResponseResult buyPracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams, String operatorInfo);
 
 	/**
 	 * @describe 创建关心包课程

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

@@ -2828,7 +2828,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-    public HttpResponseResult buyPracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams) {
+    public HttpResponseResult buyPracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams, String operatorInfo) {
         if (Objects.isNull(practiceGroupBuyParams.getUserId())) {
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请选择教师");
         }
@@ -2996,6 +2996,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         practiceGroupBuyParams.setSingleClassMinutes(practiceCourseMinutes);
         practiceGroupBuyParams.setGroupStatus(GroupStatusEnum.LOCK);
         practiceGroupBuyParams.setType(PracticeGroupType.CHARGE);
+        if(StringUtils.isNotBlank(operatorInfo)){
+        	practiceGroupBuyParams.setMemo(operatorInfo+",教务代买");
+        }
         practiceGroupDao.insert(practiceGroupBuyParams);
 
         //创建班级信息
@@ -3026,9 +3029,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             studentPaymentOrder.setType(OrderTypeEnum.PRACTICE_GROUP_RENEW);
         }
         studentPaymentOrder.setMusicGroupId(practiceGroupBuyParams.getId().toString());
-        studentPaymentOrder.setActualAmount(studentPaymentOrder.getExpectAmount());
         studentPaymentOrder.setClassGroupId(classGroup.getId());
         studentPaymentOrder.setVersion(0);
+        if(StringUtils.isNotBlank(operatorInfo)){
+        	studentPaymentOrder.setMemo(operatorInfo+",教务代买");
+        }
         studentPaymentOrderService.insert(studentPaymentOrder);
 
         //创建班级老师关联记录
@@ -3119,7 +3124,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(oneMonthPrice);
             courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
-            courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseOriginalCost);
+            courseScheduleStudentPayment.setOriginalPrice(oneMonthPrice);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
@@ -4365,7 +4370,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         practiceBuyResult.setOrderNo(orderNo);
         practiceBuyResult.setStatus(order.getStatus());
         practiceBuyResult.setCreateTime(order.getCreateTime());
-        practiceBuyResult.setPrice(order.getExpectAmount());
+        practiceBuyResult.setPrice(order.getExpectAmount().subtract(order.getCouponRemitFee()));
         practiceBuyResult.setType(order.getType().getCode());
 
         if(order.getGroupType().equals(GroupType.GOODS_SELL)){

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

@@ -264,7 +264,7 @@ public class PracticeGroupController extends BaseController {
         }
         practiceGroupBuyParams.setStudentId(sysUser.getId());
         if(Objects.isNull(practiceGroupBuyParams.getType())||PracticeGroupType.CHARGE.equals(practiceGroupBuyParams.getType())){
-            return practiceGroupService.buyPracticeGroup(practiceGroupBuyParams);
+            return practiceGroupService.buyPracticeGroup(practiceGroupBuyParams, null);
         }else{
             return practiceGroupService.createPackagePracticeGroup(practiceGroupBuyParams);
         }

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java

@@ -191,7 +191,7 @@ public class EduPracticeGroupController extends BaseController {
         }
         practiceGroupBuyParams.setEducationalTeacherId(sysUser.getId());
         if(Objects.isNull(practiceGroupBuyParams.getType())||PracticeGroupType.CHARGE.equals(practiceGroupBuyParams.getType())){
-            return eduPracticeGroupService.buyPracticeGroup(practiceGroupBuyParams, sysUser.getRealName()+"("+sysUser.getId()+")");
+            return practiceGroupService.buyPracticeGroup(practiceGroupBuyParams, sysUser.getRealName()+"("+sysUser.getId()+")");
         }else{
             return eduPracticeGroupService.createPackagePracticeGroup(practiceGroupBuyParams, sysUser.getRealName()+"("+sysUser.getId()+")");
         }