File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
app/src/main/java/com/tinyengine/it/config/filter
base/src/main/java/com/tinyengine/it/service/app/impl Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -48,5 +48,4 @@ public CorsFilter corsFilter()
4848 source .registerCorsConfiguration ("/**" , corsConfiguration );
4949 return new CorsFilter (source );
5050 }
51-
52- }
51+ }
Original file line number Diff line number Diff line change @@ -414,17 +414,15 @@ public FileResult bulkInsertOrUpdate(List<I18nEntry> entries) {
414414 int addNum = 0 ;
415415 int updateNum = 0 ;
416416 for (I18nEntry entry : entries ) {
417- // 构建查询条件,假设 key 作为唯一键
418417 // 查询数据库中是否存在该记录
419- I18nEntryDto existingEntry = i18nEntryMapper .findI18nEntriesByKeyAndLang (entry .getKey (), entry .getLang ());
420-
421- if (existingEntry == null ) {
418+ List <I18nEntryDto > i18nEntryList = i18nEntryMapper .queryI18nEntryByCondition (entry );
419+ if (i18nEntryList .isEmpty ()) {
422420 // 插入新记录
423421 i18nEntryMapper .createI18nEntry (entry );
424422 addNum = addNum + 1 ;
425423 } else {
426424 // 更新记录
427- entry .setId (existingEntry .getId ());
425+ entry .setId (i18nEntryList . get ( 0 ) .getId ());
428426 i18nEntryMapper .updateI18nEntryById (entry );
429427 updateNum = updateNum + 1 ;
430428 }
You can’t perform that action at this time.
0 commit comments