From 610732f74f40132de50b86b63931161460d25e57 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期二, 08 七月 2025 18:21:43 +0800 Subject: [PATCH] ss --- server/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java | 52 +++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 45 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java b/server/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java index cc70261..693916c 100644 --- a/server/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java +++ b/server/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java @@ -22,6 +22,8 @@ import com.doumee.service.system.SystemDictService; import freemarker.template.Configuration; import freemarker.template.Template; +import io.swagger.models.Info; +import io.swagger.models.auth.In; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -250,11 +252,13 @@ } Map<String,Object> dataMap = new HashMap<>(); dataMap.put("webDomain",domain); + dataMap.put("navIndex",objIndex.getNavIndex()); List<Seo> seoList = seoMapper.selectList(new LambdaQueryWrapper<Seo>().eq(Seo::getIsdeleted,Constants.ZERO)); - dataMap.put("seo",getSeoByHtml(Constants.PageIndex.getObj(pageIndex).getHtml(),seoList)); + Seo seo =getSeoByHtml(objIndex.getTemplate(),seoList); + dataMap.put("seo",seo); initDataMapByPage(objIndex,dataMap); - if(objIndex.getKey() == Constants.PageIndex.dynamicsDetail.getKey() || objIndex.getKey() == Constants.PageIndex.dynamicsDetail.getKey() ){ - List<Information> dataList =getInfomationListByType(objIndex.getKey() == Constants.PageIndex.dynamics.getKey() ?Constants.ZERO:Constants.ONE,null); + if(objIndex.getKey() == Constants.PageIndex.dynamicsDetail.getKey() || objIndex.getKey() == Constants.PageIndex.casesDetail.getKey() ){ + List<Information> dataList =getInfomationListByType(objIndex.getKey() == Constants.PageIndex.dynamicsDetail.getKey() ?Constants.ZERO:Constants.ONE,null); generateDetailsHtml(dataList,dataMap,flt,htmlPath+html);//鍗曟枃浠舵暟鎹� }else{ if(objIndex.getKey() == Constants.PageIndex.dynamics.getKey() || objIndex.getKey() == Constants.PageIndex.casesDetail.getKey() ){ @@ -265,12 +269,39 @@ dataMap.put("bannerList", carouselMapper.selectList(new LambdaQueryWrapper<Carousel>() .eq(Carousel::getIsdeleted,Constants.ZERO) .orderByDesc(Carousel::getSortnum ,Carousel::getCreateDate))); - dataMap.put("caseList", getInfomationListByType( Constants.ONE,12)); - dataMap.put("zixunList", getInfomationListByType( Constants.ZERO,12)); + dataMap.put("caseList", getInfomationListByType( Constants.ONE,null)); + List<Information> zixunList = getInfomationListByType( Constants.ZERO,null); + //鎵�灞炴ā鍧� 0琛屼笟璧勮銆�1杩愯惀缁忛獙銆�2鍔熻兘浠嬬粛銆�3甯傚満淇℃伅 + dataMap.put("yunyingJy", getModelFromListByModule( zixunList ,Constants.ONE)); + dataMap.put("gongnengJs", getModelFromListByModule( zixunList ,Constants.TWO)); + dataMap.put("hangyeZx", getModelListFromListByModule( zixunList ,Constants.ZERO)); + dataMap.put("shichangXx", getModelListFromListByModule( zixunList ,Constants.THREE)); } generateSingleHtml(dataMap,flt,htmlPath+html);//鍗曟枃浠舵暟鎹� } return null; + } + + private Information getModelFromListByModule(List<Information> zixunList, Integer m) { + if(zixunList !=null){ + for(Information model :zixunList){ + if(model.getModule()!=null && Constants.equalsInteger(model.getModule(),m)){ + return model; + } + } + } + return new Information(); + } + private List getModelListFromListByModule(List<Information> zixunList, Integer m) { + List<Information> list = new ArrayList<>(); + if(zixunList !=null){ + for(Information model :zixunList){ + if(model.getModule()!=null && Constants.equalsInteger(model.getModule(),m)){ + list.add(model); + } + } + } + return list; } private Seo getSeoByHtml(String html, List<Seo> seoList) { @@ -279,6 +310,11 @@ } for(Seo s :seoList){ if(StringUtils.equalsIgnoreCase(s.getPageAddr(),html)){ + return s; + } + } + for(Seo s :seoList){ + if(StringUtils.equalsIgnoreCase(s.getPageAddr(),Constants.PageIndex.defaultPage.getTemplate())){ return s; } } @@ -301,20 +337,22 @@ } for(Information data :dataList){ dataMap.put("data",data); - generateSingleHtml(dataMap,flt,htmlPath.replace("${id}",data.getId()+""));//鍗曟枃浠舵暟鎹� + String tt =htmlPath.replace("${id}",data.getId()+""); + generateSingleHtml(dataMap,flt,tt);//鍗曟枃浠舵暟鎹� } } private void generateSingleHtml(Map<String, Object> dataMap, String flt, String htmlPath) { try { Configuration configuration = freeMarkerConfigurer.getConfiguration(); + configuration.setDefaultEncoding("utf-8"); Writer out = null; // 鍔犺浇妯$増鏂囦欢 Template template = configuration.getTemplate(flt); // 鐢熸垚鏁版嵁 File docFile = new File( htmlPath); - out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(docFile))); + out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(docFile), "UTF-8")); // 杈撳嚭鏂囦欢 template.process(dataMap,out); } catch (Exception e) { -- Gitblit v1.9.3