mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-11 02:40:15 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -37,9 +37,6 @@ public class LianLianController extends BaseController {
|
||||
@Autowired
|
||||
private LianLianService lianLianService;
|
||||
|
||||
@Autowired
|
||||
private IThirdPartyPlatformConfigService thirdPartyPlatformConfigService;
|
||||
|
||||
/**
|
||||
* 推送充电站信息 notification_stationInfo
|
||||
* http://localhost:8080/LianLian/pushStationInfo
|
||||
@@ -273,8 +270,10 @@ public class LianLianController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryEquipmentDTO queryEquipmentDTO = JSONObject.parseObject(dataStr, QueryEquipmentDTO.class);
|
||||
@@ -337,8 +336,10 @@ public class LianLianController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStartChargeDTO queryStartChargeDTO = JSONObject.parseObject(dataStr, QueryStartChargeDTO.class);
|
||||
@@ -400,8 +401,10 @@ public class LianLianController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryEquipChargeStatusDTO queryEquipChargeStatusDTO = JSONObject.parseObject(dataStr, QueryEquipChargeStatusDTO.class);
|
||||
@@ -457,8 +460,10 @@ public class LianLianController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStartChargeDTO queryStartChargeDTO = JSONObject.parseObject(dataStr, QueryStartChargeDTO.class);
|
||||
@@ -513,8 +518,10 @@ public class LianLianController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
PushOrderSettlementDTO pushOrderSettlementDTO = JSONObject.parseObject(dataStr, PushOrderSettlementDTO.class);
|
||||
@@ -553,8 +560,10 @@ public class LianLianController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||
@@ -594,8 +603,10 @@ public class LianLianController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||
@@ -635,8 +646,10 @@ public class LianLianController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, "UTF-8");
|
||||
// 转换成相应对象
|
||||
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||
|
||||
@@ -64,8 +64,10 @@ public class NRController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||
@@ -100,8 +102,10 @@ public class NRController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||
@@ -138,8 +142,10 @@ public class NRController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
NRQueryOrderDTO nrQueryOrderDTO = JSONObject.parseObject(dataStr, NRQueryOrderDTO.class);
|
||||
|
||||
@@ -3,8 +3,15 @@ package com.jsowell.thirdparty.zhongdianlian;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.JWTUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.dto.PushInfoParamDTO;
|
||||
import com.jsowell.pile.dto.PushStationInfoDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.service.IThirdPartyPlatformConfigService;
|
||||
import com.jsowell.thirdparty.lianlian.common.CommonResult;
|
||||
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||
@@ -12,10 +19,7 @@ import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
||||
import com.jsowell.thirdparty.lianlian.util.Encodes;
|
||||
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -23,7 +27,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* 中电联 controller
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/9/14 15:31
|
||||
@@ -79,8 +83,11 @@ public class ZDLController extends BaseController {
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||
@@ -94,4 +101,173 @@ public class ZDLController extends BaseController {
|
||||
}
|
||||
return CommonResult.failed("查询充电站信息发生异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 中电联平台查询统计信息
|
||||
* http://localhost:8080/zdl/v1/query_stations_stats
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/query_stations_stats")
|
||||
public CommonResult<?> queryStationsStats(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||
logger.info("中电联平台查询统计信息 params:{}", JSONObject.toJSONString(dto));
|
||||
try {
|
||||
// 校验令牌
|
||||
String token = request.getHeader("Authorization");
|
||||
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
}
|
||||
// 校验签名
|
||||
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||
if (resultMap == null) {
|
||||
// 签名错误
|
||||
return CommonResult.failed("签名校验错误");
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||
queryStationInfoDTO.setOperatorId(dto.getOperatorID());
|
||||
Map<String, String> map = zdlService.queryStationStats(queryStationInfoDTO);
|
||||
|
||||
return CommonResult.success(0, "查询统计信息成功!", map.get("Data"), map.get("Sig"));
|
||||
} catch (Exception e) {
|
||||
logger.info("中电联平台查询统计信息 error:", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return CommonResult.failed("查询统计信息发生异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 中电联平台设备接口状态查询
|
||||
* http://localhost:8080/zdl/v1/query_stations_status
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/query_stations_status")
|
||||
public CommonResult<?> queryStationsStatus(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||
logger.info("中电联平台设备接口状态查询 params:{}", JSONObject.toJSONString(dto));
|
||||
try {
|
||||
// 校验令牌
|
||||
String token = request.getHeader("Authorization");
|
||||
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
}
|
||||
// 校验签名
|
||||
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||
if (resultMap == null) {
|
||||
// 签名错误
|
||||
return CommonResult.failed("签名校验错误");
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
String dataSecret = resultMap.get("DataSecret");
|
||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||
queryStationInfoDTO.setOperatorId(dto.getOperatorID());
|
||||
Map<String, String> map = zdlService.queryStationStatus(queryStationInfoDTO);
|
||||
|
||||
return CommonResult.success(0, "设备接口状态查询成功!", map.get("Data"), map.get("Sig"));
|
||||
} catch (Exception e) {
|
||||
logger.info("中电联平台设备接口状态查询 error:", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return CommonResult.failed("设备接口状态查询发生异常");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 推送充电站信息 notification_stationInfo
|
||||
* http://localhost:8080/zdl/v1/pushStationInfo
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/pushStationInfo")
|
||||
public RestApiResponse<?> pushStationInfo(@RequestBody PushStationInfoDTO dto) {
|
||||
logger.info("推送中电联平台充电站信息 params:{}", JSONObject.toJSONString(dto));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
if (StringUtils.isBlank(String.valueOf(dto.getStationId()))) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
zdlService.pushStationInfo(dto);
|
||||
response = new RestApiResponse<>();
|
||||
}catch (BusinessException e) {
|
||||
logger.error("推送中电联平台充电站信息 error",e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
}catch (Exception e) {
|
||||
logger.error("推送中电联平台充电站信息 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("推送中电联平台充电站信息 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 联联平台设备状态变化推送
|
||||
* http://localhost:8080/zdl/v1/pushStationStatus
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/pushStationStatus")
|
||||
public RestApiResponse<?> pushStationStatus(@RequestBody PushInfoParamDTO dto) {
|
||||
logger.info("中电联平台设备状态变化推送 params:{}", JSONObject.toJSONString(dto));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
if (StringUtils.isBlank(String.valueOf(dto.getPileConnectorCode())) ||
|
||||
StringUtils.isBlank(String.valueOf(dto.getStatus()))) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
String result = zdlService.notificationStationStatus(dto.getPileConnectorCode(), dto.getStatus());
|
||||
response = new RestApiResponse<>(result);
|
||||
}catch (BusinessException e) {
|
||||
logger.error("中电联平台设备状态变化推送 error",e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
}catch (Exception e) {
|
||||
logger.error("中电联平台设备状态变化推送 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("中电联平台设备状态变化推送 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 推送订单信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/pushOrderInfo/{orderCode}")
|
||||
public RestApiResponse<?> pushOrderInfo(@PathVariable("orderCode")String orderCode) {
|
||||
logger.info("中电联平台推送订单信息 params:{}", orderCode);
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
if (StringUtils.isBlank(orderCode)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
String result = zdlService.pushChargeOrderInfo(orderCode);
|
||||
response = new RestApiResponse<>(result);
|
||||
}catch (BusinessException e) {
|
||||
logger.error("中电联平台推送订单信息 error",e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
}catch (Exception e) {
|
||||
logger.error("中电联平台推送订单信息 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("中电联平台推送订单信息 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,9 @@ public interface PileStationInfoMapper {
|
||||
*/
|
||||
List<PileStationInfo> getStationInfoForLianLian();
|
||||
|
||||
|
||||
List<PileStationInfo> getStationInfoForAmap();
|
||||
|
||||
List<String> queryByStationDeptIds(@Param("stationDeptIds") List<String> stationDeptIds);
|
||||
|
||||
int updateAmapFlag(@Param("stationId") String stationId, @Param("amapFlag") String amapFlag);
|
||||
|
||||
@@ -94,6 +94,8 @@ public interface IPileStationInfoService {
|
||||
|
||||
List<PileStationInfo> getStationInfosByThirdParty();
|
||||
|
||||
List<PileStationInfo> getStationInfosByAmap();
|
||||
|
||||
List<String> queryByStationDeptIds(List<String> stationIds);
|
||||
|
||||
String selectAdapayMemberId(String stationId);
|
||||
|
||||
@@ -190,6 +190,11 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
||||
return pileStationInfoMapper.getStationInfoForLianLian();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PileStationInfo> getStationInfosByAmap() {
|
||||
return pileStationInfoMapper.getStationInfoForAmap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryByStationDeptIds(List<String> stationIds) {
|
||||
return pileStationInfoMapper.queryByStationDeptIds(stationIds);
|
||||
|
||||
@@ -409,7 +409,6 @@
|
||||
<include refid="selectPileStationInfoVo"/>
|
||||
where del_flag = '0'
|
||||
and public_flag = '1'
|
||||
and amap_flag = '1'
|
||||
</select>
|
||||
|
||||
<select id="queryByStationDeptIds" resultType="java.lang.String">
|
||||
@@ -470,4 +469,11 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getStationInfoForAmap" resultMap="PileStationInfoResult">
|
||||
<include refid="selectPileStationInfoVo"/>
|
||||
where del_flag = '0'
|
||||
and public_flag = '1'
|
||||
and amap_flag = '1'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -90,7 +90,7 @@ public class AMapServiceImpl implements AMapService {
|
||||
PageUtils.startPage(pageNo, pageSize);
|
||||
// 查询站点信息
|
||||
sw.start("查询站点信息");
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByThirdParty();
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap();
|
||||
|
||||
PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos);
|
||||
sw.stop();
|
||||
@@ -128,7 +128,7 @@ public class AMapServiceImpl implements AMapService {
|
||||
PageUtils.startPage(pageNo, pageSize);
|
||||
|
||||
// 第一次查询,得到站点
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByThirdParty();
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap();
|
||||
PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos);
|
||||
List<PileStationInfo> stationList = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(stationList)) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -150,7 +150,7 @@ public class NRServiceImpl implements NRService {
|
||||
|
||||
// 拼装南瑞平台所需参数
|
||||
NRStationInfo nrStationInfo = NRStationInfo.builder()
|
||||
.stationId("NR" + stationInfoVO.getId())
|
||||
.stationId(String.valueOf(stationInfoVO.getId()))
|
||||
.operatorID(Constants.OPERATORID_JIANG_SU)
|
||||
.equipmentOwnerID(Constants.OPERATORID_JIANG_SU)
|
||||
.stationName(stationInfoVO.getStationName())
|
||||
@@ -249,7 +249,7 @@ public class NRServiceImpl implements NRService {
|
||||
for (PileStationInfo pileStationInfo : pageInfo.getList()) {
|
||||
// 拼装参数
|
||||
NRStationInfo nrStationInfo = NRStationInfo.builder()
|
||||
.stationId("NR" + pileStationInfo.getId())
|
||||
.stationId(String.valueOf(pileStationInfo.getId()))
|
||||
.operatorID(Constants.OPERATORID_JIANG_SU)
|
||||
.equipmentOwnerID(Constants.OPERATORID_JIANG_SU)
|
||||
.stationName(pileStationInfo.getStationName())
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.jsowell.pile.domain.*;
|
||||
import com.jsowell.pile.dto.PushStationInfoDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
||||
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
||||
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
||||
@@ -58,6 +59,9 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
@Autowired
|
||||
private IPileModelInfoService pileModelInfoService;
|
||||
|
||||
@Autowired
|
||||
private IPileMerchantInfoService pileMerchantInfoService;
|
||||
|
||||
@Autowired
|
||||
private IPileConnectorInfoService pileConnectorInfoService;
|
||||
|
||||
@@ -105,11 +109,11 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
|
||||
// 组装联联平台所需要的数据格式
|
||||
// 组装中电联平台所需要的数据格式
|
||||
ZDLStationInfo info = ZDLStationInfo.builder()
|
||||
.stationId("ZDL" +dto.getStationId())
|
||||
.stationId(String.valueOf(dto.getStationId()))
|
||||
.operatorId(operatorId)
|
||||
.equipmentOwnerId(Constants.OPERATORID_JIANG_SU)
|
||||
// .equipmentOwnerId(Constants.OPERATORID_JIANG_SU)
|
||||
.stationName(pileStationInfo.getStationName())
|
||||
.countryCode(pileStationInfo.getCountryCode())
|
||||
.areaCode(pileStationInfo.getAreaCode())
|
||||
@@ -123,6 +127,14 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
.construction(Integer.valueOf(pileStationInfo.getConstruction()))
|
||||
|
||||
.build();
|
||||
// 截取运营商组织机构代码(去除最后一位后的最后九位)
|
||||
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
|
||||
String organizationCode = merchantInfo.getOrganizationCode();
|
||||
if (organizationCode.length() == 18) {
|
||||
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||
info.setEquipmentOwnerId(equipmentOwnerId);
|
||||
}
|
||||
|
||||
List<ZDLEquipmentInfo> pileList = getPileList(pileStationInfo);
|
||||
if (CollectionUtils.isNotEmpty(pileList)) {
|
||||
info.setEquipmentInfos(pileList); // 充电设备信息列表
|
||||
@@ -154,6 +166,12 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String organizationCode = "91310120MAC13L2Q9P";
|
||||
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||
System.out.println(equipmentOwnerId); // MAC13L2Q9
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询站点信息
|
||||
* @return
|
||||
@@ -329,6 +347,7 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
connectorInfo.setVoltageUpperLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
|
||||
connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
|
||||
connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent()));
|
||||
connectorInfo.setNationalStandard(2);
|
||||
if (!StringUtils.equals(modelInfo.getConnectorNum(), "1")) {
|
||||
// 如果不是单枪,则枪口功率需要除以枪口数量
|
||||
String ratedPowerStr = modelInfo.getRatedPower();
|
||||
|
||||
Reference in New Issue
Block a user