|
@@ -1,14 +1,23 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentAddDto;
|
|
|
+import com.ym.mec.biz.dal.entity.Employee;
|
|
|
+import com.ym.mec.biz.dal.entity.SellOrder;
|
|
|
import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
|
|
|
import com.ym.mec.biz.dal.entity.SubjectChange;
|
|
|
+import com.ym.mec.biz.dal.page.SellOrderQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.SubjectChangeQueryInfo;
|
|
|
import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
|
|
|
import com.ym.mec.biz.service.StudentRegistrationService;
|
|
|
import com.ym.mec.biz.service.SubjectChangeService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
+import com.ym.mec.common.page.PageInfo;
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -18,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RequestMapping("subjectChange")
|
|
@@ -31,17 +41,36 @@ public class SubjectChangeController extends BaseController {
|
|
|
private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
|
|
|
@Autowired
|
|
|
private SubjectChangeService subjectChangeService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private EmployeeDao employeeDao;
|
|
|
|
|
|
- @ApiOperation(value = "获取学生报名缴费详情")
|
|
|
- @GetMapping("/getApplyDetail")
|
|
|
- @PreAuthorize("@pcs.hasPermissions('subjectChange/getApplyDetail')")
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "studentId", value = "学生编号", required = true, dataType = "Integer"),
|
|
|
- @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
|
|
|
- public HttpResponseResult<List<StudentPaymentOrderDetail>> getApplyDetail(Integer studentId, String musicGroupId) {
|
|
|
- if (studentId == null || StringUtils.isEmpty(musicGroupId)) {
|
|
|
- return failed("参数校验异常");
|
|
|
+ @ApiOperation("销售列表")
|
|
|
+ @GetMapping(value = "/queryPage")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('sellOrder/queryPage')")
|
|
|
+ public HttpResponseResult<PageInfo<SubjectChange>> queryPage(SubjectChangeQueryInfo queryInfo) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ if (!sysUser.getIsSuperAdmin()) {
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
|
|
|
+ queryInfo.setOrganIdList(employee.getOrganIdList());
|
|
|
+ } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
|
|
|
+ return failed("用户所在分部异常");
|
|
|
+ } else {
|
|
|
+ List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
+ if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
|
|
|
+ return failed("非法请求");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (queryInfo.getEndTime() != null) {
|
|
|
+ queryInfo.setEndTime(DateUtil.getLastTimeWithDay(queryInfo.getEndTime()));
|
|
|
}
|
|
|
- return succeed(studentRegistrationService.getStudentApplyDetail(studentId, musicGroupId));
|
|
|
+ return succeed(subjectChangeService.getPageList(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取更换前的详情")
|