| | |
| | | import cn.hutool.core.util.ZipUtil; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/visual/service/impl/VisualCompServiceImpl.class */ |
| | | |
| | | public class VisualCompServiceImpl extends BaseServiceImpl<VisualCompMapper, VisualComp> implements IVisualCompService { |
| | | @Autowired |
| | | @Lazy |
| | | private IVisualCompTypeService visualCompTypeService; |
| | | |
| | | |
| | | @Override // org.springblade.modules.visual.service.IVisualCompService |
| | | |
| | | public IPage<VisualCompVO> pageVO(IPage<VisualComp> page, Map<String, Object> map) { |
| | | String nameStr = (String) map.get("name"); |
| | | String typeStr = (String) map.get("type"); |
| | | List<String> typeList = null; |
| | | if (StringUtils.isNotEmpty(typeStr)) { |
| | | VisualCompType type = (VisualCompType) this.visualCompTypeService.getOne(Lambda.eq((v0) -> { |
| | | return v0.getType(); |
| | | }, typeStr)); |
| | | VisualCompType type = (VisualCompType) this.visualCompTypeService.getOne(Lambda.eq(VisualCompType::getType, typeStr)); |
| | | if (type.getParentId().longValue() == 0L) { |
| | | typeList = (List<String>)this.visualCompTypeService.list(Lambda.eq(VisualCompType::getParentId, type.getId()).select(VisualCompType::getType )) |
| | | .stream().map(VisualCompType::getType).collect(Collectors.toList()); |
| | |
| | | return convert; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.visual.service.IVisualCompService |
| | | @Override |
| | | public void wrapper(List<VisualCompVO> voList) { |
| | | List<VisualCompType> typeList = this.visualCompTypeService.list(Lambda.ne((v0) -> { |
| | | return v0.getParentId(); |
| | | }, 0)); |
| | | List<VisualCompType> typeList = this.visualCompTypeService.list(Lambda.ne(VisualCompType::getParentId, 0)); |
| | | voList.parallelStream().forEach(item -> { |
| | | VisualCompType visualCompType = (VisualCompType) typeList.stream().filter(type -> { |
| | | VisualCompType visualCompType = typeList.stream().filter(type -> { |
| | | return item.getType().equals(type.getType()); |
| | | }).findFirst().orElse(null); |
| | | item.setTypeName((String) Optional.ofNullable(visualCompType).map((v0) -> { |
| | | item.setTypeName(Optional.ofNullable(visualCompType).map((v0) -> { |
| | | return v0.getName(); |
| | | }).orElse(null)); |
| | | }); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.visual.service.IVisualCompService |
| | | @Override |
| | | public BladeFile componentZipDownload(List<Long> componentIds) { |
| | | |
| | | List<String> jsonTexts = list(Lambda.<VisualComp>in((componentIds != null && componentIds.size() != 0), VisualComp::getId, componentIds)) |
| | |
| | | */ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.visual.service.IVisualCompService |
| | | |
| | | public void componentZipImport(MultipartFile zipFile) throws Exception { |
| | | File localZipFile = new File("static/visual/" + IdWorker.get32UUID() + ".zip"); |
| | | FileUtils.copyToFile(zipFile.getInputStream(), localZipFile); |
| | | componentZipImport(localZipFile); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.visual.service.IVisualCompService |
| | | |
| | | public void componentZipImport(File localZipFile) { |
| | | File unzipFile = ZipUtil.unzip(localZipFile); |
| | | File[] files = unzipFile.listFiles(); |