diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/MemberBasicInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/MemberBasicInfoMapper.java index 632eac41e..c6550656a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/MemberBasicInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/MemberBasicInfoMapper.java @@ -1,6 +1,7 @@ package com.jsowell.pile.mapper; import com.jsowell.pile.domain.MemberBasicInfo; +import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.vo.uniapp.MemberVO; import com.jsowell.pile.vo.uniapp.MemberWalletLogVO; import org.apache.ibatis.annotations.Param; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java index 0e032eb99..add1c9148 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java @@ -143,4 +143,11 @@ public interface PileBasicInfoMapper { * @return */ public List getPileInfoByMemberId(String memberId); + + /** + * 联联平台用,通过站点id查询桩列表信息 + * @param stationId + * @return + */ + List getPileListByStationId(@Param("stationId") String stationId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileBasicInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileBasicInfoService.java index 2d5d46967..991825649 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileBasicInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileBasicInfoService.java @@ -155,4 +155,11 @@ public interface IPileBasicInfoService { * @return */ List getPileInfoByMemberId(String memberId); + + /** + * 联联平台用,通过站点id查询桩列表信息 + * @param stationId + * @return + */ + List getPileListByStationId(String stationId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java index 87de595a9..bfc0d3c59 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java @@ -91,5 +91,5 @@ public interface IPileStationInfoService { PileStationVO getStationInfoByPileSn(String pileSn); - List getStationInfoForLianLian(int pageNum, int pageSize); + List getStationInfoForLianLian(); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java index 2d494bf46..4a0f92c52 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java @@ -601,4 +601,9 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService { } return list; } + + @Override + public List getPileListByStationId(String stationId) { + return pileBasicInfoMapper.getPileListByStationId(stationId); + } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index 2f9a41efa..fc2fe25cc 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -146,8 +146,8 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService { } @Override - public List getStationInfoForLianLian(int pageNum, int pageSize) { - PageUtils.startPage(pageNum, pageSize); + public List getStationInfoForLianLian() { + // PageUtils.startPage(pageNum, pageSize); return pileStationInfoMapper.getStationInfoForLianLian(); } diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml index 2ac2ed929..dea5d4ba4 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml @@ -367,4 +367,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t3.rated_voltage, t3.speed_type + + \ No newline at end of file diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/PileInfo.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/EquipmentInfo.java similarity index 72% rename from jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/PileInfo.java rename to jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/EquipmentInfo.java index c08535157..72f5f5e35 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/PileInfo.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/EquipmentInfo.java @@ -15,45 +15,45 @@ import java.util.List; @AllArgsConstructor @NoArgsConstructor @Data -public class PileInfo { +public class EquipmentInfo { /** * 设备编码 Y * 设备唯一编码,对同一对接平台,保证唯一 */ - private String pileSn; + private String EquipmentID; /** * 设备生产商组织机构代码 Y */ - private String organizationCode; + private String ManufacturerID; /** * 设备型号 N * 由设备生厂商定义的设备型号 */ - private String pileModelName; + private String EquipmentModel; /** * 设备名称 N */ - private String pileName; + private String EquipmentName; /** * 设备生产日期 N * YYYY-MM-DD */ - private String productionDate; + private String ProductionDate; /** * 建设时间 Y * YYYY-MM-DD */ - private String constructionTime; + private String ConstructionTime; /** * 设备类型(1-直流设备;2-交流设备;3-交直流一体设备) Y */ - private Integer pileType; + private Integer EquipmentType; /** * 设备状态 Y @@ -63,40 +63,40 @@ public class PileInfo { * 6:维护中 * 50:正常使用 */ - private Integer pileStatus; + private Integer EquipmentStatus; /** * 额定功率(单位:kW) Y */ - private BigDecimal ratedPower; + private BigDecimal EquipmentPower; /** * 新国标(0-否;1-是) Y * 是否新国标 */ - private Integer newNationalStandard; + private Integer NewNationalStandard; /** * 充电设备接口列表 Y * 该充电设备所有的充电设备接口的信息对象集合 */ - private List connectorInfos; + private List ConnectorInfos; /** * 充电设备经度 N * GCJ-02坐标系 */ - private BigDecimal pileLng; + private BigDecimal EquipmentLng; /** * 充电设备纬度 N * GCJ-02坐标系 */ - private BigDecimal pileLat; + private BigDecimal EquipmentLat; /** * 是否支持VIN码识别(0-否;1-是) Y */ - private Integer supportVinIdentify; + private Integer VinFlag; } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/StationInfo.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/StationInfo.java index d40983624..23b3a8562 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/StationInfo.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/domain/StationInfo.java @@ -264,7 +264,7 @@ public class StationInfo { * 充电设备信息列表 Y * 该充电站所有充电设备信息对象集合 */ - private List pileInfos; + private List equipmentInfos; /** * 停车收费类型 Y diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java index 35b1a8899..709fae76a 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java @@ -1,9 +1,15 @@ package com.jsowell.thirdparty.service.impl; +import com.github.pagehelper.PageInfo; +import com.google.common.collect.Lists; +import com.jsowell.common.util.DateUtils; +import com.jsowell.common.util.PageUtils; +import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.domain.PileStationInfo; -import com.jsowell.pile.service.IPileMerchantInfoService; -import com.jsowell.pile.service.IPileStationInfoService; +import com.jsowell.pile.service.*; import com.jsowell.pile.vo.base.MerchantInfoVO; +import com.jsowell.pile.vo.web.PileModelInfoVO; +import com.jsowell.thirdparty.domain.EquipmentInfo; import com.jsowell.thirdparty.domain.OperatorInfo; import com.jsowell.thirdparty.domain.StationInfo; import com.jsowell.thirdparty.dto.QueryStationInfoDTO; @@ -15,6 +21,7 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.util.Map; @Service public class LianLianServiceImpl implements LianLianService { @@ -25,6 +32,15 @@ public class LianLianServiceImpl implements LianLianService { @Autowired private IPileStationInfoService pileStationInfoService; + @Autowired + private IPileBasicInfoService pileBasicInfoService; + + @Autowired + private IPileModelInfoService pileModelInfoService; + + @Autowired + private IPileConnectorInfoService pileConnectorInfoService; + @Override public void pushMerchantInfo(Long merchantId) { @@ -52,17 +68,18 @@ public class LianLianServiceImpl implements LianLianService { int pageNo = dto.getPageNo() == 0 ? 1 : dto.getPageNo(); int pageSize = dto.getPageSize() == 0 ? 10 : dto.getPageSize(); - List stationInfos = pileStationInfoService.getStationInfoForLianLian(pageNo, pageSize); + PageUtils.startPage(pageNo, pageSize); + List stationInfos = pileStationInfoService.getStationInfoForLianLian(); if (CollectionUtils.isEmpty(stationInfos)) { // 未查到数据 return null; } - StationInfo stationInfo = null; - for (PileStationInfo pileStationInfo : stationInfos) { - stationInfo = new StationInfo(); + PageInfo pageInfo = new PageInfo<>(stationInfos); + for (PileStationInfo pileStationInfo : pageInfo.getList()) { + StationInfo stationInfo = new StationInfo(); stationInfo.setStationID(String.valueOf(pileStationInfo.getId())); MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId())); - stationInfo.setOperatorID(merchantInfo.getOrganizationCode()); // 组织结构代码 + stationInfo.setOperatorID(merchantInfo.getOrganizationCode()); // 组织机构代码 stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId())); stationInfo.setStationName(pileStationInfo.getStationName()); stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply())); @@ -83,7 +100,10 @@ public class LianLianServiceImpl implements LianLianService { stationInfo.setParkFree(Integer.valueOf(pileStationInfo.getParkFree())); stationInfo.setPayment(pileStationInfo.getPayment()); stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder())); - // stationInfo.setPileInfos(); // 充电设备信息列表 + + List pileList = getPileList(pileStationInfo); + stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表 + // stationInfo.setParkFeeType(pileStationInfo); // 停车收费类型 stationInfo.setToiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag())); stationInfo.setStoreFlag(Integer.valueOf(pileStationInfo.getStoreFlag())); @@ -100,5 +120,37 @@ public class LianLianServiceImpl implements LianLianService { return resultList; } + /** + * 获取桩列表信息 + * @param pileStationInfo + * @return + */ + private List getPileList(PileStationInfo pileStationInfo){ + List resultList = new ArrayList<>(); + // 通过站点id查询桩基本信息 + List list = pileBasicInfoService.getPileListByStationId(String.valueOf(pileStationInfo.getId())); + MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId())); + // 封装成联联平台对象 + for (PileBasicInfo pileBasicInfo : list) { + EquipmentInfo equipmentInfo = new EquipmentInfo(); + String pileSn = pileBasicInfo.getSn(); + equipmentInfo.setEquipmentID(pileSn); + equipmentInfo.setManufacturerID(merchantInfo.getOrganizationCode()); + equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, pileBasicInfo.getCreateTime())); + + PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn); + equipmentInfo.setEquipmentType(Integer.valueOf(modelInfo.getSpeedType())); + + // Map pileStatus = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileBasicInfo.getSn())); + equipmentInfo.setEquipmentStatus(50); + equipmentInfo.setEquipmentPower(new BigDecimal(modelInfo.getRatedPower())); + equipmentInfo.setNewNationalStandard(1); + // equipmentInfo.setConnectorInfos(); + equipmentInfo.setVinFlag(1); + + resultList.add(equipmentInfo); + } + return resultList; + } }