循环依赖

This commit is contained in:
2025-09-24 11:31:02 +08:00
parent 440e6fae1a
commit 46b86ca505

View File

@@ -20,6 +20,7 @@ import com.czg.sa.MyStpLogic;
import com.czg.sa.StpKit;
import com.czg.service.RedisService;
import com.czg.service.account.mapper.ShopInfoMapper;
import com.czg.service.account.mapper.ShopUserMapper;
import com.czg.system.dto.SysParamsDTO;
import com.czg.system.service.SysParamsService;
import com.czg.utils.AssertUtil;
@@ -61,7 +62,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
@Resource
private ShopTableService shopTableService;
@Resource
private ShopUserService shopUserService;
private ShopUserMapper shopUserMapper;
@Resource
private ShopExtendService shopExtendService;
@Resource
@@ -353,7 +354,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
distance = GeoUtil.getDistance(Long.parseLong(shopInfo.getLat()), Long.parseLong(shopInfo.getLng()), Long.parseLong(lat), Long.parseLong(lng));
}
ShopUser shopUser = shopUserService.queryChain().eq(ShopUser::getUserId, StpKit.USER.getLoginIdAsLong()).one();
ShopUser shopUser = shopUserMapper.selectOneByQuery(new QueryWrapper().eq(ShopUser::getUserId, StpKit.USER.getLoginIdAsLong()));
List<ShopExtend> shopExtends = shopExtendService.listInfo(shopInfo.getId(), null);
Map<String, ShopExtend> shopExtendMap = shopExtends.stream().collect(Collectors.toMap(ShopExtend::getAutoKey, i -> i));
return new ShopInfoByCodeDTO(distance, shopInfo, shopExtendMap, shopTable, shopUser != null && shopUser.getIsVip() != null && shopUser.getIsVip() == 1);