From a5ac267277e6e03073302d602423a4ffba4de8ff Mon Sep 17 00:00:00 2001 From: "1304317391@qq.com" Date: Mon, 28 Nov 2022 15:33:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=A2=9E=E5=8A=A0=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=9B=BE=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-local.yaml | 2 +- .../impl/YxStoreBargainServiceImpl.java | 3 +- .../impl/YxStoreCombinationServiceImpl.java | 3 +- .../impl/YxStoreSeckillServiceImpl.java | 43 ++++++++++--------- .../activity/vo/YxStoreBargainQueryVo.java | 4 ++ .../vo/YxStoreCombinationQueryVo.java | 3 ++ .../activity/vo/YxStoreSeckillQueryVo.java | 3 ++ .../product/domain/YxStoreProduct.java | 5 +++ .../product/rest/StoreProductController.java | 1 + .../product/service/dto/ProductDto.java | 3 ++ .../product/service/dto/StoreProductDto.java | 4 ++ .../impl/YxStoreProductServiceImpl.java | 3 +- .../product/vo/YxStoreProductQueryVo.java | 3 ++ 13 files changed, 55 insertions(+), 25 deletions(-) diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 52596901..a0f93795 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -270,7 +270,7 @@ dubbo: bxg: shop: # API_URL: http://192.168.10.113:48080/bxgApp - API_URL: http://7c539556.r5.cpolar.top + API_URL: http://719e20d2.r5.cpolar.top SITE_URL: http://192.168.10.113:48080/bxgApp UNI_SITE_URL: http://192.168.10.113:48080/bxgApp ADMIN_API_URL: http://192.168.10.113:48080/bxg diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java index 38dbf20c..a92a05cd 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java @@ -333,7 +333,8 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl)returnMap.get("productAttr")) .productValue((Map)returnMap.get("productValue")) - .storeInfo(generator.convert(storeSeckill, YxStoreSeckillQueryVo.class).setConfig(storeProductMapper.selectById(storeSeckill.getProductId()).getConfig())) + .storeInfo(generator.convert(storeSeckill, YxStoreSeckillQueryVo.class).setConfig(storeProductMapper.selectById(storeSeckill.getProductId()).getConfig()) + .setLinkImage(storeProductMapper.selectById(storeSeckill.getProductId()).getLinkImage())) .reply(replyService.getReply(storeSeckill.getProductId())) .replyCount(replyService.productReplyCount(storeSeckill.getProductId())) .tempName(tempName) @@ -248,6 +249,8 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl pageModel = new Page<>(page, limit); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) -// .eq(YxStoreSeckill::getTimeId,time) .in(YxStoreSeckill::getTimeId,idList) .le(YxStoreSeckill::getStartTime,nowTime) .ge(YxStoreSeckill::getStopTime,nowTime) @@ -298,6 +300,11 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl getSeckillingList(int page,int limit) { Page pageModel = new Page<>(page, limit); SeckillConfigVo seckillConfigVo=yxStoreSeckillService.getStoreSeckil(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) + .le(YxStoreSeckill::getStartTime,new Date()) + .ge(YxStoreSeckill::getStopTime,new Date()) + .orderByDesc(YxStoreSeckill::getSort); List timeIds=new ArrayList<>(); seckillConfigVo.getSeckillTime().forEach(seckillTimeDto -> { if (seckillTimeDto.getStatus()==1){ @@ -305,32 +312,26 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl0){ //抢购中的商品数量不为0 - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) - .le(YxStoreSeckill::getStartTime,new Date()) - .ge(YxStoreSeckill::getStopTime,new Date()) - .in(YxStoreSeckill::getTimeId,timeIds) - .orderByDesc(YxStoreSeckill::getSort); - List yxStoreSeckillQueryVos = generator.convert - (yxStoreSeckillMapper.selectPage(pageModel,wrapper).getRecords(), - YxStoreSeckillQueryVo.class); + wrapper.in(YxStoreSeckill::getTimeId,timeIds); + List yxStoreSeckillQueryVos = generator.convert + (yxStoreSeckillMapper.selectPage(pageModel,wrapper).getRecords(), YxStoreSeckillQueryVo.class); yxStoreSeckillQueryVos.forEach(item->{ Integer sum = item.getSales() + item.getStock(); item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum), 100),0).intValue()); }); return yxStoreSeckillQueryVos; - } } - return null; - + wrapper.eq(YxStoreSeckill::getTimeId,-1); + List yxStoreSeckillQueryVos = generator.convert + (yxStoreSeckillMapper.selectPage(pageModel,wrapper).getRecords(), + YxStoreSeckillQueryVo.class); + yxStoreSeckillQueryVos.forEach(item->{ + Integer sum = item.getSales() + item.getStock(); + item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum), + 100),0).intValue()); + }); + return yxStoreSeckillQueryVos; }; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreBargainQueryVo.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreBargainQueryVo.java index 9711a964..2f921c63 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreBargainQueryVo.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreBargainQueryVo.java @@ -37,6 +37,10 @@ public class YxStoreBargainQueryVo implements Serializable { @ApiModelProperty(value = "砍价活动图片") private String image; + + @ApiModelProperty(value = "链接图片") + private String linkImage; + //七天无理由等配置 private List config; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreCombinationQueryVo.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreCombinationQueryVo.java index 75d690c8..c75c528e 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreCombinationQueryVo.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreCombinationQueryVo.java @@ -42,6 +42,9 @@ public class YxStoreCombinationQueryVo implements Serializable { @ApiModelProperty(value = "推荐图") private String image; + @ApiModelProperty(value = "链接图") + private String linkImage; + @ApiModelProperty(value = "轮播图") private String images; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreSeckillQueryVo.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreSeckillQueryVo.java index 4aa6057e..69239153 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreSeckillQueryVo.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreSeckillQueryVo.java @@ -38,6 +38,9 @@ public class YxStoreSeckillQueryVo implements Serializable{ @ApiModelProperty(value = "推荐图") private String image; + @ApiModelProperty(value = "链接图") + private String linkImage; + //七天无理由价保等 private List config; @ApiModelProperty(value = "轮播图") diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java index 9596de64..ff8741f2 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java @@ -64,6 +64,11 @@ public class YxStoreProduct extends BaseDomain { @ApiModelProperty(value = "商品图片") private String image; + /** 商品链接的图片 */ + @NotBlank(message = "请上传商品链接图片") + @ApiModelProperty(value = "商品链接图片") + private String linkImage; + /** 轮播图 */ @NotBlank(message = "请上传商品轮播图") diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java index 1565fba2..5eb3842a 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java @@ -243,6 +243,7 @@ public class StoreProductController { productDto.setHotListId(yxStoreProduct.getHotListId()); productDto.setHotSales(yxStoreProduct.getHotSales()); productDto.setBenefitSort(yxStoreProduct.getBenefitSort()); + productDto.setLinkImage(yxStoreProduct.getLinkImage()); productDto.setBestSort(yxStoreProduct.getBestSort()); BeanUtil.copyProperties(yxStoreProduct,productDto,"sliderImage"); productDto.setSliderImage(Arrays.asList(yxStoreProduct.getSliderImage().split(","))); diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/ProductDto.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/ProductDto.java index a8d9a38d..9b697d34 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/ProductDto.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/ProductDto.java @@ -31,6 +31,9 @@ public class ProductDto { /** 商品图片 */ private String image; + /** 商品链接的图片 */ + private String linkImage; + /** 轮播图 */ @JsonProperty("slider_image") private List sliderImage; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/StoreProductDto.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/StoreProductDto.java index 6ba70158..07dc76b7 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/StoreProductDto.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/StoreProductDto.java @@ -37,6 +37,10 @@ public class StoreProductDto // @NotBlank(message = "商品图片必传") private String image; + /** 商品分享的链接的图片 */ +// @NotBlank(message = "商品图片必传") + private String linkImage; + /** 轮播图 */ // @NotNull(message = "轮播图不为空") @JsonProperty("slider_image") diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java index 2a0fa0ce..f4db2252 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java @@ -302,7 +302,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl pageModel = new Page<>(productQueryParam.getPage(), @@ -637,6 +637,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl