|
@@ -3,7 +3,6 @@ package com.xy.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.xy.annotation.CheckSysId;
|
|
|
import com.xy.annotation.IsAdmin;
|
|
|
import com.xy.dto.SysSystemDto;
|
|
|
import com.xy.entity.SysSystem;
|
|
@@ -18,9 +17,6 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -42,9 +38,9 @@ import static com.xy.utils.PlusBeans.toPageBean;
|
|
|
public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem> implements SysSystemService {
|
|
|
|
|
|
@IsAdmin
|
|
|
- @PostMapping("save")
|
|
|
+ @Override
|
|
|
@ApiOperation("添加系统")
|
|
|
- public R<Long> save(@RequestBody @Validated SysSystemDto.Save save) {
|
|
|
+ public R<Long> save(SysSystemDto.Save save) {
|
|
|
long count = count(new LambdaQueryWrapper<SysSystem>().eq(SysSystem::getCode, save.getCode()));
|
|
|
if (count > 0) {
|
|
|
return R.fail("标识已存在");
|
|
@@ -57,17 +53,17 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
|
|
|
}
|
|
|
|
|
|
@IsAdmin
|
|
|
- @PostMapping("update")
|
|
|
+ @Override
|
|
|
@ApiOperation("修改系统")
|
|
|
- public R update(@RequestBody @Validated SysSystemDto.Update update) {
|
|
|
+ public R update(SysSystemDto.Update update) {
|
|
|
SysSystem sysSystem = copy(SysSystem.class, update).update(Long.parseLong(SaTokenUtils.getId().toString()));
|
|
|
updateById(sysSystem);
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
|
- @PostMapping("list")
|
|
|
+ @Override
|
|
|
@ApiOperation("登录人所属系统列表")
|
|
|
- public R<List<SysSystemDto.Vo>> list(@RequestBody SysSystemDto.Select select) {
|
|
|
+ public R<List<SysSystemDto.Vo>> list(SysSystemDto.Select select) {
|
|
|
List<Long> systemIds = RedisCache.getSystemIds(SaTokenUtils.getId(Long.class));
|
|
|
LambdaQueryWrapper<SysSystem> lambdaQueryWrapper = new MybatisPlusQuery().eqWrapper(select, SysSystem.class)
|
|
|
.in(SysSystem::getId, systemIds)
|
|
@@ -81,9 +77,9 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
|
|
|
}
|
|
|
|
|
|
@IsAdmin
|
|
|
- @PostMapping("page")
|
|
|
+ @Override
|
|
|
@ApiOperation("分页查询")
|
|
|
- public R<PageBean<SysSystemDto.Vo>> page(@RequestBody @Validated SysSystemDto.PageSelect pageSelect) {
|
|
|
+ public R<PageBean<SysSystemDto.Vo>> page(SysSystemDto.PageSelect pageSelect) {
|
|
|
LambdaQueryWrapper<SysSystem> lambdaQueryWrapper = new MybatisPlusQuery().eqWrapper(pageSelect, SysSystem.class)
|
|
|
.ge(SysSystem::getCreateTime, pageSelect.getBeginCreateTime())
|
|
|
.le(SysSystem::getCreateTime, pageSelect.getEndCreateTime())
|
|
@@ -94,4 +90,12 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
|
|
|
IPage<SysSystem> page = page(toIPage(pageSelect.getPage()), lambdaQueryWrapper);
|
|
|
return R.ok(toPageBean(SysSystemDto.Vo.class, page));
|
|
|
}
|
|
|
+
|
|
|
+ @IsAdmin
|
|
|
+ @Override
|
|
|
+ @ApiOperation("删除系统")
|
|
|
+ public R del(SysSystemDto.Del del) {
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|