mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-13 14:30:08 +08:00
update 高德
This commit is contained in:
@@ -41,8 +41,8 @@ public class AMapController extends BaseController {
|
|||||||
// true 验签成功
|
// true 验签成功
|
||||||
String bizContent = requestMap.get("biz_content");
|
String bizContent = requestMap.get("biz_content");
|
||||||
GetStationInfoDTO dto = JSON.parseObject(bizContent, GetStationInfoDTO.class);
|
GetStationInfoDTO dto = JSON.parseObject(bizContent, GetStationInfoDTO.class);
|
||||||
List<AMapStationInfo> stationInfos = aMapService.getStationInfos(dto);
|
// List<AMapStationInfo> stationInfos = aMapService.getStationInfos(dto);
|
||||||
List<AMapStationInfo> stationInfosV2 = aMapService.getStationInfosV2(dto);
|
List<AMapStationInfo> stationInfos = aMapService.getStationInfosV2(dto);
|
||||||
logger.info("高德拉取充电站静态数据 success");
|
logger.info("高德拉取充电站静态数据 success");
|
||||||
return result.successResponse(stationInfos);
|
return result.successResponse(stationInfos);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ import com.jsowell.pile.service.*;
|
|||||||
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||||
import com.jsowell.pile.vo.web.OrderListVO;
|
import com.jsowell.pile.vo.web.OrderListVO;
|
||||||
import com.jsowell.pile.vo.web.PileDetailVO;
|
import com.jsowell.pile.vo.web.PileDetailVO;
|
||||||
import com.jsowell.pile.vo.web.PileInfoVO;
|
|
||||||
import com.jsowell.service.MemberService;
|
import com.jsowell.service.MemberService;
|
||||||
import com.jsowell.service.OrderService;
|
import com.jsowell.service.OrderService;
|
||||||
import com.jsowell.service.PileRemoteService;
|
import com.jsowell.service.PileRemoteService;
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ public class Constants {
|
|||||||
// ftp端口号
|
// ftp端口号
|
||||||
public static final int port = 0x15;
|
public static final int port = 0x15;
|
||||||
|
|
||||||
|
public static final String JSOWELL = "举视";
|
||||||
|
|
||||||
public static final byte[] updateServerPort = new byte[]{port};
|
public static final byte[] updateServerPort = new byte[]{port};
|
||||||
|
|
||||||
public static final String updateServerUserName = "ftptest";
|
public static final String updateServerUserName = "ftptest";
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ public class RedisCache {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void multiSave(Map<String,String> source) {
|
||||||
|
redisTemplate.opsForValue().multiSet(source);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个对象(异步清除内存)
|
* 删除单个对象(异步清除内存)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2,12 +2,13 @@ package com.jsowell.pile.mapper;
|
|||||||
|
|
||||||
import com.jsowell.pile.domain.PileBasicInfo;
|
import com.jsowell.pile.domain.PileBasicInfo;
|
||||||
import com.jsowell.pile.dto.IndexQueryDTO;
|
import com.jsowell.pile.dto.IndexQueryDTO;
|
||||||
import com.jsowell.pile.vo.uniapp.PersonalPileInfoVO;
|
|
||||||
import com.jsowell.pile.vo.web.IndexGeneralSituationVO;
|
|
||||||
import com.jsowell.pile.dto.QueryPileDTO;
|
import com.jsowell.pile.dto.QueryPileDTO;
|
||||||
import com.jsowell.pile.dto.ReplaceMerchantStationDTO;
|
import com.jsowell.pile.dto.ReplaceMerchantStationDTO;
|
||||||
import com.jsowell.pile.vo.web.PileDetailVO;
|
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||||
|
import com.jsowell.pile.vo.uniapp.PersonalPileInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.PileConnectorDetailVO;
|
import com.jsowell.pile.vo.uniapp.PileConnectorDetailVO;
|
||||||
|
import com.jsowell.pile.vo.web.IndexGeneralSituationVO;
|
||||||
|
import com.jsowell.pile.vo.web.PileDetailVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@@ -150,4 +151,6 @@ public interface PileBasicInfoMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PileBasicInfo> getPileListByStationId(@Param("stationId") String stationId);
|
List<PileBasicInfo> getPileListByStationId(@Param("stationId") String stationId);
|
||||||
|
|
||||||
|
List<PileInfoVO> queryPileDetailList(@Param("stationIdList") List<String> stationIdList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,4 +162,6 @@ public interface IPileBasicInfoService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PileBasicInfo> getPileListByStationId(String stationId);
|
List<PileBasicInfo> getPileListByStationId(String stationId);
|
||||||
|
|
||||||
|
List<PileInfoVO> queryPileDetailList(List<String> stationIdList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -653,4 +653,9 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
}
|
}
|
||||||
return pileList;
|
return pileList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PileInfoVO> queryPileDetailList(List<String> stationIdList) {
|
||||||
|
return pileBasicInfoMapper.queryPileDetailList(stationIdList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,4 +54,14 @@ public class PileInfoVO {
|
|||||||
* 设备名称
|
* 设备名称
|
||||||
*/
|
*/
|
||||||
private String modelName;
|
private String modelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String speedType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 枪口编号
|
||||||
|
*/
|
||||||
|
private String pileConnectorCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import java.util.List;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class PileDetailVO {
|
public class PileInfoVO {
|
||||||
/**
|
/**
|
||||||
* 站点id
|
* 站点id
|
||||||
*/
|
*/
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.jsowell.pile.vo.web;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Builder
|
|
||||||
public class PileInfoVO {
|
|
||||||
private String pileSn;
|
|
||||||
private String stationId;
|
|
||||||
private String merchantId;
|
|
||||||
private String modelId;
|
|
||||||
}
|
|
||||||
@@ -373,4 +373,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
from pile_basic_info
|
from pile_basic_info
|
||||||
where station_id = #{stationId,jdbcType=VARCHAR}
|
where station_id = #{stationId,jdbcType=VARCHAR}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryPileDetailList" resultType="com.jsowell.pile.vo.base.PileInfoVO">
|
||||||
|
SELECT
|
||||||
|
t1.id as pileId,
|
||||||
|
t1.sn AS pileSn,
|
||||||
|
t1.merchant_id as merchantId,
|
||||||
|
t1.station_id as stationId,
|
||||||
|
t2.model_name as modelName,
|
||||||
|
t2.rated_power as ratedPower,
|
||||||
|
t2.rated_current as ratedCurrent,
|
||||||
|
t2.rated_voltage as ratedVoltage,
|
||||||
|
t2.speed_type as speedType,
|
||||||
|
t3.pile_connector_code as pileConnectorCode
|
||||||
|
FROM
|
||||||
|
pile_basic_info t1
|
||||||
|
LEFT JOIN pile_model_info t2 on t1.model_id = t2.id
|
||||||
|
LEFT JOIN pile_connector_info t3 on t1.sn = t3.pile_sn
|
||||||
|
WHERE
|
||||||
|
t1.station_id in
|
||||||
|
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
|
||||||
|
#{item,jdbcType=VARCHAR}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
import com.jsowell.common.util.PageUtils;
|
import com.jsowell.common.util.PageUtils;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
@@ -15,6 +16,7 @@ import com.jsowell.pile.domain.PileStationInfo;
|
|||||||
import com.jsowell.pile.dto.amap.GetStationInfoDTO;
|
import com.jsowell.pile.dto.amap.GetStationInfoDTO;
|
||||||
import com.jsowell.pile.service.*;
|
import com.jsowell.pile.service.*;
|
||||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||||
|
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
||||||
import com.jsowell.pile.vo.uniapp.PileConnectorDetailVO;
|
import com.jsowell.pile.vo.uniapp.PileConnectorDetailVO;
|
||||||
import com.jsowell.pile.vo.web.BillingDetailVO;
|
import com.jsowell.pile.vo.web.BillingDetailVO;
|
||||||
@@ -430,7 +432,58 @@ public class AMapServiceImpl implements AMapService {
|
|||||||
*/
|
*/
|
||||||
private Map<String, List<AMapEquipmentInfo>> getPileListByStationIdList(List<String> stationIdList) {
|
private Map<String, List<AMapEquipmentInfo>> getPileListByStationIdList(List<String> stationIdList) {
|
||||||
Map<String, List<AMapEquipmentInfo>> resultMap = Maps.newHashMap();
|
Map<String, List<AMapEquipmentInfo>> resultMap = Maps.newHashMap();
|
||||||
// List<PileDetailVO> pileDetailVOS = pileBasicInfoService.selectPileListByStationIds(stationIdList);
|
List<PileInfoVO> pileInfoVOS = pileBasicInfoService.queryPileDetailList(stationIdList);
|
||||||
|
if (CollectionUtils.isEmpty(pileInfoVOS)) {
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
// 根据站点id分组
|
||||||
|
Map<String, List<PileInfoVO>> stationMap = pileInfoVOS.stream().collect(Collectors.groupingBy(PileInfoVO::getStationId));
|
||||||
|
|
||||||
|
|
||||||
|
// 处理结果集
|
||||||
|
List<AMapEquipmentInfo> pileList;
|
||||||
|
AMapEquipmentInfo info;
|
||||||
|
List<AMapConnectorInfo> connectorInfos;
|
||||||
|
AMapConnectorInfo connectorInfo;
|
||||||
|
for (Map.Entry<String, List<PileInfoVO>> entry : stationMap.entrySet()) {
|
||||||
|
String stationId = entry.getKey();
|
||||||
|
// 枪口维度的数据
|
||||||
|
List<PileInfoVO> pileInfoList = entry.getValue();
|
||||||
|
if (CollectionUtils.isEmpty(pileInfoList)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
pileList = Lists.newArrayList();
|
||||||
|
|
||||||
|
Map<String, List<PileInfoVO>> pileMap = pileInfoList.stream().collect(Collectors.groupingBy(PileInfoVO::getPileSn));
|
||||||
|
|
||||||
|
info = new AMapEquipmentInfo();
|
||||||
|
for (Map.Entry<String, List<PileInfoVO>> pile : pileMap.entrySet()) {
|
||||||
|
String pileSn = pile.getKey();
|
||||||
|
List<PileInfoVO> value = pile.getValue();
|
||||||
|
PileInfoVO pileInfoVO = value.get(0);
|
||||||
|
info.setEquipmentID(pileSn);
|
||||||
|
info.setManufacturerName(Constants.JSOWELL);
|
||||||
|
info.setEquipmentType(Integer.valueOf(pileInfoVO.getSpeedType()));
|
||||||
|
info.setPower(new BigDecimal(pileInfoVO.getRatedPower()));
|
||||||
|
connectorInfos = Lists.newArrayList();
|
||||||
|
for (PileInfoVO infoVO : value) {
|
||||||
|
connectorInfo = new AMapConnectorInfo();
|
||||||
|
connectorInfo.setConnectorID(infoVO.getPileConnectorCode());
|
||||||
|
Integer connectorType = Integer.parseInt(infoVO.getSpeedType()) == 1 ? 4 : 3;
|
||||||
|
connectorInfo.setConnectorType(connectorType);
|
||||||
|
connectorInfo.setPower(new BigDecimal(infoVO.getRatedPower()).setScale(1, RoundingMode.HALF_UP));
|
||||||
|
connectorInfo.setCurrent(Integer.parseInt(infoVO.getRatedCurrent()));
|
||||||
|
connectorInfo.setBrandDesc(Constants.JSOWELL);
|
||||||
|
connectorInfo.setNationalStandard(2);
|
||||||
|
connectorInfo.setVoltageLowerLimits(0);
|
||||||
|
connectorInfo.setVoltageUpperLimits(Integer.parseInt(infoVO.getRatedVoltage()));
|
||||||
|
connectorInfos.add(connectorInfo);
|
||||||
|
}
|
||||||
|
info.setConnectorInfos(connectorInfos);
|
||||||
|
}
|
||||||
|
pileList.add(info);
|
||||||
|
resultMap.put(stationId, pileList);
|
||||||
|
}
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user