|
|
@@ -13,6 +13,7 @@ import com.cyksj.model.views.HomeManagementConfigView;
|
|
|
import com.cyksj.service.home.HomeManagementConfigService;
|
|
|
import com.cyksj.service.mange.GoodsDonCategoryService;
|
|
|
import com.cyksj.service.mange.RefreshCacheService;
|
|
|
+import com.cyksj.service.translations.BackInfoTranslationsFrontService;
|
|
|
import com.cyksj.service.translations.BackInfoTranslationsService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
@@ -45,6 +46,8 @@ public class HomeManageConfigController {
|
|
|
|
|
|
private final BackInfoTranslationsService backInfoTranslationsService;
|
|
|
|
|
|
+ private final BackInfoTranslationsFrontService backInfoTranslationsFrontService;
|
|
|
+
|
|
|
/**
|
|
|
* 新增首页配置
|
|
|
*/
|
|
|
@@ -151,10 +154,16 @@ public class HomeManageConfigController {
|
|
|
SearchResult<HomeManagementConfigView> search = beanSearcher.search(HomeManagementConfigView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.field(HomeManagementConfigView::getType, type.name())
|
|
|
.build());
|
|
|
+ String lang = request.getHeader("lang");
|
|
|
search.getDataList().forEach(data -> {
|
|
|
Number number = beanSearcher.searchCount(HomeManagementConfigUserClickRecord.class, MapUtils.builder()
|
|
|
.field(HomeManagementConfigUserClickRecord::getConfigId, data.getId()).build());
|
|
|
data.setClick(number.intValue());
|
|
|
+ if (data.getType() == HomeManagementConfig.Type.rg) {
|
|
|
+ if (lang != null && !StrUtil.equals(UserPageLanguage.Language.zh_CN.name(), lang)) {
|
|
|
+ backInfoTranslationsFrontService.setFieldLanguage(data.getClass(), data, BackInfoTranslations.Type.home_config.ordinal(), data.getId(), lang);
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|