修改定时计费模型

This commit is contained in:
yuyang 2022-02-25 11:17:50 +08:00
parent 0952849a93
commit fafee173a6
2 changed files with 54 additions and 16 deletions

View File

@ -141,7 +141,6 @@ public class XhpcTimingChargingModelServiceImpl extends BaseService implements I
XhpcTimingChargingModel xhpcTimingChargingModel =new XhpcTimingChargingModel(); XhpcTimingChargingModel xhpcTimingChargingModel =new XhpcTimingChargingModel();
xhpcTimingChargingModel.setReason(xhpcTimingChargingModelDto.getReason()); xhpcTimingChargingModel.setReason(xhpcTimingChargingModelDto.getReason());
xhpcTimingChargingModel.setTimingTime(xhpcTimingChargingModelDto.getTimingTime()); xhpcTimingChargingModel.setTimingTime(xhpcTimingChargingModelDto.getTimingTime());
xhpcTimingChargingModel.setTenantId(loginUser.getTenantId());
xhpcTimingChargingModel.setCreateTime(new Date()); xhpcTimingChargingModel.setCreateTime(new Date());
xhpcTimingChargingModel.setChargingStationId(chargingStationId); xhpcTimingChargingModel.setChargingStationId(chargingStationId);
if(xhpcTimingChargingModelDto.getTimingChargingModelId() !=null){ if(xhpcTimingChargingModelDto.getTimingChargingModelId() !=null){
@ -346,6 +345,8 @@ public class XhpcTimingChargingModelServiceImpl extends BaseService implements I
} }
} }
xhpcTimingChargingCacheRateModel.setTfPricesSeq(st.toString()); xhpcTimingChargingCacheRateModel.setTfPricesSeq(st.toString());
xhpcTimingChargingCacheRateModel.setChargingStationId(chargingStationId);
xhpcTimingChargingCacheRateModel.setPhone(xhpcTimingChargingModelDto.getPhone());
xhpcTimingChargingModelMapper.insertXhpcTimingChargingCacheRateModel(xhpcTimingChargingCacheRateModel); xhpcTimingChargingModelMapper.insertXhpcTimingChargingCacheRateModel(xhpcTimingChargingCacheRateModel);
return R.ok(); return R.ok();
} }
@ -517,7 +518,7 @@ public class XhpcTimingChargingModelServiceImpl extends BaseService implements I
} }
} }
} }
return R.fail("添加费率入缓存失败,请稍后在试"); return R.ok();
} }
public static XhpcRateTimeDto[] bubbleSort(XhpcRateTimeDto[] args) { public static XhpcRateTimeDto[] bubbleSort(XhpcRateTimeDto[] args) {

View File

@ -40,21 +40,46 @@
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/> <result property="tenantId" column="tenant_id"/>
<result property="chargingStationId" column="charging_station_id"/> <result property="chargingStationId" column="charging_station_id"/>
<result property="phone" column="phone"/>
</resultMap> </resultMap>
<resultMap id="TimingChargingRateMap" type="com.xhpc.common.domain.XhpcTimingChargingRate"> <resultMap id="TimingChargingRateMap" type="com.xhpc.common.domain.XhpcTimingChargingRate">
<result property="timingChargingRateId" column="timing_charging_cache_rate_model_id"/> <result property="timingChargingRateId" column="timing_charging_cache_rate_model_id"/>
<result property="chargingStationId" column="timing_charging_model_id"/> <result property="chargingStationId" column="timing_charging_model_id"/>
<result property="powerFee" column="one_price"/> <result property="powerFee" column="power_fee"/>
<result property="serviceFee" column="one_svc_price"/> <result property="serviceFee" column="service_fee"/>
<result property="name" column="two_price"/> <result property="name" column="name"/>
<result property="status" column="two_svc_price"/> <result property="status" column="status"/>
<result property="delFlag" column="three_price"/> <result property="delFlag" column="del_flag"/>
<result property="timingChargingModelId" column="three_svc_price"/> <result property="createTime" column="create_time"/>
<result property="rateValue" column="four_price"/> <result property="createBy" column="create_by"/>
<result property="tenantId" column="four_svc_price"/> <result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
<result property="rateValue" column="rate_value"/>
<result property="tenantId" column="tenant_id"/>
</resultMap> </resultMap>
<resultMap id="TimingChargingTimeMap" type="com.xhpc.common.domain.XhpcTimingChargingTime">
<result property="timingChargingTimeId" column="timing_charging_time_id"/>
<result property="chargingStationId" column="timing_charging_model_id"/>
<result property="chargingStationId" column="charging_station_id"/>
<result property="timingChargingRateId" column="timing_charging_rate_id"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="status" column="status"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
<result property="sort" column="sort"/>
<result property="type" column="type"/>
<result property="rateValue" column="rate_value"/>
<result property="tenantId" column="tenant_id"/>
<result property="rateValue" column="rate_value"/>
</resultMap>
<select id="list" resultType="map"> <select id="list" resultType="map">
select select
@ -409,7 +434,13 @@
update_by, update_by,
</if> </if>
<if test="null != remark and '' != remark"> <if test="null != remark and '' != remark">
remark remark,
</if>
<if test="null != chargingStationId and '' != chargingStationId">
charging_station_id,
</if>
<if test="null != phone and '' != phone">
phone,
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -471,7 +502,13 @@
#{updateBy}, #{updateBy},
</if> </if>
<if test="null != remark and '' != remark"> <if test="null != remark and '' != remark">
#{remark} #{remark},
</if>
<if test="null != chargingStationId and '' != chargingStationId">
#{chargingStationId},
</if>
<if test="null != phone and '' != phone">
#{phone},
</if> </if>
</trim> </trim>
</insert> </insert>
@ -558,9 +595,7 @@
<select id="getXhpcTimingChargingModelId" resultMap="CacheRatetMap"> <select id="getXhpcTimingChargingModelId" resultMap="CacheRatetMap">
select select
crm.*, crm.*
tcm.charging_station_id chargingStationId,
tcm.phone phone
from xhpc_timing_charging_cache_rate_model crm from xhpc_timing_charging_cache_rate_model crm
join xhpc_timing_charging_model tcm on crm.timing_charging_model_id = tcm.timing_charging_model_id and tcm.status =0 and tcm.del_flag =0 and now() &gt; tcm.timing_time join xhpc_timing_charging_model tcm on crm.timing_charging_model_id = tcm.timing_charging_model_id and tcm.status =0 and tcm.del_flag =0 and now() &gt; tcm.timing_time
where crm.del_flag=0 where crm.del_flag=0
@ -621,6 +656,8 @@
select * from xhpc_timing_charging_rate where del_flag =0 and timing_charging_model_id =#{timingChargingModelId} select * from xhpc_timing_charging_rate where del_flag =0 and timing_charging_model_id =#{timingChargingModelId}
</select> </select>
<select id="getTimeTimingChargingModelId" resultMap="TimingChargingTimeMap">
select * from xhpc_timing_charging_time where del_flag =0 and timing_charging_model_id =#{timingChargingModelId}
</select>
</mapper> </mapper>