| | |
| | | } |
| | | if(filePath.length>=0){ |
| | | for(String temp : filePath) { |
| | | //产品下载不包含带有bom的图片 |
| | | if(temp.contains("bom")){ |
| | | continue; |
| | | }else{ |
| | | //添加满足情况的条件 |
| | | if(new File(sourcePathDir + File.separator + temp ).isFile()) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("product_id",productId); |
| | | wrapper.eq("attach_name",temp); |
| | | wrapper.eq("lock_flag",1); |
| | | wrapper.last("limit 1"); |
| | | AttachLock attachLock=attachLockMapper.selectOne(wrapper); |
| | | if(attachLock==null){ |
| | | //为文件则进行拷贝 |
| | | copyFile(new File(sourcePathDir + File.separator + temp ), newPathDir ); |
| | | } |
| | | //添加满足情况的条件 |
| | | if(new File(sourcePathDir + File.separator + temp ).isFile()) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("product_id",productId); |
| | | wrapper.eq("attach_name",temp); |
| | | wrapper.eq("lock_flag",1); |
| | | wrapper.last("limit 1"); |
| | | AttachLock attachLock=attachLockMapper.selectOne(wrapper); |
| | | if(attachLock==null){ |
| | | //为文件则进行拷贝 |
| | | copyFile(new File(sourcePathDir + File.separator + temp ), newPathDir ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | public void updateUrl(List<ProductBomApproving> fileBomApprovingList) { |
| | | mapper.updateUrl(fileBomApprovingList); |
| | |
| | | private ProductBom copyMaterialToBom(Material m) { |
| | | ProductBom bom=new ProductBom(); |
| | | bom.setType(m.getType()); |
| | | bom.setCategory(m.getCategory()); |
| | | //bom.setCategory(m.getCategory()); |
| | | bom.setSubCode(m.getSubCode()); |
| | | bom.setSubName(m.getSubName()); |
| | | bom.setSubModel(m.getSubModel()); |
| | | bom.setUnit(m.getUnit()); |
| | | //bom.setQuantity(m.getQuantity()); |
| | | bom.setProducer(m.getProducer()); |
| | | bom.setMaterial(m.getMaterial()); |
| | | bom.setThickness(m.getThickness()); |
| | | bom.setSurfaceDetail(m.getSurfaceDetail()); |
| | | bom.setNotes(m.getNotes()); |
| | | //bom.setProducer(m.getProducer()); |
| | | //bom.setMaterial(m.getMaterial()); |
| | | //bom.setThickness(m.getThickness()); |
| | | //bom.setSurfaceDetail(m.getSurfaceDetail()); |
| | | //bom.setNotes(m.getNotes()); |
| | | bom.setPictureUrl(m.getPictureUrl()); |
| | | bom.setDwgUrl(m.getDwgUrl()); |
| | | bom.setFileUrl(m.getFileUrl()); |
| | |
| | | return mapper.getEnabledBomListByParentCodeAndCustomCode(parentCode,customCode); |
| | | } |
| | | |
| | | public void updateMaterialField2Bom() { |
| | | List<ProductBom> bomList = mapper.selectListWithMaterialField(); |
| | | mapper.updateMaterialField2BomBatch(bomList); |
| | | } |
| | | } |