| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.pojo.InboundManagement; |
| | | import com.ruoyi.procurementrecord.service.InboundManagementService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/16 16:38 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å°è´§ç®¡ç") |
| | | @RequestMapping("/inboundManagement") |
| | | public class InboundManagementController extends BaseController { |
| | | |
| | | @Autowired |
| | | private InboundManagementService inboundManagementService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å°è´§ç®¡ç-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, InboundManagement inboundManagement) { |
| | | IPage<InboundManagement> result = inboundManagementService.listPage(page, inboundManagement); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("å°è´§ç®¡ç-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody InboundManagement inboundManagement) { |
| | | inboundManagement.setArrivalTime(new Date()); |
| | | boolean result = inboundManagementService.save(inboundManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("å°è´§ç®¡ç-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody InboundManagement inboundManagement) { |
| | | boolean result = inboundManagementService.updateById(inboundManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("å°è´§ç®¡ç-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean result = inboundManagementService.removeByIds(ids); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | } |