¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.cloud.admin; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.YwOutinbound; |
| | | import com.doumee.service.business.YwOutinboundService; |
| | | 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.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/01/06 11:05 |
| | | */ |
| | | @Api(tags = "è¿ç»´åºå
¥åºä¿¡æ¯è¡¨") |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywOutinbound") |
| | | public class YwOutinboundController extends BaseController { |
| | | |
| | | @Autowired |
| | | private YwOutinboundService ywOutinboundService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:ywoutinbound:create") |
| | | public ApiResponse create(@RequestBody YwOutinbound ywOutinbound,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywOutinbound.setLoginUserInfo(this.getLoginUser(token)); |
| | | return ApiResponse.success(ywOutinboundService.create(ywOutinbound)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:ywoutinbound:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywOutinboundService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:ywoutinbound:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | ywOutinboundService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:ywoutinbound:update") |
| | | public ApiResponse updateById(@RequestBody YwOutinbound ywOutinbound,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywOutinbound.setLoginUserInfo(this.getLoginUser(token)); |
| | | ywOutinboundService.updateById(ywOutinbound); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:ywoutinbound:query") |
| | | public ApiResponse<PageData<YwOutinbound>> findPage (@RequestBody PageWrap<YwOutinbound> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywOutinboundService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:ywoutinbound:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<YwOutinbound> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ExcelExporter.build(YwOutinbound.class).export(ywOutinboundService.findPage(pageWrap).getRecords(), "è¿ç»´åºå
¥åºä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:ywoutinbound:query") |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywOutinboundService.getDetail(id)); |
| | | } |
| | | } |