Merge remote-tracking branch 'origin/dev_天津_阳光彩印' into dev_天津_阳光彩印
| | |
| | | public R listBybomId( @PathVariable("bomId") Integer bomId){ |
| | | return R.ok(productStructureService.listBybomId(bomId)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/listBybomIdIsParent/{bomId}") |
| | | public R listBybomIdIsParent(@PathVariable Integer bomId){ |
| | | return R.ok(productStructureService.listBybomIdIsParent(bomId)); |
| | | } |
| | | } |
| | |
| | | @Mapper |
| | | public interface ProductStructureMapper extends BaseMapper<ProductStructure> { |
| | | |
| | | List<ProductStructureDto> listBybomId(@Param("bomId") Integer bomId); |
| | | List<ProductStructureDto> listBybomId(@Param("bomId") Integer bomId,@Param("isParent") Boolean isParent); |
| | | |
| | | List<ProductStructureDto> listBybomAndProcess(@Param("bomId") Integer bomId, @Param("processId") Long processId); |
| | | } |
| | |
| | | |
| | | List<ProductStructureDto> listBybomId(Integer bomId); |
| | | |
| | | List<ProductStructureDto> listBybomIdIsParent(Integer bomId); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<ProductStructureDto> listBybomId(Integer bomId) { |
| | | List<ProductStructureDto> list = productStructureMapper.listBybomId(bomId); |
| | | List<ProductStructureDto> list = productStructureMapper.listBybomId(bomId, false); |
| | | |
| | | Map<Long, ProductStructureDto> map = new HashMap<>(); |
| | | for (ProductStructureDto node : list) { |
| | |
| | | return tree; |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductStructureDto> listBybomIdIsParent(Integer bomId) { |
| | | return productStructureMapper.listBybomId(bomId, true); |
| | | } |
| | | |
| | | } |
| | |
| | | if (processRoute == null) { |
| | | return R.fail("请先设置工艺路线"); |
| | | } |
| | | List<ProductStructureDto> productStructureDtos = productStructureMapper.listBybomId(processRoute.getBomId()); |
| | | List<ProductStructureDto> productStructureDtos = productStructureMapper.listBybomId(processRoute.getBomId(),false); |
| | | if (productStructureDtos.isEmpty()) { |
| | | return R.fail("请先设置产品结构"); |
| | | } |
| | |
| | | left join product p on pm.product_id = p.id |
| | | left join product_process pp on ps.process_id = pp.id |
| | | where ps.bom_id = #{bomId} |
| | | <if test="isParent"> |
| | | and ps.parent_id is not null |
| | | </if> |
| | | order by ps.id |
| | | </select> |
| | | <select id="listBybomAndProcess" resultType="com.ruoyi.production.dto.ProductStructureDto"> |