From 2a061df05dc73cff2e6e0b6ad34b6bb900593de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=A4=A9=E5=B0=A7?= <10594804+zhangtianyao1578@user.noreply.gitee.com> Date: Wed, 9 Apr 2025 17:44:55 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8E=BB=E6=8E=89pc=E7=AB=AF=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=BC=B9=E7=AA=97=202.=E9=A1=B5=E8=84=9A=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E8=B7=AF=E5=BE=84=E4=BF=AE=E6=94=B9=203.=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=A1=B5=E8=84=9A=E5=AF=B9=E5=BA=94=E7=9A=84=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E6=96=B9=E6=B3=95=E3=80=81=E7=B1=BB=E3=80=81=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constants/SysConfigConstants.java | 7 ++ .../com/zbkj/pc/controlller/PcController.java | 15 ++- .../zbkj/pc/entity/GroupConfigConstants.java | 43 +++++++ .../com/zbkj/pc/entity/PcBottomQrCodeVo.java | 47 +++++++ .../com/zbkj/pc/entity/PcFriendlyLinkVo.java | 47 +++++++ .../com/zbkj/pc/entity/PcPhilosophyVo.java | 47 +++++++ .../zbkj/pc/entity/PcQuickEntryLinksVo.java | 47 +++++++ .../com/zbkj/pc/entity/PcQuickEntryVo.java | 47 +++++++ .../pc/entity/PcShoppingConfigResponse.java | 70 +++++++++++ .../java/com/zbkj/pc/service/PcService.java | 118 ++++++++++++++++-- pc/components/layoutHeader.vue | 78 ++++++------ pc/layouts/default.vue | 2 +- pc/pages/index.vue | 1 + pc/server/homeApi.ts | 2 +- 14 files changed, 516 insertions(+), 55 deletions(-) create mode 100644 crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/GroupConfigConstants.java create mode 100644 crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcBottomQrCodeVo.java create mode 100644 crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcFriendlyLinkVo.java create mode 100644 crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcPhilosophyVo.java create mode 100644 crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcQuickEntryLinksVo.java create mode 100644 crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcQuickEntryVo.java create mode 100644 crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcShoppingConfigResponse.java diff --git a/crmeb/crmeb-common/src/main/java/com/zbkj/common/constants/SysConfigConstants.java b/crmeb/crmeb-common/src/main/java/com/zbkj/common/constants/SysConfigConstants.java index c7b2fad..0dfe78e 100644 --- a/crmeb/crmeb-common/src/main/java/com/zbkj/common/constants/SysConfigConstants.java +++ b/crmeb/crmeb-common/src/main/java/com/zbkj/common/constants/SysConfigConstants.java @@ -76,4 +76,11 @@ public class SysConfigConstants { public static final String CONFIG_YUE_PAY_STATUS = "yue_pay_status"; /** 支付宝支付状态 */ public static final String CONFIG_ALI_PAY_STATUS = "ali_pay_status"; + + + + + + + } diff --git a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/controlller/PcController.java b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/controlller/PcController.java index 70b8703..c53019e 100644 --- a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/controlller/PcController.java +++ b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/controlller/PcController.java @@ -1,7 +1,7 @@ package com.zbkj.pc.controlller; import com.zbkj.common.response.CommonResult; -import com.zbkj.pc.entity.PcHomeBannerVo; +import com.zbkj.pc.entity.PcShoppingConfigResponse; import com.zbkj.pc.service.PcService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -11,18 +11,17 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import java.util.List; - @Slf4j @RestController("PcController") -@RequestMapping("api/pc") +@RequestMapping("api/pc/home") @Api(tags = "商品") public class PcController { @Autowired PcService pcService; - @ApiOperation(value = "获取首页banner") - @RequestMapping(value = "/get/banner", method = RequestMethod.GET) - public CommonResult> getHomeBanner() { - return CommonResult.success(pcService.getHomeBanner()); + + @ApiOperation(value = "获取首页配置信息") + @RequestMapping(value = "/get/config", method = RequestMethod.GET) + public CommonResult getHomeConfig() { + return CommonResult.success(pcService.getHomeConfig()); } } diff --git a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/GroupConfigConstants.java b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/GroupConfigConstants.java new file mode 100644 index 0000000..646b30a --- /dev/null +++ b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/GroupConfigConstants.java @@ -0,0 +1,43 @@ +package com.zbkj.pc.entity; + +/** + * 组合配置常量类 + * +---------------------------------------------------------------------- + * | CRMEB [ CRMEB赋能开发者,助力企业发展 ] + * +---------------------------------------------------------------------- + * | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved. + * +---------------------------------------------------------------------- + * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 + * +---------------------------------------------------------------------- + * | Author: CRMEB Team + * +---------------------------------------------------------------------- + */ +public class GroupConfigConstants { + + /** tag-首页banner */ + public static final Integer TAG_HOME_BANNER = 1; + /** tag-首页推荐 */ + public static final Integer TAG_HOME_RECOMMEND = 2; + /** tag-经营理念 */ + public static final Integer TAG_PHILOSOPHY = 3; + /** tag-友情链接 */ + public static final Integer TAG_FRIENDLY_LINKS = 4; + /** tag-快捷入口 */ + public static final Integer TAG_QUICK_ENTRY = 5; + /** tag-商户PC店铺Banner */ + public static final Integer TAG_MERCHANT_PC_BANNER = 6; + /** tag-商户PC店铺商品推荐 */ + public static final Integer TAG_MERCHANT_PC_RECOMMEND_PRODUCT = 7; + /** tag-首页底部二维码 */ + public static final Integer TAG_BOTTOM_QR_CODE = 8; + /** tag-首页广告 */ + public static final Integer TAG_HOME_ADVERTISEMENT = 9; + /** tag-首页导航 */ + public static final Integer TAG_HOME_NAVIGATION = 10; + /** tag-付费会员权益 */ + public static final Integer TAG_PAID_MEMBER_BENEFITS = 11; + /** tag-积分区间 */ + public static final Integer TAG_INTEGRAL_INTERVAL = 12; + /** tag_开屏广告数据 */ + public static final Integer TAG_SPLASH_AD_DATA = 13; +} diff --git a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcBottomQrCodeVo.java b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcBottomQrCodeVo.java new file mode 100644 index 0000000..a0d6205 --- /dev/null +++ b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcBottomQrCodeVo.java @@ -0,0 +1,47 @@ +package com.zbkj.pc.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * PC底部二维码Vo对象 + * +---------------------------------------------------------------------- + * | CRMEB [ CRMEB赋能开发者,助力企业发展 ] + * +---------------------------------------------------------------------- + * | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved. + * +---------------------------------------------------------------------- + * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 + * +---------------------------------------------------------------------- + * | Author: CRMEB Team + * +---------------------------------------------------------------------- + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "PcBottomQrCodeVo", description = "PC底部二维码Vo对象") +public class PcBottomQrCodeVo implements Serializable { + + private static final long serialVersionUID = -3097800453211866415L; + + @ApiModelProperty(value = "ID") + private Integer id; + + @ApiModelProperty(value = "二维码名称", required = true) + @NotBlank(message = "请填写二维码名称") + private String name; + + @ApiModelProperty(value = "二维码地址", required = true) + @NotBlank(message = "二维码地址不能为空") + private String imageUrl; + + @ApiModelProperty(value = "排序", required = true) + @NotNull(message = "排序不能为空") + private Integer sort; +} diff --git a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcFriendlyLinkVo.java b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcFriendlyLinkVo.java new file mode 100644 index 0000000..f4e4f6c --- /dev/null +++ b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcFriendlyLinkVo.java @@ -0,0 +1,47 @@ +package com.zbkj.pc.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * PC友情链接Vo对象 + * +---------------------------------------------------------------------- + * | CRMEB [ CRMEB赋能开发者,助力企业发展 ] + * +---------------------------------------------------------------------- + * | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved. + * +---------------------------------------------------------------------- + * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 + * +---------------------------------------------------------------------- + * | Author: CRMEB Team + * +---------------------------------------------------------------------- + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "PcFriendlyLinkVo", description = "PC友情链接Vo对象") +public class PcFriendlyLinkVo implements Serializable { + + private static final long serialVersionUID = -3097800453211866415L; + + @ApiModelProperty(value = "ID") + private Integer id; + + @ApiModelProperty(value = "链接名称", required = true) + @NotBlank(message = "请填写链接名称") + private String name; + + @ApiModelProperty(value = "链接地址", required = true) + @NotBlank(message = "链接地址不能为空") + private String linkUrl; + + @ApiModelProperty(value = "排序", required = true) + @NotNull(message = "排序不能为空") + private Integer sort; +} diff --git a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcPhilosophyVo.java b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcPhilosophyVo.java new file mode 100644 index 0000000..40a50dc --- /dev/null +++ b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcPhilosophyVo.java @@ -0,0 +1,47 @@ +package com.zbkj.pc.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * PC经营理念Vo对象 + * +---------------------------------------------------------------------- + * | CRMEB [ CRMEB赋能开发者,助力企业发展 ] + * +---------------------------------------------------------------------- + * | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved. + * +---------------------------------------------------------------------- + * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 + * +---------------------------------------------------------------------- + * | Author: CRMEB Team + * +---------------------------------------------------------------------- + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "PcPhilosophyVo", description = "PC经营理念Vo对象") +public class PcPhilosophyVo implements Serializable { + + private static final long serialVersionUID = -3097800453211866415L; + + @ApiModelProperty(value = "ID") + private Integer id; + + @ApiModelProperty(value = "图片地址", required = true) + @NotBlank(message = "请选择图片") + private String imageUrl; + + @ApiModelProperty(value = "理念描述", required = true) + @NotBlank(message = "请填写理念描述") + private String name; + + @ApiModelProperty(value = "排序", required = true) + @NotNull(message = "排序不能为空") + private Integer sort; +} diff --git a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcQuickEntryLinksVo.java b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcQuickEntryLinksVo.java new file mode 100644 index 0000000..58ba746 --- /dev/null +++ b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcQuickEntryLinksVo.java @@ -0,0 +1,47 @@ +package com.zbkj.pc.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * PC快捷入口链接Vo对象 + * +---------------------------------------------------------------------- + * | CRMEB [ CRMEB赋能开发者,助力企业发展 ] + * +---------------------------------------------------------------------- + * | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved. + * +---------------------------------------------------------------------- + * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 + * +---------------------------------------------------------------------- + * | Author: CRMEB Team + * +---------------------------------------------------------------------- + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "PcQuickEntryLinksVo", description = "PC快捷入口链接Vo对象") +public class PcQuickEntryLinksVo implements Serializable { + + private static final long serialVersionUID = -3097800453211866415L; + + @ApiModelProperty(value = "ID") + private Integer id; + + @ApiModelProperty(value = "链接名称", required = true) + @NotBlank(message = "请填写链接名称") + private String name; + + @ApiModelProperty(value = "链接地址", required = true) + @NotBlank(message = "链接地址不能为空") + private String linkUrl; + + @ApiModelProperty(value = "排序", required = true) + @NotNull(message = "排序不能为空") + private Integer sort; +} diff --git a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcQuickEntryVo.java b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcQuickEntryVo.java new file mode 100644 index 0000000..a6dacca --- /dev/null +++ b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcQuickEntryVo.java @@ -0,0 +1,47 @@ +package com.zbkj.pc.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * PC快捷入口Vo对象 + * +---------------------------------------------------------------------- + * | CRMEB [ CRMEB赋能开发者,助力企业发展 ] + * +---------------------------------------------------------------------- + * | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved. + * +---------------------------------------------------------------------- + * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 + * +---------------------------------------------------------------------- + * | Author: CRMEB Team + * +---------------------------------------------------------------------- + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "PcQuickEntryVo", description = "PC快捷入口Vo对象") +public class PcQuickEntryVo implements Serializable { + + private static final long serialVersionUID = -3097800453211866415L; + + @ApiModelProperty(value = "ID") + private Integer id; + + @ApiModelProperty(value = "入口名称", required = true) + @NotBlank(message = "请填写入口名称") + private String name; + + @ApiModelProperty(value = "排序", required = true) + @NotNull(message = "排序不能为空") + private Integer sort; + + @ApiModelProperty(value = "快捷入口链接组") + private List linkList; +} diff --git a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcShoppingConfigResponse.java b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcShoppingConfigResponse.java new file mode 100644 index 0000000..87c022c --- /dev/null +++ b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/entity/PcShoppingConfigResponse.java @@ -0,0 +1,70 @@ +package com.zbkj.pc.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +/** + * PC配置信息响应对象 + * +---------------------------------------------------------------------- + * | CRMEB [ CRMEB赋能开发者,助力企业发展 ] + * +---------------------------------------------------------------------- + * | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved. + * +---------------------------------------------------------------------- + * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 + * +---------------------------------------------------------------------- + * | Author: CRMEB Team + * +---------------------------------------------------------------------- + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "PcShoppingConfigResponse", description = "PC配置信息响应对象") +public class PcShoppingConfigResponse implements Serializable { + + private static final long serialVersionUID = -4585094537501770138L; + + @ApiModelProperty(value = "PC商城—左上角logo") + private String leftTopLogo; + + @ApiModelProperty(value = "PC商城—品牌好店广告图") + private String goodStoreImage; + + @ApiModelProperty(value = "PC商城—手机体验购买二维码类型 1:小程序 2:公众号/H5") + private String goPhoneQrCodeType; + +// @ApiModelProperty(value = "联系电话") +// private String phone; +// +// @ApiModelProperty(value = "地址") +// private String address; +// +// @ApiModelProperty(value = "授权信息") +// private String authInfo; +// +// @ApiModelProperty(value = "备案号") +// private String filingNum; + +// @ApiModelProperty(value = "首页广告") +// private PcHomeAdvertisementVo advertisement; + + @ApiModelProperty(value = "经营理念列表") + private List philosophyList; + + @ApiModelProperty(value = "友情链接列表") + private List friendlyLinkList; + + @ApiModelProperty(value = "快捷入口列表") + private List quickEntryList; + + @ApiModelProperty(value = "二维码列表") + private List qrCodeList; + +// @ApiModelProperty(value = "首页导航列表") +// private List homeNavigationList; +} diff --git a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/service/PcService.java b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/service/PcService.java index a0da051..8360e6a 100644 --- a/crmeb/crmeb-front/src/main/java/com/zbkj/pc/service/PcService.java +++ b/crmeb/crmeb-front/src/main/java/com/zbkj/pc/service/PcService.java @@ -1,17 +1,16 @@ package com.zbkj.pc.service; import cn.hutool.core.collection.CollUtil; -import cn.hutool.json.JSON; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.google.gson.Gson; -import com.zbkj.common.model.system.SystemFormTemp; +import com.zbkj.common.constants.Constants; import com.zbkj.common.model.system.SystemGroupData; import com.zbkj.pc.dao.GroupConfigDao; -import com.zbkj.pc.entity.GroupConfig; -import com.zbkj.pc.entity.PcHomeBannerVo; +import com.zbkj.pc.entity.*; import com.zbkj.service.service.SystemGroupDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,11 +18,15 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.stream.Collectors; + @Service public class PcService { @Autowired SystemGroupDataService systemGroupDataService; @Autowired + GroupConfigDao systemGroupConfigDao; + @Autowired private GroupConfigDao groupConfigDao; public List getHomeBanner() { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); @@ -58,8 +61,6 @@ public class PcService { JSONArray array= (JSONArray) jsonObject.get("fields"); jsonObject= (JSONObject) array.get(0); // vo.setImageUrl(jsonObject.get("")); -// vo.setName(config.getName()); -// vo.setLinkUrl(config.getLinkUrl()); vo.setSort(config.getSort()); vo.setImageUrl(jsonObject.get("value").toString()); voList.add(vo); @@ -75,4 +76,107 @@ public class PcService { JSONObject js= (JSONObject) array.get(0); System.out.println(js.get("value")); } + public PcShoppingConfigResponse getHomeConfig() { + List keyList = new ArrayList<>(); +// keyList.add(SysConfigConstants.PC_SHOPPING_LEFT_TOP_LOGO); +// keyList.add(SysConfigConstants.PC_SHOPPING_GOOD_STORE_IMAGE); +// keyList.add(SysConfigConstants.PC_SHOPPING_GO_PHONE_QR_CODE_TYPE); +// +// MyRecord myRecord = systemConfigService.getValuesByKeyList(keyList); + PcShoppingConfigResponse response = new PcShoppingConfigResponse(); +// response.setLeftTopLogo(myRecord.getStr(SysConfigConstants.PC_SHOPPING_LEFT_TOP_LOGO)); +// response.setGoodStoreImage(myRecord.getStr(SysConfigConstants.PC_SHOPPING_GOOD_STORE_IMAGE)); +// response.setGoPhoneQrCodeType(myRecord.getStr(SysConfigConstants.PC_SHOPPING_GO_PHONE_QR_CODE_TYPE)); + + response.setPhilosophyList(getPhilosophyList()); + response.setFriendlyLinkList(getFriendlyLinkList()); + response.setQuickEntryList(getQuickEntryList()); + response.setQrCodeList(getBottomQrCodeList()); +// response.setAdvertisement(getHomeAdvertisement()); +// response.setHomeNavigationList(getHomeNavigationList()); + return response; + } + private List getFriendlyLinkList() { + List configList =findByTag(GroupConfigConstants.TAG_FRIENDLY_LINKS, Constants.SORT_ASC, true); + if (CollUtil.isEmpty(configList)) { + return new ArrayList<>(); + } + Iterator iterator = configList.iterator(); + List voList = new ArrayList<>(); + while (iterator.hasNext()) { + GroupConfig config = iterator.next(); + PcFriendlyLinkVo vo = new PcFriendlyLinkVo(); + vo.setId(config.getId()); + vo.setName(config.getName()); + vo.setLinkUrl(config.getLinkUrl()); + vo.setSort(config.getSort()); + voList.add(vo); + } + return voList; + } + private List getPhilosophyList() { + List configList = findByTag(GroupConfigConstants.TAG_PHILOSOPHY, Constants.SORT_ASC, true); + if (CollUtil.isEmpty(configList)) { + return new ArrayList<>(); + } + Iterator iterator = configList.iterator(); + List voList = new ArrayList<>(); + while (iterator.hasNext()) { + GroupConfig config = iterator.next(); + PcPhilosophyVo vo = new PcPhilosophyVo(); + vo.setId(config.getId()); + vo.setImageUrl(config.getImageUrl()); + vo.setName(config.getName()); + vo.setSort(config.getSort()); + voList.add(vo); + } + return voList; + } + public List findByTag(Integer tag, String sortRule, Boolean status) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(GroupConfig::getTag, tag); + lqw.eq(GroupConfig::getIsDel, 0); + if (ObjectUtil.isNotNull(status)) { + lqw.eq(GroupConfig::getStatus, status ? 1 : 0); + } + if (StrUtil.isBlank(sortRule) || sortRule.equals(Constants.SORT_ASC)) { + lqw.orderByAsc(GroupConfig::getSort); + } else { + lqw.orderByDesc(GroupConfig::getSort); + } + lqw.orderByDesc(GroupConfig::getId); + return systemGroupConfigDao.selectList(lqw); + } + private List getQuickEntryList() { + List configList = findByTag(GroupConfigConstants.TAG_QUICK_ENTRY, Constants.SORT_ASC, true); + if (CollUtil.isEmpty(configList)) { + return new ArrayList<>(); + } + return configList.stream().map(confing -> { + PcQuickEntryVo quickEntryVo = new PcQuickEntryVo(); + quickEntryVo.setId(confing.getId()); + quickEntryVo.setName(confing.getName()); + quickEntryVo.setSort(confing.getSort()); + if (StrUtil.isNotBlank(confing.getExpand())) { + List linksVoList = com.alibaba.fastjson.JSONArray.parseArray(confing.getExpand(), PcQuickEntryLinksVo.class); + quickEntryVo.setLinkList(linksVoList); + } + return quickEntryVo; + }).collect(Collectors.toList()); + } + + private List getBottomQrCodeList() { + List codeConfigList = findByTag(GroupConfigConstants.TAG_BOTTOM_QR_CODE, Constants.SORT_ASC, null); + if (CollUtil.isEmpty(codeConfigList)) { + return CollUtil.newArrayList(); + } + return codeConfigList.stream().map(codeConfig -> { + PcBottomQrCodeVo codeVo = new PcBottomQrCodeVo(); + codeVo.setId(codeConfig.getId()); + codeVo.setImageUrl(codeConfig.getImageUrl()); + codeVo.setSort(codeConfig.getSort()); + codeVo.setName(codeConfig.getName()); + return codeVo; + }).collect(Collectors.toList()); + } } diff --git a/pc/components/layoutHeader.vue b/pc/components/layoutHeader.vue index 3246162..f167a0b 100644 --- a/pc/components/layoutHeader.vue +++ b/pc/components/layoutHeader.vue @@ -82,8 +82,36 @@ - + @@ -112,34 +140,7 @@ - + @@ -178,14 +179,14 @@