mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
新增 对接联联平台接口
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -12,34 +12,34 @@ import lombok.NoArgsConstructor;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrganizationInfo {
|
||||
public class OperatorInfo {
|
||||
/**
|
||||
* 对接平台ID(组织机构代码) Y
|
||||
*/
|
||||
private String organizationCode;
|
||||
private String OperatorID;
|
||||
|
||||
/**
|
||||
* 对接平台名称(机构全称) Y
|
||||
*/
|
||||
private String organizationName;
|
||||
private String OperatorName;
|
||||
|
||||
/**
|
||||
* 对接平台电话(对接平台客服电话1) Y
|
||||
*/
|
||||
private String ServiceTelNumber1;
|
||||
private String OperatorTel1;
|
||||
|
||||
/**
|
||||
* 对接平台电话2(对接平台客服电话2 ) N
|
||||
*/
|
||||
private String ServiceTelNumber2;
|
||||
private String OperatorTel2;
|
||||
|
||||
/**
|
||||
* 对接平台注册地址 N
|
||||
*/
|
||||
private String registerAddress;
|
||||
private String OperatorRegAddress;
|
||||
|
||||
/**
|
||||
* 备注 N
|
||||
*/
|
||||
private String mark;
|
||||
private String OperatorNote;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
package com.jsowell.thirdparty.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
31
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/dto/QueryStationInfoDTO.java
vendored
Normal file
31
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/dto/QueryStationInfoDTO.java
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 查询站点信息dto
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/8 10:02
|
||||
*/
|
||||
@Data
|
||||
public class QueryStationInfoDTO {
|
||||
/**
|
||||
* 上次查询时间
|
||||
* 格式“yyyy-MM-dd HH:mm:ss”,可以为空,如果
|
||||
* 不填写,则查询所有的充电站信息
|
||||
*/
|
||||
private String LastQueryTime;
|
||||
|
||||
/**
|
||||
* 查询页码
|
||||
* 不填写默认为 1
|
||||
*/
|
||||
private Integer PageNo;
|
||||
|
||||
/**
|
||||
* 每页数量
|
||||
* 不填写默认为 10
|
||||
*/
|
||||
private Integer PageSize;
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.jsowell.thirdparty.service;
|
||||
|
||||
import com.jsowell.thirdparty.domain.StationInfo;
|
||||
import com.jsowell.thirdparty.dto.QueryStationInfoDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LianLianService {
|
||||
|
||||
/**
|
||||
@@ -7,4 +12,6 @@ public interface LianLianService {
|
||||
* @param merchantId
|
||||
*/
|
||||
void pushMerchantInfo(Long merchantId);
|
||||
|
||||
List<StationInfo> query_stations_info(QueryStationInfoDTO dto);
|
||||
}
|
||||
|
||||
@@ -1,25 +1,104 @@
|
||||
package com.jsowell.thirdparty.service.impl;
|
||||
|
||||
import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.service.IPileMerchantInfoService;
|
||||
import com.jsowell.pile.service.IPileStationInfoService;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
import com.jsowell.thirdparty.domain.OperatorInfo;
|
||||
import com.jsowell.thirdparty.domain.StationInfo;
|
||||
import com.jsowell.thirdparty.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.thirdparty.service.LianLianService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class LianLianServiceImpl implements LianLianService {
|
||||
|
||||
@Autowired
|
||||
private IPileMerchantInfoService pileMerchantInfoService;
|
||||
|
||||
@Autowired
|
||||
private IPileStationInfoService pileStationInfoService;
|
||||
|
||||
|
||||
@Override
|
||||
public void pushMerchantInfo(Long merchantId) {
|
||||
// 通过id查询运营商信息
|
||||
|
||||
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(merchantId));
|
||||
// 组装联联平台所需要的数据格式
|
||||
|
||||
OperatorInfo operatorInfo = OperatorInfo.builder()
|
||||
.OperatorID(merchantInfo.getOrganizationCode()) // 组织机构代码
|
||||
.OperatorName(merchantInfo.getMerchantName()) // 机构全称
|
||||
.OperatorTel1(merchantInfo.getMerchantTel()) // 对接平台客服电话1
|
||||
.build();
|
||||
// 调用联联平台接口
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充电站信息
|
||||
* 对外接口 query_stations_info
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<StationInfo> query_stations_info(QueryStationInfoDTO dto) {
|
||||
List<StationInfo> resultList = new ArrayList<>();
|
||||
int pageNo = dto.getPageNo() == 0 ? 1 : dto.getPageNo();
|
||||
int pageSize = dto.getPageSize() == 0 ? 10 : dto.getPageSize();
|
||||
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfoForLianLian(pageNo, pageSize);
|
||||
if (CollectionUtils.isEmpty(stationInfos)) {
|
||||
// 未查到数据
|
||||
return null;
|
||||
}
|
||||
StationInfo stationInfo = null;
|
||||
for (PileStationInfo pileStationInfo : stationInfos) {
|
||||
stationInfo = new StationInfo();
|
||||
stationInfo.setStationID(String.valueOf(pileStationInfo.getId()));
|
||||
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
|
||||
stationInfo.setOperatorID(merchantInfo.getOrganizationCode()); // 组织结构代码
|
||||
stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId()));
|
||||
stationInfo.setStationName(pileStationInfo.getStationName());
|
||||
stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()));
|
||||
stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking()));
|
||||
stationInfo.setCountryCode(pileStationInfo.getCountryCode());
|
||||
stationInfo.setAreaCode(pileStationInfo.getAreaCode());
|
||||
stationInfo.setAddress(pileStationInfo.getAddress());
|
||||
stationInfo.setServiceTel(pileStationInfo.getServiceTel());
|
||||
stationInfo.setStationType(Integer.valueOf(pileStationInfo.getStationType()));
|
||||
stationInfo.setParkNums(Integer.valueOf(pileStationInfo.getParkNums()));
|
||||
stationInfo.setStationLng(new BigDecimal(pileStationInfo.getStationLng()));
|
||||
stationInfo.setStationLat(new BigDecimal(pileStationInfo.getStationLat()));
|
||||
stationInfo.setConstruction(Integer.valueOf(pileStationInfo.getConstruction()));
|
||||
stationInfo.setOpenAllDay(Integer.valueOf(pileStationInfo.getOpenAllDay()));
|
||||
// stationInfo.setMinElectricityPrice(pileStationInfo); // 最低充电电费率
|
||||
// stationInfo.setElectricityFee(); // 电费 xx元/度
|
||||
// stationInfo.setServiceFee(); // 服务费 xx元/度
|
||||
stationInfo.setParkFree(Integer.valueOf(pileStationInfo.getParkFree()));
|
||||
stationInfo.setPayment(pileStationInfo.getPayment());
|
||||
stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()));
|
||||
// stationInfo.setPileInfos(); // 充电设备信息列表
|
||||
// stationInfo.setParkFeeType(pileStationInfo); // 停车收费类型
|
||||
stationInfo.setToiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag()));
|
||||
stationInfo.setStoreFlag(Integer.valueOf(pileStationInfo.getStoreFlag()));
|
||||
stationInfo.setRestaurantFlag(Integer.valueOf(pileStationInfo.getRestaurantFlag()));
|
||||
stationInfo.setLoungeFlag(Integer.valueOf(pileStationInfo.getLoungeFlag()));
|
||||
stationInfo.setCanopyFlag(Integer.valueOf(pileStationInfo.getCanopyFlag()));
|
||||
stationInfo.setPrinterFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()));
|
||||
stationInfo.setBarrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()));
|
||||
stationInfo.setParkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()));
|
||||
|
||||
resultList.add(stationInfo);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user