¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.cloud.admin; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | 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.core.utils.Constants; |
| | | import com.doumee.dao.business.model.YwContractRevenue; |
| | | import com.doumee.service.business.YwContractRevenueService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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/11/25 10:29 |
| | | */ |
| | | @Api(tags = "è¿ç»´ååæ¶æ¯æµæ°´") |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywContractRevenue") |
| | | public class YwContractRevenueCloudController extends BaseController { |
| | | |
| | | @Autowired |
| | | private YwContractRevenueService ywContractRevenueService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:ywcontractrevenue:create") |
| | | public ApiResponse create(@RequestBody YwContractRevenue ywContractRevenue,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywContractRevenue.setLoginUserInfo(getLoginUser(token)); |
| | | return ApiResponse.success(ywContractRevenueService.create(ywContractRevenue)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:ywcontractrevenue:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywContractRevenueService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:ywcontractrevenue:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | ywContractRevenueService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:ywcontractrevenue:update") |
| | | public ApiResponse updateById(@RequestBody YwContractRevenue ywContractRevenue,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywContractRevenueService.updateById(ywContractRevenue); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å
³éæµæ°´") |
| | | @GetMapping("/close") |
| | | @CloudRequiredPermission("business:ywcontractrevenue:update") |
| | | public ApiResponse close(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywContractRevenueService.closeRevenue(id,getLoginUser(token)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:ywcontractrevenue:query") |
| | | public ApiResponse<PageData<YwContractRevenue>> findPage (@RequestBody PageWrap<YwContractRevenue> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywContractRevenueService.findPage(pageWrap)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ¶æ¯å表") |
| | | @PostMapping("/list") |
| | | @CloudRequiredPermission("business:ywcontractrevenue:query") |
| | | public ApiResponse<List<YwContractRevenue>> list (@RequestBody YwContractRevenue ywContractRevenue,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywContractRevenueService.findList(ywContractRevenue)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:ywcontractrevenue:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<YwContractRevenue> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ExcelExporter.build(YwContractRevenue.class).export(ywContractRevenueService.findPage(pageWrap).getRecords(), "è¿ç»´ååæ¶æ¯æµæ°´", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:ywcontractrevenue:query") |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywContractRevenueService.getDetail(id)); |
| | | } |
| | | } |