Browse Source

拼团秒杀砍价支持单独配置链接图

sj
1304317391@qq.com 2 years ago
parent
commit
c509e75d4c
  1. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreBargain.java
  2. 4
      zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreCombination.java
  3. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreSeckill.java
  4. 8
      zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreBargainController.java
  5. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationDto.java
  6. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillDto.java
  7. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java
  8. 3
      zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java
  9. 21
      zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java

3
zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreBargain.java

@ -54,6 +54,9 @@ public class YxStoreBargain extends BaseDomain {
@ApiModelProperty(value = "砍价产品图片")
private String image;
/** 砍价活动图片 */
@ApiModelProperty(value = "砍价链接图片")
private String linkImage;
/** 单位名称 */
@ApiModelProperty(value = "砍价产品单位名称")

4
zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreCombination.java

@ -56,6 +56,10 @@ public class YxStoreCombination extends BaseDomain {
@ApiModelProperty(value = "推荐图")
private String image;
/** 链接图 */
@ApiModelProperty(value = "链接图")
private String linkImage;
/** 轮播图 */
@NotBlank(message = "请上传商品轮播")

3
zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreSeckill.java

@ -51,6 +51,9 @@ public class YxStoreSeckill extends BaseDomain {
@ApiModelProperty(value = "推荐图")
private String image;
/** 推荐图 */
@ApiModelProperty(value = "链接图")
private String linkImage;
/** 轮播图 */
@NotBlank(message = "请上传商品轮播")

8
zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreBargainController.java

@ -83,4 +83,12 @@ public class StoreBargainController {
yxStoreBargainService.removeById(id);
return new ResponseEntity(HttpStatus.OK);
}
@Log("查询砍价详情")
@ApiOperation(value = "查询砍价详情")
@GetMapping(value = "/yxStoreBargain/info/{id}")
@PreAuthorize("@ss.hasAnyPermissions('admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_SELECT')")
public ResponseEntity getInfo(@PathVariable Integer id){
return new ResponseEntity<>(yxStoreBargainService.getById(id),HttpStatus.OK);
}
}

3
zsw-bxg/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationDto.java

@ -39,6 +39,9 @@ public class YxStoreCombinationDto implements Serializable {
// 推荐图
private String image;
// 链接图
private String linkImage;
private String images;
/** 轮播图 */

3
zsw-bxg/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillDto.java

@ -39,6 +39,9 @@ public class YxStoreSeckillDto implements Serializable {
// 推荐图
private String image;
// 轮播图
private String linkImage;
// 轮播图
private String images;

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

@ -333,8 +333,7 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
YxStoreBargainQueryVo storeBargainQueryVo = generator.convert(storeBargain,
YxStoreBargainQueryVo.class)
.setConfig(storeProductMapper.selectById(storeBargain.getProductId()).getConfig())
.setLinkImage(storeProductMapper.selectById(storeBargain.getProductId()).getLinkImage());
.setConfig(storeProductMapper.selectById(storeBargain.getProductId()).getConfig());
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,8 +137,7 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
StoreCombinationVo storeCombinationVo = new StoreCombinationVo();
storeCombinationVo.setStoreInfo(storeCombinationQueryVo.setConfig(storeProductMapper.selectById(storeCombination.getProductId()).getConfig())
.setLinkImage(storeProductMapper.selectById(storeCombination.getProductId()).getLinkImage()));
storeCombinationVo.setStoreInfo(storeCombinationQueryVo.setConfig(storeProductMapper.selectById(storeCombination.getProductId()).getConfig()));
//评价
storeCombinationVo.setReply(replyService

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

@ -227,8 +227,7 @@ 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())
.setLinkImage(storeProductMapper.selectById(storeSeckill.getProductId()).getLinkImage()))
.storeInfo(generator.convert(storeSeckill, YxStoreSeckillQueryVo.class).setConfig(storeProductMapper.selectById(storeSeckill.getProductId()).getConfig()))
.reply(replyService.getReply(storeSeckill.getProductId()))
.replyCount(replyService.productReplyCount(storeSeckill.getProductId()))
.tempName(tempName)
@ -272,8 +271,12 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
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());
if (sum==0){
item.setPercent(100);
}else {
item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum),
100),0).intValue());
}
});
return yxStoreSeckillQueryVos;
}
@ -317,8 +320,13 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
(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());
if (sum==0){
item.setPercent(100);
}else {
item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum),
100),0).intValue());
}
});
return yxStoreSeckillQueryVos;
}
@ -464,6 +472,7 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
yxStoreSeckill.setCost(BigDecimal.valueOf(resultDTO.getMinCost()));
yxStoreSeckill.setStock(resultDTO.getStock());
yxStoreSeckill.setImages(String.join(",", resources.getImages()));
yxStoreSeckill.setLinkImage(resources.getLinkImage());
this.saveOrUpdate(yxStoreSeckill);
//属性处理

Loading…
Cancel
Save