Просмотр исходного кода

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

刘俊驰 2 месяцев назад
Родитель
Сommit
b6f4162fca

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

@@ -28,7 +28,7 @@ public class TempDirectorTrainingCampController extends BaseController {
 
     @ApiOperation(value="获取训练营详情")
     @GetMapping(value = "/getDetail")
-    public HttpResponseResult<TempDirectorTrainingCamp> addCamp(Integer campId){
+    public HttpResponseResult<TempDirectorTrainingCamp> getDetail(Integer campId){
         return succeed(tempDirectorTrainingCampService.getById(campId));
     }
 

+ 5 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TempDirectorTrainingCampDetailServiceImpl.java

@@ -18,6 +18,7 @@ import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.IdGeneratorService;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -180,6 +181,9 @@ public class TempDirectorTrainingCampDetailServiceImpl extends ServiceImpl<TempD
         if(StringUtils.equals(campDetail.getPaymentStatus(),"PAID")){
             throw new BizException("您已缴费请勿重复支付");
         }
+        Integer userId = campDetail.getUserId();
+        Teacher teacher = teacherDao.get(userId);
+        TenantContextHolder.setTenantId(teacher.getTenantId());
         Date now = new Date();
         TempDirectorTrainingCamp trainingCamp = tempDirectorTrainingCampService.getById(campDetail.getTempDirectorTrainingCampId());
         this.checkTraining(now,trainingCamp);
@@ -206,8 +210,6 @@ public class TempDirectorTrainingCampDetailServiceImpl extends ServiceImpl<TempD
         if(money.compareTo(payDto.getAmount()) != 0){
             throw new BizException("活动信息变更,请重新下单");
         }
-        Integer userId = campDetail.getUserId();
-        Teacher teacher = teacherDao.get(userId);
         String channelType = "";
         StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
         studentPaymentOrder.setUserId(userId);
@@ -261,6 +263,7 @@ public class TempDirectorTrainingCampDetailServiceImpl extends ServiceImpl<TempD
         studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
         studentPaymentOrder.setUpdateTime(nowDate);
         studentPaymentOrderService.update(studentPaymentOrder);
+        TenantContextHolder.clearTenantId();
         return BaseController.succeed(payMap);
     }