Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop
# Conflicts: # framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java
This commit is contained in:
@@ -21,9 +21,9 @@ public class TransactionCommitSendMQEvent extends ApplicationEvent {
|
||||
private final String tag;
|
||||
|
||||
@Getter
|
||||
private final String message;
|
||||
private final Object message;
|
||||
|
||||
public TransactionCommitSendMQEvent(Object source, String topic, String tag, String message) {
|
||||
public TransactionCommitSendMQEvent(Object source, String topic, String tag, Object message) {
|
||||
super(source);
|
||||
this.topic = topic;
|
||||
this.tag = tag;
|
||||
|
||||
@@ -8,7 +8,9 @@ import cn.lili.cache.CachePrefix;
|
||||
import cn.lili.common.context.ThreadContextHolder;
|
||||
import cn.lili.common.enums.ClientTypeEnum;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.event.TransactionCommitSendMQEvent;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.properties.RocketmqCustomProperties;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.security.token.Token;
|
||||
@@ -29,11 +31,13 @@ import cn.lili.modules.system.entity.dto.connect.WechatConnectSetting;
|
||||
import cn.lili.modules.system.entity.dto.connect.dto.WechatConnectSettingItem;
|
||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||
import cn.lili.modules.system.service.SettingService;
|
||||
import cn.lili.rocketmq.tags.MemberTagsEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -66,6 +70,14 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
private MemberTokenGenerate memberTokenGenerate;
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
/**
|
||||
* RocketMQ 配置
|
||||
*/
|
||||
@Autowired
|
||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||
|
||||
@Autowired
|
||||
private ApplicationEventPublisher applicationEventPublisher;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -235,6 +247,8 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
memberService.save(newMember);
|
||||
newMember = memberService.findByUsername(newMember.getUsername());
|
||||
bindMpMember(openId, unionId, newMember);
|
||||
// 发送会员注册信息
|
||||
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("new member register", rocketmqCustomProperties.getMemberTopic(), MemberTagsEnum.MEMBER_REGISTER.name(), newMember));
|
||||
return memberTokenGenerate.createToken(newMember, true);
|
||||
}
|
||||
|
||||
@@ -262,9 +276,9 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
* 这样,微信小程序注册之后,其他app 公众号页面,都可以实现绑定自动登录功能
|
||||
* </p>
|
||||
*
|
||||
* @param openId 微信openid
|
||||
* @param unionId 微信unionid
|
||||
* @param member 会员
|
||||
* @param openId 微信openid
|
||||
* @param unionId 微信unionid
|
||||
* @param member 会员
|
||||
*/
|
||||
private void bindMpMember(String openId, String unionId, Member member) {
|
||||
|
||||
|
||||
@@ -82,6 +82,14 @@ public interface GoodsSkuService extends IService<GoodsSku> {
|
||||
*/
|
||||
GoodsSku getGoodsSkuByIdFromCache(String id);
|
||||
|
||||
/**
|
||||
* 从缓存中获取可参与促销商品
|
||||
*
|
||||
* @param skuId skuid
|
||||
* @return 商品详情
|
||||
*/
|
||||
GoodsSku getCanPromotionGoodsSkuByIdFromCache(String skuId);
|
||||
|
||||
/**
|
||||
* 获取商品sku详情
|
||||
*
|
||||
@@ -143,7 +151,7 @@ public interface GoodsSkuService extends IService<GoodsSku> {
|
||||
/**
|
||||
* 分页查询商品sku信息
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param page 分页参数
|
||||
* @param queryWrapper 查询参数
|
||||
* @return 商品sku信息
|
||||
*/
|
||||
|
||||
@@ -22,6 +22,7 @@ import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSkuDTO;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsSalesModeEnum;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||
import cn.lili.modules.goods.entity.vos.GoodsSkuSpecVO;
|
||||
import cn.lili.modules.goods.entity.vos.GoodsSkuVO;
|
||||
@@ -237,6 +238,15 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
return goodsSku;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsSku getCanPromotionGoodsSkuByIdFromCache(String skuId) {
|
||||
GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId);
|
||||
if (goodsSku != null && GoodsSalesModeEnum.WHOLESALE.name().equals(goodsSku.getSalesModel())) {
|
||||
throw new ServiceException(ResultCode.PROMOTION_GOODS_DO_NOT_JOIN_WHOLESALE, goodsSku.getGoodsName());
|
||||
}
|
||||
return goodsSku;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getGoodsSkuDetail(String goodsId, String skuId) {
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
|
||||
@@ -8,6 +8,7 @@ import cn.lili.cache.CachePrefix;
|
||||
import cn.lili.common.context.ThreadContextHolder;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.common.event.TransactionCommitSendMQEvent;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.properties.RocketmqCustomProperties;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
@@ -35,7 +36,6 @@ import cn.lili.modules.store.entity.dos.Store;
|
||||
import cn.lili.modules.store.entity.enums.StoreStatusEnum;
|
||||
import cn.lili.modules.store.service.StoreService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
||||
import cn.lili.rocketmq.tags.MemberTagsEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -43,8 +43,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -88,11 +88,9 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
*/
|
||||
@Autowired
|
||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||
/**
|
||||
* RocketMQ
|
||||
*/
|
||||
|
||||
@Autowired
|
||||
private RocketMQTemplate rocketMQTemplate;
|
||||
private ApplicationEventPublisher applicationEventPublisher;
|
||||
/**
|
||||
* 缓存
|
||||
*/
|
||||
@@ -182,6 +180,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Token autoRegister(ConnectAuthUser authUser) {
|
||||
|
||||
if (CharSequenceUtil.isEmpty(authUser.getNickname())) {
|
||||
@@ -225,6 +224,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Token mobilePhoneLogin(String mobilePhone) {
|
||||
QueryWrapper<Member> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("mobile", mobilePhone);
|
||||
@@ -243,12 +243,13 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
*
|
||||
* @param member
|
||||
*/
|
||||
private void registerHandler(Member member) {
|
||||
@Transactional
|
||||
public void registerHandler(Member member) {
|
||||
member.setId(SnowFlake.getIdStr());
|
||||
//保存会员
|
||||
this.save(member);
|
||||
String destination = rocketmqCustomProperties.getMemberTopic() + ":" + MemberTagsEnum.MEMBER_REGISTER.name();
|
||||
rocketMQTemplate.asyncSend(destination, member, RocketmqSendCallbackBuilder.commonCallback());
|
||||
// 发送会员注册信息
|
||||
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("new member register", rocketmqCustomProperties.getMemberTopic(), MemberTagsEnum.MEMBER_REGISTER.name(), member));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -288,10 +289,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||
}
|
||||
Member member = this.getById(tokenUser.getId());
|
||||
if (member.getPassword().equals(DEFAULT_PASSWORD)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return member.getPassword().equals(DEFAULT_PASSWORD);
|
||||
|
||||
}
|
||||
|
||||
@@ -343,6 +341,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Token register(String userName, String password, String mobilePhone) {
|
||||
//检测会员信息
|
||||
checkMember(userName, mobilePhone);
|
||||
@@ -350,8 +349,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
Member member = new Member(userName, new BCryptPasswordEncoder().encode(password), mobilePhone);
|
||||
//注册成功后用户自动登录
|
||||
registerHandler(member);
|
||||
Token token = memberTokenGenerate.createToken(member, false);
|
||||
return token;
|
||||
return memberTokenGenerate.createToken(member, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -388,6 +386,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Member addMember(MemberAddDTO memberAddDTO) {
|
||||
|
||||
//检测会员信息
|
||||
@@ -463,8 +462,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
memberPointMessage.setPoint(point);
|
||||
memberPointMessage.setType(type);
|
||||
memberPointMessage.setMemberId(memberId);
|
||||
String destination = rocketmqCustomProperties.getMemberTopic() + ":" + MemberTagsEnum.MEMBER_POINT_CHANGE.name();
|
||||
rocketMQTemplate.asyncSend(destination, memberPointMessage, RocketmqSendCallbackBuilder.commonCallback());
|
||||
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("update member point", rocketmqCustomProperties.getMemberTopic(), MemberTagsEnum.MEMBER_POINT_CHANGE.name(), memberPointMessage));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -134,7 +134,7 @@ public class CheckDataRender implements CartRenderStep {
|
||||
cartSkuVO.setErrorMessage("商品库存不足,现有库存数量[" + dataSku.getQuantity() + "]");
|
||||
}
|
||||
//如果存在商品促销活动,则判定商品促销状态
|
||||
if (CollUtil.isNotEmpty(cartSkuVO.getNotFilterPromotionMap()) || Boolean.TRUE.equals(cartSkuVO.getGoodsSku().getPromotionFlag())) {
|
||||
if (!cartSkuVO.getCartType().equals(CartTypeEnum.POINTS) && (CollUtil.isNotEmpty(cartSkuVO.getNotFilterPromotionMap()) || Boolean.TRUE.equals(cartSkuVO.getGoodsSku().getPromotionFlag()))) {
|
||||
//获取当前最新的促销信息
|
||||
cartSkuVO.setPromotionMap(this.promotionGoodsService.getCurrentGoodsPromotion(cartSkuVO.getGoodsSku(), tradeDTO.getCartTypeEnum().name()));
|
||||
//设定商品价格
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SystemLogVO implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "日志记录时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Field(type = FieldType.Date, format = DateFormat.basic_date_time)
|
||||
@Field(type = FieldType.Date, format = DateFormat.basic_date_time, fielddata = true)
|
||||
private Date createTime = new Date();
|
||||
|
||||
@ApiModelProperty(value = "请求用户")
|
||||
|
||||
@@ -291,7 +291,7 @@ public class CouponServiceImpl extends AbstractPromotionsServiceImpl<CouponMappe
|
||||
throw new ServiceException(ResultCode.COUPON_SCOPE_ERROR);
|
||||
}
|
||||
for (String id : split) {
|
||||
GoodsSku goodsSku = goodsSkuService.getGoodsSkuByIdFromCache(id);
|
||||
GoodsSku goodsSku = goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(id);
|
||||
if (goodsSku == null) {
|
||||
throw new ServiceException(ResultCode.GOODS_NOT_EXIST);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class KanjiaActivityGoodsServiceImpl extends AbstractPromotionsServiceImp
|
||||
* @return 商品sku
|
||||
*/
|
||||
private GoodsSku checkSkuExist(String skuId) {
|
||||
GoodsSku goodsSku = this.goodsSkuService.getGoodsSkuByIdFromCache(skuId);
|
||||
GoodsSku goodsSku = this.goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(skuId);
|
||||
if (goodsSku == null) {
|
||||
log.error("商品ID为" + skuId + "的商品不存在!");
|
||||
throw new ServiceException();
|
||||
@@ -206,7 +206,7 @@ public class KanjiaActivityGoodsServiceImpl extends AbstractPromotionsServiceImp
|
||||
}
|
||||
KanjiaActivityGoodsDTO kanjiaActivityGoodsDTO = new KanjiaActivityGoodsDTO();
|
||||
BeanUtils.copyProperties(kanjiaActivityGoods, kanjiaActivityGoodsDTO);
|
||||
GoodsSku goodsSku = this.goodsSkuService.getGoodsSkuByIdFromCache(kanjiaActivityGoods.getSkuId());
|
||||
GoodsSku goodsSku = this.goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(kanjiaActivityGoods.getSkuId());
|
||||
if (goodsSku != null) {
|
||||
kanjiaActivityGoodsDTO.setGoodsSku(goodsSku);
|
||||
}
|
||||
@@ -233,7 +233,7 @@ public class KanjiaActivityGoodsServiceImpl extends AbstractPromotionsServiceImp
|
||||
//获取砍价商品
|
||||
KanjiaActivityGoods kanJiaActivityGoods = this.getById(id);
|
||||
//获取商品SKU
|
||||
GoodsSku goodsSku = this.goodsSkuService.getGoodsSkuByIdFromCache(kanJiaActivityGoods.getSkuId());
|
||||
GoodsSku goodsSku = this.goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(kanJiaActivityGoods.getSkuId());
|
||||
//填写活动商品价格、剩余数量
|
||||
kanJiaActivityGoodsVO.setGoodsSku(goodsSku);
|
||||
kanJiaActivityGoodsVO.setStock(kanJiaActivityGoods.getStock());
|
||||
|
||||
@@ -115,7 +115,7 @@ public class KanjiaActivityServiceImpl extends ServiceImpl<KanJiaActivityMapper,
|
||||
}
|
||||
KanjiaActivity kanJiaActivity = new KanjiaActivity();
|
||||
//获取商品信息
|
||||
GoodsSku goodsSku = goodsSkuService.getGoodsSkuByIdFromCache(kanJiaActivityGoods.getSkuId());
|
||||
GoodsSku goodsSku = goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(kanJiaActivityGoods.getSkuId());
|
||||
if (goodsSku != null) {
|
||||
kanJiaActivity.setSkuId(kanJiaActivityGoods.getSkuId());
|
||||
kanJiaActivity.setGoodsName(goodsSku.getGoodsName());
|
||||
|
||||
@@ -297,7 +297,7 @@ public class PintuanServiceImpl extends AbstractPromotionsServiceImpl<PintuanMap
|
||||
if (pintuan.getPromotionGoodsList() != null && !pintuan.getPromotionGoodsList().isEmpty()) {
|
||||
List<PromotionGoods> promotionGoods = PromotionTools.promotionGoodsInit(pintuan.getPromotionGoodsList(), pintuan, PromotionTypeEnum.PINTUAN);
|
||||
for (PromotionGoods promotionGood : promotionGoods) {
|
||||
if (goodsSkuService.getGoodsSkuByIdFromCache(promotionGood.getSkuId()) == null) {
|
||||
if (goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(promotionGood.getSkuId()) == null) {
|
||||
log.error("商品[" + promotionGood.getGoodsName() + "]不存在或处于不可售卖状态!");
|
||||
throw new ServiceException("商品[" + promotionGood.getGoodsName() + "]不存在或处于不可售卖状态!");
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl<Points
|
||||
* @return 商品sku
|
||||
*/
|
||||
private GoodsSku checkSkuExist(String skuId) {
|
||||
GoodsSku goodsSku = this.goodsSkuService.getGoodsSkuByIdFromCache(skuId);
|
||||
GoodsSku goodsSku = this.goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(skuId);
|
||||
if (goodsSku == null) {
|
||||
log.error("商品ID为" + skuId + "的商品不存在!");
|
||||
throw new ServiceException();
|
||||
|
||||
@@ -5,11 +5,8 @@ import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.common.enums.PromotionTypeEnum;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsSalesModeEnum;
|
||||
import cn.lili.modules.goods.entity.vos.GoodsVO;
|
||||
import cn.lili.modules.goods.service.GoodsService;
|
||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||
@@ -75,7 +72,7 @@ public class PromotionGoodsServiceImpl extends ServiceImpl<PromotionGoodsMapper,
|
||||
@Override
|
||||
public List<PromotionGoods> findSkuValidPromotion(String skuId, String storeIds) {
|
||||
|
||||
GoodsSku sku = goodsSkuService.getGoodsSkuByIdFromCache(skuId);
|
||||
GoodsSku sku = goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(skuId);
|
||||
if (sku == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
@@ -316,40 +313,6 @@ public class PromotionGoodsServiceImpl extends ServiceImpl<PromotionGoodsMapper,
|
||||
return promotionMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean save(PromotionGoods entity) {
|
||||
this.checkGoodsSku(entity.getSkuId());
|
||||
return super.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveBatch(Collection<PromotionGoods> entityList) {
|
||||
for (PromotionGoods promotionGoods : entityList) {
|
||||
this.checkGoodsSku(promotionGoods.getSkuId());
|
||||
}
|
||||
return super.saveBatch(entityList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveOrUpdateBatch(Collection<PromotionGoods> entityList) {
|
||||
for (PromotionGoods promotionGoods : entityList) {
|
||||
this.checkGoodsSku(promotionGoods.getSkuId());
|
||||
}
|
||||
return super.saveOrUpdateBatch(entityList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否为不能参加促销活动的商品
|
||||
*
|
||||
* @param skuId 商品skuId
|
||||
*/
|
||||
private void checkGoodsSku(String skuId) {
|
||||
GoodsSku goodsSku = goodsSkuService.getGoodsSkuByIdFromCache(skuId);
|
||||
if (goodsSku != null && GoodsSalesModeEnum.WHOLESALE.name().equals(goodsSku.getSalesModel())) {
|
||||
throw new ServiceException(ResultCode.PROMOTION_GOODS_DO_NOT_JOIN_WHOLESALE, goodsSku.getGoodsName());
|
||||
}
|
||||
}
|
||||
|
||||
private void setGoodsPromotionInfo(GoodsSku dataSku, Map.Entry<String, Object> promotionInfo) {
|
||||
JSONObject promotionsObj = JSONUtil.parseObj(promotionInfo.getValue());
|
||||
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
||||
|
||||
@@ -161,7 +161,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec
|
||||
List<PromotionGoods> promotionGoodsList = new ArrayList<>();
|
||||
for (SeckillApplyVO seckillApply : seckillApplyList) {
|
||||
//获取参与活动的商品信息
|
||||
GoodsSku goodsSku = goodsSkuService.getGoodsSkuByIdFromCache(seckillApply.getSkuId());
|
||||
GoodsSku goodsSku = goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(seckillApply.getSkuId());
|
||||
if (!goodsSku.getStoreId().equals(storeId)) {
|
||||
continue;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec
|
||||
List<SeckillApply> list = this.list(queryWrapper).stream().filter(i -> i.getTimeLine() != null && seckill.getHours().contains(i.getTimeLine().toString())).collect(Collectors.toList());
|
||||
for (SeckillApply seckillApply : list) {
|
||||
//获取参与活动的商品信息
|
||||
GoodsSku goodsSku = goodsSkuService.getGoodsSkuByIdFromCache(seckillApply.getSkuId());
|
||||
GoodsSku goodsSku = goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(seckillApply.getSkuId());
|
||||
//获取促销商品
|
||||
PromotionGoods promotionGoods = this.setSeckillGoods(goodsSku, seckillApply, seckill);
|
||||
promotionGoodsList.add(promotionGoods);
|
||||
@@ -373,7 +373,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec
|
||||
if (!seckillApplyList.isEmpty()) {
|
||||
List<SeckillApply> collect = seckillApplyList.stream().filter(i -> i.getTimeLine().equals(startTimeline) && i.getPromotionApplyStatus().equals(PromotionsApplyStatusEnum.PASS.name())).collect(Collectors.toList());
|
||||
for (SeckillApply seckillApply : collect) {
|
||||
GoodsSku goodsSku = goodsSkuService.getGoodsSkuByIdFromCache(seckillApply.getSkuId());
|
||||
GoodsSku goodsSku = goodsSkuService.getCanPromotionGoodsSkuByIdFromCache(seckillApply.getSkuId());
|
||||
if (goodsSku != null) {
|
||||
SeckillGoodsVO goodsVO = new SeckillGoodsVO();
|
||||
BeanUtil.copyProperties(seckillApply, goodsVO);
|
||||
|
||||
@@ -11,7 +11,6 @@ import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 自定义分词
|
||||
@@ -38,12 +37,12 @@ public class CustomWords extends BaseEntity {
|
||||
private String name;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "是否禁用")
|
||||
@ApiModelProperty(value = "是否禁用: 0,禁用;1,不禁用")
|
||||
private Integer disabled;
|
||||
|
||||
|
||||
public CustomWords(String name) {
|
||||
this.name = name;
|
||||
this.disabled = 0;
|
||||
this.disabled = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.lili.modules.search.mapper;
|
||||
|
||||
import cn.lili.modules.search.entity.dos.CustomWords;
|
||||
import cn.lili.mybatis.mybatisplus.SpiceBaseMapper;
|
||||
import cn.lili.mybatis.mybatisplus.external.SpiceBaseMapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,6 +62,12 @@ public interface CustomWordsService extends IService<CustomWords> {
|
||||
*/
|
||||
boolean deleteBathByName(List<String> names);
|
||||
|
||||
/**
|
||||
* 批量插入自定义分词
|
||||
*
|
||||
* @param customWordsList 自定义分词列表
|
||||
* @return 受影响行数
|
||||
*/
|
||||
long insertBatchCustomWords(List<CustomWords> customWordsList);
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.lili.mybatis.mybatisplus;
|
||||
package cn.lili.mybatis.mybatisplus.external;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.lili.mybatis.mybatisplus;
|
||||
package cn.lili.mybatis.mybatisplus.external;
|
||||
|
||||
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
|
||||
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
|
||||
Reference in New Issue
Block a user