@@ -375,6 +375,35 @@ public Result<FileResult> readFilesAndbulkCreate(String lang, MultipartFile file
375375 return Result .success (i18nFileResult );
376376 }
377377
378+ /**
379+ * 通过app查询表t_i18n_entry所有信息
380+ *
381+ * @return the 18 n entry list result
382+ */
383+ @ Override
384+ public I18nEntryListResult findI18nEntryByApp (Integer host , String hostType ) {
385+ I18nEntryListResult i18nEntriesListResult = new I18nEntryListResult ();
386+ // 获取所属应用/区块的 语言列表 getHostLangs
387+ List <I18nLang > i18nLangsList = getHostLangs ();
388+ if (i18nLangsList == null || i18nLangsList .isEmpty ()) {
389+ return i18nEntriesListResult ;
390+ }
391+ // 获取词条列表
392+ List <I18nEntryDto > i18nEntriesList = i18nEntryMapper .findI18nEntriesByHostandHostType (host , hostType );
393+ if (i18nEntriesList == null ) {
394+ return i18nEntriesListResult ;
395+ }
396+ // 格式化词条列表
397+ SchemaI18n messages = formatEntriesList (i18nEntriesList );
398+ List <I18nLang > i18nLangsListTemp = i18nLangsList .stream ()
399+ .map (i18nLang -> new I18nLang (i18nLang .getLang (), i18nLang .getLabel ()))
400+ .collect (Collectors .toList ());
401+
402+ i18nEntriesListResult .setI18nLangsList (i18nLangsListTemp );
403+ i18nEntriesListResult .setMessages (messages );
404+ return i18nEntriesListResult ;
405+ }
406+
378407 /**
379408 * 批量创建或修改
380409 *
@@ -449,7 +478,7 @@ public List<EntriesItem> parseZipFileStream(MultipartFile file) throws Exception
449478 // 解压ZIP文件并处理
450479 List <FileInfo > fileInfos = Utils .unzip (file );
451480 for (FileInfo fileInfo : fileInfos ) {
452- entriesItems = parseZip (fileInfo );
481+ entriesItems . addAll ( parseZip (fileInfo ) );
453482 }
454483 return entriesItems ;
455484 }
@@ -530,7 +559,7 @@ private EntriesItem setLang(String fileName) {
530559 } else {
531560 name = fileName .substring (0 , lastDotIndex ); // 返回不带扩展名的文件名
532561 }
533- if (Enums .I18nFileName .EN_US .getValue (). equals ( name )) {
562+ if (name . contains ( Enums .I18nFileName .EN_US .getValue ())) {
534563 entriesItem .setLang (2 );
535564 } else {
536565 entriesItem .setLang (1 );
0 commit comments