| | |
| | | package com.ruoyi.goods.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | LocalDateTime newTime7 = now.minusYears(30); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears,parseTime7); |
| | | wrapper3.le(GoodsSku::getYears, DateUtil.format(parseTime7, "yyyy")); |
| | | } |
| | | if(homeGoodsSkuDTO.getYear()==3){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | |
| | | LocalDateTime newTime15 = now.minusYears(15); |
| | | String formattedDate15 = newTime15.format(formatter); |
| | | LocalDateTime parseTime15= LocalDate.parse(formattedDate15).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears, parseTime15) |
| | | .gt(GoodsSku::getYears, parseTime7); |
| | | wrapper3.le(GoodsSku::getYears, DateUtil.format(parseTime15, "yyyy")) |
| | | .gt(GoodsSku::getYears, DateUtil.format(parseTime7, "yyyy")); |
| | | } |
| | | |
| | | if(homeGoodsSkuDTO.getYear()==4){ |
| | |
| | | LocalDateTime newTime15 = now.minusYears(15); |
| | | String formattedDate15 = newTime15.format(formatter); |
| | | LocalDateTime parseTime15= LocalDate.parse(formattedDate15).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears, parseTime7) |
| | | .gt(GoodsSku::getYears, parseTime15); |
| | | wrapper3.le(GoodsSku::getYears, DateUtil.format(parseTime7, "yyyy")) |
| | | .gt(GoodsSku::getYears, DateUtil.format(parseTime15, "yyyy")); |
| | | } |
| | | |
| | | if(homeGoodsSkuDTO.getYear()==5){ |
| | |
| | | LocalDateTime newTime7 = now.minusYears(1); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | |
| | | LocalDateTime newTime15 = now.minusYears(5); |
| | | String formattedDate15 = newTime15.format(formatter); |
| | | LocalDateTime parseTime15= LocalDate.parse(formattedDate15).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears, parseTime7) |
| | | .ge(GoodsSku::getYears, parseTime15); |
| | | wrapper3.le(GoodsSku::getYears, DateUtil.format(parseTime7, "yyyy")) |
| | | .ge(GoodsSku::getYears, DateUtil.format(parseTime15, "yyyy")); |
| | | } |
| | | if (homeGoodsSkuDTO.getSort()==1){ |
| | | wrapper3.last(" ORDER BY IF(isnull(sort_num),1,0), sort_num DESC,create_time DESC"); |
| | |
| | | public HomeGoodsSkuInfoVO getHomeGoodsSkuInfo(HomeGoodsSkuDTO homeGoodsSkuDTO) { |
| | | GoodsSku byId = this.getById(homeGoodsSkuDTO.getGoodsSkuId()); |
| | | HomeGoodsSkuInfoVO homeGoodsSkuInfoVO=new HomeGoodsSkuInfoVO(); |
| | | homeGoodsSkuInfoVO.setId(byId.getId()); |
| | | homeGoodsSkuInfoVO.setSkuName(byId.getSkuName()); |
| | | homeGoodsSkuInfoVO.setYears(String.valueOf(byId.getYears().getYear())); |
| | | GoodsBrand data = goodsSkuClient.getBrandOne(byId.getBrandId(), SecurityConstants.INNER).getData(); |
| | |
| | | .eq(GoodsGroupPurchase::getStartStatus, |
| | | StartStatusEnum.STARTED); |
| | | GoodsGroupPurchase goodsGroupPurchase = goodsGroupPurchaseMapper.selectOne(queryWrapper1); |
| | | log.info("团购商品信息=================》:{}", goodsGroupPurchase); |
| | | if(goodsGroupPurchase!=null){ |
| | | HomeGoodsSkuDTO homeGoodsSkuDTO1 =new HomeGoodsSkuDTO(); |
| | | homeGoodsSkuDTO1.setGoodsSkuId(goodsGroupPurchase.getId()); |
| | | homeGoodsSkuDTO1.setMemberId(homeGoodsSkuDTO.getMemberId()); |
| | | Order data4 = orderClient.getOrderByGroupPurchaseMemberId2(homeGoodsSkuDTO1, SecurityConstants.INNER).getData(); |
| | | if (data4!=null){ |
| | | log.info("关联订单信息=================》:{}", data4); |
| | | homeGoodsSkuInfoVO.setId(goodsGroupPurchase.getId()); |
| | | homeGoodsSkuInfoVO.setIsGoodsGroupPurchase(1); |
| | | if (data4 != null) { |
| | | homeGoodsSkuInfoVO.setIsGoodsGroupPurchase(2); |
| | | }else{ |
| | | homeGoodsSkuInfoVO.setIsGoodsGroupPurchase(1); |
| | | } |
| | | |
| | | }else{ |
| | | log.info( |
| | | "=============================没有查询到团购信息============================="); |
| | | homeGoodsSkuInfoVO.setIsGoodsGroupPurchase(1); |
| | | } |
| | | |