diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 2dcebe34..c2e3b4cf 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -244,7 +244,7 @@ dubbo: bxg: shop: # API_URL: http://192.168.10.113:48080/bxgApp - API_URL: https://d305-27-19-79-51.jp.ngrok.io + API_URL: https://c522-27-19-79-200.jp.ngrok.io 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/app/modules/activity/rest/AppStoreSeckillController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreSeckillController.java index 6b339efa..2f96a114 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreSeckillController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreSeckillController.java @@ -119,6 +119,10 @@ public class AppStoreSeckillController { JSONObject jsonObject = JSON.parseObject(jsonStr); int time = Integer.valueOf(jsonObject.get("time").toString());//时间 5 int continued = Integer.valueOf(jsonObject.get("continued").toString());//活动持续事件 3 + String rule=""; + if (jsonObject.get("rule")!=null){ + rule=jsonObject.get("rule").toString(); + } SimpleDateFormat sdf = new SimpleDateFormat("HH"); String nowTime = sdf.format(new Date()); String index = nowTime.substring(0, 1); @@ -131,23 +135,27 @@ public class AppStoreSeckillController { seckillTimeDto.setState("即将开始"); seckillTimeDto.setTime(jsonObject.get("time").toString().length() > 1 ? jsonObject.get("time").toString() + ":00" : "0" + jsonObject.get("time").toString() + ":00"); seckillTimeDto.setStatus(2); + seckillTimeDto.setRule(rule); seckillTimeDto.setStop(today + activityEndHour * 3600); } else { if (currentHour >= time && currentHour < activityEndHour) { seckillTimeDto.setState("抢购中"); seckillTimeDto.setTime(jsonObject.get("time").toString().length() > 1 ? jsonObject.get("time").toString() + ":00" : "0" + jsonObject.get("time").toString() + ":00"); seckillTimeDto.setStatus(1); + seckillTimeDto.setRule(rule); seckillTimeDto.setStop(today + activityEndHour * 3600); seckillTimeIndex.set(yxSystemGroupDataList.indexOf(i)); } else if (currentHour < time) { seckillTimeDto.setState("即将开始"); seckillTimeDto.setTime(jsonObject.get("time").toString().length() > 1 ? jsonObject.get("time").toString() + ":00" : "0" + jsonObject.get("time").toString() + ":00"); seckillTimeDto.setStatus(2); + seckillTimeDto.setRule(rule); seckillTimeDto.setStop(OrderUtil.dateToTimestamp(new Date()) + activityEndHour * 3600); } else if (currentHour >= activityEndHour) { seckillTimeDto.setState("已结束"); seckillTimeDto.setTime(jsonObject.get("time").toString().length() > 1 ? jsonObject.get("time").toString() + ":00" : "0" + jsonObject.get("time").toString() + ":00"); seckillTimeDto.setStatus(0); + seckillTimeDto.setRule(rule); seckillTimeDto.setStop(today + activityEndHour * 3600); } } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/dto/SeckillTimeDto.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/dto/SeckillTimeDto.java index 1999b249..430c1d7f 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/dto/SeckillTimeDto.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/dto/SeckillTimeDto.java @@ -22,6 +22,9 @@ public class SeckillTimeDto { @ApiModelProperty(value = "秒杀产品状态") private Integer status; + @ApiModelProperty(value = "秒杀规则") + private String rule; + @ApiModelProperty(value = "秒杀产品停止时间") private Integer stop; } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java index e096af17..a3c8ab62 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java @@ -82,9 +82,11 @@ public class YxEvaluationServiceImpl extends BaseServiceImpl list = generator.convert(baseMapper.selectList(wrapper),EvaluationDTO.class); list.forEach(evaluationDTO->{ - YxStoreProduct yxStoreProduct = yxStoreProductService.getProductInfo(Long.valueOf(evaluationDTO.getProduct())); - evaluationDTO.setProductInfo(yxStoreProduct); + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue()) + .eq(YxStoreProduct::getId, evaluationDTO.getProduct()); + YxStoreProduct yxStoreProduct = storeProductMapper.selectOne(wrapper1); + //这里需要有一个非空判断 + if (ObjectUtil.isNotNull(yxStoreProduct)){ + evaluationDTO.setProductInfo(yxStoreProduct); + }else{ + evaluationDTO.setProductInfo(new YxStoreProduct().setStoreName("该评测商品已删除或已下架")); + } }); return list; } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/expert/domain/YxStoreExpert.java b/zsw-bxg/src/main/java/co/yixiang/modules/expert/domain/YxStoreExpert.java index f33f42cc..80a15ff7 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/expert/domain/YxStoreExpert.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/expert/domain/YxStoreExpert.java @@ -61,7 +61,7 @@ public class YxStoreExpert implements Serializable { /** 专家所属单位 */ - @NotBlank +// @NotBlank private String expertUnit; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/impl/YxStoreHotListServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/impl/YxStoreHotListServiceImpl.java index 8a91ec84..6aca1a34 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/impl/YxStoreHotListServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/impl/YxStoreHotListServiceImpl.java @@ -8,6 +8,9 @@ */ package co.yixiang.modules.hotList.service.impl; +import cn.hutool.core.util.ObjectUtil; +import co.yixiang.exception.ErrorRequestException; +import co.yixiang.modules.product.service.mapper.StoreProductMapper; import org.springframework.beans.BeanUtils; import cn.hutool.json.JSONUtil; import co.yixiang.common.service.impl.BaseServiceImpl; @@ -54,16 +57,13 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl queryAll(YxStoreHotListQueryCriteria criteria, Pageable pageable) { getPage(pageable); PageInfo page = new PageInfo<>(queryAll(criteria)); -// PageInfo page1 = new PageInfo<>(); -// BeanUtils.copyProperties(page,page1); -// BeanUtilsBean.getInstance().copyProperties(page1, page); page.getList().forEach(hotList->{ List productArr = JSONUtil.toList(hotList.getProductList(), Integer.class); List list1 =new ArrayList<>(); @@ -72,8 +72,11 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl productArr = JSONUtil.toList(hotListDto.getProductList(), Integer.class); List list1 =new ArrayList<>(); productArr.forEach(productId->{ - //这里需要有一个非空判断 - YxStoreProduct yxStoreProduct = yxStoreProductService.getProductInfo(Long.valueOf(productId)); - list1.add(yxStoreProduct); + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue()) + .eq(YxStoreProduct::getId, productId); + YxStoreProduct yxStoreProduct = storeProductMapper.selectOne(wrapper1); + //这里需要有一个非空判断,找不到这个商品就不加 + if (ObjectUtil.isNotNull(yxStoreProduct)){ + list1.add(yxStoreProduct); + } }); hotListDto.setProductInfo(list1); }); 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 27b587c2..3d8c79b7 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 @@ -73,6 +73,9 @@ public class YxStoreProduct extends BaseDomain { @ApiModelProperty(value = "商品名称") private String storeName; + /**价保和无理由退款等配置**/ + @TableField(typeHandler = JacksonTypeHandler.class) + private YxStoreProductConfig config; /** 商品简介 */ @ApiModelProperty(value = "商品简介") diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProductConfig.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProductConfig.java new file mode 100644 index 00000000..1ea9e50c --- /dev/null +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProductConfig.java @@ -0,0 +1,18 @@ +package co.yixiang.modules.product.domain; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class YxStoreProductConfig implements Serializable { + //无理由退款天数 + private Integer withoutReason; + //无理由退款图标 + private String withoutReasonPic; + //价保天数 + private Integer confirmed; + //价保图标 + private String confirmedPic; + +} 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 e64643ef..6f4b7e38 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 @@ -211,6 +211,7 @@ public class StoreProductController { YxStoreProduct yxStoreProduct = yxStoreProductService.getById(id); ProductDto productDto = new ProductDto(); productDto.setParameter(yxStoreProduct.getParameter()); + productDto.setConfig(yxStoreProduct.getConfig()); BeanUtil.copyProperties(yxStoreProduct,productDto,"sliderImage"); productDto.setSliderImage(Arrays.asList(yxStoreProduct.getSliderImage().split(","))); YxStoreProductAttrResult storeProductAttrResult = yxStoreProductAttrResultService 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 067eb480..4094f38d 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 @@ -1,6 +1,9 @@ package co.yixiang.modules.product.service.dto; +import co.yixiang.modules.product.domain.YxStoreProductConfig; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Getter; @@ -21,8 +24,7 @@ import java.util.Map; @AllArgsConstructor @Getter @Setter -public class ProductDto -{ +public class ProductDto { /** 商品id */ private Long id; @@ -43,6 +45,9 @@ public class ProductDto @JsonProperty("store_info") private String storeInfo; + /**价保和无理由退款等配置**/ + private YxStoreProductConfig config; + /** 关键字 */ private String keyword; 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 f6c5cc16..e2a9f797 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 @@ -1,5 +1,6 @@ package co.yixiang.modules.product.service.dto; +import co.yixiang.modules.product.domain.YxStoreProductConfig; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import com.fasterxml.jackson.annotation.JsonProperty; @@ -52,6 +53,9 @@ public class StoreProductDto @NotBlank(message = "关键字不能为空") private String keyword; + /**价保和无理由退款等配置**/ + @JsonProperty("config") + private YxStoreProductConfig config; /** 商品条码(一维码) */ @JsonProperty("bar_code") 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 95937443..0c3393a8 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 @@ -197,7 +197,6 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl