| | |
| | | import com.doumee.dao.business.model.dto.BaseGoodsCreateOrUpdateRequest; |
| | | import com.doumee.dao.business.model.dto.BaseGoodsDTO; |
| | | import com.doumee.service.business.BaseGoodsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | /** |
| | | * 主键上下架 |
| | | * |
| | | * @param idList 实体对象 |
| | | */ |
| | | @ApiOperation("根据ID查询") |
| | | @PostMapping("/{status") |
| | | @RequiresPermissions("business:basegoods:query") |
| | | public ApiResponse updateStatusByIds(@RequestBody List<Integer> idList, @PathVariable Integer status){ |
| | | baseGoodsService.updateStatusByIds(idList,status); |
| | | return ApiResponse.success(null); |
| | | @ApiOperation("根据ID查询批量上架下架") |
| | | @PostMapping("/updateStatus") |
| | | @RequiresPermissions("business:basegoods:update") |
| | | public ApiResponse updateStatusByIds(@RequestBody BaseGoods param ){ |
| | | baseGoodsService.updateStatusByIds(param); |
| | | return ApiResponse.success("操作成功!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 主键上下架 |
| | | * |
| | | * @param id 实体对象 |
| | | */ |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/updateStatusById") |
| | | @RequiresPermissions("business:basegoods:query") |
| | | public ApiResponse updateStatusById(@RequestParam Integer id,@RequestParam Integer status){ |
| | | baseGoodsService.updateStatusById(id,status); |
| | | return ApiResponse.success(null); |
| | | } |
| | | // /** |
| | | // * 主键上下架 |
| | | // * |
| | | // * @param id 实体对象 |
| | | // */ |
| | | // @ApiOperation("上架 、下架") |
| | | // @GetMapping("/updateStatusById") |
| | | // @RequiresPermissions("business:basegoods:update") |
| | | // public ApiResponse updateStatusById(@RequestParam Integer id,@RequestParam Integer status){ |
| | | // baseGoodsService.updateStatusById(id,status); |
| | | // return ApiResponse.success(null); |
| | | // } |
| | | |
| | | /** |
| | | * 主键查询 |
| | |
| | | baseGoodsService.update(baseGoods); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("导入模板") |
| | | @PostMapping("/importExcel") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), |
| | | }) |
| | | @RequiresPermissions("business:basegoods:create") |
| | | public ApiResponse<Integer> importExcel (@ApiParam(value = "file") MultipartFile file) { |
| | | return ApiResponse.success(baseGoodsService.importBaseGoodsBatch(file)); |
| | | } |
| | | } |