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

Commit baf9e389 authored by 胡佳晨's avatar 胡佳晨

提交 无可参加的活动时500

parent 3b7de285
package com.liquidnet.service.goblin.service.impl;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.*;
......@@ -43,7 +44,8 @@ public class GoblinStoreZhengzaiServiceImpl implements IGoblinStoreZhengzaiServi
List<GoblinSelfMarketingVo> voList = ObjectUtil.getGoblinSelfMarketingVoList();
LocalDateTime now = LocalDateTime.now();
for (GoblinSelfMarketingVo item : list) {
if (LocalDateTime.parse(item.getStartTime(), DTF_YMD_HMS).isBefore(now) && LocalDateTime.parse(item.getEndTime(), DTF_YMD_HMS).isAfter(now)) {
GoblinMarketingZhengzaiRelationVo zhengzaiRelationVo = redisUtils.getZhengzaiRelation(item.getSelfMarketId(), storeId);
if (LocalDateTime.parse(item.getEndTime(), DTF_YMD_HMS).isAfter(now) && zhengzaiRelationVo != null ) {
if (marketIds.contains(item.getSelfMarketId())) {
List<GoblinMarketRelationVo> relationVo = redisUtils.getMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue(), item.getSelfMarketId());
List<String> storeIdList = relationVo.stream().map(GoblinMarketRelationVo::getStoreId).distinct().collect(Collectors.toList());//配置了商铺的店铺
......
......@@ -185,7 +185,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
priceList.add(item.getPriceMarketing());
}
if (errorNameList.size() == params.getGoblinStoreZhengzaiItemParams().size()) {
return ResponseDto.failure(JsonUtils.toJson(errorNameList));
return ResponseDto.failure("148001", JsonUtils.toJson(errorNameList));
}
//mongo
GoblinGoodsInfoVo spuVo = redisUtils.getGoodsInfoVo(params.getSpuId());
......@@ -201,6 +201,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
redisUtils.setGoodsInfoVo(spuVo);
relationVo.setSkuList(skuList);
relationVo.setSpuId(spuVo.getSpuId());
relationVo.setStoreId(params.getStoreId());
redisUtils.addMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue(), params.getSelfMarketId(), relationVo);
redisUtils.addStoreMarketIsConfig(params.getSelfMarketId(), params.getStoreId(), params.getSpuId(), marketSpuId);
// 执行sql
......@@ -208,7 +209,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_SELF_MARKET.getKey(),
sqlData);
if (errorNameList.size() > 0) {
return ResponseDto.failure(JsonUtils.toJson(errorNameList));
return ResponseDto.failure("148001", JsonUtils.toJson(errorNameList));
}
return ResponseDto.success();
}
......@@ -267,7 +268,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
priceList.add(bean.getPriceMarketing());
}
if (errorNameList.size() == params.getGoblinStoreZhengzaiItemParams().size()) {
return ResponseDto.failure(JsonUtils.toJson(errorNameList));
return ResponseDto.failure("148001", JsonUtils.toJson(errorNameList));
}
//mongo
GoblinGoodsInfoVo spuVo = redisUtils.getGoodsInfoVo(params.getSpuId());
......@@ -286,7 +287,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_SELF_MARKET.getKey(),
sqlData);
if (errorNameList.size() > 0) {
return ResponseDto.failure(JsonUtils.toJson(errorNameList));
return ResponseDto.failure("148001", JsonUtils.toJson(errorNameList));
}
return ResponseDto.success();
}
......
......@@ -30,6 +30,6 @@
149013=SKU编辑失败
149014=SKU添加失败,重复的规格信息
148001=库存不足
149035=
\ No newline at end of file
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