| | |
| | | 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; |
| | |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("到货管理-添加") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody InboundManagement inboundManagement) { |
| | | inboundManagement.setArrivalTime(new Date()); |
| | | boolean result = inboundManagementService.save(inboundManagement); |
| | |
| | | |
| | | @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); |