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

Commit aa4be889 authored by zhanggb's avatar zhanggb

~api:商品管理:商品编辑:SKU批量更新逻辑调整;

parent d95b769d
...@@ -485,7 +485,8 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -485,7 +485,8 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
}); });
} }
goblinMongoUtils.updateGoodsSkuInfoVoBySpuId(updateSkuInfoVo); // goblinMongoUtils.updateGoodsSkuInfoVoBySpuId(updateSkuInfoVo);
goblinMongoUtils.updateGoodsSkuInfoVoPropBySpuId(updateSkuInfoVo);
goblinRedisUtils.delGoodsInfoVo(updateSpuInfoVo.getSpuId()); goblinRedisUtils.delGoodsInfoVo(updateSpuInfoVo.getSpuId());
LinkedList<String> toMqSqls = CollectionUtil.linkedListString(); LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
......
...@@ -972,6 +972,17 @@ public class GoblinMongoUtils { ...@@ -972,6 +972,17 @@ public class GoblinMongoUtils {
).getModifiedCount() > 0; ).getModifiedCount() > 0;
} }
public boolean updateGoodsSkuInfoVoPropBySpuId(GoblinGoodsSkuInfoVo vo) {
return mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("spuId").is(vo.getSpuId()).and("delFlg").is("0")).getQueryObject(),
Update.update("skuNo", vo.getSkuNo())
.set("virtualFlg", vo.getVirtualFlg())
.set("logisticsTemplate", vo.getLogisticsTemplate())
.set("updatedBy", vo.getUpdatedBy())
.set("updatedAt", mongoConverter.convertToMongoType(vo.getUpdatedAt())).getUpdateObject()
).getModifiedCount() > 0;
}
public boolean updateGoodsSkuInfoVoByShelves(String storeId, List<String> spuIdList, boolean shelvesFlg, String uid, LocalDateTime time) { public boolean updateGoodsSkuInfoVoByShelves(String storeId, List<String> spuIdList, boolean shelvesFlg, String uid, LocalDateTime time) {
return mongoTemplate.updateMulti(Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("spuId").in(spuIdList.toArray())), return mongoTemplate.updateMulti(Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("spuId").in(spuIdList.toArray())),
Update.update("shelvesStatus", shelvesFlg ? "3" : "1").set("shelvesAt", time).set("updatedBy", uid).set("updatedAt", time), Update.update("shelvesStatus", shelvesFlg ? "3" : "1").set("shelvesAt", time).set("updatedBy", uid).set("updatedAt", time),
......
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