|  |  |  | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.model.PlatformGroup; | 
|---|
|  |  |  | import com.doumee.dao.web.reqeust.PlatformDataDTO; | 
|---|
|  |  |  | import com.doumee.service.business.PlatformGroupService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author 江蹄蹄 | 
|---|
|  |  |  | * @since 2024/04/28 16:06 | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformgroup:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestBody PlatformGroup platformGroup,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | platformGroup.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(platformGroupService.create(platformGroup)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformgroup:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | platformGroupService.deleteById(id); | 
|---|
|  |  |  | platformGroupService.deleteById(id,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/delete/batch") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformgroup:delete") | 
|---|
|  |  |  | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | platformGroupService.deleteByIdInBatch(this.getIdList(ids)); | 
|---|
|  |  |  | platformGroupService.deleteByIdInBatch(this.getIdList(ids),this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformgroup:update") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestBody PlatformGroup platformGroup,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | platformGroup.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | platformGroupService.updateById(platformGroup); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformgroup:query") | 
|---|
|  |  |  | public ApiResponse<PageData<PlatformGroup>> findPage (@RequestBody PageWrap<PlatformGroup> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | pageWrap.getModel().setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | return ApiResponse.success(platformGroupService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("查询列表") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformgroup:query") | 
|---|
|  |  |  | public ApiResponse<List<PlatformGroup>> list (@RequestBody PlatformGroup pageWrap, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | pageWrap.setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | return ApiResponse.success(platformGroupService.findList(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出Excel") | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(platformGroupService.findById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取月台组信息") | 
|---|
|  |  |  | @PostMapping("/getPlatformGroupList") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformgroup:query") | 
|---|
|  |  |  | public ApiResponse<List<PlatformGroup>>  getPlatformGroupList (@RequestBody PlatformDataDTO platformDataDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(platformGroupService.getAllPlatformGroup(platformDataDTO,getLoginUser(token))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|