记得上下班打卡 | git大法好,push需谨慎

Commit b9526e33 authored by 张国柄's avatar 张国柄

~API:优惠券列表:筛选时间字段命名调整;

~API:优惠券详情:SPU分类名称展示处理;
parent 7d711a12
......@@ -40,11 +40,11 @@ public class GoblinStoreMgtCouponAddParam implements Serializable {
@ApiModelProperty(position = 15, required = true, value = "开始时间[yyyy-MM-dd HH:mm:ss]", example = "2022-12-01 00:00:00")
@NotBlank(message = "发布时间不能为空")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "开始时间格式有误")
private String startDt;
private String startTime;
@ApiModelProperty(position = 16, required = true, value = "开始时间[yyyy-MM-dd HH:mm:ss]", example = "2022-12-01 00:00:00")
@NotBlank(message = "发布时间不能为空")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "开始时间格式有误")
private String endDt;
private String endTime;
@ApiModelProperty(position = 10, required = true, value = "券类型[1-代金券|2-折扣券|3-满减券]", allowableValues = "1,2,3", example = "1")
......@@ -117,8 +117,8 @@ public class GoblinStoreMgtCouponAddParam implements Serializable {
storeCouponBasicVo.setReceiveCurb(this.getReceiveCurb());
storeCouponBasicVo.setUseScope(this.getUseScope());
storeCouponBasicVo.setState("0");// 等待开始
storeCouponBasicVo.setStartTime(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getStartDt()));
storeCouponBasicVo.setEndTime(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getEndDt()));
storeCouponBasicVo.setStartTime(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getStartTime()));
storeCouponBasicVo.setEndTime(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getEndTime()));
storeCouponBasicVo.setSpuIdList(this.getUseScope().equals("1") ? this.getSpuIdList() : null);
return storeCouponBasicVo;
}
......
......@@ -13,6 +13,7 @@ import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtCouponInfoVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtCouponListVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtCouponSpuListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfGoodsCategoryVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponBasicVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtExtraService;
......@@ -178,11 +179,22 @@ public class GoblinStoreMgtCouponServiceImpl implements IGoblinstoreMgtCouponSer
mgtCouponInfoVo.setCouponVo(couponVo);
if ("1".equals(couponVo.getUseScope())) {
List<String> spuIds = goblinRedisUtils.getStoreCouponSpuIds(storeCouponId);
if (CollectionUtils.isEmpty(spuIds)) {
if (!CollectionUtils.isEmpty(spuIds)) {
List<GoblinSelfGoodsCategoryVo> selfGoodsCategoryVos = goblinStoreMgtExtraService.listCategoryVo();
ArrayList<GoblinStoreMgtCouponSpuListVo> couponSpuListVos = ObjectUtil.getGoblinStoreMgtCouponSpuListVoArrayList();
spuIds.forEach(spuId -> {
GoblinGoodsInfoVo goodsInfoVo = goblinRedisUtils.getGoodsInfoVo(spuId);
String cateFid = goodsInfoVo.getCateFid(), cateSid = goodsInfoVo.getCateSid(), cateTid = goodsInfoVo.getCateTid();
List<GoblinSelfGoodsCategoryVo> categoryVoList = selfGoodsCategoryVos.stream()
.filter(cr -> Arrays.asList(cateFid, cateSid, cateTid).contains(cr.getCateId())).collect(Collectors.toList());
categoryVoList.forEach(cr -> {
if (cr.getCateId().equals(cateFid)) goodsInfoVo.setCateFid(cr.getName());
if (cr.getCateId().equals(cateSid)) goodsInfoVo.setCateSid(cr.getName());
if (cr.getCateId().equals(cateTid)) goodsInfoVo.setCateTid(cr.getName());
});
couponSpuListVos.add(GoblinStoreMgtCouponSpuListVo.getNew().copy(goodsInfoVo));
});
mgtCouponInfoVo.setSpuVoList(couponSpuListVos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment