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

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

修改 同步标签

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