mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-12 19:29:52 +08:00
新增 对接联联平台接口
This commit is contained in:
@@ -862,6 +862,10 @@ public class OrderService {
|
|||||||
UniAppOrderVO.BillingDetails billingDetails = new UniAppOrderVO.BillingDetails();
|
UniAppOrderVO.BillingDetails billingDetails = new UniAppOrderVO.BillingDetails();
|
||||||
BeanUtils.copyBeanProp(billingDetails, orderDetail);
|
BeanUtils.copyBeanProp(billingDetails, orderDetail);
|
||||||
vo.setBillingDetails(billingDetails);
|
vo.setBillingDetails(billingDetails);
|
||||||
|
|
||||||
|
// orderDetail.getSharpElectricityPrice()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,4 +71,10 @@ public interface PileStationInfoMapper {
|
|||||||
* @return 充电站对象集合
|
* @return 充电站对象集合
|
||||||
*/
|
*/
|
||||||
List<PileStationVO> queryStationInfos(@Param("stationDTO") QueryStationDTO dto);
|
List<PileStationVO> queryStationInfos(@Param("stationDTO") QueryStationDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询充电站信息(联联平台,分页使用)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PileStationInfo> getStationInfoForLianLian();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,4 +90,6 @@ public interface IPileStationInfoService {
|
|||||||
PileStationVO getStationInfo(String stationId);
|
PileStationVO getStationInfo(String stationId);
|
||||||
|
|
||||||
PileStationVO getStationInfoByPileSn(String pileSn);
|
PileStationVO getStationInfoByPileSn(String pileSn);
|
||||||
|
|
||||||
|
List<PileStationInfo> getStationInfoForLianLian(int pageNum, int pageSize);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
|
|||||||
.merchantId(merchantId)
|
.merchantId(merchantId)
|
||||||
.merchantName(pileMerchantInfo.getMerchantName())
|
.merchantName(pileMerchantInfo.getMerchantName())
|
||||||
.merchantTel(pileMerchantInfo.getServicePhone())
|
.merchantTel(pileMerchantInfo.getServicePhone())
|
||||||
|
.organizationCode(pileMerchantInfo.getOrganizationCode())
|
||||||
.deptId(pileMerchantInfo.getDeptId())
|
.deptId(pileMerchantInfo.getDeptId())
|
||||||
.build();
|
.build();
|
||||||
return vo;
|
return vo;
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ import com.jsowell.common.core.domain.entity.SysDept;
|
|||||||
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
||||||
import com.jsowell.common.core.page.PageResponse;
|
import com.jsowell.common.core.page.PageResponse;
|
||||||
import com.jsowell.common.core.redis.RedisCache;
|
import com.jsowell.common.core.redis.RedisCache;
|
||||||
import com.jsowell.common.util.DateUtils;
|
import com.jsowell.common.util.*;
|
||||||
import com.jsowell.common.util.DistanceUtils;
|
|
||||||
import com.jsowell.common.util.SecurityUtils;
|
|
||||||
import com.jsowell.common.util.StringUtils;
|
|
||||||
import com.jsowell.common.util.ip.AddressUtils;
|
import com.jsowell.common.util.ip.AddressUtils;
|
||||||
import com.jsowell.pile.domain.PileStationInfo;
|
import com.jsowell.pile.domain.PileStationInfo;
|
||||||
import com.jsowell.pile.dto.FastCreateStationDTO;
|
import com.jsowell.pile.dto.FastCreateStationDTO;
|
||||||
@@ -148,6 +145,12 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
|||||||
return stationInfo;
|
return stationInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PileStationInfo> getStationInfoForLianLian(int pageNum, int pageSize) {
|
||||||
|
PageUtils.startPage(pageNum, pageSize);
|
||||||
|
return pileStationInfoMapper.getStationInfoForLianLian();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充电站信息列表
|
* 查询充电站信息列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ public class MerchantInfoVO {
|
|||||||
*/
|
*/
|
||||||
private String merchantTel;
|
private String merchantTel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织结构代码
|
||||||
|
*/
|
||||||
|
private String organizationCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门id
|
* 部门id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -369,4 +369,8 @@
|
|||||||
and del_flag = '0'
|
and del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getStationInfoForLianLian" resultMap="PileStationInfoResult">
|
||||||
|
<include refid="selectPileStationInfoVo">
|
||||||
|
</include>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -12,34 +12,34 @@ import lombok.NoArgsConstructor;
|
|||||||
@Builder
|
@Builder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class OrganizationInfo {
|
public class OperatorInfo {
|
||||||
/**
|
/**
|
||||||
* 对接平台ID(组织机构代码) Y
|
* 对接平台ID(组织机构代码) Y
|
||||||
*/
|
*/
|
||||||
private String organizationCode;
|
private String OperatorID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对接平台名称(机构全称) Y
|
* 对接平台名称(机构全称) Y
|
||||||
*/
|
*/
|
||||||
private String organizationName;
|
private String OperatorName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对接平台电话(对接平台客服电话1) Y
|
* 对接平台电话(对接平台客服电话1) Y
|
||||||
*/
|
*/
|
||||||
private String ServiceTelNumber1;
|
private String OperatorTel1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对接平台电话2(对接平台客服电话2 ) N
|
* 对接平台电话2(对接平台客服电话2 ) N
|
||||||
*/
|
*/
|
||||||
private String ServiceTelNumber2;
|
private String OperatorTel2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对接平台注册地址 N
|
* 对接平台注册地址 N
|
||||||
*/
|
*/
|
||||||
private String registerAddress;
|
private String OperatorRegAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注 N
|
* 备注 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.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.dto;
|
package com.jsowell.thirdparty.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
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;
|
package com.jsowell.thirdparty.service;
|
||||||
|
|
||||||
|
import com.jsowell.thirdparty.domain.StationInfo;
|
||||||
|
import com.jsowell.thirdparty.dto.QueryStationInfoDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface LianLianService {
|
public interface LianLianService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7,4 +12,6 @@ public interface LianLianService {
|
|||||||
* @param merchantId
|
* @param merchantId
|
||||||
*/
|
*/
|
||||||
void pushMerchantInfo(Long merchantId);
|
void pushMerchantInfo(Long merchantId);
|
||||||
|
|
||||||
|
List<StationInfo> query_stations_info(QueryStationInfoDTO dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,104 @@
|
|||||||
package com.jsowell.thirdparty.service.impl;
|
package com.jsowell.thirdparty.service.impl;
|
||||||
|
|
||||||
|
import com.jsowell.pile.domain.PileStationInfo;
|
||||||
import com.jsowell.pile.service.IPileMerchantInfoService;
|
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 com.jsowell.thirdparty.service.LianLianService;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class LianLianServiceImpl implements LianLianService {
|
public class LianLianServiceImpl implements LianLianService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPileMerchantInfoService pileMerchantInfoService;
|
private IPileMerchantInfoService pileMerchantInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileStationInfoService pileStationInfoService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void pushMerchantInfo(Long merchantId) {
|
public void pushMerchantInfo(Long merchantId) {
|
||||||
// 通过id查询运营商信息
|
// 通过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