场站详情接口
This commit is contained in:
parent
e7ebf9a722
commit
f1f3fa9ae3
@ -170,7 +170,7 @@ public class XhpcChargingStationController extends BaseController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电站详情(站点详情)
|
* 电站详情+站点详情
|
||||||
* @param chargingStationId 站点id
|
* @param chargingStationId 站点id
|
||||||
* @param longitude 经度
|
* @param longitude 经度
|
||||||
* @param latitude 维度
|
* @param latitude 维度
|
||||||
@ -182,9 +182,26 @@ public class XhpcChargingStationController extends BaseController {
|
|||||||
return AjaxResult.success(xhpcChargingStationService.getXhpcChargingStationMassage(chargingStationId,longitude,latitude));
|
return AjaxResult.success(xhpcChargingStationService.getXhpcChargingStationMassage(chargingStationId,longitude,latitude));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站详情---价格详情
|
||||||
|
* @param chargingStationId 站点id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/getXhpcRateTimeMassage")
|
||||||
|
public AjaxResult getXhpcRateTimeMassage(@Param("chargingStationId") Long chargingStationId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(xhpcChargingStationService.getXhpcRateTimeMassage(chargingStationId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站详情---终端列表
|
||||||
|
* @param chargingStationId 站点id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/getXhpcTerminalMassage")
|
||||||
|
public AjaxResult getXhpcTerminalMassage(@Param("chargingStationId") Long chargingStationId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(xhpcChargingStationService.getXhpcTerminalMassage(chargingStationId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,8 +38,8 @@ public class XhpcRateTime extends BaseEntity {
|
|||||||
/** 计费模型id */
|
/** 计费模型id */
|
||||||
private Long rateModelId;
|
private Long rateModelId;
|
||||||
|
|
||||||
/** 0 全部时间排列完 1 有剩余时间 */
|
/** 时间排序有小到大 */
|
||||||
private Integer type;
|
private Integer sort;
|
||||||
|
|
||||||
public static long getSerialVersionUID() {
|
public static long getSerialVersionUID() {
|
||||||
|
|
||||||
@ -126,14 +126,14 @@ public class XhpcRateTime extends BaseEntity {
|
|||||||
this.rateModelId = rateModelId;
|
this.rateModelId = rateModelId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getType() {
|
public Integer getSort() {
|
||||||
|
|
||||||
return type;
|
return sort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setType(Integer type) {
|
public void setSort(Integer sort) {
|
||||||
|
|
||||||
this.type = type;
|
this.sort = sort;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,6 +119,26 @@ public interface XhpcChargingStationMapper {
|
|||||||
Map<String,Object> getXhpcChargingStationMassage(@Param("chargingStationId")Long chargingStationId,@Param("longitude")String longitude,@Param("latitude")String latitude);
|
Map<String,Object> getXhpcChargingStationMassage(@Param("chargingStationId")Long chargingStationId,@Param("longitude")String longitude,@Param("latitude")String latitude);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取图片信息
|
||||||
|
* @param imgIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
List<Map<String,Object>> getImageList(@Param("imgIds")List<String> imgIds);
|
List<Map<String,Object>> getImageList(@Param("imgIds")List<String> imgIds);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站详情---价格详情
|
||||||
|
* @param chargingStationId 电站ID
|
||||||
|
* @return 电站
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> getXhpcRateTimeMassage(@Param("chargingStationId")Long chargingStationId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站详情---终端列表
|
||||||
|
* @param chargingStationId 电站ID
|
||||||
|
* @return 电站
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> getXhpcTerminalMassage(@Param("chargingStationId")Long chargingStationId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,6 +121,19 @@ public interface IXhpcChargingStationService {
|
|||||||
Map<String,Object> getXhpcChargingStationMassage(Long chargingStationId,String longitude,String latitude);
|
Map<String,Object> getXhpcChargingStationMassage(Long chargingStationId,String longitude,String latitude);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站详情---价格详情
|
||||||
|
* @param chargingStationId 电站ID
|
||||||
|
* @return 电站
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> getXhpcRateTimeMassage(Long chargingStationId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站详情---终端列表
|
||||||
|
* @param chargingStationId 电站ID
|
||||||
|
* @return 电站
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> getXhpcTerminalMassage(Long chargingStationId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,7 +208,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
//检查格式是否正确
|
//检查格式是否正确
|
||||||
//冒泡排序(结束时间小于开始时间)
|
//冒泡排序(结束时间小于开始时间)
|
||||||
//每个时间段都要存
|
//每个时间段都要存
|
||||||
|
//返回计费模型 24:00 转成 00:00
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -287,4 +287,29 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String,Object>> getXhpcRateTimeMassage(Long chargingStationId) {
|
||||||
|
return xhpcChargingStationMapper.getXhpcRateTimeMassage(chargingStationId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getXhpcTerminalMassage(Long chargingStationId) {
|
||||||
|
|
||||||
|
List<Map<String, Object>> list = xhpcChargingStationMapper.getXhpcTerminalMassage(chargingStationId);
|
||||||
|
|
||||||
|
if(list !=null && list.size()>0){
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
Map<String, Object> map = list.get(i);
|
||||||
|
//终端状态用 redis数据
|
||||||
|
//终端状态
|
||||||
|
map.put("status","1");
|
||||||
|
//soc
|
||||||
|
map.put("soc","18%");
|
||||||
|
//剩余时间
|
||||||
|
map.put("remainingTime","16分钟");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public class XhpcRateTimeServiceImpl implements IXhpcRateTimeService{
|
|||||||
//该判断防止某个时间段费率没有录入
|
//该判断防止某个时间段费率没有录入
|
||||||
if(hpcRateTimeMap ==null){
|
if(hpcRateTimeMap ==null){
|
||||||
//获取剩余时间费率
|
//获取剩余时间费率
|
||||||
return xhpcRateTimeMapper.getXhpcRateTimeType(datchargingStationIde);
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
Map<String,Object> map =new HashMap<>();
|
Map<String,Object> map =new HashMap<>();
|
||||||
Long rateId = Long.valueOf(hpcRateTimeMap.get("rateId").toString());
|
Long rateId = Long.valueOf(hpcRateTimeMap.get("rateId").toString());
|
||||||
|
|||||||
@ -241,4 +241,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getXhpcRateTimeMassage" resultType="map">
|
||||||
|
select
|
||||||
|
xrt.start_time as startTime,
|
||||||
|
xrt.end_time as endTime,
|
||||||
|
xr.power_fee as powerFee,
|
||||||
|
xr.service_fee as serviceFee
|
||||||
|
from xhpc_rate_time as xrt
|
||||||
|
left join xhpc_rate as xr on xr.rate_id = xrt.rate_id
|
||||||
|
where xrt.charging_station_id =#{chargingStationId} and xrt.status=0 and xrt.del_flag=0
|
||||||
|
order by xrt.sort asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getXhpcTerminalMassage" resultType="map">
|
||||||
|
select
|
||||||
|
te.name as name,
|
||||||
|
cp.power as power,
|
||||||
|
cp.auxiliary_power_supply as auxiliaryPowerSupply,
|
||||||
|
cp.input_voltage as inputVoltage
|
||||||
|
from xhpc_terminal as te
|
||||||
|
left join xhpc_charging_pile as cp on cp.charging_pile_id = te.charging_pile_id
|
||||||
|
where te.charging_station_id =#{chargingStationId} and te.status=0 and te.del_flag=0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
|
<result property="sort" column="sort" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="getXhpcRateTime" resultType="map">
|
<select id="getXhpcRateTime" resultType="map">
|
||||||
@ -27,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
rate_id as rateId,
|
rate_id as rateId,
|
||||||
start_time as startTime,
|
start_time as startTime,
|
||||||
end_time as endTime
|
end_time as endTime
|
||||||
from xhpc_rate_time where charging_station_id =#{datchargingStationId} and start_time <=#{date} and end_time >=#{date} and status=0 and del_flag=0 and type=0
|
from xhpc_rate_time where charging_station_id =#{datchargingStationId} and start_time <=#{date} and end_time >=#{date} and status=0 and del_flag=0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getXhpcTimeType" resultType="map">
|
<select id="getXhpcTimeType" resultType="map">
|
||||||
@ -43,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
ra.power_fee as powerFee,
|
ra.power_fee as powerFee,
|
||||||
ra.service_fee as serviceFee
|
ra.service_fee as serviceFee
|
||||||
from xhpc_rate as ra
|
from xhpc_rate as ra
|
||||||
where ra.charging_station_id =#{datchargingStationId} and ra.status=0 and ra.del_flag=0 and ra.rate_id=(select rate_id from xhpc_rate_time where status=0 and del_flag=0 and type=1 and charging_station_id =#{datchargingStationId} LIMIT 1)
|
where ra.charging_station_id =#{datchargingStationId} and ra.status=0 and ra.del_flag=0 and ra.rate_id=(select rate_id from xhpc_rate_time where status=0 and del_flag=0 and charging_station_id =#{datchargingStationId} LIMIT 1)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user