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

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

修改 同步标签

parent 328fbd4c
...@@ -468,9 +468,7 @@ public class GoblinMongoUtils { ...@@ -468,9 +468,7 @@ public class GoblinMongoUtils {
List<GoblinGoodsInfoVo> marketGoodsInfoVos = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()); List<GoblinGoodsInfoVo> marketGoodsInfoVos = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
if (!CollectionUtils.isEmpty(marketGoodsInfoVos)) { if (!CollectionUtils.isEmpty(marketGoodsInfoVos)) {
List<String> marketSpuIds = marketGoodsInfoVos.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList()); List<String> marketSpuIds = marketGoodsInfoVos.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList());
mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateMany( Update update = Update.update("spuNo", vo.getSpuNo())
Query.query(Criteria.where("spuId").in(marketSpuIds).and("delFlg").is("0")).getQueryObject(),
Update.update("spuNo", vo.getSpuNo())
.set("name", vo.getName()) .set("name", vo.getName())
.set("subtitle", vo.getSubtitle()) .set("subtitle", vo.getSubtitle())
.set("sellPrice", vo.getSellPrice()) .set("sellPrice", vo.getSellPrice())
...@@ -488,13 +486,22 @@ public class GoblinMongoUtils { ...@@ -488,13 +486,22 @@ public class GoblinMongoUtils {
.set("virtualFlg", vo.getVirtualFlg()) .set("virtualFlg", vo.getVirtualFlg())
.set("imageList", mongoConverter.convertToMongoType(vo.getImageList())) .set("imageList", mongoConverter.convertToMongoType(vo.getImageList()))
.set("logisticsTemplate", vo.getLogisticsTemplate()) .set("logisticsTemplate", vo.getLogisticsTemplate())
.set("tagVoList", mongoConverter.convertToMongoType(vo.getTagVoList()))
.set("extagVoList", mongoConverter.convertToMongoType(vo.getExtagVoList()))
.set("artagVoList", mongoConverter.convertToMongoType(vo.getArtagVoList()))
.set("serviceSupportVoList", mongoConverter.convertToMongoType(vo.getServiceSupportVoList())) .set("serviceSupportVoList", mongoConverter.convertToMongoType(vo.getServiceSupportVoList()))
.set("updatedBy", vo.getUpdatedBy()) .set("updatedBy", vo.getUpdatedBy())
.set("updatedAt", vo.getUpdatedAt()) .set("updatedAt", vo.getUpdatedAt());
.getUpdateObject() if (vo.getTagVoList() != null) {
update.set("tagVoList", mongoConverter.convertToMongoType(vo.getTagVoList()));
}
if (vo.getExtagVoList() != null) {
update.set("extagVoList", mongoConverter.convertToMongoType(vo.getExtagVoList()));
}
if (vo.getArtagVoList() != null) {
update.set("artagVoList", mongoConverter.convertToMongoType(vo.getArtagVoList()));
}
mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("spuId").in(marketSpuIds).and("delFlg").is("0")).getQueryObject(),
update.getUpdateObject()
); );
return marketSpuIds; return marketSpuIds;
} }
...@@ -900,7 +907,7 @@ public class GoblinMongoUtils { ...@@ -900,7 +907,7 @@ public class GoblinMongoUtils {
//查询聚合数据 //查询聚合数据
Aggregation aggregation = Aggregation.newAggregation( Aggregation aggregation = Aggregation.newAggregation(
Aggregation.match(criteria), Aggregation.match(criteria),
Aggregation.project("spuId", "skuPriceActual","orderType"), Aggregation.project("spuId", "skuPriceActual", "orderType"),
Aggregation.group("spuId") Aggregation.group("spuId")
.first("spuId").as("spuId") .first("spuId").as("spuId")
.first("orderType").as("orderType") .first("orderType").as("orderType")
......
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