From 0b79b0426586a0fad0247ed13cb6eac1a61bfe13 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期六, 24 八月 2024 11:06:12 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java | 7 +++++-- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java | 14 +++++++++----- ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TInviteUser.java | 4 ++-- ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/tools/MessageUtil.java | 2 -- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/ISiteService.java | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TInviteUser.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TInviteUser.java index 7c85ccf..5e0fe6c 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TInviteUser.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TInviteUser.java @@ -30,8 +30,8 @@ private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Long id; + @TableId(value = "id", type = IdType.NONE) + private Integer id; @ApiModelProperty(value = "用户id") @TableField("app_user_id") diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java index 34a893d..c0352fe 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java @@ -14,6 +14,7 @@ import com.ruoyi.chargingPile.service.*; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.GeodesyUtil; +import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.security.utils.SecurityUtils; @@ -30,6 +31,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.time.LocalTime; import java.util.*; @@ -122,8 +124,9 @@ } @ApiOperation(value = "获取站点分页列表", tags = {"小程序-站点管理-首页"}) @PostMapping("/pageList") - public AjaxResult<PageInfo<SiteVO>> pageList(@Validated @RequestBody SiteQuery query){ - return AjaxResult.success(siteService.pageList(query)); + public AjaxResult<PageInfo<SiteVO>> pageList(@Validated @RequestBody SiteQuery query, HttpServletRequest request){ + int isLogin = StringUtils.isEmpty(SecurityUtils.getToken(request)) ? 0 : 1; + return AjaxResult.success(siteService.pageList(query,isLogin)); } @ApiOperation(value = "获取站点列表", tags = {"小程序-站点管理-地图导航站点"}) diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/ISiteService.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/ISiteService.java index e96f7e3..b24a0eb 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/ISiteService.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/ISiteService.java @@ -67,7 +67,7 @@ * @return */ - PageInfo<SiteVO> pageList(SiteQuery query); + PageInfo<SiteVO> pageList(SiteQuery query,Integer isLogin); /** * 获取站点详情 diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java index e483d89..1a3a90f 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java @@ -19,6 +19,7 @@ import com.ruoyi.chargingPile.service.ISiteService; import com.ruoyi.chargingPile.service.TChargingGunService; import com.ruoyi.chargingPile.service.TChargingPileService; +import com.ruoyi.common.core.utils.ServletUtils; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.PageInfo; @@ -224,11 +225,14 @@ } @Override - public PageInfo<SiteVO> pageList(SiteQuery query) { - // 获取当前登录用户id - Long userId = tokenService.getLoginUserApplet().getUserId(); - // 根据id查询用户信息 - TAppUser appUser = appUserClient.getUserById(userId).getData(); + public PageInfo<SiteVO> pageList(SiteQuery query,Integer isLogin) { + TAppUser appUser = null; + if(isLogin == 1){ + // 获取当前登录用户id + Long userId = tokenService.getLoginUserApplet().getUserId(); + // 根据id查询用户信息 + appUser = appUserClient.getUserById(userId).getData(); + } PageInfo<SiteVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); List<SiteVO> list = this.baseMapper.pageList(query,pageInfo); if(Objects.nonNull(appUser) && Objects.nonNull(appUser.getVipId())){ diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/tools/MessageUtil.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/tools/MessageUtil.java index e7f11c8..10749fc 100644 --- a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/tools/MessageUtil.java +++ b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/tools/MessageUtil.java @@ -53,8 +53,6 @@ private PlatformRestartService platformRestartService; @Autowired private PlatformRemoteUpdateService platformRemoteUpdateService; - @Autowired - private MessageConvertUtil messageConvertUtil; /** * 登录认证应答 -- Gitblit v1.7.1