套餐商品 实时同步
This commit is contained in:
@@ -825,7 +825,8 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
public void syncProductPackageBySourceShop(Product product, Long pointShopId) {
|
||||
if (StrUtil.isNotBlank(product.getGroupSnap()) && product.getGroupSnap().length() > 5) {
|
||||
ProductGroupVo proGroupVo = JSONObject.parseObject(product.getGroupSnap(), ProductGroupVo.class);
|
||||
List<ProductGroupVo> proGroupVos = JSON.parseArray(product.getGroupSnap(), ProductGroupVo.class);
|
||||
for (ProductGroupVo proGroupVo : proGroupVos) {
|
||||
List<ProductGroupVo.Food> goodList = new ArrayList<>();
|
||||
for (ProductGroupVo.Food goods : proGroupVo.getGoods()) {
|
||||
if (goods.getProId() != null) {
|
||||
@@ -849,7 +850,8 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
proGroupVo.setNumber(proGroupVo.getCount());
|
||||
}
|
||||
}
|
||||
product.setGroupSnap(JSON.toJSONString(proGroupVo, JSONWriter.Feature.WriteMapNullValue));
|
||||
}
|
||||
product.setGroupSnap(JSON.toJSONString(proGroupVos, JSONWriter.Feature.WriteMapNullValue));
|
||||
productService.saveOrUpdate(product);
|
||||
}
|
||||
}
|
||||
@@ -1142,7 +1144,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
prodConsRelationService.remove(QueryWrapper.create()
|
||||
.eq(ProdConsRelation::getShopId, shopId)
|
||||
.eq(ProdConsRelation::getProductId, product.getId()));
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
Map<Long, BigDecimal> map = list.stream().collect(Collectors.toMap(ProdConsRelation::getConsInfoId, ProdConsRelation::getSurplusStock));
|
||||
List<ConsInfo> newCons = consInfoService.queryChain()
|
||||
.in(ConsInfo::getSyncId, map.keySet()).eq(ConsInfo::getShopId, shopId).list();
|
||||
|
||||
Reference in New Issue
Block a user