|
|
@@ -1,14 +1,12 @@
|
|
|
package com.ktg.web.controller.iscs;
|
|
|
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ktg.common.annotation.Log;
|
|
|
import com.ktg.common.core.controller.BaseController;
|
|
|
-import com.ktg.common.core.domain.AjaxResult;
|
|
|
import com.ktg.common.enums.BusinessType;
|
|
|
import com.ktg.common.pojo.CommonResult;
|
|
|
-import com.ktg.common.utils.StringUtils;
|
|
|
+import com.ktg.common.utils.poi.ExcelUtil;
|
|
|
import com.ktg.system.domain.SysTeam;
|
|
|
import com.ktg.system.service.ISysTeamService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -19,82 +17,100 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* 小组Controller
|
|
|
*
|
|
|
* @author cc
|
|
|
- * @date 2024-09-12
|
|
|
+ * @date 2024-09-13
|
|
|
*/
|
|
|
-@Api("管理后台 - 小组相关")
|
|
|
+@Api("小组")
|
|
|
@RestController
|
|
|
-@RequestMapping("/md/team")
|
|
|
+@RequestMapping("/iscs/team")
|
|
|
public class SysTeamController extends BaseController
|
|
|
{
|
|
|
@Autowired
|
|
|
private ISysTeamService sysTeamService;
|
|
|
|
|
|
/**
|
|
|
- * 查询小组列表
|
|
|
+ * 查询小组分页
|
|
|
*/
|
|
|
- @GetMapping("/getSysTeamPage")
|
|
|
- @ApiOperation("获得小组-分页")
|
|
|
+ @ApiOperation("查询小组-分页")
|
|
|
@Parameters({
|
|
|
@Parameter(name = "page", description = "Page"),
|
|
|
@Parameter(name = "sysTeam", description = "实体参数")
|
|
|
})
|
|
|
- // @PreAuthorize("@ss.hasPermission('cms:content:query')")
|
|
|
- public CommonResult<Page<SysTeam>> list(Page page, SysTeam sysTeam)
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:team:list')")
|
|
|
+ @GetMapping("/getSysTeamPage")
|
|
|
+ public CommonResult<Page<SysTeam>> getSysTeamPage(Page<SysTeam> page, SysTeam sysTeam)
|
|
|
{
|
|
|
- /* startPage();
|
|
|
- List<SysTeam> list = sysTeamService.selectSysTeamList(sysTeam);
|
|
|
- return getDataTable(list);*/
|
|
|
Page<SysTeam> result = sysTeamService.page(page, Wrappers.<SysTeam>lambdaQuery()
|
|
|
- .eq(StringUtils.isNotBlank(sysTeam.getName()), SysTeam::getName, sysTeam.getName())
|
|
|
.orderByDesc(SysTeam::getId));
|
|
|
return CommonResult.success(result);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 导出小组列表
|
|
|
+ */
|
|
|
+ @ApiOperation("导出小组列表")
|
|
|
+ @Parameter(name = "sysTeam", description = "实体参数")
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:team:export')")
|
|
|
+ @Log(title = "小组", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/exportSysTeam")
|
|
|
+ public void exportSysTeam(HttpServletResponse response, SysTeam sysTeam)
|
|
|
+ {
|
|
|
+ List<SysTeam> list = sysTeamService.selectSysTeamList(sysTeam);
|
|
|
+ ExcelUtil<SysTeam> util = new ExcelUtil<SysTeam>(SysTeam.class);
|
|
|
+ util.exportExcel(response, list, "小组数据");
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 获取小组详细信息
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('md:team:query')")
|
|
|
+ @ApiOperation("获取小组详细信息")
|
|
|
+ @Parameter(name = "id", description = "id")
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:team:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
+ public CommonResult<SysTeam> selectSysTeamById(@PathVariable("id") Long id)
|
|
|
{
|
|
|
- return AjaxResult.success(sysTeamService.selectSysTeamById(id));
|
|
|
+ return CommonResult.success(sysTeamService.selectSysTeamById(id));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新增小组
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('md:team:add')")
|
|
|
+ @ApiOperation("新增小组")
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:team:add')")
|
|
|
@Log(title = "小组", businessType = BusinessType.INSERT)
|
|
|
- @PostMapping
|
|
|
- public AjaxResult add(@RequestBody SysTeam sysTeam)
|
|
|
+ @PostMapping("/insertSysTeam")
|
|
|
+ public CommonResult<Boolean> insertSysTeam(@RequestBody @Parameter(name = "sysTeam", description = "新增数据类,放到body") SysTeam sysTeam)
|
|
|
{
|
|
|
- return toAjax(sysTeamService.insertSysTeam(sysTeam));
|
|
|
+ return CommonResult.success(sysTeamService.insertSysTeam(sysTeam) == 1);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改小组
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('md:team:edit')")
|
|
|
+ @ApiOperation("修改小组")
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:team:edit')")
|
|
|
@Log(title = "小组", businessType = BusinessType.UPDATE)
|
|
|
- @PutMapping
|
|
|
- public AjaxResult edit(@RequestBody SysTeam sysTeam)
|
|
|
+ @PutMapping("/updateSysTeam")
|
|
|
+ public CommonResult<Boolean> updateSysTeam(@RequestBody @Parameter(name = "sysTeam", description = "修改数据类,放到body") SysTeam sysTeam)
|
|
|
{
|
|
|
- return toAjax(sysTeamService.updateSysTeam(sysTeam));
|
|
|
+ return CommonResult.success(sysTeamService.updateSysTeam(sysTeam) == 1);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除小组
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('md:team:remove')")
|
|
|
+ @ApiOperation("删除小组")
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:team:remove')")
|
|
|
@Log(title = "小组", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
+ public CommonResult<Boolean> deleteByids(@PathVariable Long[] ids)
|
|
|
{
|
|
|
- return toAjax(sysTeamService.deleteSysTeamByIds(ids));
|
|
|
+ return CommonResult.success(sysTeamService.deleteSysTeamByIds(ids) == 1);
|
|
|
}
|
|
|
}
|