山东省内 替换街道级区划编码
This commit is contained in:
parent
b70763c1f5
commit
aa6cde425d
@ -61,21 +61,12 @@ public class FirePointQo {
|
|||||||
*/
|
*/
|
||||||
private String satelliteImage;
|
private String satelliteImage;
|
||||||
|
|
||||||
public FirePointQo() {
|
/**
|
||||||
}
|
* 乡镇街道区划编码
|
||||||
|
*/
|
||||||
|
private String towncode;
|
||||||
|
|
||||||
public FirePointQo(String fireCode, Integer countyCode, String countyName, Integer satelliteTimeTs, Double longitude, Double latitude, String satelliteType, String landtype, String confidence, String fireImage, String satelliteImage) {
|
public FirePointQo() {
|
||||||
this.fireCode = fireCode;
|
|
||||||
this.countyCode = countyCode;
|
|
||||||
this.countyName = countyName;
|
|
||||||
this.satelliteTimeTs = satelliteTimeTs;
|
|
||||||
this.longitude = longitude;
|
|
||||||
this.latitude = latitude;
|
|
||||||
this.satelliteType = satelliteType;
|
|
||||||
this.landtype = landtype;
|
|
||||||
this.confidence = confidence;
|
|
||||||
this.fireImage = fireImage;
|
|
||||||
this.satelliteImage = satelliteImage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFireCode() {
|
public String getFireCode() {
|
||||||
@ -166,20 +157,16 @@ public class FirePointQo {
|
|||||||
this.satelliteImage = satelliteImage;
|
this.satelliteImage = satelliteImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTowncode() {
|
||||||
|
return towncode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTowncode(String towncode) {
|
||||||
|
this.towncode = towncode;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "FirePointQo{" +
|
return "FirePointQo{" + "fireCode='" + fireCode + '\'' + ", countyCode=" + countyCode + ", countyName='" + countyName + '\'' + ", satelliteTimeTs=" + satelliteTimeTs + ", longitude=" + longitude + ", latitude=" + latitude + ", satelliteType='" + satelliteType + '\'' + ", landtype='" + landtype + '\'' + ", confidence='" + confidence + '\'' + ", fireImage='" + fireImage + '\'' + ", satelliteImage='" + satelliteImage + '\'' + ", towncode='" + towncode + '\'' + '}';
|
||||||
"fireCode='" + fireCode + '\'' +
|
|
||||||
", countyCode=" + countyCode +
|
|
||||||
", countyName='" + countyName + '\'' +
|
|
||||||
", satelliteTimeTs=" + satelliteTimeTs +
|
|
||||||
", longitude=" + longitude +
|
|
||||||
", latitude=" + latitude +
|
|
||||||
", satelliteType='" + satelliteType + '\'' +
|
|
||||||
", landtype='" + landtype + '\'' +
|
|
||||||
", confidence='" + confidence + '\'' +
|
|
||||||
", fireImage='" + fireImage + '\'' +
|
|
||||||
", satelliteImage='" + satelliteImage + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import com.xkrs.model.qo.FirePointQo;
|
|||||||
import com.xkrs.model.vo.GaoDeIgGeocodeVo;
|
import com.xkrs.model.vo.GaoDeIgGeocodeVo;
|
||||||
import com.xkrs.service.FirePointService;
|
import com.xkrs.service.FirePointService;
|
||||||
import com.xkrs.service.GlobalConfigService;
|
import com.xkrs.service.GlobalConfigService;
|
||||||
|
import com.xkrs.service.StreetService;
|
||||||
import com.xkrs.sms.PushHelper;
|
import com.xkrs.sms.PushHelper;
|
||||||
import com.xkrs.sms.SMSHelper;
|
import com.xkrs.sms.SMSHelper;
|
||||||
import com.xkrs.utils.*;
|
import com.xkrs.utils.*;
|
||||||
@ -72,6 +73,9 @@ public class FirePointServiceImpl implements FirePointService {
|
|||||||
@Resource
|
@Resource
|
||||||
private GlobalConfigService globalConfigService;
|
private GlobalConfigService globalConfigService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StreetService streetService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AgentOrgDao agentOrgDao;
|
private AgentOrgDao agentOrgDao;
|
||||||
|
|
||||||
@ -179,6 +183,26 @@ public class FirePointServiceImpl implements FirePointService {
|
|||||||
shanDongFirePoint.setFireCode(firePointQo.getFireCode());
|
shanDongFirePoint.setFireCode(firePointQo.getFireCode());
|
||||||
shanDongFirePoint.setCountyCode(firePointQo.getCountyCode().toString());
|
shanDongFirePoint.setCountyCode(firePointQo.getCountyCode().toString());
|
||||||
shanDongFirePoint.setCountyName(firePointQo.getCountyName());
|
shanDongFirePoint.setCountyName(firePointQo.getCountyName());
|
||||||
|
|
||||||
|
//设置乡镇街道区划编码和名称---Start
|
||||||
|
String townCode = firePointQo.getTowncode();
|
||||||
|
shanDongFirePoint.setStreetCode(townCode);
|
||||||
|
shanDongFirePoint.setStreetName("");
|
||||||
|
List<StreetEntity> streetList = streetService.findByStreetCode(townCode);
|
||||||
|
if (null != streetList && streetList.size() > 0) {
|
||||||
|
StreetEntity street = streetList.get(0);
|
||||||
|
shanDongFirePoint.setStreetName(street.getStreetName());
|
||||||
|
if (!street.getCountyCode().equals(shanDongFirePoint.getCountyCode())) {//这三个错误日志可以监视接收的towncode有木有问题,日志里不出现"发生重大错误"就是没问题
|
||||||
|
log.info("发生重大错误,接收的countyCode是" + shanDongFirePoint.getCountyCode() + ",本地表中根据streetCode(towncode)" + townCode + "找到的countyCode是" + street.getCountyCode() + ",firePointQo详情=" + firePointQo.toString());
|
||||||
|
}
|
||||||
|
if (!street.getCountyName().equals(shanDongFirePoint.getCountyName())) {
|
||||||
|
log.info("发生重大错误,接收的countyName是" + shanDongFirePoint.getCountyName() + ",本地表中根据streetCode(towncode)" + townCode + "找到的countyName是" + street.getCountyName() + ",firePointQo详情=" + firePointQo.toString());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.info("发生重大错误,传过来的towncode(" + townCode + ")连找都找不到,firePointQo详情=" + firePointQo.toString());
|
||||||
|
}
|
||||||
|
//设置乡镇街道区划编码和名称---End
|
||||||
|
|
||||||
shanDongFirePoint.setSatelliteTime(DateTimeUtil.timeMillisToString(firePointQo.getSatelliteTimeTs().longValue()));
|
shanDongFirePoint.setSatelliteTime(DateTimeUtil.timeMillisToString(firePointQo.getSatelliteTimeTs().longValue()));
|
||||||
shanDongFirePoint.setLongitude(firePointQo.getLongitude());
|
shanDongFirePoint.setLongitude(firePointQo.getLongitude());
|
||||||
shanDongFirePoint.setLatitude(firePointQo.getLatitude());
|
shanDongFirePoint.setLatitude(firePointQo.getLatitude());
|
||||||
@ -297,13 +321,6 @@ public class FirePointServiceImpl implements FirePointService {
|
|||||||
GaoDeIgGeocodeVo.Regeocode reGeoCode = geocode.getRegeocodes().get(0);
|
GaoDeIgGeocodeVo.Regeocode reGeoCode = geocode.getRegeocodes().get(0);
|
||||||
String formattedAddress = reGeoCode.getFormatted_address();
|
String formattedAddress = reGeoCode.getFormatted_address();
|
||||||
firePointEntity.setFirePointAddress(formattedAddress);
|
firePointEntity.setFirePointAddress(formattedAddress);
|
||||||
GaoDeIgGeocodeVo.AddressComponent addressComponent = reGeoCode.getAddressComponent().get(0);
|
|
||||||
firePointEntity.setCountyCode(addressComponent.getAdcode());
|
|
||||||
firePointEntity.setCountyName(addressComponent.getDistrict());
|
|
||||||
String townCode = addressComponent.getTowncode();
|
|
||||||
String fixedTownCode = townCode.length() > 9 ? townCode.substring(0, 9) : townCode;
|
|
||||||
firePointEntity.setStreetCode(fixedTownCode);
|
|
||||||
firePointEntity.setStreetName(addressComponent.getTownship());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user