1修改redis设置key

This commit is contained in:
fengjundan 2021-08-05 11:18:32 +08:00
parent ca31abbdd7
commit 18940b3bc9
10 changed files with 40 additions and 10 deletions

View File

@ -52,7 +52,7 @@ public class TokenService {
redisService.setCacheObject(ACCESS_TOKEN + token, loginUser, EXPIRE_TIME, TimeUnit.SECONDS);
Map<String, Object> map1 = new HashMap<>();
map1.put("privilege", loginUser.getSysUser().getDataPowerType());
redisService.setCacheMap(loginUser.getSysUser().getUserId() + ":privilege", map1);
redisService.setCacheMap("privilege:" + loginUser.getSysUser().getUserId(), map1);
return map;
}

View File

@ -530,12 +530,12 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
}
//费率
List<Map<String, Object>> xhpcRateList = xhpcChargingStationMapper.getXhpcRateList(chargingStationId);
map.put("rateList",xhpcRateList);
map.put("xhpcRateList", xhpcRateList);
//费率时段,先反设置时段在反默认时段
List<Map<String, Object>> xhpcRateTimeTypeList = xhpcChargingStationMapper.getXhpcRateTimeTypeList(chargingStationId, 1);
xhpcRateTimeTypeList.addAll(xhpcChargingStationMapper.getXhpcRateTimeTypeList(chargingStationId, 2));
map.put("rateTimeList",xhpcRateTimeTypeList);
map.put("xhpcRateTimeList", xhpcRateTimeTypeList);
if(type ==2){
//统计终端充redis获取终端信息

View File

@ -183,7 +183,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ct.station_type as stationType,
op.name as operatorName,
ct.type as type,
ct.station_type as stationType,
(select dict_value from xhpc_dict_biz where code ='charging_station_type' and dict_key =ct.station_type) as stationTypeName,
ct.serial_number as serialNumber,
ct.construction_site as constructionSite,

View File

@ -222,7 +222,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
rt.start_time as startTime,
replace(rt.end_time,'00:00:00','24:00:00') AS endTime,
rt.rate_id as rateId,
rate_value as rateValue,
rt.rate_value as rateValue,
ra.name as rateName
from xhpc_rate_time as rt
left join xhpc_rate as ra on ra.rate_id =rt.rate_id

View File

@ -16,6 +16,16 @@ public class OrderApplication {
public static void main(String[] args) {
SpringApplication.run(OrderApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 订单服务启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

View File

@ -93,7 +93,7 @@ public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHis
*/
@Override
public AjaxResult internetUser(Long userId) {
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
Map<String, Object> map = redisService.getCacheMap("privilege:" + userId);
if (StringUtils.isNotNull(map)) {
String privilege = StringUtils.valueOf(map.get("privilege"));
if (StringUtils.isNotEmpty(privilege)) {
@ -122,7 +122,7 @@ public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHis
*/
@Override
public List<Map<String, Object>> page(Long userId, String serialNumber, String createTimeStart, String createTimeEnd, String chargingStationName, String status) {
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
Map<String, Object> map = redisService.getCacheMap("privilege:" + userId);
if (StringUtils.isNotNull(map)) {
String privilege = StringUtils.valueOf(map.get("privilege"));
if (StringUtils.isNotEmpty(privilege)) {

View File

@ -93,7 +93,7 @@ public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrd
*/
@Override
public AjaxResult operatorUser(Long userId) {
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
Map<String, Object> map = redisService.getCacheMap("privilege:" + userId);
if (StringUtils.isNotNull(map)) {
String privilege = StringUtils.valueOf(map.get("privilege"));
if (StringUtils.isNotEmpty(privilege)) {
@ -123,7 +123,7 @@ public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrd
*/
@Override
public List<Map<String, Object>> page(Long userId, String serialNumber, String createTimeStart, String createTimeEnd, String chargingStationName, String status) {
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
Map<String, Object> map = redisService.getCacheMap("privilege:" + userId);
if (StringUtils.isNotNull(map)) {
String privilege = StringUtils.valueOf(map.get("privilege"));
if (StringUtils.isNotEmpty(privilege)) {

View File

@ -321,7 +321,8 @@
te.name as terminalName,
ho.act_price as actPrice,
ho.act_power_price as actPowerPrice,
(select charging_time from xhpc_real_time_order where charging_order_id=ho.charging_order_id ORDER BY create_time desc LIMIT 1) as chargingTime
(select charging_time from xhpc_real_time_order where charging_order_id=ho.charging_order_id ORDER BY
create_time desc LIMIT 1) as chargingTime,
(select charging_degree from xhpc_real_time_order where charging_order_id=ho.charging_order_id ORDER BY create_time desc LIMIT 1) as chargingDegree,
(select DATE_FORMAT(create_time,'%m月%d日') from xhpc_real_time_order where charging_order_id=ho.charging_order_id ORDER BY create_time asc LIMIT 1) as daysOne,
(select DATE_FORMAT(create_time,'%H:%m') from xhpc_real_time_order where charging_order_id=ho.charging_order_id ORDER BY create_time asc LIMIT 1) as timeOne,

View File

@ -16,6 +16,16 @@ public class PaymentApplication {
public static void main(String[] args) {
SpringApplication.run(PaymentApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 支付服务启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

View File

@ -16,6 +16,16 @@ public class UserApplication {
public static void main(String[] args) {
SpringApplication.run(UserApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 账号服务启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}