From df4c761b081d083b6ec4f87011f08ddd89abc014 Mon Sep 17 00:00:00 2001 From: yuyang <2265829957@qq.com> Date: Thu, 29 Jul 2021 15:07:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E5=85=85=E7=94=B5=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../station/mapper/XhpcTerminalMapper.java | 8 ++++++++ .../service/XhpcTerminalServiceImpl.java | 18 ++++++++++++++---- .../mapper/XhpcChargingStationMapper.xml | 4 +++- .../resources/mapper/XhpcTerminalMapper.xml | 13 +++++++++++++ 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcTerminalMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcTerminalMapper.java index 238b3963..f71e1b07 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcTerminalMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcTerminalMapper.java @@ -81,4 +81,12 @@ public interface XhpcTerminalMapper { * @return */ Map getWXpNumMessage(@Param("pNum")String pNum); + + + /** + * 获取图片信息 + * @param imgIds + * @return + */ + List> getImageList(@Param("imgIds")List imgIds); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java index 3d4f3135..a907455c 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java @@ -7,9 +7,7 @@ import com.xhpc.charging.station.mapper.XhpcTerminalMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 终端Service业务层处理 @@ -86,7 +84,9 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService{ //获取枪的状态 Map map = xhpcTerminalMapper.getWXpNumMessage(pNum); - + if(map ==null || map.get("chargingStationId")==null){ + return AjaxResult.error(1007,"无效的终端编码"); + } Long chargingStationId = Long.parseLong(map.get("chargingStationId").toString()); //HH:mm:ss String tiem = DateUtil.formatTime(new Date()); @@ -94,6 +94,16 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService{ if(xhpcRateTime!=null){ map.putAll(xhpcRateTime); } + //图片信息 + List imgList =new ArrayList<>(); + if(map.get("imgId") !=null && map.get("imgId").toString() !=""){ + String[] split = map.get("imgId").toString().split(","); + imgList= Arrays.asList(split); + List> imgLists = xhpcTerminalMapper.getImageList(imgList); + map.put("imgIdList",imgLists); + }else{ + map.put("imgIdList",new ArrayList<>()); + } return AjaxResult.success(map); } 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 1637b6f7..d4bdfcf7 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 @@ -223,7 +223,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - and area_code=#{code} + and (area_code in (select + code + from xhpc_area where pcode=#{code}) or area_code=#{code}) ORDER BY distance asc diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml index 9d4a24de..e2ea339f 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml @@ -264,4 +264,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join xhpc_charging_station as ct on ct.charging_station_id =ter.charging_station_id where ter.serial_number=#{pNum} and ter.del_flag = 0 + +