| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.dao.business.model.InoutDayCount; |
| | | import com.doumee.service.business.InoutDayCountService; |
| | | 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/12 16:19 |
| | | */ |
| | | @Api(tags = "åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨") |
| | | @RestController |
| | | @RequestMapping("/business/inoutDayCount") |
| | | public class InoutDayCountController extends BaseController { |
| | | |
| | | @Autowired |
| | | private InoutDayCountService inoutDayCountService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:inoutdaycount:create") |
| | | public ApiResponse create(@RequestBody InoutDayCount inoutDayCount) { |
| | | return ApiResponse.success(inoutDayCountService.create(inoutDayCount)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:inoutdaycount:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | inoutDayCountService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:inoutdaycount: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)); |
| | | } |
| | | inoutDayCountService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:inoutdaycount:update") |
| | | public ApiResponse updateById(@RequestBody InoutDayCount inoutDayCount) { |
| | | inoutDayCountService.updateById(inoutDayCount); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:inoutdaycount:query") |
| | | public ApiResponse<PageData<InoutDayCount>> findPage (@RequestBody PageWrap<InoutDayCount> pageWrap) { |
| | | return ApiResponse.success(inoutDayCountService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:inoutdaycount:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<InoutDayCount> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(InoutDayCount.class).export(inoutDayCountService.findPage(pageWrap).getRecords(), "åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:inoutdaycount:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(inoutDayCountService.findById(id)); |
| | | } |
| | | } |