| | |
| | | import com.ruoyi.basic.service.ISupplierService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/system/supplier") |
| | |
| | | |
| | | /** |
| | | * 供应商删除 |
| | | * @param id |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delSupplier(Integer id) { |
| | | supplierService.delSupplier(id); |
| | | public AjaxResult delSupplier(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("请选择至少一条数据"); |
| | | } |
| | | supplierService.delSupplier(ids); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/info") |
| | | public AjaxResult supplierDetail(Integer id) { |
| | | @GetMapping("/{id}") |
| | | public AjaxResult supplierDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(supplierService.supplierDetail(id)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody SupplierManage supplierManage) { |
| | | supplierService.supplierUpdate(supplierManage); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | * @param response |
| | | * @param supplierManageDto |
| | | */ |
| | | @GetMapping("/export") |
| | | public void supplierExport(HttpServletResponse response, SupplierManageDto supplierManageDto) { |
| | | @PostMapping("/export") |
| | | public void supplierExport(HttpServletResponse response,SupplierManageDto supplierManageDto) { |
| | | supplierService.supplierExport(response, supplierManageDto); |
| | | } |
| | | } |