From 25bfcdaf1036bf36cb54211da2647ecb3421808c Mon Sep 17 00:00:00 2001 From: yuyang <2265829957@qq.com> Date: Wed, 21 Jul 2021 16:00:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=88=97=E8=A1=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../XhpcChargingStationController.java | 19 ++++++++++ .../mapper/XhpcChargingStationMapper.java | 24 ++++++++++++ .../service/IXhpcChargingStationService.java | 14 +++++++ .../XhpcChargingStationServiceImpl.java | 31 +++++++++++++++ .../mapper/XhpcChargingStationMapper.xml | 38 +++++++++++++++++++ 5 files changed, 126 insertions(+) diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java index f37a2aa3..8ab8874e 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java @@ -138,4 +138,23 @@ public class XhpcChargingStationController extends BaseController { } + /** + * 微信小程序电站列表 + * @param name 电站名称 + * @param serviceFacilities 标签(服务设施) + * @param code 城市id + * @param longitude 经度 + * @param latitude 维度 + * @return + */ + //@PreAuthorize(hasPermi = "system:station:list") + @GetMapping("/wxList") + public TableDataInfo wxList(String name,String serviceFacilities,Integer code,String longitude,String latitude) + { + startPage(); + List> list = xhpcChargingStationService.wxList(name,serviceFacilities,code,longitude,latitude); + return getDataTable(list); + } + + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java index aad58189..95372111 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java @@ -87,4 +87,28 @@ public interface XhpcChargingStationMapper { * @return 电站 */ List> stationInternetBlackList(Long chargingStationId); + + /** + * 微信小程序电站列表 + * @param name 电站名称 + * @param serviceFacilities 标签集合(服务设施) + * @param code 城市id + * @param longitude 经度 + * @param latitude 维度 + * @param clientVisible 微信小程序是否可见 2可见 + * @return + */ + List> wxList(@Param("name") String name,@Param("serviceFacilities")List serviceFacilities,@Param("code")Integer code,@Param("longitude")String longitude,@Param("latitude")String latitude,@Param("clientVisible")Integer clientVisible); + + + /** + * 根据code获取数据 + * + * @param code 字典code + * @param serviceFacilities 筛选条件 + * @return 电站 + */ + List> getCode(@Param("code")String code,@Param("serviceFacilities")List serviceFacilities); + + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java index 5ec9b9ed..46421f93 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java @@ -88,4 +88,18 @@ public interface IXhpcChargingStationService { * @return 电站 */ public List> stationInternetBlackList(Long chargingStationId); + + + + /** + * 微信小程序电站列表 + * @param name 电站名称 + * @param serviceFacilities 标签(服务设施) + * @param code 城市id + * @param longitude 经度 + * @param latitude 维度 + * @return + */ + public List> wxList(String name,String serviceFacilities,Integer code,String longitude,String latitude); + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index d0e9ea65..f81e0e1d 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -176,4 +176,35 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi return xhpcChargingStationMapper.stationInternetBlackList(chargingStationId); } + @Override + public List> wxList(String name, String serviceFacilities, Integer code, String longitude, String latitude) { + + List stringList =new ArrayList<>(); + if(serviceFacilities !=null && serviceFacilities !=""){ + String[] split = serviceFacilities.split(","); + stringList=Arrays.asList(split); + } + List> list = xhpcChargingStationMapper.wxList(name, stringList, code, longitude, latitude,2); + if(list !=null && list.size()>0){ + for (int i = 0; i < list.size(); i++) { + Map map = list.get(i); + Long chargingStationId = Long.valueOf(map.get("chargingStationId").toString()); + //获取该时段电费 + //HH:mm:ss + String tiem = DateUtil.formatTime(new Date()); + Map xhpcRateTime = xhpcRateTimeService.getXhpcRateTime(tiem, chargingStationId); + if(xhpcRateTime!=null){ + map.putAll(xhpcRateTime); + } + //获取标签 + List> label_type = xhpcChargingStationMapper.getCode("label_type",stringList); + map.put("serviceFacilities",label_type); + //桩(空闲和使用从redis获取) + + } + } + return list; + } + + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml index 0d5e8da8..d0dba82b 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -166,4 +166,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + \ No newline at end of file