|
@@ -0,0 +1,74 @@
|
|
|
+package com.ym.mec.student.controller.degree;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.microsvc.toolkit.common.response.paging.PageInfo;
|
|
|
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.entity.DegreeLevelFeeNew;
|
|
|
+import com.ym.mec.biz.dal.vo.DegreeLevelFeeNewVo;
|
|
|
+import com.ym.mec.biz.dal.wrapper.DegreeLevelFeeWrapper;
|
|
|
+import com.ym.mec.biz.service.DegreeLevelFeeService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@Validated
|
|
|
+@RestController
|
|
|
+@RequestMapping("/degreeLevelFee")
|
|
|
+@Api(tags = "考级等级费用配置")
|
|
|
+public class DegreeLevelFeeController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DegreeLevelFeeService degreeLevelFeeService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "详情", notes = "考级等级费用配置-根据详情ID查询单条, 传入id")
|
|
|
+ @GetMapping("/detail/{id}")
|
|
|
+ public HttpResponseResult<DegreeLevelFeeNew> detail(@PathVariable("id") Long id) {
|
|
|
+
|
|
|
+ DegreeLevelFeeNew wrapper = degreeLevelFeeService.detail(id);
|
|
|
+
|
|
|
+ return succeed(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询分页", notes = "考级等级费用配置- 传入 DegreeLevelFeeWrapper.DegreeLevelFeeQuery")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('degreeLevelFee/page')")
|
|
|
+ @PostMapping("/page")
|
|
|
+ public HttpResponseResult<PageInfo<DegreeLevelFeeNewVo>> page(@RequestBody DegreeLevelFeeWrapper.DegreeLevelFeeQuery query) {
|
|
|
+
|
|
|
+ return succeed(QueryInfo.pageInfo(degreeLevelFeeService.selectPage(QueryInfo.getPage(query), query)));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "考级费用配置", notes = "考级费用配置查询")
|
|
|
+ @GetMapping("/degreeLevelFeeConfig")
|
|
|
+ public HttpResponseResult<DegreeLevelFeeWrapper.DegreeLevelFee> degreeLevelFeeConfig() {
|
|
|
+
|
|
|
+ // 登录用户信息
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if(Objects.isNull(user)||Objects.isNull(user.getId())){
|
|
|
+ return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 根据用户机构ID,查询对应考级配置
|
|
|
+ return succeed(degreeLevelFeeService.degreeLevelFeeConfig(user.getTenantId()));
|
|
|
+ }
|
|
|
+}
|