mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-11 10:49:52 +08:00
update
This commit is contained in:
@@ -136,10 +136,15 @@ public interface PileBillingTemplateMapper {
|
|||||||
BillingTemplateVO selectBillingTemplateByStationId(@Param("stationId") String stationId);
|
BillingTemplateVO selectBillingTemplateByStationId(@Param("stationId") String stationId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过模板id查询计费模板详情列表
|
* 通过模板id数组批量查询计费模板详情列表
|
||||||
*/
|
*/
|
||||||
List<PileBillingDetail> queryBillingDetailByTemplateIds(@Param("templateIds") Long[] templateIds);
|
List<PileBillingDetail> queryBillingDetailByTemplateIds(@Param("templateIds") Long[] templateIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过模板id查询计费模板详情列表
|
||||||
|
*/
|
||||||
|
List<PileBillingDetail> queryBillingDetailByTemplateId(@Param("templateId") Long templateId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 插入充电桩和计费模板关系
|
* 插入充电桩和计费模板关系
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -275,7 +275,8 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
|||||||
result.setType(pileBillingTemplate.getType());
|
result.setType(pileBillingTemplate.getType());
|
||||||
|
|
||||||
// 查计费模板详情
|
// 查计费模板详情
|
||||||
List<PileBillingDetail> detailList = pileBillingTemplateMapper.queryBillingDetailByTemplateIds(new Long[]{id});
|
// List<PileBillingDetail> detailList = pileBillingTemplateMapper.queryBillingDetailByTemplateIds(new Long[]{id});
|
||||||
|
List<PileBillingDetail> detailList = queryBillingDetailById(id);
|
||||||
if (CollectionUtils.isNotEmpty(detailList)) {
|
if (CollectionUtils.isNotEmpty(detailList)) {
|
||||||
List<BillingTimeDTO> timeArray = Lists.newArrayList();
|
List<BillingTimeDTO> timeArray = Lists.newArrayList();
|
||||||
// 取出4个时间段类型
|
// 取出4个时间段类型
|
||||||
@@ -358,12 +359,18 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过计费模板id查询计费模板详情
|
||||||
|
* 缓存30分账,修改清缓存
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PileBillingDetail> queryBillingDetailById(Long id) {
|
public List<PileBillingDetail> queryBillingDetailById(Long id) {
|
||||||
String redisKey = CacheConstants.QUERY_BILLING_DETAIL_BY_ID + id;
|
String redisKey = CacheConstants.QUERY_BILLING_DETAIL_BY_ID + id;
|
||||||
List<PileBillingDetail> pileBillingDetails = redisCache.getCacheList(redisKey);
|
List<PileBillingDetail> pileBillingDetails = redisCache.getCacheList(redisKey);
|
||||||
if (CollectionUtils.isEmpty(pileBillingDetails)) {
|
if (CollectionUtils.isEmpty(pileBillingDetails)) {
|
||||||
pileBillingDetails = pileBillingTemplateMapper.queryBillingDetailByTemplateIds(new Long[]{id});
|
pileBillingDetails = pileBillingTemplateMapper.queryBillingDetailByTemplateId(id);
|
||||||
if (CollectionUtils.isNotEmpty(pileBillingDetails)) {
|
if (CollectionUtils.isNotEmpty(pileBillingDetails)) {
|
||||||
redisCache.setCacheList(redisKey, pileBillingDetails);
|
redisCache.setCacheList(redisKey, pileBillingDetails);
|
||||||
redisCache.expire(redisKey, 30, TimeUnit.MINUTES);
|
redisCache.expire(redisKey, 30, TimeUnit.MINUTES);
|
||||||
|
|||||||
@@ -392,6 +392,24 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryBillingDetailByTemplateId" resultMap="PileBillingDetailResult">
|
||||||
|
SELECT
|
||||||
|
t1.id,
|
||||||
|
t1.template_code,
|
||||||
|
t1.time_type,
|
||||||
|
t1.electricity_price,
|
||||||
|
t1.service_price,
|
||||||
|
t1.apply_time,
|
||||||
|
t1.create_by,
|
||||||
|
t1.create_time,
|
||||||
|
t1.update_by,
|
||||||
|
t1.update_time,
|
||||||
|
t1.del_flag
|
||||||
|
FROM pile_billing_detail t1
|
||||||
|
JOIN pile_billing_template t2 ON t2.template_code = t1.template_code
|
||||||
|
WHERE t2.id = #{templateId,jdbcType=BIGINT}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertPileBillingRelation">
|
<insert id="insertPileBillingRelation">
|
||||||
insert into pile_billing_relation
|
insert into pile_billing_relation
|
||||||
(pile_sn, billing_template_code, station_id)
|
(pile_sn, billing_template_code, station_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user