| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.service.StockOutRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * åºåºè®°å½è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-21 05:27:04 |
| | | */ |
| | | @Api(tags = "åºåº") |
| | | @RestController |
| | | @RequestMapping("/stockOutRecord") |
| | | public class StockOutRecordController { |
| | | @Autowired |
| | | private StockOutRecordService stockOutRecordService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "ç产åºåº-åºåºç®¡ç-å表", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "åºåºç®¡çå表") |
| | | public AjaxResult listPage(Page page, StockOutRecordDto stockOutRecordDto) { |
| | | IPage<StockOutRecordDto> result = stockOutRecordService.listPage(page, stockOutRecordDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("") |
| | | @Log(title = "åºåºç®¡ç-æ°å¢åºåº", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody StockOutRecordDto stockOutRecordDto) { |
| | | return AjaxResult.success(stockOutRecordService.add(stockOutRecordDto)); |
| | | } |
| | | |
| | | @PutMapping("/{id}") |
| | | @Log(title = "åºåºç®¡ç-æ´æ°åºåº", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@PathVariable("id") Long id, @RequestBody StockOutRecordDto stockOutRecordDto) { |
| | | return AjaxResult.success(stockOutRecordService.update(id, stockOutRecordDto)); |
| | | } |
| | | |
| | | @DeleteMapping("") |
| | | @Log(title = "åºåºç®¡ç-å é¤åºåº", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(stockOutRecordService.batchDelete(ids)); |
| | | } |
| | | } |