| package doumeemes.api.ext; | 
|   | 
| import doumeemes.api.BaseController; | 
| import doumeemes.core.annotation.excel.ExcelExporter; | 
| import doumeemes.core.annotation.pr.PreventRepeat; | 
| import doumeemes.core.model.ApiResponse; | 
| import doumeemes.core.model.PageWrap; | 
| import doumeemes.core.model.PageData; | 
| import doumeemes.dao.business.model.WOutboundDetail; | 
| import doumeemes.dao.ext.dto.QueryWOutboundDetailExtDTO; | 
| import doumeemes.dao.ext.vo.WOutboundDetailExtListVO; | 
| import doumeemes.service.business.WOutboundDetailService; | 
| import doumeemes.service.ext.WOutboundDetailExtService; | 
| 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 2022/04/20 10:57 | 
|  */ | 
| @RestController | 
| @RequestMapping("/ext/wOutboundDetailExt") | 
| @Api(tags = "出入库单明细接口") | 
| public class WOutboundDetailExtController extends BaseController { | 
|   | 
|     @Autowired | 
|     private WOutboundDetailExtService wOutboundDetailExtService; | 
|      | 
|     @Autowired | 
|     private WOutboundDetailService wOutboundDetailService; | 
|   | 
|     @PreventRepeat | 
|     @ApiOperation("新建") | 
|     @PostMapping("/create") | 
|     @RequiresPermissions("ext:woutbounddetailext:create") | 
|     public ApiResponse create(@RequestBody WOutboundDetail wOutboundDetail) { | 
|         return ApiResponse.success(wOutboundDetailService.create(wOutboundDetail)); | 
|     } | 
|   | 
|     @ApiOperation("根据ID删除") | 
|     @GetMapping("/delete/{id}") | 
|     @RequiresPermissions("ext:woutbounddetailext:delete") | 
|     public ApiResponse deleteById(@PathVariable Integer id) { | 
|         wOutboundDetailService.deleteById(id); | 
|         return ApiResponse.success(null); | 
|     } | 
|   | 
|     @ApiOperation("批量删除") | 
|     @GetMapping("/delete/batch") | 
|     @RequiresPermissions("ext:woutbounddetailext:delete") | 
|     public ApiResponse deleteByIds(@RequestParam String ids) { | 
|         String [] idArray = ids.split(","); | 
|         List<Integer> idList = new ArrayList<>(); | 
|         for (String id : idArray) { | 
|             idList.add(Integer.valueOf(id)); | 
|         } | 
|         wOutboundDetailService.deleteByIdInBatch(idList); | 
|         return ApiResponse.success(null); | 
|     } | 
|   | 
|     @ApiOperation("根据ID修改") | 
|     @PostMapping("/updateById") | 
|     @RequiresPermissions("ext:woutbounddetailext:update") | 
|     public ApiResponse updateById(@RequestBody WOutboundDetail wOutboundDetail) { | 
|         wOutboundDetailService.updateById(wOutboundDetail); | 
|         return ApiResponse.success(null); | 
|     } | 
|   | 
|     @ApiOperation("分页查询") | 
|     @PostMapping("/page") | 
|     @RequiresPermissions("ext:woutbounddetailext:query") | 
|     public ApiResponse<PageData<WOutboundDetailExtListVO>> findPage (@RequestBody PageWrap<QueryWOutboundDetailExtDTO> pageWrap) { | 
|         return ApiResponse.success(wOutboundDetailExtService.findPage(pageWrap)); | 
|     } | 
|   | 
|     @ApiOperation("导出Excel") | 
|     @PostMapping("/exportExcel") | 
|     @RequiresPermissions("ext:woutbounddetailext:exportExcel") | 
|     public void exportExcel (@RequestBody PageWrap<QueryWOutboundDetailExtDTO> pageWrap, HttpServletResponse response) { | 
|         ExcelExporter.build(WOutboundDetailExtListVO.class).export(wOutboundDetailExtService.findPage(pageWrap).getRecords(), "出入库单明细", response); | 
|     } | 
|   | 
|     @ApiOperation("根据ID查询") | 
|     @GetMapping("/{id}") | 
|     @RequiresPermissions("ext:woutbounddetailext:query") | 
|     public ApiResponse findById(@PathVariable Integer id) { | 
|         return ApiResponse.success(wOutboundDetailService.findById(id)); | 
|     } | 
| } |