| | |
| | | import com.whyc.dto.FileDirPath; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.ZipUtils; |
| | | import com.whyc.mapper.AttachLockMapper; |
| | | import com.whyc.mapper.MaterialMapper; |
| | | import com.whyc.mapper.ProductBomMapper; |
| | | import com.whyc.mapper.ProductMapper; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private ProductMapper productMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private AttachLockMapper attachLockMapper; |
| | | |
| | | @Autowired |
| | | private DocLogService logService; |
| | |
| | | List<ProductBom> endList=new ArrayList<>(); |
| | | list.stream().forEach(bom -> { |
| | | bom.setConnFlag(0); |
| | | if(bom.getDwgUrl()!=null){ |
| | | QueryWrapper qwrapper=new QueryWrapper(); |
| | | qwrapper.eq("material_id",bom.getMaterialId()); |
| | | qwrapper.eq("attach_name",bom.getDwgUrl().substring(bom.getDwgUrl().lastIndexOf("\\")+1)); |
| | | qwrapper.last("limit 1"); |
| | | AttachLock attachLock=attachLockMapper.selectOne(wrapper); |
| | | if(attachLock!=null){ |
| | | bom.setDwgUrl(""); |
| | | } |
| | | } |
| | | endList.add(bom); |
| | | if(bom.getMaterials()!=null&&bom.getMaterials().size()>0){ |
| | | for (Material m:bom.getMaterials()) { |
| | |
| | | //根据产品id查询子件及其关联的物料信息 |
| | | public Response getBomAndMaterial(int productId,int version) { |
| | | List<ProductBom> list=mapper.getBomAndMaterial(productId,version); |
| | | if(list!=null&&list.size()>0){ |
| | | list.stream().forEach(bom -> { |
| | | if(bom.getDwgUrl()!=null){ |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("material_id",bom.getMaterialId()); |
| | | wrapper.eq("attach_name",bom.getDwgUrl().substring(bom.getDwgUrl().lastIndexOf("\\")+1)); |
| | | wrapper.last("limit 1"); |
| | | AttachLock attachLock=attachLockMapper.selectOne(wrapper); |
| | | if(attachLock!=null){ |
| | | bom.setDwgUrl(""); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | return new Response().setII(1,list.size()>0,list,"返回物料信息及关联物料"); |
| | | } |
| | | |
| | |
| | | public List<ProductBom> getEnabledBomListByParentCodeAndCustomCode(String parentCode, String customCode) { |
| | | return mapper.getEnabledBomListByParentCodeAndCustomCode(parentCode,customCode); |
| | | } |
| | | |
| | | } |