| | |
| | | import com.ruoyi.basic.entity.Supply; |
| | | import com.ruoyi.basic.service.SupplyService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/supply") |
| | | @Tag(name = "供应商信息表") |
| | | public class SupplyController { |
| | | |
| | | private SupplyService supplyService; |
| | |
| | | * 查询 |
| | | */ |
| | | @GetMapping("/list") |
| | | public R<IPage<Supply>> list(Page page,SupplyDto supplyDto) { |
| | | IPage<Supply> list = supplyService.selectSupplyList(page,supplyDto); |
| | | public R<IPage<Supply>> list(Page page, SupplyDto supplyDto) { |
| | | IPage<Supply> list = supplyService.selectSupplyList(page, supplyDto); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 新增修改 |
| | | * 供应商list |
| | | */ |
| | | @GetMapping("/supplyList") |
| | | public R<List<Supply>> list() { |
| | | return R.ok(supplyService.supplyList()); |
| | | } |
| | | |
| | | /** |
| | | * 供应商新增修改 |
| | | */ |
| | | @PostMapping("/addOrEditSupply") |
| | | public R addOrEditSupply(@RequestBody SupplyDto supplyDto) { |
| | | return R.ok(supplyService.addOrEditSupply(supplyDto)); |
| | | } |
| | | |
| | | /** |
| | | * 批量新增 |
| | | */ |
| | | @PostMapping("/addBatch") |
| | | @Operation(summary = "供应商信息表-批量新增") |
| | | public R addBatch(@RequestBody List<SupplyDto> list) { |
| | | if (list.size() == 0) { |
| | | return R.fail("请选择要导入的数据"); |
| | | } |
| | | list.forEach(item -> { |
| | | supplyService.addOrEditSupply(item); |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.ok(supplyService.delSupplyByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 供应商导出 |
| | | */ |
| | | @PostMapping("/export") |
| | | public void supplierExport(HttpServletResponse response, SupplyDto supplyDto) { |
| | | supplyService.supplyExport(response, supplyDto); |
| | | } |
| | | |
| | | } |