mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-05 06:27:59 +08:00
update
This commit is contained in:
@@ -23,6 +23,8 @@ public class CacheConstants {
|
|||||||
|
|
||||||
public static final int cache_expire_time_1d = 60 * 60 * 24;
|
public static final int cache_expire_time_1d = 60 * 60 * 24;
|
||||||
|
|
||||||
|
public static final String QUERY_BILLING_DETAIL_BY_ID = "query_billing_detail_by_id:";
|
||||||
|
|
||||||
//
|
//
|
||||||
public static final String SELECT_PILE_BILLING_TEMPLATE_BY_ID = "select_Pile_Billing_Template_By_Id:";
|
public static final String SELECT_PILE_BILLING_TEMPLATE_BY_ID = "select_Pile_Billing_Template_By_Id:";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.pile.service;
|
package com.jsowell.pile.service;
|
||||||
|
|
||||||
|
import com.jsowell.pile.domain.PileBillingDetail;
|
||||||
import com.jsowell.pile.domain.PileBillingRelation;
|
import com.jsowell.pile.domain.PileBillingRelation;
|
||||||
import com.jsowell.pile.domain.PileBillingTemplate;
|
import com.jsowell.pile.domain.PileBillingTemplate;
|
||||||
import com.jsowell.pile.dto.CreateOrUpdateBillingTemplateDTO;
|
import com.jsowell.pile.dto.CreateOrUpdateBillingTemplateDTO;
|
||||||
@@ -157,4 +158,6 @@ public interface IPileBillingTemplateService {
|
|||||||
* 通过站点id查询当前时间的收费详情
|
* 通过站点id查询当前时间的收费详情
|
||||||
*/
|
*/
|
||||||
CurrentTimePriceDetails getCurrentTimePriceDetails(String stationId);
|
CurrentTimePriceDetails getCurrentTimePriceDetails(String stationId);
|
||||||
|
|
||||||
|
List<PileBillingDetail> queryBillingDetailById(Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -358,6 +358,20 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PileBillingDetail> queryBillingDetailById(Long id) {
|
||||||
|
String redisKey = CacheConstants.QUERY_BILLING_DETAIL_BY_ID + id;
|
||||||
|
List<PileBillingDetail> pileBillingDetails = redisCache.getCacheList(redisKey);
|
||||||
|
if (CollectionUtils.isEmpty(pileBillingDetails)) {
|
||||||
|
pileBillingDetails = pileBillingTemplateMapper.queryBillingDetailByTemplateIds(new Long[]{id});
|
||||||
|
if (CollectionUtils.isNotEmpty(pileBillingDetails)) {
|
||||||
|
redisCache.setCacheList(redisKey, pileBillingDetails);
|
||||||
|
redisCache.expire(redisKey, 30, TimeUnit.MINUTES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pileBillingDetails;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BillingTemplateVO> queryPublicBillingTemplateList() {
|
public List<BillingTemplateVO> queryPublicBillingTemplateList() {
|
||||||
return pileBillingTemplateMapper.queryPublicBillingTemplateList();
|
return pileBillingTemplateMapper.queryPublicBillingTemplateList();
|
||||||
@@ -391,6 +405,7 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
|||||||
// 通过计费模板id 清缓存
|
// 通过计费模板id 清缓存
|
||||||
if (templateId != null) {
|
if (templateId != null) {
|
||||||
redisKeyList.add(CacheConstants.SELECT_PILE_BILLING_TEMPLATE_BY_ID + templateId);
|
redisKeyList.add(CacheConstants.SELECT_PILE_BILLING_TEMPLATE_BY_ID + templateId);
|
||||||
|
redisKeyList.add(CacheConstants.QUERY_BILLING_DETAIL_BY_ID + templateId);
|
||||||
}
|
}
|
||||||
redisCache.deleteObject(redisKeyList);
|
redisCache.deleteObject(redisKeyList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,14 +107,14 @@ public class AMapServiceImpl implements AMapService {
|
|||||||
}
|
}
|
||||||
aMapInfo.setConstruction(Integer.parseInt(construction));
|
aMapInfo.setConstruction(Integer.parseInt(construction));
|
||||||
aMapInfo.setBusineHours(stationInfo.getBusinessHours());
|
aMapInfo.setBusineHours(stationInfo.getBusinessHours());
|
||||||
|
// 根据站点id查询计费模板
|
||||||
List<AMapPriceChargingInfo> priceList = getPriceInfoByStationId(String.valueOf(stationInfo.getId()));
|
List<AMapPriceChargingInfo> priceList = getPriceInfoByStationId(String.valueOf(stationInfo.getId()));
|
||||||
aMapInfo.setPriceChargingInfo(priceList);
|
aMapInfo.setPriceChargingInfo(priceList);
|
||||||
|
// 根据站点id查询快、慢充设备数量
|
||||||
Map<String, Integer> pileNumMap = pileConnectorInfoService.getPileTypeNum(stationInfo.getId());
|
Map<String, Integer> pileNumMap = pileConnectorInfoService.getPileTypeNum(stationInfo.getId());
|
||||||
aMapInfo.setFastEquipmentNum(pileNumMap.get("fastTotal"));
|
aMapInfo.setFastEquipmentNum(pileNumMap.get("fastTotal"));
|
||||||
aMapInfo.setSlowEquipmentNum(pileNumMap.get("slowTotal"));
|
aMapInfo.setSlowEquipmentNum(pileNumMap.get("slowTotal"));
|
||||||
|
// 根据站点查询站点下所有桩
|
||||||
List<AMapEquipmentInfo> aMapEquipmentInfos = getPileListByStationId(String.valueOf(stationInfo.getId()));
|
List<AMapEquipmentInfo> aMapEquipmentInfos = getPileListByStationId(String.valueOf(stationInfo.getId()));
|
||||||
aMapInfo.setEquipmentInfos(aMapEquipmentInfos);
|
aMapInfo.setEquipmentInfos(aMapEquipmentInfos);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user