From bcadfb6de692c138774688efd7928a973d59860f Mon Sep 17 00:00:00 2001 From: doum <doum> Date: 星期二, 23 九月 2025 13:51:42 +0800 Subject: [PATCH] H5静态化 --- server/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java | 55 ++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 42 insertions(+), 13 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 9d0d0e7..4da47ed 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 @@ -243,11 +243,10 @@ throw new BusinessException(ResponseStatus.BAD_REQUEST); } -// freeMarkerConfigurer.setPreferFileSystemAccess(true); -// freeMarkerConfigurer.setTemplateLoaderPath(queryByCode(Constants.SYSTEM,Constants.PAGE_TEMPLATES_PATH).getCode()); String flt = objIndex.getTemplate();//妯$増鍚嶇О String html = objIndex.getHtml();//椤甸潰鍚嶇О String domain = queryByCode(Constants.SYSTEM,Constants.WEB_DOMAIN).getCode(); + String gitUrl = queryByCode(Constants.SYSTEM,Constants.GIT_CODR_URL).getCode(); String htmlPath = queryByCode(Constants.SYSTEM,Constants.STATIC_PAGES_PATH).getCode(); // domain = "."; // htmlPath = "D://static/"; @@ -257,12 +256,17 @@ } Map<String,Object> dataMap = new HashMap<>(); dataMap.put("webDomain",domain); + dataMap.put("gitCodeUrl",gitUrl); dataMap.put("navIndex",objIndex.getNavIndex()); List<Seo> seoList = seoMapper.selectList(new LambdaQueryWrapper<Seo>().eq(Seo::getIsdeleted,Constants.ZERO)); Seo seo =getSeoByHtml(objIndex.getTemplate(),seoList); dataMap.put("seo",seo); initDataMapByPage(dataMap); if(objIndex.getKey() == Constants.PageIndex.dynamicsDetail.getKey() || objIndex.getKey() == Constants.PageIndex.casesDetail.getKey() ){ + File f = new File(htmlPath+"dynamics/"); + if(!f.exists()){ + f.mkdirs(); + } List<Information> dataList =getInfomationListByType(objIndex.getKey() == Constants.PageIndex.dynamicsDetail.getKey() ?Constants.ZERO:Constants.ONE,null); generateDetailsHtml(dataList,dataMap,flt,htmlPath+html);//鍗曟枃浠舵暟鎹� }else @@ -299,8 +303,6 @@ if(objIndex == null){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } -// freeMarkerConfigurer.setPreferFileSystemAccess(true); -// freeMarkerConfigurer.setTemplateLoaderPaths(queryByCode(Constants.SYSTEM,Constants.PAGE_TEMPLATES_PATH_MOBILE).getCode()); String flt = objIndex.getTemplate();//妯$増鍚嶇О String html = objIndex.getHtml();//椤甸潰鍚嶇О String domain = queryByCode(Constants.SYSTEM,Constants.WEB_DOMAIN_MOBILE).getCode(); @@ -312,34 +314,51 @@ Map<String,Object> dataMap = new HashMap<>(); dataMap.put("webDomain",domain); dataMap.put("navIndex",objIndex.getNavIndex()); + dataMap.put("template",flt); List<Seo> seoList = seoMapper.selectList(new LambdaQueryWrapper<Seo>().eq(Seo::getIsdeleted,Constants.ZERO)); Seo seo =getSeoByHtml(objIndex.getTemplate(),seoList); dataMap.put("seo",seo); initDataMapByPage(dataMap); - if(objIndex.getKey() == Constants.MobilePageIndex.dynamicsDetail.getKey() || objIndex.getKey() == Constants.PageIndex.casesDetail.getKey() ){ - List<Information> dataList =getInfomationListByType(objIndex.getKey() == Constants.MobilePageIndex.dynamicsDetail.getKey() ?Constants.ZERO:Constants.ONE,null); + if(objIndex.getKey() == Constants.MobilePageIndex.dynamicDetail.getKey() || objIndex.getKey() == Constants.PageIndex.casesDetail.getKey() ){ + File f = new File(htmlPath+"dynamics/"); + if(!f.exists()){ + f.mkdirs(); + } + List<Information> dataList =getInfomationListByType(objIndex.getKey() == Constants.MobilePageIndex.dynamicDetail.getKey() ?Constants.ZERO:Constants.ONE,null); generateDetailsHtml(dataList,dataMap,flt,htmlPath+html);//鍗曟枃浠舵暟鎹� - }else - if(objIndex.getKey() == Constants.MobilePageIndex.bannerDetails.getKey() ){ + }else if(objIndex.getKey() == Constants.MobilePageIndex.bannerDetails.getKey() ){ List<Carousel> dataList = carouselMapper.selectList(new LambdaQueryWrapper<Carousel>() .eq(Carousel::getIsdeleted,Constants.ZERO) .eq(Carousel::getJumpType,Constants.ONE)//澶栭摼 .orderByDesc(Carousel::getSortnum ,Carousel::getCreateDate)); generateBannerDetailsHtml(dataList,dataMap,flt,htmlPath+html);//鍗曟枃浠舵暟鎹� - }else{ - if(objIndex.getKey() == Constants.MobilePageIndex.dynamics.getKey() || objIndex.getKey() == Constants.MobilePageIndex.casesDetail.getKey() ){ - dataMap.put("dataList", getInfomationListByType(objIndex.getKey() == Constants.MobilePageIndex.dynamics.getKey() ?Constants.ZERO:Constants.ONE,null)); + }else if(objIndex.getKey() == Constants.MobilePageIndex.dynamics.getKey() ){ + List<Information> zixunList = getInfomationListByType( Constants.ZERO,null); + //鎵�灞炴ā鍧� 0琛屼笟璧勮銆�1杩愯惀缁忛獙銆�2鍔熻兘浠嬬粛銆�3甯傚満淇℃伅 + + dataMap.put("gongnengJs", getModelListFromListByModule( zixunList ,Constants.TWO)); + dataMap.put("hangyeZx", getModelListFromListByModule( zixunList ,Constants.ZERO)); + dataMap.put("shichangXx", getModelListFromListByModule( zixunList ,Constants.THREE)); + for (int i = 0; i < 4; i++) { + dataMap.put("pageTitle",i==0?"琛屼笟璧勮":(i==1?"杩愯惀缁忛獙":(i==2?"鍔熻兘浠嬬粛":"甯傚満淇℃伅"))); + dataMap.put("dataList", getModelListFromListByModule( zixunList,i)); + generateSingleHtml(dataMap,flt,htmlPath+(html.replace("${type}",i+"")));//鍗曟枃浠舵暟鎹� } + }else{ if(objIndex.getKey() == Constants.MobilePageIndex.index.getKey()){ //濡傛灉鏄椤� dataMap.put("bannerList", carouselMapper.selectList(new LambdaQueryWrapper<Carousel>() .eq(Carousel::getIsdeleted,Constants.ZERO) .orderByDesc(Carousel::getSortnum ,Carousel::getCreateDate))); dataMap.put("caseList", getInfomationListByType( Constants.ONE,null)); + } + if(objIndex.getKey() == Constants.MobilePageIndex.index.getKey() + ||objIndex.getKey() == Constants.MobilePageIndex.dynamicIndex.getKey()){ + //濡傛灉鏄椤� 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("yunyingJy", getModelListFromListByModule( zixunList ,Constants.ONE)); + dataMap.put("gongnengJs", getModelListFromListByModule( zixunList ,Constants.TWO)); dataMap.put("hangyeZx", getModelListFromListByModule( zixunList ,Constants.ZERO)); dataMap.put("shichangXx", getModelListFromListByModule( zixunList ,Constants.THREE)); } @@ -403,6 +422,10 @@ } for(Information data :dataList){ dataMap.put("data",data); + if(Constants.equalsInteger(data.getType(),Constants.ZERO)){ + int i = Constants.formatIntegerNum(data.getModule()); + dataMap.put("pageTitle",i==0?"琛屼笟璧勮":(i==1?"杩愯惀缁忛獙":(i==2?"鍔熻兘浠嬬粛":"甯傚満淇℃伅"))); + } String tt =htmlPath.replace("${id}",data.getId()+""); generateSingleHtml(dataMap,flt,tt);//鍗曟枃浠舵暟鎹� } @@ -458,6 +481,12 @@ String path = findDictDataByLabel(dictDataList,Constants.FILE_DIR); footDataVO.setFileDir(path); footDataVO.setFootWords(findDictDataByLabel(dictDataList,Constants.FOOT_WORDS)); + String temp = footDataVO.getFootWords(); + footDataVO.setFootWords1(temp); + if(StringUtils.indexOf(temp,"dmtt.run")>0){ + footDataVO.setFootWords1(temp.substring(0,StringUtils.indexOf(temp,"dmtt.run"))); + footDataVO.setFootWords2(temp.substring(StringUtils.indexOf(temp,"dmtt.run") + "dmtt.run".length())); + } footDataVO.setQyemail(findDictDataByLabel(dictDataList,Constants.QYEMAIL)); footDataVO.setFootImgUrl(findDictDataByLabel(dictDataList,Constants.FOOT_IMGURL)); footDataVO.setFootFullImgUrl(path+ footDataVO.getFootImgUrl()); -- Gitblit v1.9.3