|
|
@@ -13,7 +13,9 @@ import org.apache.logging.log4j.util.PropertiesUtil; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.ResourceUtils; |
|
|
|
|
|
|
|
import java.io.FileNotFoundException; |
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
@@ -46,11 +48,18 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS |
|
|
|
private String ipPositionRequestKey; |
|
|
|
|
|
|
|
// 从CSV文件读取省会城市中心点位置信息 |
|
|
|
private void getPosFromFile(String centerAddress) { |
|
|
|
private void getPosFromFile(String centerAddress) { |
|
|
|
// 不存在说明token是已过期了 |
|
|
|
String centerProvinceName = ""; |
|
|
|
String centerProvinceLonAndAlt = ""; |
|
|
|
List<String> centerAddressSets = CSVUtil.readCSV(this.centerProvinceFilePath); |
|
|
|
String appResPath = ""; |
|
|
|
try { |
|
|
|
appResPath = ResourceUtils.getURL("resources:").getPath(); |
|
|
|
log.debug(appResPath); |
|
|
|
} catch (Exception e) { |
|
|
|
log.debug("cannot find path"); |
|
|
|
} |
|
|
|
List<String> centerAddressSets = CSVUtil.readCSV(appResPath + this.centerProvinceFilePath); |
|
|
|
for (String centerAddressSet:centerAddressSets) { |
|
|
|
String[] centerAddressSetArray = centerAddressSet.split(","); |
|
|
|
if (centerAddressSetArray.length < 3) { |
|
|
|