| 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.BomDetail; | 
| import doumeemes.dao.ext.bean.BomMaterialBean; | 
| import doumeemes.dao.ext.dto.QueryBomDetailExtDTO; | 
| import doumeemes.dao.ext.vo.BomDetailExtListVO; | 
| import doumeemes.service.business.BomDetailService; | 
| import doumeemes.service.ext.BomDetailExtService; | 
| 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 11:01 | 
|  */ | 
| @RestController | 
| @RequestMapping("/ext/bomDetailExt") | 
| @Api(tags = "物料清单明细接口") | 
| public class BomDetailExtController extends BaseController { | 
|   | 
|     @Autowired | 
|     private BomDetailExtService bomDetailExtService; | 
|   | 
|     @Autowired | 
|     private BomDetailService bomDetailService; | 
|   | 
| //    @PreventRepeat | 
| //    @ApiOperation("新建") | 
| //    @PostMapping("/create") | 
| //    @RequiresPermissions("ext:bomdetailext:create") | 
| //    public ApiResponse create(@RequestBody BomDetail bomDetail) { | 
| //        return ApiResponse.success(bomDetailService.create(bomDetail)); | 
| //    } | 
| // | 
| //    @ApiOperation("根据ID删除") | 
| //    @GetMapping("/delete/{id}") | 
| //    @RequiresPermissions("ext:bomdetailext:delete") | 
| //    public ApiResponse deleteById(@PathVariable Integer id) { | 
| //        bomDetailService.deleteById(id); | 
| //        return ApiResponse.success(null); | 
| //    } | 
| // | 
| //    @ApiOperation("批量删除") | 
| //    @GetMapping("/delete/batch") | 
| //    @RequiresPermissions("ext:bomdetailext: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)); | 
| //        } | 
| //        bomDetailService.deleteByIdInBatch(idList); | 
| //        return ApiResponse.success(null); | 
| //    } | 
| // | 
| //    @ApiOperation("根据ID修改") | 
| //    @PostMapping("/updateById") | 
| //    @RequiresPermissions("ext:bomdetailext:update") | 
| //    public ApiResponse updateById(@RequestBody BomDetail bomDetail) { | 
| //        bomDetailService.updateById(bomDetail); | 
| //        return ApiResponse.success(null); | 
| //    } | 
| // | 
| //    @ApiOperation("分页查询") | 
| //    @PostMapping("/page") | 
| //    @RequiresPermissions("ext:bomdetailext:query") | 
| //    public ApiResponse<PageData<BomDetailExtListVO>> findPage (@RequestBody PageWrap<QueryBomDetailExtDTO> pageWrap) { | 
| //        return ApiResponse.success(bomDetailExtService.findPage(pageWrap)); | 
| //    } | 
| // | 
| //    @ApiOperation("导出Excel") | 
| //    @PostMapping("/exportExcel") | 
| //    @RequiresPermissions("ext:bomdetailext:exportExcel") | 
| //    public void exportExcel (@RequestBody PageWrap<QueryBomDetailExtDTO> pageWrap, HttpServletResponse response) { | 
| //        ExcelExporter.build(BomDetailExtListVO.class).export(bomDetailExtService.findPage(pageWrap).getRecords(), "物料清单明细", response); | 
| //    } | 
| // | 
| //    @ApiOperation("根据ID查询") | 
| //    @GetMapping("/{id}") | 
| //    @RequiresPermissions("ext:bomdetailext:query") | 
| //    public ApiResponse findById(@PathVariable Integer id) { | 
| //        return ApiResponse.success(bomDetailService.findById(id)); | 
| //    } | 
|   | 
|   | 
|     @ApiOperation("根据物料获取详细列表") | 
|     @GetMapping("/findByBomId") | 
| //    @RequiresPermissions("ext:bomdetailext:query") | 
|     public ApiResponse<List<BomDetail>> findByBomId(@RequestParam Integer materialId) { | 
|         return ApiResponse.success(bomDetailService.findByMaterialId(materialId)); | 
|     } | 
|   | 
|     @ApiOperation("BOM物料tree") | 
|     @GetMapping("/bomMaterialTree") | 
| //    @RequiresPermissions("ext:bomdetailext:query") | 
|     public ApiResponse<BomMaterialBean> bomMaterialTree(@RequestParam Integer bomId) { | 
|         return ApiResponse.success(bomDetailService.bomMaterialTree(bomId)); | 
|     } | 
|   | 
| //    @ApiOperation("根据BOM物料树查询") | 
| //    @GetMapping("/bomByMaterialId") | 
| ////    @RequiresPermissions("ext:bomdetailext:query") | 
| //    public ApiResponse<List<BomMaterialBean>> bomByMaterialId(@RequestParam Integer materialId) { | 
| //        return ApiResponse.success(bomDetailService.findMaterialListById(materialId)); | 
| //    } | 
|   | 
|   | 
|   | 
|   | 
|   | 
| } |