| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | package com.doumee.api.business; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelExporter; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Solutions; | 
|---|
|  |  |  | import com.doumee.dao.business.model.SolutionsBase; | 
|---|
|  |  |  | import com.doumee.service.business.SolutionsBaseService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author æ±è¹è¹ | 
|---|
|  |  |  | * @date 2024/10/28 19:16 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Api(tags = "ä¿é©æ¹æ¡ä¿¡æ¯è¡¨") | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/business/solutionsBase") | 
|---|
|  |  |  | public class SolutionsBaseController extends BaseController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SolutionsBaseService solutionsBaseService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("æ°å»º") | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestBody SolutionsBase solutionsBase) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsBaseService.create(solutionsBase)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("æ ¹æ®IDå é¤") | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id) { | 
|---|
|  |  |  | solutionsBaseService.deleteById(id); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("æ¹éå é¤") | 
|---|
|  |  |  | @GetMapping("/delete/batch") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:delete") | 
|---|
|  |  |  | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { | 
|---|
|  |  |  | String [] idArray = ids.split(","); | 
|---|
|  |  |  | List<Integer> idList = new ArrayList<>(); | 
|---|
|  |  |  | for (String id : idArray) { | 
|---|
|  |  |  | idList.add(Integer.valueOf(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | solutionsBaseService.deleteByIdInBatch(idList); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("æ ¹æ®IDä¿®æ¹") | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:update") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestBody SolutionsBase solutionsBase) { | 
|---|
|  |  |  | solutionsBaseService.updateById(solutionsBase); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("ç¦ç¨å¯ç¨") | 
|---|
|  |  |  | @PostMapping("/updateStatus") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:update") | 
|---|
|  |  |  | public ApiResponse updateStatus(@RequestBody SolutionsBase bean) { | 
|---|
|  |  |  | solutionsBaseService.updateStatus(bean); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("å页æ¥è¯¢") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:query") | 
|---|
|  |  |  | public ApiResponse<PageData<SolutionsBase>> findPage (@RequestBody PageWrap<SolutionsBase> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsBaseService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("å表æ¥è¯¢") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:query") | 
|---|
|  |  |  | public ApiResponse<List<SolutionsBase>> list (@RequestBody SolutionsBase solutionsBase) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsBaseService.findList(solutionsBase)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导åºExcel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<SolutionsBase> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | ExcelExporter.build(SolutionsBase.class).export(solutionsBaseService.findPage(pageWrap).getRecords(), "ä¿é©æ¹æ¡ä¿¡æ¯è¡¨", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("æ ¹æ®IDæ¥è¯¢") | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:query") | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsBaseService.findById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("æµè¯çæä¸»æ¹æ¡") | 
|---|
|  |  |  | @GetMapping("/createSolutionBase") | 
|---|
|  |  |  | public ApiResponse createSolutionBase(Integer solutionId) { | 
|---|
|  |  |  | solutionsBaseService.createSolutionBase(solutionId); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|