This commit is contained in:
2024-11-29 14:54:06 +08:00
parent b6c5180a39
commit b1ba27aa1e

View File

@@ -337,6 +337,7 @@ public class TbShopSyncInfoServiceImpl extends ServiceImpl<TbShopSyncInfoMapper,
public void syncGroupPackage(Integer shopId, Map<Integer, Integer> pros, Map<Integer, Integer> skus) {
productRepository.findPackageByShopId(shopId.toString()).forEach(tbProduct -> {
tbProduct.setProGroupVo(JSONUtil.parseJSONStrTList(tbProduct.getGroupSnap(), ProductGroupVo.class));
if (tbProduct.getProGroupVo() != null) {
tbProduct.getProGroupVo().forEach(proGroupVo -> {
proGroupVo.getGoods().forEach(goods -> {
if (pros.containsKey(goods.getProId())) {
@@ -357,6 +358,7 @@ public class TbShopSyncInfoServiceImpl extends ServiceImpl<TbShopSyncInfoMapper,
});
tbProduct.setGroupSnap(ListUtil.listToJsonString(tbProduct.getProGroupVo()));
productRepository.save(tbProduct);
}
});
}