| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.base.entity.Supplier; |
| | |
| | | //@RequiresPermissions("org.jeecg.modules:base_supplier:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody Supplier supplier) { |
| | | supplier.setSupplierStatus(CommonConstant.STATUS_1); |
| | | supplierService.save(supplier); |
| | | return Result.OK("添加成功!"); |
| | | } |
| | |
| | | return super.importExcel(request, response, Supplier.class); |
| | | } |
| | | |
| | | |
| | | @AutoLog(value = "供应商-启用&禁用") |
| | | @ApiOperation(value = "供应商-启用&禁用", notes = "供应商-启用&禁用") |
| | | @PutMapping(value = "/active") |
| | | public Result<?> active(@RequestParam(name = "id", required = true) String id) { |
| | | Supplier supplier = supplierService.getById(id); |
| | | if (CommonConstant.STATUS_1.equals(supplier.getSupplierStatus())) { |
| | | supplier.setSupplierStatus(CommonConstant.STATUS_0); |
| | | } else { |
| | | supplier.setSupplierStatus(CommonConstant.STATUS_1); |
| | | } |
| | | supplierService.updateById(supplier); |
| | | return Result.ok("操作成功!"); |
| | | } |
| | | |
| | | } |