diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTimingChargingModelMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTimingChargingModelMapper.xml index b5af5aab..0a5895ae 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTimingChargingModelMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTimingChargingModelMapper.xml @@ -581,9 +581,11 @@ tcm.timing_charging_model_id as timingChargingModelId, tcm.reason as reason, cs.name as chargingStationName, + cs.charging_station_id as chargingStationId, tcm.timing_time as timingTime, tcm.status as status, - tcm.create_time as createTime + tcm.create_time as createTime, + tcm.phone as phone from xhpc_timing_charging_model as tcm left join xhpc_charging_station as cs on cs.charging_station_id = tcm.charging_station_id where tcm.timing_charging_model_id =#{timingChargingModelId} diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java index 054c5065..b045b116 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java @@ -3,13 +3,17 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.log.annotation.Log; import com.xhpc.common.log.enums.BusinessType; +import com.xhpc.common.security.service.TokenService; import com.xhpc.general.service.IXhpcServiceDataUpdateService; +import com.xhpc.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; + /** * program: ruoyi * User: HongYun @@ -21,6 +25,8 @@ public class XhpcServiceDataUpdateController { @Autowired IXhpcServiceDataUpdateService xhpcServiceDataUpdateService; + @Resource + TokenService tokenService; @GetMapping("/list") public AjaxResult list(){ @@ -31,7 +37,8 @@ public class XhpcServiceDataUpdateController { @Log(title = "小程序设置-修改", businessType = BusinessType.UPDATE) @GetMapping("/update") public AjaxResult update(@RequestParam(required = false) String SOC, @RequestParam(required = false) String version, @RequestParam(required = false) String phone, @RequestParam(required = false) String aliyunMessageCount) { - - return xhpcServiceDataUpdateService.update(SOC, version, phone, aliyunMessageCount); + LoginUser loginUser = tokenService.getLoginUser(); + String tenantId = loginUser.getTenantId(); + return xhpcServiceDataUpdateService.update(SOC, version, phone, aliyunMessageCount,tenantId); } } diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/IXhpcServiceDataUpdateService.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/IXhpcServiceDataUpdateService.java index bd8707e6..c8fdb991 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/IXhpcServiceDataUpdateService.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/IXhpcServiceDataUpdateService.java @@ -29,7 +29,7 @@ public interface IXhpcServiceDataUpdateService { * @date 2021/11/30 14:44 * @since version-1.0 */ - AjaxResult update(String SOC, String version, String phone, String aliyunMessageCount); + AjaxResult update(String SOC, String version, String phone, String aliyunMessageCount,String tenantId); } diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcServiceDataUpdateServiceImpl.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcServiceDataUpdateServiceImpl.java index b1402433..bbd7374e 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcServiceDataUpdateServiceImpl.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcServiceDataUpdateServiceImpl.java @@ -2,6 +2,8 @@ package com.xhpc.general.service; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.redis.service.RedisService; +import com.xhpc.common.security.service.TokenService; +import com.xhpc.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -18,14 +20,18 @@ public class XhpcServiceDataUpdateServiceImpl implements IXhpcServiceDataUpdateS @Autowired private RedisService redisService; + @Autowired + private TokenService tokenService; + @Override public Map list() { - + LoginUser loginUser = tokenService.getLoginUser(); + String tenantId = loginUser.getTenantId(); Map list=new HashMap<>(); - String cacheSOC = redisService.getCacheObject("global:SOC"); - String cacheVersion = redisService.getCacheObject("global:version"); - String cachePhone = redisService.getCacheObject("global:phone"); - String cacheAliyunMessageCount = redisService.getCacheObject("global:AliyunMessageCount"); + String cacheSOC = redisService.getCacheObject("global:"+tenantId+":SOC"); + String cacheVersion = redisService.getCacheObject("global:"+tenantId+":version"); + String cachePhone = redisService.getCacheObject("global:"+tenantId+":phone"); + //String cacheAliyunMessageCount = redisService.getCacheObject("global:AliyunMessageCount"); list.put("SOC",cacheSOC); list.put("version",cacheVersion); list.put("phone", cachePhone); @@ -35,7 +41,7 @@ public class XhpcServiceDataUpdateServiceImpl implements IXhpcServiceDataUpdateS @Override - public AjaxResult update(String SOC, String version, String phone, String aliyunMessageCount) { + public AjaxResult update(String SOC, String version, String phone, String aliyunMessageCount,String tenantId) { if (SOC != null) { int soc = Integer.parseInt(SOC); @@ -52,9 +58,9 @@ public class XhpcServiceDataUpdateServiceImpl implements IXhpcServiceDataUpdateS // return AjaxResult.error("短信条数为空"); // } - redisService.setCacheObject("global:SOC", SOC); - redisService.setCacheObject("global:version", version); - redisService.setCacheObject("global:phone", phone); + redisService.setCacheObject("global:"+tenantId+":SOC", SOC); + redisService.setCacheObject("global:"+tenantId+":version", version); + redisService.setCacheObject("global:"+tenantId+":phone", phone); // redisService.setCacheObject("global:AliyunMessageCount", aliyunMessageCount); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index 023c6078..df20124a 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -234,7 +234,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar number =Integer.parseInt(userMessage.get("socUser").toString()); } //平台 - String soc = redisService.getCacheObject("global:SOC"); + String soc = redisService.getCacheObject("global:"+tenantId+":SOC"); if(!"".equals(soc) && soc!=null){ if(number!=0){ if(Integer.parseInt(soc)-number<0){ @@ -544,7 +544,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar int number =0; //平台 - String soc = redisService.getCacheObject("global:SOC"); + String soc = redisService.getCacheObject("global:"+xhpcTerminal.getTenantId()+":SOC"); if(!"".equals(soc) && soc!=null){ if(number!=0){ if(Integer.parseInt(soc)-number<0){ @@ -785,7 +785,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar number =Integer.parseInt(userMessage.get("socUser").toString()); } //平台 - String soc = redisService.getCacheObject("global:SOC"); + String soc = redisService.getCacheObject("global:"+xhpcTerminal.getTenantId()+":SOC"); if(!"".equals(soc) && soc!=null){ if(number!=0){ if(Integer.parseInt(soc)-number<0){ diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java index f5545e77..2bec9645 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java @@ -437,12 +437,14 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU public AjaxResult appInfo(HttpServletRequest request) { try{ LoginUser loginUser = logUserUtils.getLogUser(request); - Object version = redisService.getCacheObject("global:version"); - Object servicePhone = redisService.getCacheObject("global:phone"); + String tenantId = loginUser.getTenantId(); + Object version = redisService.getCacheObject("global:"+tenantId+":version"); + Object servicePhone = redisService.getCacheObject("global:"+tenantId+":phone"); //根据不同的用户类型查询不同的信息 Long userid = loginUser.getUserid(); Integer userType = loginUser.getUserType(); - R user = userTypeService.getUser(null, loginUser.getUserid(), loginUser.getUserType(), null,loginUser.getTenantId()); + + R user = userTypeService.getUser(null, loginUser.getUserid(), loginUser.getUserType(), null,tenantId); if(user !=null && user.getData() !=null){ Map map = (Map)user.getData(); //发票、留言板、版本、客服电话 @@ -481,7 +483,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU map.put("activity",0); map.put("activitySize",1); map.put("activityImg","https://xhpc-bucket1.oss-cn-hangzhou.aliyuncs.com/bunengshanchu/1.png"); - map.put("socSize",redisService.getCacheObject("global:SOC")); + map.put("socSize",redisService.getCacheObject("global:"+tenantId+":SOC")); return AjaxResult.success(map); }else{ return AjaxResult.error("请重新登录",HttpStatus.USER_LOGIN);