场站查询接口
This commit is contained in:
parent
4665e59741
commit
f969d2dc9a
@ -150,6 +150,24 @@ public class XhpcChargingStationController extends BaseController {
|
||||
return xhpcChargingStationService.addXhpcChargingStation(xhpcChargingStationDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 场站详情接口
|
||||
* @param chargingStationId
|
||||
* @param type 1详情使用 2编辑使用
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getXhpcChargingStationMessage")
|
||||
public AjaxResult getXhpcChargingStationMessage(Long chargingStationId,Integer type)
|
||||
{
|
||||
return AjaxResult.success(xhpcChargingStationService.getXhpcChargingStationMessage(chargingStationId,type));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 微信小程序电站列表
|
||||
* @param name 电站名称
|
||||
@ -160,11 +178,11 @@ public class XhpcChargingStationController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
//@PreAuthorize(hasPermi = "system:station:list")
|
||||
@GetMapping("/wxList")
|
||||
public TableDataInfo wxList(String name,String serviceFacilities,Integer code,String longitude,String latitude)
|
||||
@GetMapping("/getWXList")
|
||||
public TableDataInfo getWXList(String name,String serviceFacilities,Integer code,String longitude,String latitude)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String,Object>> list = xhpcChargingStationService.wxList(name,serviceFacilities,code,longitude,latitude);
|
||||
List<Map<String,Object>> list = xhpcChargingStationService.getWXList(name,serviceFacilities,code,longitude,latitude);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -176,10 +194,10 @@ public class XhpcChargingStationController extends BaseController {
|
||||
* @param latitude 维度
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getXhpcChargingStationMassage")
|
||||
public AjaxResult getXhpcChargingStationMassage(@Param("chargingStationId") Long chargingStationId,@Param("longitude")String longitude,@Param("latitude")String latitude)
|
||||
@GetMapping(value = "/getWXXhpcChargingStationMessage")
|
||||
public AjaxResult getWXXhpcChargingStationMessage(@Param("chargingStationId") Long chargingStationId,@Param("longitude")String longitude,@Param("latitude")String latitude)
|
||||
{
|
||||
return AjaxResult.success(xhpcChargingStationService.getXhpcChargingStationMassage(chargingStationId,longitude,latitude));
|
||||
return AjaxResult.success(xhpcChargingStationService.getWXXhpcChargingStationMessage(chargingStationId,longitude,latitude));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -187,10 +205,10 @@ public class XhpcChargingStationController extends BaseController {
|
||||
* @param chargingStationId 站点id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getXhpcRateTimeMassage")
|
||||
@GetMapping(value = "/getWXXhpcRateTimeMassage")
|
||||
public AjaxResult getXhpcRateTimeMassage(@Param("chargingStationId") Long chargingStationId)
|
||||
{
|
||||
return AjaxResult.success(xhpcChargingStationService.getXhpcRateTimeMassage(chargingStationId));
|
||||
return AjaxResult.success(xhpcChargingStationService.getWXXhpcRateTimeMassage(chargingStationId));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -198,10 +216,10 @@ public class XhpcChargingStationController extends BaseController {
|
||||
* @param chargingStationId 站点id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getXhpcTerminalMassage")
|
||||
public AjaxResult getXhpcTerminalMassage(@Param("chargingStationId") Long chargingStationId)
|
||||
@GetMapping(value = "/getWXXhpcTerminalMassage")
|
||||
public AjaxResult getWXXhpcTerminalMassage(@Param("chargingStationId") Long chargingStationId)
|
||||
{
|
||||
return AjaxResult.success(xhpcChargingStationService.getXhpcTerminalMassage(chargingStationId));
|
||||
return AjaxResult.success(xhpcChargingStationService.getWXXhpcTerminalMassage(chargingStationId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -25,14 +25,18 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
@Excel(name = "运营商id")
|
||||
private Long operatorId;
|
||||
|
||||
/** 电站类型 */
|
||||
@Excel(name = "电站类型")
|
||||
/** 电站地址 */
|
||||
@Excel(name = "电站地址")
|
||||
private Integer type;
|
||||
|
||||
/** 建设场所 */
|
||||
@Excel(name = "建设场所")
|
||||
private String constructionSite;
|
||||
|
||||
/** 电站类型 */
|
||||
@Excel(name = "电站类型")
|
||||
private String stationType;
|
||||
|
||||
/** 服务设施 */
|
||||
@Excel(name = "服务设施")
|
||||
private String serviceFacilities;
|
||||
@ -289,4 +293,14 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
this.reminderInstructions = reminderInstructions;
|
||||
}
|
||||
|
||||
public String getStationType() {
|
||||
|
||||
return stationType;
|
||||
}
|
||||
|
||||
public void setStationType(String stationType) {
|
||||
|
||||
this.stationType = stationType;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -42,6 +42,9 @@ public class XhpcRateTime extends BaseEntity {
|
||||
/** 时间排序有小到大 */
|
||||
private Integer sort;
|
||||
|
||||
/** 1 设置时间段 2默认时间段 */
|
||||
private Integer type;
|
||||
|
||||
public static long getSerialVersionUID() {
|
||||
|
||||
return serialVersionUID;
|
||||
@ -137,4 +140,14 @@ public class XhpcRateTime extends BaseEntity {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -91,6 +91,16 @@ public interface XhpcChargingStationMapper {
|
||||
*/
|
||||
List<Map<String,Object>> stationInternetBlackList(Long chargingStationId);
|
||||
|
||||
|
||||
/**
|
||||
* 电站详情信息
|
||||
*
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 电站
|
||||
*/
|
||||
Map<String,Object> getXhpcChargingStationMessage(@Param("chargingStationId")Long chargingStationId);
|
||||
|
||||
|
||||
/**
|
||||
* 微信小程序电站列表
|
||||
* @param name 电站名称
|
||||
@ -101,7 +111,7 @@ public interface XhpcChargingStationMapper {
|
||||
* @param clientVisible 微信小程序是否可见 2可见
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> wxList(@Param("name") String name,@Param("serviceFacilities")List<String> serviceFacilities,@Param("code")Integer code,@Param("longitude")String longitude,@Param("latitude")String latitude,@Param("clientVisible")Integer clientVisible);
|
||||
List<Map<String,Object>> getWXList(@Param("name") String name,@Param("serviceFacilities")List<String> serviceFacilities,@Param("code")Integer code,@Param("longitude")String longitude,@Param("latitude")String latitude,@Param("clientVisible")Integer clientVisible);
|
||||
|
||||
|
||||
/**
|
||||
@ -119,7 +129,7 @@ public interface XhpcChargingStationMapper {
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 电站
|
||||
*/
|
||||
Map<String,Object> getXhpcChargingStationMassage(@Param("chargingStationId")Long chargingStationId,@Param("longitude")String longitude,@Param("latitude")String latitude);
|
||||
Map<String,Object> getWXXhpcChargingStationMessage(@Param("chargingStationId")Long chargingStationId,@Param("longitude")String longitude,@Param("latitude")String latitude);
|
||||
|
||||
|
||||
/**
|
||||
@ -135,7 +145,7 @@ public interface XhpcChargingStationMapper {
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 电站
|
||||
*/
|
||||
List<Map<String,Object>> getXhpcRateTimeMassage(@Param("chargingStationId")Long chargingStationId);
|
||||
List<Map<String,Object>> getWXXhpcRateTimeMassage(@Param("chargingStationId")Long chargingStationId);
|
||||
|
||||
|
||||
/**
|
||||
@ -143,7 +153,7 @@ public interface XhpcChargingStationMapper {
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 电站
|
||||
*/
|
||||
List<Map<String,Object>> getXhpcTerminalMassage(@Param("chargingStationId")Long chargingStationId);
|
||||
List<Map<String,Object>> getWXXhpcTerminalMassage(@Param("chargingStationId")Long chargingStationId);
|
||||
|
||||
|
||||
/**
|
||||
@ -166,4 +176,29 @@ public interface XhpcChargingStationMapper {
|
||||
* 添加费率时段
|
||||
*/
|
||||
int addXhpcRateTime(XhpcRateTime xhpcRateTime);
|
||||
|
||||
|
||||
/**
|
||||
* 返回费率
|
||||
*/
|
||||
List<Map<String,Object>> getXhpcRateList(@Param("chargingStationId")Long chargingStationId);
|
||||
|
||||
|
||||
/**
|
||||
* 返回费率时段(设置时段)
|
||||
*/
|
||||
List<Map<String,Object>> getXhpcRateTimeTypeList(@Param("chargingStationId")Long chargingStationId,@Param("type")Integer type);
|
||||
|
||||
|
||||
/**
|
||||
* 今日充电量、今日充电用户、今日充电次数
|
||||
*/
|
||||
Map<String,Object> getXhpcRateTimeOrderStatistics(@Param("chargingStationId")Long chargingStationId);
|
||||
|
||||
/**
|
||||
* 获取终端列表
|
||||
* @param chargingStationId
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getXhpcTerminalList(@Param("chargingStationId")Long chargingStationId);
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 电站
|
||||
*/
|
||||
public XhpcChargingStation selectXhpcChargingStationById(Long chargingStationId);
|
||||
XhpcChargingStation selectXhpcChargingStationById(Long chargingStationId);
|
||||
|
||||
/**
|
||||
* 查询电站列表
|
||||
@ -30,7 +30,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param operatorName 运营商名称
|
||||
* @return 电站集合
|
||||
*/
|
||||
public List<Map<String,Object>> selectXhpcChargingStationList(String name,String operatorName);
|
||||
List<Map<String,Object>> selectXhpcChargingStationList(String name,String operatorName);
|
||||
|
||||
/**
|
||||
* 新增电站
|
||||
@ -38,7 +38,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param xhpcChargingStation 电站
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertXhpcChargingStation(XhpcChargingStation xhpcChargingStation);
|
||||
int insertXhpcChargingStation(XhpcChargingStation xhpcChargingStation);
|
||||
|
||||
/**
|
||||
* 修改电站
|
||||
@ -46,7 +46,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param xhpcChargingStation 电站
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateXhpcChargingStation(XhpcChargingStation xhpcChargingStation);
|
||||
int updateXhpcChargingStation(XhpcChargingStation xhpcChargingStation);
|
||||
|
||||
/**
|
||||
* 批量删除电站
|
||||
@ -54,7 +54,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param chargingStationIds 需要删除的电站ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateXhpcChargingStationByIds(Long[] chargingStationIds);
|
||||
int updateXhpcChargingStationByIds(Long[] chargingStationIds);
|
||||
|
||||
/**
|
||||
* 删除电站信息
|
||||
@ -62,7 +62,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateXhpcChargingStationById(Long chargingStationId);
|
||||
int updateXhpcChargingStationById(Long chargingStationId);
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
@ -71,7 +71,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param chargingStationId 场站id
|
||||
* @return 结果
|
||||
*/
|
||||
public int status(Integer status,Long chargingStationId);
|
||||
int status(Integer status,Long chargingStationId);
|
||||
|
||||
/**
|
||||
* APP端、小程序是否可见
|
||||
@ -81,7 +81,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param chargingStationId 场站id
|
||||
* @return 结果
|
||||
*/
|
||||
public int clientVisible(Integer type,String clientVisible,Long chargingStationId);
|
||||
int clientVisible(Integer type,String clientVisible,Long chargingStationId);
|
||||
|
||||
/**
|
||||
* 合作的电站
|
||||
@ -99,6 +99,13 @@ public interface IXhpcChargingStationService {
|
||||
AjaxResult addXhpcChargingStation(XhpcChargingStationDto xhpcChargingStationDto);
|
||||
|
||||
|
||||
/**
|
||||
* 电站详情(站点详情)
|
||||
*
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 电站
|
||||
*/
|
||||
Map<String,Object> getXhpcChargingStationMessage(Long chargingStationId,Integer type);
|
||||
|
||||
/**
|
||||
* 微信小程序电站列表
|
||||
@ -109,16 +116,16 @@ public interface IXhpcChargingStationService {
|
||||
* @param latitude 维度
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> wxList(String name,String serviceFacilities,Integer code,String longitude,String latitude);
|
||||
List<Map<String,Object>> getWXList(String name,String serviceFacilities,Integer code,String longitude,String latitude);
|
||||
|
||||
|
||||
/**
|
||||
* 电站详情(站点详情)
|
||||
* 电站详情(站点详情-小程序)
|
||||
*
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 电站
|
||||
*/
|
||||
Map<String,Object> getXhpcChargingStationMassage(Long chargingStationId,String longitude,String latitude);
|
||||
Map<String,Object> getWXXhpcChargingStationMessage(Long chargingStationId,String longitude,String latitude);
|
||||
|
||||
|
||||
/**
|
||||
@ -126,7 +133,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 电站
|
||||
*/
|
||||
List<Map<String,Object>> getXhpcRateTimeMassage(Long chargingStationId);
|
||||
List<Map<String,Object>> getWXXhpcRateTimeMassage(Long chargingStationId);
|
||||
|
||||
|
||||
/**
|
||||
@ -134,6 +141,6 @@ public interface IXhpcChargingStationService {
|
||||
* @param chargingStationId 电站ID
|
||||
* @return 电站
|
||||
*/
|
||||
List<Map<String,Object>> getXhpcTerminalMassage(Long chargingStationId);
|
||||
List<Map<String,Object>> getWXXhpcTerminalMassage(Long chargingStationId);
|
||||
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
Date startTwo = DateUtil.parse(xhpcRateTimeTwo.getStartTime());
|
||||
Date endTwo = DateUtil.parse(xhpcRateTimeTwo.getEndTime());
|
||||
if (DateUtil.compare(startOne, endTwo)<0&&DateUtil.compare(startTwo, endOne)<0){
|
||||
return AjaxResult.error("1003","时间段有重叠");
|
||||
return AjaxResult.error("1004","时间段有重叠");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -278,7 +278,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
BeanUtils.copyProperties(xhpcChargingStationDto,xhpcRateModel);
|
||||
int i = xhpcChargingStationMapper.addXhpcRateModel(xhpcRateModel);
|
||||
if(i==0){
|
||||
return AjaxResult.error("1004","费率计费模型添加失败");
|
||||
return AjaxResult.error("1005","费率计费模型添加失败");
|
||||
}
|
||||
//费率模型id
|
||||
Long rateModelId = xhpcRateModel.getRateModelId();
|
||||
@ -288,7 +288,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
xhpcChargingStation.setRateModelId(rateModelId);
|
||||
int j = xhpcChargingStationMapper.addXhpcChargingStation(xhpcChargingStation);
|
||||
if(j==0){
|
||||
return AjaxResult.error("1003","电站基本信息添加失败");
|
||||
return AjaxResult.error("1006","电站基本信息添加失败");
|
||||
}
|
||||
Long chargingStationId = xhpcChargingStation.getChargingStationId();
|
||||
|
||||
@ -333,52 +333,99 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
if(k==0){
|
||||
if(!"00:00:00".equals(xhpcRateTimeDto.getStartTime())){
|
||||
//添加一条默认费率时段
|
||||
sort = addXhpcRateTime(rateModelId,defaultPeriodId,"00:00:00",startTime,sort);
|
||||
sort = addXhpcRateTime(chargingStationId,rateModelId,defaultPeriodId,"00:00:00",startTime,sort,2);
|
||||
}
|
||||
//并把本条数据也添加上
|
||||
sort = addXhpcRateTime(rateModelId,defaultPeriodIdMap,startTime,endTime,sort);
|
||||
}else{
|
||||
sort = addXhpcRateTime(chargingStationId,rateModelId,defaultPeriodIdMap,startTime,endTime,sort,1);
|
||||
}else if(k<list.size()){
|
||||
//判断上条数据的结束时间是否等于现在这条数据的开始时间,不等于添加一条默认费率时段
|
||||
String endTimeK = list.get(k - 1).getEndTime();
|
||||
if(!endTimeK.equals(startTime)){
|
||||
//添加一条默认费率时段
|
||||
sort = addXhpcRateTime(rateModelId,defaultPeriodId,endTimeK,startTime,sort);
|
||||
sort = addXhpcRateTime(chargingStationId,rateModelId,defaultPeriodId,endTimeK,startTime,sort,2);
|
||||
}
|
||||
//并把本条数据也添加上
|
||||
sort = addXhpcRateTime(rateModelId,defaultPeriodIdMap,startTime,endTime,sort);
|
||||
|
||||
if(k==(list.size()-1) && !endTimeK.equals("24:00:00")){
|
||||
sort = addXhpcRateTime(chargingStationId,rateModelId,defaultPeriodIdMap,startTime,endTime,sort,1);
|
||||
}else{
|
||||
String endTimeK = list.get(k - 1).getEndTime();
|
||||
if(!endTimeK.equals(startTime)){
|
||||
//添加一条默认费率时段
|
||||
sort = addXhpcRateTime(rateModelId,defaultPeriodId,startTime,"24:00:00",sort);
|
||||
sort = addXhpcRateTime(chargingStationId,rateModelId,defaultPeriodId,endTimeK,startTime,sort,2);
|
||||
}
|
||||
//并把本条数据也添加上
|
||||
sort = addXhpcRateTime(chargingStationId,rateModelId,defaultPeriodIdMap,startTime,endTime,sort,1);
|
||||
if(!endTime.equals("24:00:00")){
|
||||
//添加一条默认费率时段
|
||||
sort = addXhpcRateTime(chargingStationId,rateModelId,defaultPeriodId,startTime,"24:00:00",sort,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
/**
|
||||
* 场站详情接口
|
||||
* @param chargingStationId
|
||||
* @param type 1详情使用 2编辑使用
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getXhpcChargingStationMessage(Long chargingStationId,Integer type) {
|
||||
|
||||
private int addXhpcRateTime(Long rateModelId, Long defaultPeriodId,String startTime,String endTime, int sort) {
|
||||
|
||||
Map<String, Object> map = xhpcChargingStationMapper.getXhpcChargingStationMessage(chargingStationId);
|
||||
//图片信息
|
||||
List<String> imgList =new ArrayList<>();
|
||||
if(map.get("imgId") !=null && map.get("imgId").toString() !=""){
|
||||
String[] split = map.get("imgId").toString().split(",");
|
||||
imgList=Arrays.asList(split);
|
||||
List<Map<String, Object>> imgLists = xhpcChargingStationMapper.getImageList(imgList);
|
||||
map.put("imgIdList",imgLists);
|
||||
}else{
|
||||
map.put("imgIdList",new ArrayList<>());
|
||||
}
|
||||
//费率
|
||||
List<Map<String, Object>> xhpcRateList = xhpcChargingStationMapper.getXhpcRateList(chargingStationId);
|
||||
map.put("rateList",xhpcRateList);
|
||||
|
||||
//费率时段,先反设置时段,在反默认时段
|
||||
List<Map<String, Object>> xhpcRateTimeTypeList = xhpcChargingStationMapper.getXhpcRateTimeTypeList(chargingStationId, 1);
|
||||
xhpcRateTimeTypeList.addAll(xhpcChargingStationMapper.getXhpcRateTimeTypeList(chargingStationId, 2));
|
||||
map.put("rateTimeList",xhpcRateTimeTypeList);
|
||||
if(type ==2){
|
||||
//统计终端(充redis获取终端信息)
|
||||
map.putAll(xhpcChargingStationMapper.getXhpcRateTimeOrderStatistics(chargingStationId));
|
||||
//桩列表
|
||||
List<Map<String, Object>> xhpcTerminalList = xhpcChargingStationMapper.getXhpcTerminalList(chargingStationId);
|
||||
map.put("terminalList",xhpcTerminalList);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private int addXhpcRateTime(Long chargingStationId,Long rateModelId, Long defaultPeriodId,String startTime,String endTime, int sort,int type) {
|
||||
XhpcRateTime xhpcRateTime =new XhpcRateTime();
|
||||
xhpcRateTime.setChargingStationId(chargingStationId);
|
||||
xhpcRateTime.setRateId(defaultPeriodId);
|
||||
Date start = DateUtil.parse(startTime);
|
||||
xhpcRateTime.setStartTime(start);
|
||||
Date emd = DateUtil.parse(endTime);
|
||||
xhpcRateTime.setEndTime(emd);
|
||||
xhpcRateTime.setRateTimeId(rateModelId);
|
||||
xhpcRateTime.setRateModelId(rateModelId);
|
||||
xhpcRateTime.setSort(sort);
|
||||
xhpcRateTime.setType(type);
|
||||
xhpcChargingStationMapper.addXhpcRateTime(xhpcRateTime);
|
||||
sort++;
|
||||
return sort;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> wxList(String name, String serviceFacilities, Integer code, String longitude, String latitude) {
|
||||
public List<Map<String, Object>> getWXList(String name, String serviceFacilities, Integer code, String longitude, String latitude) {
|
||||
|
||||
List<String> stringList =new ArrayList<>();
|
||||
if(serviceFacilities !=null && serviceFacilities !=""){
|
||||
String[] split = serviceFacilities.split(",");
|
||||
stringList=Arrays.asList(split);
|
||||
}
|
||||
List<Map<String, Object>> list = xhpcChargingStationMapper.wxList(name, stringList, code, longitude, latitude,2);
|
||||
List<Map<String, Object>> list = xhpcChargingStationMapper.getWXList(name, stringList, code, longitude, latitude,2);
|
||||
if(list !=null && list.size()>0){
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map<String,Object> map = list.get(i);
|
||||
@ -406,10 +453,10 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getXhpcChargingStationMassage(Long chargingStationId,String longitude,String latitude) {
|
||||
public Map<String, Object> getWXXhpcChargingStationMessage(Long chargingStationId,String longitude,String latitude) {
|
||||
|
||||
//获取基本信息
|
||||
Map<String, Object> map = xhpcChargingStationMapper.getXhpcChargingStationMassage(chargingStationId,longitude,latitude);
|
||||
Map<String, Object> map = xhpcChargingStationMapper.getWXXhpcChargingStationMessage(chargingStationId,longitude,latitude);
|
||||
//桩空闲数量,从redis获取
|
||||
|
||||
//标签
|
||||
@ -443,14 +490,14 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,Object>> getXhpcRateTimeMassage(Long chargingStationId) {
|
||||
return xhpcChargingStationMapper.getXhpcRateTimeMassage(chargingStationId);
|
||||
public List<Map<String,Object>> getWXXhpcRateTimeMassage(Long chargingStationId) {
|
||||
return xhpcChargingStationMapper.getWXXhpcRateTimeMassage(chargingStationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getXhpcTerminalMassage(Long chargingStationId) {
|
||||
public List<Map<String, Object>> getWXXhpcTerminalMassage(Long chargingStationId) {
|
||||
|
||||
List<Map<String, Object>> list = xhpcChargingStationMapper.getXhpcTerminalMassage(chargingStationId);
|
||||
List<Map<String, Object>> list = xhpcChargingStationMapper.getWXXhpcTerminalMassage(chargingStationId);
|
||||
|
||||
if(list !=null && list.size()>0){
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
|
||||
@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="name" column="name" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="type" column="type" />
|
||||
<result property="stationType" column="station_type" />
|
||||
<result property="constructionSite" column="construction_site" />
|
||||
<result property="serviceFacilities" column="service_facilities" />
|
||||
<result property="peripheryFacilities" column="periphery_facilities" />
|
||||
@ -170,7 +171,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select name from xhpc_internet_user where del_flag=0 and internet_user_id not in (select internet_user_id from xhpc_station_internet_blacklist where charging_station_id=#{chargingStationId})
|
||||
</select>
|
||||
|
||||
<select id="wxList" resultType="map">
|
||||
<select id="getXhpcChargingStationMessage" resultType="map">
|
||||
select
|
||||
ct.charging_station_id as chargingStationId,
|
||||
ct.name as name,
|
||||
ct.operator_id as operatorId,
|
||||
op.name as operatorName,
|
||||
ct.type as type,
|
||||
ct.station_type as stationType,
|
||||
(select dict_value from xhpc_dict_biz where code ='charging_station_type' and dict_key =ct.station_type) as stationTypeName,
|
||||
ct.serial_number as serialNumber,
|
||||
ct.construction_site as constructionSite,
|
||||
(select dict_value from xhpc_dict_biz where code ='charging_construction_site' and dict_key =ct.construction_site) as constructionSiteName,
|
||||
ct.address as address,
|
||||
ct.detailed_address as detailedAddress,
|
||||
ct.periphery_facilities as peripheryFacilities,
|
||||
ct.service_facilities as erviceFacilities,
|
||||
ct.parking_instructions as parkingInstructions,
|
||||
ct.business_instructions as businessInstructions,
|
||||
ct.reminder_instructions as reminderInstructions,
|
||||
ct.img_id as imgId
|
||||
from xhpc_charging_station as ct
|
||||
left join xhpc_operator as op on op.operator_id = ct.operator_id
|
||||
where ct.charging_station_id = 4 and ct.del_flag =0
|
||||
</select>
|
||||
|
||||
<select id="getWXList" resultType="map">
|
||||
select
|
||||
charging_station_id as chargingStationId,
|
||||
name as name,
|
||||
@ -210,7 +236,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getXhpcChargingStationMassage" resultType="map">
|
||||
<select id="getWXXhpcChargingStationMessage" resultType="map">
|
||||
select
|
||||
charging_station_id as chargingStationId,
|
||||
(select type from xhpc_charging_pile where charging_station_id = charging_station_id and del_flag=0 and status=0) as type,
|
||||
@ -242,7 +268,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getXhpcRateTimeMassage" resultType="map">
|
||||
<select id="getWXXhpcRateTimeMassage" resultType="map">
|
||||
select
|
||||
xrt.start_time as startTime,
|
||||
xrt.end_time as endTime,
|
||||
@ -255,7 +281,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getXhpcTerminalMassage" resultType="map">
|
||||
<select id="getWXXhpcTerminalMassage" resultType="map">
|
||||
select
|
||||
te.name as name,
|
||||
cp.power as power,
|
||||
@ -588,6 +614,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="null != remark and '' != remark">
|
||||
remark
|
||||
</if>
|
||||
<if test="null != type ">
|
||||
type
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != chargingStationId ">
|
||||
@ -629,8 +658,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="null != remark and '' != remark">
|
||||
#{remark}
|
||||
</if>
|
||||
<if test="null != type ">
|
||||
#{type}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="getXhpcRateList" resultType="map">
|
||||
select
|
||||
power_fee as powerFee,
|
||||
service_fee as serviceFee,
|
||||
name as name
|
||||
from xhpc_rate
|
||||
where charging_station_id=#{chargingStationId} and del_flag =0
|
||||
</select>
|
||||
|
||||
<select id="getXhpcRateTimeTypeList" resultType="map">
|
||||
<if test="type ==1">
|
||||
select
|
||||
rt.start_time as startTime,
|
||||
replace(rt.end_time,'00:00:00','24:00:00') AS endTime,
|
||||
rt.rate_id as rateId,
|
||||
ra.name as rateName
|
||||
from xhpc_rate_time as rt
|
||||
left join xhpc_rate as ra on ra.rate_id =rt.rate_id
|
||||
where rt.charging_station_id=#{chargingStationId} and rt.del_flag =0 and rt.type=1
|
||||
</if>
|
||||
<if test="type ==2">
|
||||
select
|
||||
rt.start_time as startTime,
|
||||
replace(rt.end_time,'00:00:00','24:00:00') AS endTime,
|
||||
rt.rate_id as rateId,
|
||||
ra.name as rateName
|
||||
from xhpc_rate_time as rt
|
||||
left join xhpc_rate as ra on ra.rate_id =rt.rate_id
|
||||
where rt.charging_station_id=#{chargingStationId} and rt.del_flag =0 and rt.type=2
|
||||
group by type
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getXhpcRateTimeOrderStatistics" resultType="map">
|
||||
select
|
||||
sum(charging_degree) as chargingDegreeSum,
|
||||
COUNT(real_time_order_id) as realTimeOrderIdCount,
|
||||
COUNT(DISTINCT user_id) as userIdCount
|
||||
from xhpc_real_time_order
|
||||
where real_time_order_id in (
|
||||
select max(real_time_order_id) from xhpc_real_time_order WHERE to_days(create_time) = to_days(now()) and charging_station_id=#{chargingStationId} group by charging_order_id )
|
||||
</select>
|
||||
|
||||
<select id="getXhpcTerminalList" resultType="map">
|
||||
select
|
||||
te.terminal_id as terminalId,
|
||||
te.name as terminalName,
|
||||
ct.name as chargingStationName,
|
||||
te.pile_serial_number as pileSerialNumber,
|
||||
cp.power as power,
|
||||
cp.serial_number as serialNumber,
|
||||
te.status as status,
|
||||
te.work_status as workStatus
|
||||
from xhpc_terminal as te
|
||||
left join xhpc_charging_station as ct on ct.charging_station_id = te.charging_station_id
|
||||
left join xhpc_charging_pile as cp on cp.charging_pile_id = te.charging_pile_id
|
||||
where te.charging_station_id=#{chargingStationId} and te.del_flag=0
|
||||
</select>
|
||||
</mapper>
|
||||
@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="type" column="type" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getXhpcRateTime" resultType="map">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user