跳到主要内容

气价管理

功能描述

新增气价,修改气价,查看气价修改历史记录,对使用某气价的用户进行批量修改,将这些用户从 a 气价调到 b 气价,对查询出的用户进行批量修改,将这些用户从 a 气价调到 b 气价 项目:SaleClient

组件:GasPriceManage

组件别名:gas-price-manage

查询条件

没有特殊 不做阐述

查询列表

主要查询sql

select * from (
select
t2.f_version as new_version,
case when t3.f_version is null then '0'
else t3.f_version end using_version,
case when getdate() between t3.f_perform_date and t3.f_end_date then '使用中'
when getdate() < t3.f_perform_date then '预调价'
when t3.f_end_date is null then '有效'
when t3.f_state = '删除' then '删除'
else '已作废' end f_price_state,
t3.*,
t3.f_price_type + (select ' ' + cast(CONVERT(decimal(18,4),f_price)as varchar) + '|'
from t_detailprice d where d.f_stairprice_id=t3.id for xml path(''))
f_value,
o.name as f_filiale_name,
isnull(u.c, 0) usercount
from (
select f_price_id,max(id) id from t_stairprice group by f_price_id
) t1
left join
t_stairprice t2 on t1.id=t2.id
left join
(
select t_stairprice.*,case when f_custom = '自定义气价' then f_custom else '正常气价' end custom
from t_stairprice where (getdate() between f_perform_date and f_end_date or f_end_date is null) and f_state = '有效'
) t3 on t1.f_price_id=t3.f_price_id
left join t_organization o on t3.f_filialeid = o.id
left join
(
select f_filialeid,f_new_price_id f_price_id,count(f_user_id) c from
(
select
u.*,isnull(up.f_price_id,u.f_price_id) f_new_price_id
from t_userfiles u
left join
(
select * from (
select
DATEDIFF(day,getdate(),f_parameter_value) days,
b.f_userinfo_id,b.f_userfiles_id,sp.*
from t_userproperties p left join t_basicliving b on p.f_userinfo_id = b.f_userinfo_id
LEFT JOIN
(select * from t_stairprice where (getdate() between f_perform_date and f_end_date or f_end_date is null) and f_state = '有效')
sp on b.f_price_id = sp.f_price_id
where p.f_state='有效' and p.f_parameter_key = 'dibaohu_endDate' and b.f_state = '有效'
) up where days > 0
) up on u.f_userinfo_id = up.f_userinfo_id
) u
where f_table_state='正常' AND f_userinfo_id in (
select f_userinfo_id from t_userinfo where f_user_state = '正常' and f_createfile_date is not null
)
group by f_filialeid,f_new_price_id
) u on u.f_filialeid = t3.f_filialeid and u.f_price_id = t3.f_price_id
) xx where {condition}
order by {orderitem}

按钮操作

批量调价

打开一个查询列表 查询出用户 可以对查询出来的用户进行批量调价

列表操作

使用户数

单击使用户数数字 可以转到一个查询列表对这些用户进行调价

配置说明

GasPrice.json

{
"isLimit": true, // 限购
"audit": false, // 启用审核
"heatingSeason": true, // 采暖季
"deductionWay": "cycle" // 'cycle: 周期扣费; day: 日运算扣费; singleHS: 采暖季独立扣费; dayHS: 采暖季日扣费;' 此值不配置默认周期扣费
}

名词解释

阶段月数

阶梯气价使用:表示几个月为一个循环,每过一个循环接阶梯量从0开始重新累计计算

开始日期

阶梯从开始日期开始计算 如开始日期为 2022-01-01 阶段月数为 2 个月 则第一个周期为 2022-01-01 至 2022-02-28 第二个周期为 2022-03-01 至 2022-04-30

优先级

部分地方使用不用考虑

是否采暖

一个区分气价的条件 可以不用考虑

优先级

气价下拉列表的顺序

周期扣费

按照气价开始日期以及阶段月数为一个周期,每个周期都会重置阶梯量 需注意人口基数及人口增量,例如:人口基数为4,人口增量为100,指在档案人口数大于4时,每多增加一个人口,相应每阶梯阶梯上限增加100.

周期平均扣费(仅适用阶梯周期为自然年)

若档案中开户日期f_open_date,在当前划价周期区间内时,将每阶阶梯用量分摊到当前周期内的每月,用户的每阶阶梯上限只能用,开户时间到本周期结束剩余月数乘以月平均数。 例如:若阶梯周期为每一自然年为阶梯周期,一阶用量上限240m³,二阶用量上限480m³,三阶无上限,则平均每月阶梯用量为一阶240/12=20m³,二阶480/12=40m³ 用户a在2023年4月(例如:f_open_date为2023-04-06)开户建档用气,当前阶梯剩余月数为4-12月共9月,则用户2023年的阶梯规则为一阶920=180m³,二阶940=360m³,三阶无上限。

日运算扣费(仅适用阶梯周期为自然月,且表具有抄表记录)

若表具有正常的抄表记录,将每阶阶梯用量分摊至全年的每一天,例如:阶梯周期为1月,一阶用量50m³,二阶用量100m³,三阶无上限,则每日阶梯为一阶日用量:5012/365=1.6438m³,二阶日用量:10012/365=3.2877m³,三阶日用量无上限 抄表划价时,首先获取最后一次抄表记录的时间f_end_handdate,判断当前时间距f_end_handdate的相差天数f_day.则用户每次划价的阶梯情况为一阶日用量f_day,一阶日用量f_day,三阶无上限

采暖季独立扣费

采暖季冬日扣费