小横幅更改,更改条件查询

This commit is contained in:
liuyingfang
2024-04-11 16:31:59 +08:00
parent 05bf581734
commit 5946c78cf9
8 changed files with 246 additions and 20 deletions

View File

@@ -2,14 +2,18 @@ package com.chaozhanggui.system.cashierservice.service;
import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.entity.Enum.LogoEnum;
import com.chaozhanggui.system.cashierservice.entity.dto.HomeDto;
import com.chaozhanggui.system.cashierservice.entity.vo.*;
import com.chaozhanggui.system.cashierservice.redis.RedisUtil;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.*;
import com.chaozhanggui.system.cashierservice.util.DateUtils;
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
import com.chaozhanggui.system.cashierservice.util.Threads;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@@ -44,6 +48,8 @@ public class HomePageService {
private SysDictDetailMapper sysDictDetailMapper;
@Resource
private TagProductDeptsMapper tagProductDeptsMapper;
@Autowired
private RedisUtil redisUtil;
public Result homePage(HomeDto homeDto, String environmen) throws ExecutionException, InterruptedException {
@@ -182,15 +188,31 @@ public class HomePageService {
/**
* 小条幅
*/
TbSystemCoupons tbSystemCoupons = productMapper.selectLimit();
BannerVO bannerVO = new BannerVO();
bannerVO.setCoupons(tbSystemCoupons == null?"":tbSystemCoupons.getName());
List<TbPlatformDict> tbPlatformDicts = platformDictMapper.queryAllByType("icon", environment);
bannerVO.setLogo(tbPlatformDicts);
homeUpVO.setBannerVO(bannerVO);
homeUpVO.setBannerVO(bannerVoRandom());
return Result.success(CodeEnum.SUCCESS, homeUpVO);
}
/**
* 小条幅随机数据
* @return
*/
private BannerVO bannerVoRandom(){
BannerVO bannerVO = new BannerVO();
List<BannerInfoVo> bannerInfoList = new ArrayList<>();
for (int i = 0; i < 10; i++) {
BannerInfoVo bannerInfoVo = new BannerInfoVo();
bannerInfoVo.setName(StringUtil.generateRandomNickname(5));
bannerInfoVo.setLogo(LogoEnum.getValueByKey(RandomUtil.randomInt()));
bannerInfoVo.setMoney(RandomUtil.randomDecimalGenerator());
bannerInfoList.add(bannerInfoVo);
}
bannerVO.setCounponsInfo(bannerInfoList);
bannerVO.setCoupons(redisUtil.getMessage("num"));
return bannerVO;
}
}