开始充电页面接口
This commit is contained in:
parent
de7be19c31
commit
df4c761b08
@ -81,4 +81,12 @@ public interface XhpcTerminalMapper {
|
||||
* @return
|
||||
*/
|
||||
Map<String,Object> getWXpNumMessage(@Param("pNum")String pNum);
|
||||
|
||||
|
||||
/**
|
||||
* 获取图片信息
|
||||
* @param imgIds
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getImageList(@Param("imgIds")List<String> imgIds);
|
||||
}
|
||||
|
||||
@ -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<String, Object> 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<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 = xhpcTerminalMapper.getImageList(imgList);
|
||||
map.put("imgIdList",imgLists);
|
||||
}else{
|
||||
map.put("imgIdList",new ArrayList<>());
|
||||
}
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
|
||||
@ -223,7 +223,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="code !=null and code !=''">
|
||||
and area_code=#{code}
|
||||
and (area_code in (select
|
||||
code
|
||||
from xhpc_area where pcode=#{code}) or area_code=#{code})
|
||||
</if>
|
||||
ORDER BY distance asc
|
||||
</select>
|
||||
|
||||
@ -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
|
||||
</select>
|
||||
|
||||
<select id="getImageList" resultType="map">
|
||||
select
|
||||
img_id as imgId,
|
||||
url as url
|
||||
from xhpc_img where del_flag=0 and status=0
|
||||
<if test="imgIds !=null and imgIds.size()>0 ">
|
||||
and img_id in
|
||||
<foreach collection="imgIds" item="chargingStationId" open="(" separator="," close=")">
|
||||
#{chargingStationId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user