Forráskód Böngészése

站点导入更新

skyline 1 éve
szülő
commit
d09eb45f3e

+ 2 - 1
admin-web/src/views/admin/station/list/upload.vue

@@ -173,6 +173,7 @@ const initState = () => ({
     {label: '充电桩SN', value: 'equipmentId'},
     {label: '充电口SN', value: 'connectorId'},
     {label: '车位编号', value: 'parkingNo'},
+    {label: '互联平台', value: 'platformName'},
   ]
 })
 
@@ -481,4 +482,4 @@ defineExpose({
   z-index: 10000 !important;
 }
 
-</style>
+</style>

+ 6 - 1
service/src/main/java/com/kym/service/admin/impl/StationServiceImpl.java

@@ -11,6 +11,7 @@ import com.kym.common.cache.PlatformCache;
 import com.kym.common.exception.BusinessException;
 import com.kym.common.utils.CommUtil;
 import com.kym.common.utils.PlatformAesUtil;
+import com.kym.common.utils.PlatformConvertUtil;
 import com.kym.entity.admin.*;
 import com.kym.entity.admin.queryParams.StationQueryParam;
 import com.kym.entity.admin.vo.LocalStationVo;
@@ -293,6 +294,7 @@ public class StationServiceImpl extends MyBaseServiceImpl<StationMapper, Station
                         // 默认状态设置为空闲
                         var connectorInfo = new ConnectorInfo().setStatus(EquipmentInfo.SERVICE_STATUS_空闲);
                         BeanUtils.copyProperties(connector, connectorInfo);
+                        connectorInfo.setConnectorId(PlatformConvertUtil.parse2LocalConnectorId(connector.getConnectorId()));
                         connectorList.add(connectorInfo);
                     });
                 }
@@ -337,7 +339,7 @@ public class StationServiceImpl extends MyBaseServiceImpl<StationMapper, Station
     @Transactional
     public void importStation(JSONObject data) {
         var fieldIndexes = data.getJSONArray("fieldIndexes");
-        if (fieldIndexes.size() != 7) {
+        if (fieldIndexes.size() != 8) {
             throw new BusinessException("导入数据格式错误,请正确匹配对应数据列");
         }
 
@@ -374,6 +376,9 @@ public class StationServiceImpl extends MyBaseServiceImpl<StationMapper, Station
         KymCache.INSTANCE.putConnectorId2ShortId(equipmentRelations.stream().collect(Collectors.toMap(EquipmentRelation::getConnectorId, EquipmentRelation::getShortId)));
         KymCache.INSTANCE.putConnectorId2StationId(equipmentRelations.stream().collect(Collectors.toMap(EquipmentRelation::getConnectorId, EquipmentRelation::getStationId)));
         KymCache.INSTANCE.putConnectorId2ParkingNo(equipmentRelations.stream().collect(Collectors.toMap(EquipmentRelation::getConnectorId, EquipmentRelation::getParkingNo)));
+        PlatformCache.INSTANCE.putConnectorId2PlatformName(equipmentRelations.stream().collect(Collectors.toMap(EquipmentRelation::getConnectorId, EquipmentRelation::getPlatformName)));
+        PlatformCache.INSTANCE.putStationId2PlatformName(equipmentRelations.stream().collect(Collectors.toMap(EquipmentRelation::getStationId, EquipmentRelation::getPlatformName)));
+
     }
 
 }