wayn111 / newbee-mall-pro Goto Github PK
View Code? Open in Web Editor NEWnewbee-mall-pro是newbee-mall商城的pro版本,商城样式了进行大量美化,提升交互性。实现了推荐算法、商品秒杀、优惠卷使用,滑块验证码,支付宝支付,中文分词检索等高级功能
License: GNU General Public License v3.0
newbee-mall-pro是newbee-mall商城的pro版本,商城样式了进行大量美化,提升交互性。实现了推荐算法、商品秒杀、优惠卷使用,滑块验证码,支付宝支付,中文分词检索等高级功能
License: GNU General Public License v3.0
本地运行时候发现新增商品总是会有问题,然后查了一下发现是jedis的方法问题
在ltd.newbee.mall.redis.JedisSearch
中
public boolean addGoodsIndex(String keyPrefix, Goods goods) {
Map<String, String> hash = MyBeanUtil.toMap(goods);
hash.put("_language", Constants.GOODS_IDX_LANGUAGE);
//client.hset(keyPrefix + goods.getGoodsId(), MyBeanUtil.toMap(goods)); <--这句报错
client.hmset(keyPrefix + goods.getGoodsId(), MyBeanUtil.toMap(goods)); //<--改成了这句
return true;
}
亲测将hset
改成hmset
就不报错了 也不知道为什么。。。
请问下面这里通过goodsId得到该商品的所有订单列表之后,将订单中的商品数量进行累加,累加之后得到的sum,为什么可以跟用户进行关联? 这里得到的好像是某个商品的所有用户的购买数量累加吧?
`// 遍历订单商品
for (OrderItemVO newBeeMallOrderItem : listMap.getOrDefault(orderId, Collections.emptyList())) {
Long goodsId = newBeeMallOrderItem.getGoodsId();
Long categoryId = newBeeMallOrderItem.getCategoryId();
RelateDTO relateDTO = new RelateDTO();
relateDTO.setUserId(newBeeMallOrder.getUserId());
relateDTO.setProductId(goodsId);
relateDTO.setCategoryId(categoryId);
// 通过计算商品购买次数,来建立相似度
List list = goodsListMap.getOrDefault(goodsId, Collections.emptyList());
int sum = list.stream().mapToInt(OrderItemVO::getGoodsCount).sum();
relateDTO.setIndex(sum);
relateDTOList.add(relateDTO);
}`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.