mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-03 21:48:13 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -102,7 +102,7 @@ public class HaiNanPlatformController extends BaseController {
|
|||||||
// 转换成相应对象
|
// 转换成相应对象
|
||||||
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||||
queryStationInfoDTO.setOperatorId(dto.getOperatorID());
|
queryStationInfoDTO.setOperatorId(dto.getOperatorID());
|
||||||
queryStationInfoDTO.setThirdPlatformType(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode());
|
queryStationInfoDTO.setThirdPlatformType(ThirdPlatformTypeEnum.HAI_NAN_1_PLATFORM.getTypeCode());
|
||||||
Map<String, String> map = platformLogic.queryStationsInfo(queryStationInfoDTO);
|
Map<String, String> map = platformLogic.queryStationsInfo(queryStationInfoDTO);
|
||||||
logger.info("海南平台查询充电站信息 result:{}", JSON.toJSONString(map));
|
logger.info("海南平台查询充电站信息 result:{}", JSON.toJSONString(map));
|
||||||
return CommonResult.success(0, "查询充电站信息成功!", map.get("Data"), map.get("Sig"));
|
return CommonResult.success(0, "查询充电站信息成功!", map.get("Data"), map.get("Sig"));
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ public class LianLianController extends BaseController {
|
|||||||
if (StringUtils.isBlank(orderCode)) {
|
if (StringUtils.isBlank(orderCode)) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||||
}
|
}
|
||||||
String result = lianLianService.notificationOrderInfo(orderCode);
|
String result = lianLianService.notificationChargeOrderInfo(orderCode);
|
||||||
response = new RestApiResponse<>(result);
|
response = new RestApiResponse<>(result);
|
||||||
}catch (BusinessException e) {
|
}catch (BusinessException e) {
|
||||||
logger.error("联联平台推送订单信息 error",e);
|
logger.error("联联平台推送订单信息 error",e);
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ public enum ThirdPlatformTypeEnum {
|
|||||||
YONG_CHENG_BO_CHE("4", "甬城泊车平台", "330205020"),
|
YONG_CHENG_BO_CHE("4", "甬城泊车平台", "330205020"),
|
||||||
NING_XIA_JIAO_TOU("5", "宁夏交投", "MA771QENX"),
|
NING_XIA_JIAO_TOU("5", "宁夏交投", "MA771QENX"),
|
||||||
XIN_DIAN_TU("6", "新电途平台", "MA25CNM38"),
|
XIN_DIAN_TU("6", "新电途平台", "MA25CNM38"),
|
||||||
HAI_NAN_1("7", "海南一张网(监管平台)", "578725200"),
|
HAI_NAN_1_PLATFORM("7", "海南一张网(监管平台)", "578725200"),
|
||||||
HAI_NAN_2("8", "海南一张网(充电平台)", "MAA9A0PP1"),
|
HAI_NAN_2_PLATFORM("8", "海南一张网(充电平台)", "MAA9A0PP1"),
|
||||||
HUA_WEI("9", "华为平台", "MA5GTQ528"),
|
HUA_WEI("9", "华为平台", "MA5GTQ528"),
|
||||||
NEI_MENG_GU_PLATFORM("10", "内蒙古平台", ""),
|
NEI_MENG_GU_PLATFORM("10", "内蒙古平台", ""),
|
||||||
QING_HAI_PLATFORM("11", "青海平台", ""),
|
QING_HAI_PLATFORM("11", "青海平台", ""),
|
||||||
|
|||||||
@@ -6,4 +6,13 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class QueryOperatorInfoDTO {
|
public class QueryOperatorInfoDTO {
|
||||||
|
/**
|
||||||
|
* 查询页码 默认为1
|
||||||
|
*/
|
||||||
|
private int PageNo = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每页数量 默认为50
|
||||||
|
*/
|
||||||
|
private int PageSize = 50;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ public class CommonParamsDTO {
|
|||||||
@JsonProperty(value = "OperatorID")
|
@JsonProperty(value = "OperatorID")
|
||||||
private String operatorID;
|
private String operatorID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据请求方的标识 请求方组织机构代码九位
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "PlatformID")
|
||||||
|
private String platformID;
|
||||||
|
|
||||||
@JsonProperty(value = "Data")
|
@JsonProperty(value = "Data")
|
||||||
private String data;
|
private String data;
|
||||||
|
|
||||||
|
|||||||
@@ -3,32 +3,53 @@
|
|||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.jsowell.pile.mapper.ThirdPartyStationRelationMapper">
|
<mapper namespace="com.jsowell.pile.mapper.ThirdPartyStationRelationMapper">
|
||||||
|
|
||||||
<resultMap type="com.jsowell.pile.domain.ThirdPartyStationRelation" id="ThirdPartyStationRelationResult">
|
<resultMap type="com.jsowell.pile.domain.ThirdPartyStationRelation" id="ThirdPartyStationRelationResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id"/>
|
||||||
<result property="stationId" column="station_id" />
|
<result property="stationId" column="station_id"/>
|
||||||
<result property="thirdPartyType" column="third_party_type" />
|
<result property="thirdPartyType" column="third_party_type"/>
|
||||||
<result property="startMode" column="start_mode" />
|
<result property="startMode" column="start_mode"/>
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time"/>
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time"/>
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by"/>
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectThirdPartyStationRelationVo">
|
<sql id="selectThirdPartyStationRelationVo">
|
||||||
select id, station_id, third_party_type, start_mode, create_time, create_by, update_time, update_by, del_flag from thirdparty_station_relation
|
select id,
|
||||||
|
station_id,
|
||||||
|
third_party_type,
|
||||||
|
start_mode,
|
||||||
|
create_time,
|
||||||
|
create_by,
|
||||||
|
update_time,
|
||||||
|
update_by,
|
||||||
|
del_flag
|
||||||
|
from thirdparty_station_relation
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="Base_Column_List" >
|
<sql id="Base_Column_List">
|
||||||
id, station_id, third_party_type, start_mode, create_time, create_by, update_time, update_by, del_flag
|
id,
|
||||||
|
station_id,
|
||||||
|
third_party_type,
|
||||||
|
start_mode,
|
||||||
|
create_time,
|
||||||
|
create_by,
|
||||||
|
update_time,
|
||||||
|
update_by,
|
||||||
|
del_flag
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectThirdPartyStationRelationList" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation" resultMap="ThirdPartyStationRelationResult">
|
<select id="selectThirdPartyStationRelationList" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation"
|
||||||
|
resultMap="ThirdPartyStationRelationResult">
|
||||||
<include refid="selectThirdPartyStationRelationVo"/>
|
<include refid="selectThirdPartyStationRelationVo"/>
|
||||||
where del_flag = '0'
|
where del_flag = '0'
|
||||||
<if test="stationId != null "> and station_id = #{stationId}</if>
|
<if test="stationId != null">
|
||||||
<if test="thirdPartyType != null and thirdPartyType != ''"> and third_party_type = #{thirdPartyType}</if>
|
and station_id = #{stationId}
|
||||||
|
</if>
|
||||||
|
<if test="thirdPartyType != null and thirdPartyType != ''">
|
||||||
|
and third_party_type = #{thirdPartyType}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectThirdPartyStationRelationById" parameterType="Long" resultMap="ThirdPartyStationRelationResult">
|
<select id="selectThirdPartyStationRelationById" parameterType="Long" resultMap="ThirdPartyStationRelationResult">
|
||||||
@@ -36,68 +57,120 @@
|
|||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertThirdPartyStationRelation" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertThirdPartyStationRelation" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation"
|
||||||
|
useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into thirdparty_station_relation
|
insert into thirdparty_station_relation
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="stationId != null">station_id,</if>
|
<if test="stationId != null">
|
||||||
<if test="thirdPartyType != null">third_party_type,</if>
|
station_id,
|
||||||
<if test="startMode != null">start_mode,</if>
|
</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="thirdPartyType != null">
|
||||||
<if test="createBy != null">create_by,</if>
|
third_party_type,
|
||||||
<if test="updateTime != null">update_time,</if>
|
</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="startMode != null">
|
||||||
<if test="delFlag != null">del_flag,</if>
|
start_mode,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">
|
||||||
|
create_by,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">
|
||||||
|
update_by,
|
||||||
|
</if>
|
||||||
|
<if test="delFlag != null">
|
||||||
|
del_flag,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="stationId != null">#{stationId},</if>
|
<if test="stationId != null">
|
||||||
<if test="thirdPartyType != null">#{thirdPartyType},</if>
|
#{stationId},
|
||||||
<if test="startMode != null">#{startMode},</if>
|
</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="thirdPartyType != null">
|
||||||
<if test="createBy != null">#{createBy},</if>
|
#{thirdPartyType},
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="startMode != null">
|
||||||
<if test="delFlag != null">#{delFlag},</if>
|
#{startMode},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">
|
||||||
|
#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">
|
||||||
|
#{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="delFlag != null">
|
||||||
|
#{delFlag},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateThirdPartyStationRelation" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation">
|
<update id="updateThirdPartyStationRelation" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation">
|
||||||
update thirdparty_station_relation
|
update thirdparty_station_relation
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="stationId != null">station_id = #{stationId},</if>
|
<if test="stationId != null">
|
||||||
<if test="thirdPartyType != null">third_party_type = #{thirdPartyType},</if>
|
station_id = #{stationId},
|
||||||
<if test="startMode != null">start_mode = #{startMode},</if>
|
</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="thirdPartyType != null">
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
third_party_type = #{thirdPartyType},
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="startMode != null">
|
||||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
start_mode = #{startMode},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">
|
||||||
|
create_by = #{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">
|
||||||
|
update_by = #{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="delFlag != null">
|
||||||
|
del_flag = #{delFlag},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
where station_id = #{stationId,jdbcType=BIGINT}
|
where station_id = #{stationId,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteThirdPartyStationRelationById" parameterType="Long">
|
<delete id="deleteThirdPartyStationRelationById" parameterType="Long">
|
||||||
delete from thirdparty_station_relation where id = #{id}
|
delete
|
||||||
|
from thirdparty_station_relation
|
||||||
|
where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteThirdPartyStationRelationByIds" parameterType="String">
|
<delete id="deleteThirdPartyStationRelationByIds" parameterType="String">
|
||||||
delete from thirdparty_station_relation where id in
|
delete
|
||||||
|
from thirdparty_station_relation where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectRelationInfo" resultType="com.jsowell.pile.vo.base.ThirdPartyStationRelationVO">
|
<select id="selectRelationInfo" resultType="com.jsowell.pile.vo.base.ThirdPartyStationRelationVO">
|
||||||
select
|
select t1.station_id as stationId,
|
||||||
t1.station_id as stationId,
|
t1.third_party_type as thirdPartyType,
|
||||||
t1.third_party_type as thirdPartyType,
|
t1.start_mode as startMode,
|
||||||
t1.start_mode as startMode,
|
t2.url_address as urlAddress,
|
||||||
t2.url_address as urlAddress,
|
t2.operator_id as operatorId,
|
||||||
t2.operator_id as operatorId,
|
t2.operator_secret as operatorSecret,
|
||||||
t2.operator_secret as operatorSecret,
|
t2.sign_secret as signSecret,
|
||||||
t2.sign_secret as signSecret,
|
t2.data_secret as dataSecret,
|
||||||
t2.data_secret as dataSecret,
|
t2.data_secret_IV as dataSecretIv
|
||||||
t2.data_secret_IV as dataSecretIv
|
from thirdparty_station_relation t1
|
||||||
from thirdparty_station_relation t1 join thirdparty_setting_info t2 on t1.third_party_type = t2.type
|
join thirdparty_setting_info t2 on t1.third_party_type = t2.type
|
||||||
where t1.del_flag = '0'
|
where t1.del_flag = '0'
|
||||||
<if test="stationId != null">
|
<if test="stationId != null">
|
||||||
and t1.station_id = #{stationId,jdbcType=BIGINT}
|
and t1.station_id = #{stationId,jdbcType=BIGINT}
|
||||||
@@ -109,17 +182,17 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRelationInfoList" resultType="com.jsowell.pile.vo.base.ThirdPartyStationRelationVO">
|
<select id="getRelationInfoList" resultType="com.jsowell.pile.vo.base.ThirdPartyStationRelationVO">
|
||||||
select
|
select t1.station_id as stationId,
|
||||||
t1.station_id as stationId,
|
t1.third_party_type as thirdPartyType,
|
||||||
t1.third_party_type as thirdPartyType,
|
t1.start_mode as startMode,
|
||||||
t1.start_mode as startMode,
|
t2.url_address as urlAddress,
|
||||||
t2.url_address as urlAddress,
|
t2.operator_id as operatorId,
|
||||||
t2.operator_id as operatorId,
|
t2.operator_secret as operatorSecret,
|
||||||
t2.operator_secret as operatorSecret,
|
t2.sign_secret as signSecret,
|
||||||
t2.sign_secret as signSecret,
|
t2.data_secret as dataSecret,
|
||||||
t2.data_secret as dataSecret,
|
t2.data_secret_IV as dataSecretIv
|
||||||
t2.data_secret_IV as dataSecretIv
|
from thirdparty_station_relation t1
|
||||||
from thirdparty_station_relation t1 join thirdparty_setting_info t2 on t1.third_party_type = t2.type
|
join thirdparty_setting_info t2 on t1.third_party_type = t2.type
|
||||||
where t1.del_flag = '0'
|
where t1.del_flag = '0'
|
||||||
<if test="stationId != null">
|
<if test="stationId != null">
|
||||||
and t1.station_id = #{stationId,jdbcType=BIGINT}
|
and t1.station_id = #{stationId,jdbcType=BIGINT}
|
||||||
@@ -129,11 +202,9 @@
|
|||||||
<update id="updateRelationDelFlag">
|
<update id="updateRelationDelFlag">
|
||||||
update
|
update
|
||||||
thirdparty_station_relation
|
thirdparty_station_relation
|
||||||
set
|
set del_flag = '1'
|
||||||
del_flag = '1'
|
where station_id = #{stationId,jdbcType=VARCHAR}
|
||||||
where
|
and third_party_type in
|
||||||
station_id = #{stationId,jdbcType=VARCHAR}
|
|
||||||
and third_party_type in
|
|
||||||
<foreach collection="types" open="(" item="type" close=")" separator=",">
|
<foreach collection="types" open="(" item="type" close=")" separator=",">
|
||||||
#{type,jdbcType=VARCHAR}
|
#{type,jdbcType=VARCHAR}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public class CommonService {
|
|||||||
// // 华为
|
// // 华为
|
||||||
// result = huaWeiService.notificationOperationSystemInfo(dto);
|
// result = huaWeiService.notificationOperationSystemInfo(dto);
|
||||||
// }
|
// }
|
||||||
if(StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode(), dto.getThirdPartyType())) {
|
if(StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
|
||||||
// 海南
|
// 海南
|
||||||
result = haiNanChargeService.pushStationInfoV2(dto);
|
result = haiNanChargeService.pushStationInfoV2(dto);
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ public class CommonService {
|
|||||||
// }
|
// }
|
||||||
// huaWeiService.notificationEquipChargeStatus(orderInfo.getOrderCode());
|
// huaWeiService.notificationEquipChargeStatus(orderInfo.getOrderCode());
|
||||||
// }
|
// }
|
||||||
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode(), thirdPartyType)) {
|
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1_PLATFORM.getTypeCode(), thirdPartyType)) {
|
||||||
// 海南平台
|
// 海南平台
|
||||||
haiNanChargeService.notificationStationStatus(pileConnectorCode, changedStatus);
|
haiNanChargeService.notificationStationStatus(pileConnectorCode, changedStatus);
|
||||||
}
|
}
|
||||||
@@ -363,7 +363,7 @@ public class CommonService {
|
|||||||
// // 推送订单信息
|
// // 推送订单信息
|
||||||
// result = huaWeiService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
|
// result = huaWeiService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
|
||||||
// }
|
// }
|
||||||
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode(), thirdPartyType)) {
|
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1_PLATFORM.getTypeCode(), thirdPartyType)) {
|
||||||
// 海南平台
|
// 海南平台
|
||||||
haiNanChargeService.notificationChargeOrderInfo(orderBasicInfo.getOrderCode());
|
haiNanChargeService.notificationChargeOrderInfo(orderBasicInfo.getOrderCode());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import com.jsowell.thirdparty.common.CommonService;
|
|||||||
import com.jsowell.thirdparty.lianlian.domain.*;
|
import com.jsowell.thirdparty.lianlian.domain.*;
|
||||||
import com.jsowell.pile.thirdparty.CommonParamsDTO;
|
import com.jsowell.pile.thirdparty.CommonParamsDTO;
|
||||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||||
|
import com.jsowell.thirdparty.platform.common.StationInfo;
|
||||||
import com.jsowell.thirdparty.platform.util.Cryptos;
|
import com.jsowell.thirdparty.platform.util.Cryptos;
|
||||||
import com.jsowell.thirdparty.platform.util.Encodes;
|
import com.jsowell.thirdparty.platform.util.Encodes;
|
||||||
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ public class AccessTokenVO {
|
|||||||
@JsonProperty(value = "OperatorID")
|
@JsonProperty(value = "OperatorID")
|
||||||
private String operatorID;
|
private String operatorID;
|
||||||
|
|
||||||
|
@JsonProperty(value = "PlatformID")
|
||||||
|
private String platformId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 整型
|
* 整型
|
||||||
* 0:成功;
|
* 0:成功;
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ public interface ThirdPartyPlatformService {
|
|||||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
default Map<String, String> queryToken(String operatorId, String operatorSecret) {
|
// default Map<String, String> queryToken(String operatorId, String operatorSecret) {
|
||||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
// throw new UnsupportedOperationException("This method is not yet implemented");
|
||||||
}
|
// }
|
||||||
|
|
||||||
// =================================================================================== //
|
// =================================================================================== //
|
||||||
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 由我方平台实现此接口,对方平台调用的查询接口 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ //
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 由我方平台实现此接口,对方平台调用的查询接口 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ //
|
||||||
@@ -234,15 +234,6 @@ public interface ThirdPartyPlatformService {
|
|||||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单信息推送 notification_orderInfo
|
|
||||||
*
|
|
||||||
* @throws UnsupportedOperationException 未实现异常
|
|
||||||
*/
|
|
||||||
default String notificationOrderInfo(String orderCode) {
|
|
||||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点费率变化推送 notification_stationFee
|
* 站点费率变化推送 notification_stationFee
|
||||||
*
|
*
|
||||||
@@ -253,11 +244,7 @@ public interface ThirdPartyPlatformService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电订单推送 notification_charge_order_info
|
* 充电订单推送 notification_charge_order_info/notification_orderInfo
|
||||||
* TODO 海南一张网文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
|
||||||
* TODO 甬城泊车平台文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
|
||||||
* TODO 华为平台文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
|
||||||
* TODO 内蒙古平台文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
|
||||||
*
|
*
|
||||||
* @param orderCode 订单编号
|
* @param orderCode 订单编号
|
||||||
* @throws UnsupportedOperationException 未实现异常
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.lianlian.domain;
|
package com.jsowell.thirdparty.platform.common;
|
||||||
|
|
||||||
|
|
||||||
import com.alibaba.fastjson2.annotation.JSONField;
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
@@ -168,7 +168,7 @@ public class StationInfo {
|
|||||||
* 站点引导 N
|
* 站点引导 N
|
||||||
* 描述性文字,用于引导车主找到充电车位
|
* 描述性文字,用于引导车主找到充电车位
|
||||||
*/
|
*/
|
||||||
// private String SiteGuide;
|
private String SiteGuide;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建设场所 Y
|
* 建设场所 Y
|
||||||
@@ -196,19 +196,19 @@ public class StationInfo {
|
|||||||
* 站点照片 N
|
* 站点照片 N
|
||||||
* 充电设备照片、充电车位照片、停车场入口照片
|
* 充电设备照片、充电车位照片、停车场入口照片
|
||||||
*/
|
*/
|
||||||
// private List<String> Pictures;
|
private List<String> Pictures;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用车型描述 N
|
* 使用车型描述 N
|
||||||
* 描述该站点接受的车大小以及类型,如大巴、物流车、私家乘用车、出租车等
|
* 描述该站点接受的车大小以及类型,如大巴、物流车、私家乘用车、出租车等
|
||||||
*/
|
*/
|
||||||
// private String MatchCars;
|
private String MatchCars;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车位楼层及数量描述 N
|
* 车位楼层及数量描述 N
|
||||||
* 车位楼层以及数量信息
|
* 车位楼层以及数量信息
|
||||||
*/
|
*/
|
||||||
// private String ParkInfo;
|
private String ParkInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 停车场产权方 N
|
* 停车场产权方 N
|
||||||
@@ -70,7 +70,7 @@ import java.util.stream.Collectors;
|
|||||||
public class HaiNanPlatformServiceImpl implements ThirdPartyPlatformService {
|
public class HaiNanPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||||
Logger logger = LoggerFactory.getLogger(HaiNanPlatformServiceImpl.class);
|
Logger logger = LoggerFactory.getLogger(HaiNanPlatformServiceImpl.class);
|
||||||
// 平台类型
|
// 平台类型
|
||||||
private final String platformType = ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode();
|
private final String platformType = ThirdPlatformTypeEnum.HAI_NAN_1_PLATFORM.getTypeCode();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PileMerchantInfoService pileMerchantInfoService;
|
private PileMerchantInfoService pileMerchantInfoService;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import com.jsowell.thirdparty.lianlian.domain.*;
|
|||||||
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
||||||
import com.jsowell.thirdparty.lianlian.vo.EquipmentAuthVO;
|
import com.jsowell.thirdparty.lianlian.vo.EquipmentAuthVO;
|
||||||
import com.jsowell.thirdparty.platform.ThirdPartyPlatformService;
|
import com.jsowell.thirdparty.platform.ThirdPartyPlatformService;
|
||||||
|
import com.jsowell.thirdparty.platform.common.StationInfo;
|
||||||
import com.jsowell.thirdparty.platform.util.Cryptos;
|
import com.jsowell.thirdparty.platform.util.Cryptos;
|
||||||
import com.jsowell.thirdparty.platform.util.Encodes;
|
import com.jsowell.thirdparty.platform.util.Encodes;
|
||||||
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
||||||
@@ -682,7 +683,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
* @throws UnsupportedOperationException 未实现异常
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String notificationOrderInfo(String orderCode) {
|
public String notificationChargeOrderInfo(String orderCode) {
|
||||||
|
|
||||||
// 根据订单号查询出信息
|
// 根据订单号查询出信息
|
||||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.jsowell.thirdparty.platform.neimenggu.domain;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
|
import com.jsowell.thirdparty.platform.common.StationInfo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内蒙古平台站点信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class SupStationInfo extends StationInfo {
|
||||||
|
/**
|
||||||
|
* 充换电站唯一编码
|
||||||
|
* 行政区划代码,区县地区码(6位)+运营商ID(9位)+充换电站ID
|
||||||
|
*/
|
||||||
|
@JSONField(name = "StationUniqueNumber")
|
||||||
|
private String stationUniqueNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充换电站所在县以下行政区划代码
|
||||||
|
* 填写内容为12位行政区划代码,1-6位为县及以上行政区划代码,7-12位为县以下区划代码;
|
||||||
|
* 参考地址:http://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/2022/
|
||||||
|
*/
|
||||||
|
@JSONField(name = "AreaCodeCountryside")
|
||||||
|
private String areaCodeCountryside;
|
||||||
|
}
|
||||||
@@ -1,15 +1,193 @@
|
|||||||
package com.jsowell.thirdparty.platform.neimenggu.service;
|
package com.jsowell.thirdparty.platform.neimenggu.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||||
|
import com.jsowell.common.exception.BusinessException;
|
||||||
|
import com.jsowell.common.util.JWTUtils;
|
||||||
|
import com.jsowell.common.util.StringUtils;
|
||||||
|
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
|
||||||
|
import com.jsowell.pile.domain.ThirdPartyStationRelation;
|
||||||
|
import com.jsowell.pile.dto.QueryOperatorInfoDTO;
|
||||||
|
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||||
|
import com.jsowell.pile.service.ThirdPartyPlatformConfigService;
|
||||||
|
import com.jsowell.pile.service.ThirdPartyStationRelationService;
|
||||||
|
import com.jsowell.pile.thirdparty.CommonParamsDTO;
|
||||||
|
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
||||||
import com.jsowell.thirdparty.platform.ThirdPartyPlatformService;
|
import com.jsowell.thirdparty.platform.ThirdPartyPlatformService;
|
||||||
|
import com.jsowell.thirdparty.platform.util.Cryptos;
|
||||||
|
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内蒙古监测平台逻辑
|
* 内蒙古监测平台逻辑
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||||
// 平台类型
|
// 平台类型
|
||||||
private final String platformType = ThirdPlatformTypeEnum.NEI_MENG_GU_PLATFORM.getTypeCode();
|
private final String thirdPlatformType = ThirdPlatformTypeEnum.NEI_MENG_GU_PLATFORM.getTypeCode();
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ThirdPartyPlatformConfigService thirdPartyPlatformConfigService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query_token 获取token,提供给第三方平台使用
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, String> queryToken(CommonParamsDTO dto) {
|
||||||
|
String operatorId = dto.getPlatformID();
|
||||||
|
// 通过operatorId 查出 operatorSecret
|
||||||
|
ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorId);
|
||||||
|
if (platformConfig == null) {
|
||||||
|
throw new BusinessException("1", "无此对接平台");
|
||||||
|
}
|
||||||
|
|
||||||
|
String operatorSecret = platformConfig.getOperatorSecret();
|
||||||
|
String dataSecret = platformConfig.getDataSecret();
|
||||||
|
String dataSecretIv = platformConfig.getDataSecretIv();
|
||||||
|
String signSecret = platformConfig.getSignSecret();
|
||||||
|
|
||||||
|
// 解密data 获取参数中的OperatorSecret
|
||||||
|
try {
|
||||||
|
String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv);
|
||||||
|
String inputOperatorSecret = null;
|
||||||
|
if (StringUtils.isNotBlank(decrypt)) {
|
||||||
|
inputOperatorSecret = JSON.parseObject(decrypt).getString("PlatformSecret");
|
||||||
|
}
|
||||||
|
if (!StringUtils.equals(operatorSecret, inputOperatorSecret)) {
|
||||||
|
throw new RuntimeException("密钥不一致");
|
||||||
|
}
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
throw new BusinessException("2", "密钥错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成token
|
||||||
|
String token = JWTUtils.createToken(operatorId, operatorSecret, JWTUtils.ttlMillis);
|
||||||
|
|
||||||
|
// 组装返回参数
|
||||||
|
AccessTokenVO vo = new AccessTokenVO();
|
||||||
|
vo.setAccessToken(token);
|
||||||
|
// vo.setOperatorID(operatorId);
|
||||||
|
vo.setPlatformId(operatorId);
|
||||||
|
vo.setTokenAvailableTime((int) (JWTUtils.ttlMillis / 1000));
|
||||||
|
vo.setFailReason(0);
|
||||||
|
vo.setSuccStat(0);
|
||||||
|
|
||||||
|
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||||
|
// 加密数据
|
||||||
|
String encryptData = Cryptos.aesEncrypt(JSON.toJSONString(vo), dataSecret, dataSecretIv);
|
||||||
|
resultMap.put("Data", encryptData);
|
||||||
|
// 生成sig
|
||||||
|
String resultSign = GBSignUtils.sign(resultMap, signSecret);
|
||||||
|
resultMap.put("Sig", resultSign);
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运营商信息 query_operator_info
|
||||||
|
* supervise_query_operator_info
|
||||||
|
*
|
||||||
|
* @param dto 查询运营商信息DTO
|
||||||
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, String> queryOperatorInfo(QueryOperatorInfoDTO dto) {
|
||||||
|
Map<String, String> resultMap = Maps.newHashMap();
|
||||||
|
// TODO 查询接入内蒙古平台的站点信息
|
||||||
|
List<ThirdPartyStationRelation> thirdPartyStationRelations =
|
||||||
|
thirdPartyStationRelationService.selectThirdPartyStationRelationList(thirdPlatformType);
|
||||||
|
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询充电站信息 query_stations_info
|
||||||
|
* 此接口用于查询对接平台的充电站的信息
|
||||||
|
*
|
||||||
|
* @param dto 查询站点信息dto
|
||||||
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
|
||||||
|
return ThirdPartyPlatformService.super.queryStationsInfo(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备接口状态查询 query_station_status
|
||||||
|
*
|
||||||
|
* @param dto 查询站点信息dto
|
||||||
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, String> queryStationStatus(QueryStationInfoDTO dto) {
|
||||||
|
return ThirdPartyPlatformService.super.queryStationStatus(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备状态变化推送 notification_stationStatus
|
||||||
|
* 推送充电设备接口状态信息 supervise_notification_station_status
|
||||||
|
*
|
||||||
|
* @param pileConnectorCode 充电枪口编号
|
||||||
|
* @param status 枪口状态
|
||||||
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String notificationStationStatus(String pileConnectorCode, String status) {
|
||||||
|
return ThirdPartyPlatformService.super.notificationStationStatus(pileConnectorCode, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电订单推送 notification_charge_order_info
|
||||||
|
*
|
||||||
|
* @param orderCode 订单编号
|
||||||
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String notificationChargeOrderInfo(String orderCode) {
|
||||||
|
return ThirdPartyPlatformService.super.notificationChargeOrderInfo(orderCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送充电状态 notification_equip_charge_status
|
||||||
|
* 推送充电状态信息 supervise_notification_equip_charge_status
|
||||||
|
*
|
||||||
|
* @param orderCode 订单编号
|
||||||
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String notificationEquipChargeStatus(String orderCode) {
|
||||||
|
return ThirdPartyPlatformService.super.notificationEquipChargeStatus(orderCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送充换电站用能统计信息 supervise_notification_operation_stats_info
|
||||||
|
*
|
||||||
|
* @param stationId
|
||||||
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String notificationOperationStatsInfo(String stationId) {
|
||||||
|
return ThirdPartyPlatformService.super.notificationOperationStatsInfo(stationId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送充电站历史充电订单信息 supervise_notification_charge_order_info_history
|
||||||
|
*
|
||||||
|
* @param stationId
|
||||||
|
* @throws UnsupportedOperationException 未实现异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String notificationChargeOrderInfoHistory(String stationId) {
|
||||||
|
return ThirdPartyPlatformService.super.notificationChargeOrderInfoHistory(stationId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user