|
@@ -1,7 +1,6 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
|
|
|
-import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
|
import com.ym.mec.biz.dal.dao.SysAreaDao;
|
|
@@ -12,10 +11,7 @@ import com.ym.mec.biz.dal.entity.Organization;
|
|
|
import com.ym.mec.biz.dal.entity.SysArea;
|
|
|
import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.SporadicChargeInfoQueryInfo;
|
|
|
-import com.ym.mec.biz.service.DegreeRegistrationService;
|
|
|
-import com.ym.mec.biz.service.SporadicChargeInfoService;
|
|
|
-import com.ym.mec.biz.service.SysConfigService;
|
|
|
-import com.ym.mec.biz.service.SysTenantConfigService;
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
@@ -26,7 +22,6 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.*;
|
|
@@ -44,7 +39,7 @@ public class DegreeController extends BaseController {
|
|
|
private SporadicChargeInfoService sporadicChargeInfoService;
|
|
|
|
|
|
@Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
+ private SysUserService sysUserService;
|
|
|
|
|
|
@Autowired
|
|
|
private TeacherDao teacherDao;
|
|
@@ -68,15 +63,11 @@ public class DegreeController extends BaseController {
|
|
|
@PostMapping("/pay")
|
|
|
public HttpResponseResult pay(@RequestBody DegreeRegistrationActivityDto degreeRegistration) throws Exception {
|
|
|
if(degreeRegistration.getOrganId() == null){
|
|
|
- return failed("该分部暂未开放此活动");
|
|
|
- }
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if(Objects.isNull(user)){
|
|
|
- return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
+ return failed("暂未开放此活动");
|
|
|
}
|
|
|
+ SysUser user = sysUserService.getUser();
|
|
|
TenantContextHolder.setTenantId(user.getTenantId());
|
|
|
- degreeRegistration.setUserId(user.getId());
|
|
|
- HttpResponseResult result = degreeRegistrationService.check(degreeRegistration);
|
|
|
+ HttpResponseResult result = degreeRegistrationService.check(degreeRegistration,user);
|
|
|
if(result.getCode() != 200){
|
|
|
return result;
|
|
|
}
|
|
@@ -101,12 +92,7 @@ public class DegreeController extends BaseController {
|
|
|
@ApiOperation(value = "考级报名检查")
|
|
|
@PostMapping("/check")
|
|
|
public HttpResponseResult check(@RequestBody DegreeRegistrationActivityDto degreeRegistration) {
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if(Objects.isNull(user)){
|
|
|
- return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
- }
|
|
|
- degreeRegistration.setUserId(user.getId());
|
|
|
- return degreeRegistrationService.check(degreeRegistration);
|
|
|
+ return degreeRegistrationService.check(degreeRegistration,sysUserService.getUser());
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询收费列表")
|
|
@@ -124,11 +110,7 @@ public class DegreeController extends BaseController {
|
|
|
@ApiOperation(value = "获取活动参数")
|
|
|
@GetMapping("/getParams")
|
|
|
public HttpResponseResult getParams(){
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if(Objects.isNull(user)||Objects.isNull(user.getId())){
|
|
|
- return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
- }
|
|
|
-
|
|
|
+ SysUser user = sysUserService.getUser();
|
|
|
SporadicChargeInfoQueryInfo queryInfo = new SporadicChargeInfoQueryInfo();
|
|
|
queryInfo.setOrganId("42");
|
|
|
queryInfo.setChargeType(SporadicChargeTypeEnum.LEVEL);
|