新增 对接联联平台接口

This commit is contained in:
Lemon
2023-04-08 14:20:19 +08:00
parent a3a82c1648
commit c73ca96ee2
21 changed files with 166 additions and 24 deletions

View File

@@ -862,6 +862,10 @@ public class OrderService {
UniAppOrderVO.BillingDetails billingDetails = new UniAppOrderVO.BillingDetails();
BeanUtils.copyBeanProp(billingDetails, orderDetail);
vo.setBillingDetails(billingDetails);
// orderDetail.getSharpElectricityPrice()
}
return vo;
}

View File

@@ -71,4 +71,10 @@ public interface PileStationInfoMapper {
* @return 充电站对象集合
*/
List<PileStationVO> queryStationInfos(@Param("stationDTO") QueryStationDTO dto);
/**
* 查询充电站信息(联联平台,分页使用)
* @return
*/
List<PileStationInfo> getStationInfoForLianLian();
}

View File

@@ -90,4 +90,6 @@ public interface IPileStationInfoService {
PileStationVO getStationInfo(String stationId);
PileStationVO getStationInfoByPileSn(String pileSn);
List<PileStationInfo> getStationInfoForLianLian(int pageNum, int pageSize);
}

View File

@@ -170,6 +170,7 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
.merchantId(merchantId)
.merchantName(pileMerchantInfo.getMerchantName())
.merchantTel(pileMerchantInfo.getServicePhone())
.organizationCode(pileMerchantInfo.getOrganizationCode())
.deptId(pileMerchantInfo.getDeptId())
.build();
return vo;

View File

@@ -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.page.PageResponse;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.DistanceUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.*;
import com.jsowell.common.util.ip.AddressUtils;
import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.dto.FastCreateStationDTO;
@@ -148,6 +145,12 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
return stationInfo;
}
@Override
public List<PileStationInfo> getStationInfoForLianLian(int pageNum, int pageSize) {
PageUtils.startPage(pageNum, pageSize);
return pileStationInfoMapper.getStationInfoForLianLian();
}
/**
* 查询充电站信息列表
*

View File

@@ -25,6 +25,11 @@ public class MerchantInfoVO {
*/
private String merchantTel;
/**
* 组织结构代码
*/
private String organizationCode;
/**
* 部门id
*/

View File

@@ -369,4 +369,8 @@
and del_flag = '0'
</select>
<select id="getStationInfoForLianLian" resultMap="PileStationInfoResult">
<include refid="selectPileStationInfoVo">
</include>
</select>
</mapper>

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@@ -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;
}

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.dto;
package com.jsowell.thirdparty.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;

View 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;
}

View File

@@ -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);
}

View File

@@ -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;
}
}