将高德和第三方平台方法区分

This commit is contained in:
Lemon
2023-10-25 17:20:59 +08:00
parent a652456839
commit cb654a6df5
7 changed files with 41 additions and 7 deletions

View File

@@ -78,6 +78,9 @@ public interface PileStationInfoMapper {
*/ */
List<PileStationInfo> getStationInfoForLianLian(); List<PileStationInfo> getStationInfoForLianLian();
List<PileStationInfo> getStationInfoForAmap();
List<String> queryByStationDeptIds(@Param("stationDeptIds") List<String> stationDeptIds); List<String> queryByStationDeptIds(@Param("stationDeptIds") List<String> stationDeptIds);
int updateAmapFlag(@Param("stationId") String stationId, @Param("amapFlag") String amapFlag); int updateAmapFlag(@Param("stationId") String stationId, @Param("amapFlag") String amapFlag);

View File

@@ -94,6 +94,8 @@ public interface IPileStationInfoService {
List<PileStationInfo> getStationInfosByThirdParty(); List<PileStationInfo> getStationInfosByThirdParty();
List<PileStationInfo> getStationInfosByAmap();
List<String> queryByStationDeptIds(List<String> stationIds); List<String> queryByStationDeptIds(List<String> stationIds);
String selectAdapayMemberId(String stationId); String selectAdapayMemberId(String stationId);

View File

@@ -190,6 +190,11 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
return pileStationInfoMapper.getStationInfoForLianLian(); return pileStationInfoMapper.getStationInfoForLianLian();
} }
@Override
public List<PileStationInfo> getStationInfosByAmap() {
return pileStationInfoMapper.getStationInfoForAmap();
}
@Override @Override
public List<String> queryByStationDeptIds(List<String> stationIds) { public List<String> queryByStationDeptIds(List<String> stationIds) {
return pileStationInfoMapper.queryByStationDeptIds(stationIds); return pileStationInfoMapper.queryByStationDeptIds(stationIds);

View File

@@ -409,7 +409,6 @@
<include refid="selectPileStationInfoVo"/> <include refid="selectPileStationInfoVo"/>
where del_flag = '0' where del_flag = '0'
and public_flag = '1' and public_flag = '1'
and amap_flag = '1'
</select> </select>
<select id="queryByStationDeptIds" resultType="java.lang.String"> <select id="queryByStationDeptIds" resultType="java.lang.String">
@@ -470,4 +469,11 @@
</foreach> </foreach>
</if> </if>
</select> </select>
<select id="getStationInfoForAmap" resultMap="PileStationInfoResult">
<include refid="selectPileStationInfoVo"/>
where del_flag = '0'
and public_flag = '1'
and amap_flag = '1'
</select>
</mapper> </mapper>

View File

@@ -90,7 +90,7 @@ public class AMapServiceImpl implements AMapService {
PageUtils.startPage(pageNo, pageSize); PageUtils.startPage(pageNo, pageSize);
// 查询站点信息 // 查询站点信息
sw.start("查询站点信息"); sw.start("查询站点信息");
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByThirdParty(); List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap();
PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos); PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos);
sw.stop(); sw.stop();
@@ -128,7 +128,7 @@ public class AMapServiceImpl implements AMapService {
PageUtils.startPage(pageNo, pageSize); PageUtils.startPage(pageNo, pageSize);
// 第一次查询,得到站点 // 第一次查询,得到站点
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByThirdParty(); List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap();
PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos); PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos);
List<PileStationInfo> stationList = pageInfo.getList(); List<PileStationInfo> stationList = pageInfo.getList();
if (CollectionUtils.isEmpty(stationList)) { if (CollectionUtils.isEmpty(stationList)) {

File diff suppressed because one or more lines are too long

View File

@@ -10,6 +10,7 @@ import com.jsowell.pile.domain.*;
import com.jsowell.pile.dto.PushStationInfoDTO; import com.jsowell.pile.dto.PushStationInfoDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO; import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.service.*; import com.jsowell.pile.service.*;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO; import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.pile.vo.web.PileModelInfoVO; import com.jsowell.pile.vo.web.PileModelInfoVO;
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO; import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
@@ -58,6 +59,9 @@ public class ZDLServiceImpl implements ZDLService {
@Autowired @Autowired
private IPileModelInfoService pileModelInfoService; private IPileModelInfoService pileModelInfoService;
@Autowired
private IPileMerchantInfoService pileMerchantInfoService;
@Autowired @Autowired
private IPileConnectorInfoService pileConnectorInfoService; private IPileConnectorInfoService pileConnectorInfoService;
@@ -105,11 +109,11 @@ public class ZDLServiceImpl implements ZDLService {
String dataSecretIv = relationInfo.getDataSecretIv(); String dataSecretIv = relationInfo.getDataSecretIv();
String urlAddress = relationInfo.getUrlAddress(); String urlAddress = relationInfo.getUrlAddress();
// 组装联平台所需要的数据格式 // 组装中电联平台所需要的数据格式
ZDLStationInfo info = ZDLStationInfo.builder() ZDLStationInfo info = ZDLStationInfo.builder()
.stationId("ZDL" +dto.getStationId()) .stationId(String.valueOf(dto.getStationId()))
.operatorId(operatorId) .operatorId(operatorId)
.equipmentOwnerId(Constants.OPERATORID_JIANG_SU) // .equipmentOwnerId(Constants.OPERATORID_JIANG_SU)
.stationName(pileStationInfo.getStationName()) .stationName(pileStationInfo.getStationName())
.countryCode(pileStationInfo.getCountryCode()) .countryCode(pileStationInfo.getCountryCode())
.areaCode(pileStationInfo.getAreaCode()) .areaCode(pileStationInfo.getAreaCode())
@@ -123,6 +127,14 @@ public class ZDLServiceImpl implements ZDLService {
.construction(Integer.valueOf(pileStationInfo.getConstruction())) .construction(Integer.valueOf(pileStationInfo.getConstruction()))
.build(); .build();
// 截取运营商组织机构代码(去除最后一位后的最后九位)
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
String organizationCode = merchantInfo.getOrganizationCode();
if (organizationCode.length() == 18) {
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
info.setEquipmentOwnerId(equipmentOwnerId);
}
List<ZDLEquipmentInfo> pileList = getPileList(pileStationInfo); List<ZDLEquipmentInfo> pileList = getPileList(pileStationInfo);
if (CollectionUtils.isNotEmpty(pileList)) { if (CollectionUtils.isNotEmpty(pileList)) {
info.setEquipmentInfos(pileList); // 充电设备信息列表 info.setEquipmentInfos(pileList); // 充电设备信息列表
@@ -154,6 +166,12 @@ public class ZDLServiceImpl implements ZDLService {
return result; return result;
} }
public static void main(String[] args) {
String organizationCode = "91310120MAC13L2Q9P";
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
System.out.println(equipmentOwnerId); // MAC13L2Q9
}
/** /**
* 查询站点信息 * 查询站点信息
* @return * @return