| | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.model.Shop; |
| | | import com.doumee.dao.system.vo.ShopMoneyVO; |
| | | import com.doumee.dao.web.dto.ResetSystemUserPwdDTO; |
| | | import com.doumee.service.business.ShopService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | |
| | | @RequiresPermissions("business:shop:create") |
| | | public ApiResponse create(@RequestBody Shop shop) { |
| | | return ApiResponse.success(shopService.create(shop)); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("设置供货价") |
| | | @PostMapping("/setGoodsPrice") |
| | | @RequiresPermissions("business:shop:update") |
| | | public ApiResponse setGoodsPrice(@RequestBody Shop shop) { |
| | | return ApiResponse.success(shopService.setGoodsPrice(shop)); |
| | | } |
| | | |
| | | @ApiOperation("根据ID删除") |
| | |
| | | return ApiResponse.success(shopService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("分页查询账号明细") |
| | | @PostMapping("/pageMoney") |
| | | @RequiresPermissions("business:shop:query") |
| | | public ApiResponse<PageData<ShopMoneyVO>> findPageMoney (@RequestBody PageWrap<Shop> pageWrap) { |
| | | return ApiResponse.success(shopService.findPageMoney(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("查询所有数据") |
| | | @PostMapping("/findAll") |
| | | @RequiresPermissions("business:shop:query") |
| | | public ApiResponse<List<Shop>> findAll (@RequestBody PageWrap<Shop> pageWrap) { |
| | | return ApiResponse.success(shopService.findAll(pageWrap)); |
| | | public ApiResponse<List<Shop>> findAll (@RequestBody Shop pageWrap) { |
| | | return ApiResponse.success(shopService.findList(pageWrap)); |
| | | } |
| | | |
| | | |
| | |
| | | public void exportExcel (@RequestBody PageWrap<Shop> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Shop.class).export(shopService.findPage(pageWrap).getRecords(), "店铺基本信息表", response); |
| | | } |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcelMoney") |
| | | @RequiresPermissions("business:shop:exportExcel") |
| | | public void exportExcelMoney (@RequestBody PageWrap<Shop> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(ShopMoneyVO.class).export(shopService.findPageMoney(pageWrap).getRecords(), "经销商账号明细", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/{id}") |
| | |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(shopService.findById(id)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("重置经销商密码") |
| | | @PostMapping("/resetPwd") |
| | | @RequiresPermissions("system:user:resetPwd") |
| | | public ApiResponse resetPwd ( @RequestBody Shop dto) { |
| | | shopService.resetPwd(dto); |
| | | return ApiResponse.success(null); |
| | | } |
| | | } |