Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
2025-10-31 16:18:41 +08:00
2 changed files with 11 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import com.czg.account.dto.ShopConfigDTO;
import com.czg.account.entity.ShopConfig;
import com.czg.account.service.ShopConfigService;
import com.czg.sa.StpKit;
import com.czg.service.RedisService;
import com.czg.service.account.mapper.ShopConfigMapper;
import com.czg.service.account.mapper.ShopInfoMapper;
import com.czg.utils.PageUtil;
@@ -12,6 +13,9 @@ import com.mybatisflex.core.util.LambdaGetter;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -27,6 +31,8 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
@Resource
private ShopInfoMapper shopInfoMapper;
@Resource
private RedisService redisService;
private QueryWrapper buildQueryWrapper(ShopConfigDTO param) {
QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
@@ -48,9 +54,9 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
shopConfig.setId(mainShopId);
save(shopConfig);
}
List<Long> extistList = list(new QueryWrapper().in(ShopConfig::getId, shopIdList).select(ShopConfig::getId)).stream().map(ShopConfig::getId).toList();
if (!shopIdList.isEmpty()) {
List<Long> extistList = list(new QueryWrapper().in(ShopConfig::getId, shopIdList).select(ShopConfig::getId)).stream().map(ShopConfig::getId).toList();
shopIdList.stream().filter(id -> !extistList.contains(id)).forEach(id -> {
save(new ShopConfig().setId(id).setMainId(mainShopId));
});
@@ -81,6 +87,9 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
}
}
extistList.forEach(item -> redisService.del("shopInfo::" + item));
redisService.del("shopInfo::" + mainShopId);
}
}

View File

@@ -192,7 +192,7 @@ public class TbMemberConfigServiceImpl extends ServiceImpl<TbMemberConfigMapper,
memberConfig.setMemberPriceShopIdList(JSONObject.toJSONString(memberDTO.getMemberPriceShopIdList()));
}
shopConfigService.editStatusByShopIdList(memberConfig.getShopId(), memberConfig.getIsOpen().intValue(),false, "is_account_ay",
shopConfigService.editStatusByShopIdList(memberConfig.getShopId(), memberConfig.getIsOpen().intValue() == 1 && memberConfig.getIsMemberPrice() == 1 ? 1 : 0,false, "is_account_ay",
"ALL".equals(memberConfig.getMemberPriceShopType()) ? "all" : "part",
StrUtil.isNotBlank(memberConfig.getMemberPriceShopIdList()) ? JSONArray.parseArray(memberConfig.getMemberPriceShopIdList()).toList(Long.class) : new ArrayList<>());