| | |
| | | import com.ruoyi.business.entity.PurchaseRegistration; |
| | | import com.ruoyi.business.service.PurchaseRegistrationService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private PurchaseRegistrationService purchaseRegistrationService; |
| | | |
| | | /** |
| | | * 查询 |
| | | * 采购登记表查询 |
| | | */ |
| | | @GetMapping("/list") |
| | | public R<IPage<PurchaseRegistration>> list(Page page, PurchaseRegistrationDto purchaseRegistrationDto) { |
| | | public R<IPage<PurchaseRegistration>> list(Page<PurchaseRegistration> page, PurchaseRegistrationDto purchaseRegistrationDto) { |
| | | IPage<PurchaseRegistration> list = purchaseRegistrationService.selectPurchaseRegistrationList(page,purchaseRegistrationDto); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 新增修改 |
| | | * 采购登记表新增修改 |
| | | */ |
| | | @PostMapping("/addOrEditPR") |
| | | public R addOrEditSupply(@RequestBody PurchaseRegistrationDto purchaseRegistrationDto) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * 批量新增 |
| | | */ |
| | | @PostMapping("/addBatch") |
| | | @Operation(summary = "采购登记表-批量新增") |
| | | public R addBatch(@RequestBody List<PurchaseRegistrationDto> list) { |
| | | if (list.size() == 0) { |
| | | return R.fail("请选择要导入的数据"); |
| | | } |
| | | list.forEach(item -> { |
| | | purchaseRegistrationService.addOrEditPR(item); |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 采购登记表删除 |
| | | */ |
| | | @DeleteMapping("/delPR") |
| | | public R remove(@RequestBody Long[] ids) { |