|
@@ -1,5 +1,12 @@
|
|
|
package com.github.zuihou.business.controller.classSchedule;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.github.zuihou.authority.dto.auth.UserPageDTO;
|
|
|
+import com.github.zuihou.authority.entity.auth.User;
|
|
|
+import com.github.zuihou.authority.service.auth.UserService;
|
|
|
+import com.github.zuihou.base.request.PageParams;
|
|
|
import com.github.zuihou.business.classSchedule.entity.ScheduleMonth;
|
|
|
import com.github.zuihou.business.classSchedule.dto.ScheduleMonthSaveDTO;
|
|
|
import com.github.zuihou.business.classSchedule.dto.ScheduleMonthUpdateDTO;
|
|
@@ -10,9 +17,13 @@ import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
import com.github.zuihou.base.controller.SuperController;
|
|
|
import com.github.zuihou.base.R;
|
|
|
+import com.github.zuihou.context.BaseContextHandler;
|
|
|
+import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.compress.utils.Lists;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -38,6 +49,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
//@PreAuth(replace = "scheduleMonth:")
|
|
|
public class ScheduleMonthController extends SuperController<ScheduleMonthService, Long, ScheduleMonth, ScheduleMonthPageDTO, ScheduleMonthSaveDTO, ScheduleMonthUpdateDTO> {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 添加
|
|
|
* @param scheduleMonthSaveDTO
|
|
@@ -49,6 +63,22 @@ public class ScheduleMonthController extends SuperController<ScheduleMonthServic
|
|
|
return success(scheduleMonth);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void query(PageParams<ScheduleMonthPageDTO> params, IPage<ScheduleMonth> page, Long defSize) {
|
|
|
+ ScheduleMonth model = BeanUtil.toBean(params.getModel(),ScheduleMonth.class);
|
|
|
+ QueryWrap<ScheduleMonth> wrapper = this.handlerWrapper(model, params);
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
+ Long userId = BaseContextHandler.getUserId();
|
|
|
+ Map<String, Object> orgMap = userService.getDataScopeById(userId);
|
|
|
+ List<Long> orgIds = orgMap.containsKey("orgIds")? (List)orgMap.get("orgIds") : Lists.newArrayList();
|
|
|
+ if(CollectionUtil.isNotEmpty(orgIds)){
|
|
|
+ wrapper.in("org_id", orgIds);
|
|
|
+ }
|
|
|
+ baseService.page(page, wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@ApiOperation(value = "修改排班月份", notes = "修改排班月份")
|
|
|
@PostMapping("/update")
|
|
|
public R<ScheduleMonth> update(ScheduleMonthUpdateDTO model) {
|