Browse Source

商品增加链接图字段

sj
1304317391@qq.com 2 years ago
parent
commit
a5ac267277
  1. 2
      yudao-server/src/main/resources/application-local.yaml
  2. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java
  3. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java
  4. 43
      zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java
  5. 4
      zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreBargainQueryVo.java
  6. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreCombinationQueryVo.java
  7. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreSeckillQueryVo.java
  8. 5
      zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java
  9. 1
      zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java
  10. 3
      zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/ProductDto.java
  11. 4
      zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/StoreProductDto.java
  12. 3
      zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java
  13. 3
      zsw-bxg/src/main/java/co/yixiang/modules/product/vo/YxStoreProductQueryVo.java

2
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

3
zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java

@ -333,7 +333,8 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
YxStoreBargainQueryVo storeBargainQueryVo = generator.convert(storeBargain,
YxStoreBargainQueryVo.class)
.setConfig(storeProductMapper.selectById(storeBargain.getProductId()).getConfig());
.setConfig(storeProductMapper.selectById(storeBargain.getProductId()).getConfig())
.setLinkImage(storeProductMapper.selectById(storeBargain.getProductId()).getLinkImage());
YxUser yxUser;
if (StringUtils.isBlank(uid.toString())||uid==0){
yxUser=new YxUser();

3
zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java

@ -137,7 +137,8 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
StoreCombinationVo storeCombinationVo = new StoreCombinationVo();
storeCombinationVo.setStoreInfo(storeCombinationQueryVo.setConfig(storeProductMapper.selectById(storeCombination.getProductId()).getConfig()));
storeCombinationVo.setStoreInfo(storeCombinationQueryVo.setConfig(storeProductMapper.selectById(storeCombination.getProductId()).getConfig())
.setLinkImage(storeProductMapper.selectById(storeCombination.getProductId()).getLinkImage()));
//评价
storeCombinationVo.setReply(replyService

43
zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java

@ -227,7 +227,8 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
return StoreSeckillVo.builder()
.productAttr((List<YxStoreProductAttrQueryVo>)returnMap.get("productAttr"))
.productValue((Map<String, YxStoreProductAttrValue>)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<YxStoreSeckillMap
Integer startTime = null;
for (SeckillTimeDto seckillTimeDto:seckillConfigVo.getSeckillTime()){
if (seckillTimeDto.getId()==time){ //获取即将开始的时间
//先把传来的即将开始的时间段加入
idList.add(time);
int today = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(new Date()));
startTime=today + Integer.valueOf(seckillTimeDto.getTime().split(":")[0]) * 3600;
}
@ -260,7 +263,6 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
Page<YxStoreSeckill> pageModel = new Page<>(page, limit);
LambdaQueryWrapper<YxStoreSeckill> 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<YxStoreSeckillMap
public List<YxStoreSeckillQueryVo> getSeckillingList(int page,int limit) {
Page<YxStoreSeckill> pageModel = new Page<>(page, limit);
SeckillConfigVo seckillConfigVo=yxStoreSeckillService.getStoreSeckil();
LambdaQueryWrapper<YxStoreSeckill> 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<Integer> timeIds=new ArrayList<>();
seckillConfigVo.getSeckillTime().forEach(seckillTimeDto -> {
if (seckillTimeDto.getStatus()==1){
@ -305,32 +312,26 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
}
});
if (timeIds.size()!=0){ //有抢购中的
Long count=yxStoreSeckillService.lambdaQuery()
.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.le(YxStoreSeckill::getStartTime,new Date())
.ge(YxStoreSeckill::getStopTime,new Date())
.in(YxStoreSeckill::getTimeId,timeIds)
.count();
if (count>0){ //抢购中的商品数量不为0
LambdaQueryWrapper<YxStoreSeckill> 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<YxStoreSeckillQueryVo> yxStoreSeckillQueryVos = generator.convert
(yxStoreSeckillMapper.selectPage(pageModel,wrapper).getRecords(),
YxStoreSeckillQueryVo.class);
wrapper.in(YxStoreSeckill::getTimeId,timeIds);
List<YxStoreSeckillQueryVo> 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<YxStoreSeckillQueryVo> 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;
};

4
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<EditableTabs> config;

3
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;

3
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<EditableTabs> config;
@ApiModelProperty(value = "轮播图")

5
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 = "请上传商品轮播图")

1
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(",")));

3
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<String> sliderImage;

4
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")

3
zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java

@ -302,7 +302,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
//无其他排序条件时,防止因为商品排序导致商品重复
if (StringUtils.isNullOrEmpty(productQueryParam.getPriceOrder()) && StringUtils.isNullOrEmpty(productQueryParam.getSalesOrder())) {
// wrapper.orderByDesc(YxStoreProduct::getId);
wrapper.orderByDesc(YxStoreProduct::getId);
wrapper.orderByDesc(YxStoreProduct::getSort);
}
Page<YxStoreProduct> pageModel = new Page<>(productQueryParam.getPage(),
@ -637,6 +637,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
yxStoreProduct.setBenefitSort(storeProductDto.getBenefitSort());
yxStoreProduct.setBestSort(storeProductDto.getBestSort());
yxStoreProduct.setSliderImage(String.join(",", storeProductDto.getSliderImage()));
yxStoreProduct.setLinkImage(storeProductDto.getLinkImage()); //链接首页图
if (storeProductDto.getId() != null) {
//清空商品转发图

3
zsw-bxg/src/main/java/co/yixiang/modules/product/vo/YxStoreProductQueryVo.java

@ -44,6 +44,9 @@ public class YxStoreProductQueryVo implements Serializable {
@ApiModelProperty(value = "商品图片")
private String image;
@ApiModelProperty(value = "链接图片")
private String linkImage;
private String image_base;
private String codeBase;

Loading…
Cancel
Save