Commit 5f7bc3b3 authored by 刘林's avatar 刘林

fix(jg):移装变更接口修改

parent 7ebe3016
......@@ -195,10 +195,10 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
String county = (String) tableData.get("transferCounty");
String street = (String) tableData.get("transferStreet");
String address = (String) tableData.get("transferAddress");
//区内移装,需判断是否为同一地市,如果不是同一地市,返回异常
//区内移装,需判断是否为同一地市,如果不是同一地市,返回异常 -> 610000#610200#610204#610204002
if ("0".equals(tableData.get("transferType"))) {
deviceList.forEach(device -> {
String deviceCity = Arrays.stream(((String) device.get("USE_PLACE_CODE")).split("#"))
String deviceCity = Arrays.stream(((String) device.get("USE_SITE_CODE")).split("#"))
.skip(1)
.findFirst()
.orElseThrow(() -> new BadRequest("没有查询到地市信息"));
......@@ -209,7 +209,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
});
} else{
deviceList.forEach(device -> {
String deviceCity = Arrays.stream(((String) device.get("USE_PLACE_CODE")).split("#"))
String deviceCity = Arrays.stream(((String) device.get("USE_SITE_CODE")).split("#"))
.skip(1)
.findFirst()
.orElseThrow(() -> new BadRequest("没有查询到地市信息"));
......@@ -1149,6 +1149,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
}
//获取移装新位置,更新ES
String newUsePlace = "";
String newUsePlaceCode = "";
String newAddress = "";
String newLongitudeLatitude = "";
if (!ValidationUtil.isEmpty(newData)) {
......@@ -1164,24 +1165,28 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
String[] provinceList = province.split("_");
if (provinceList.length > 1) {
newUsePlace += provinceList[1] + "/";
newUsePlaceCode += provinceList[0] + "#";
}
}
if (!ObjectUtils.isEmpty(city)) {
String[] cityList = city.split("_");
if (cityList.length > 1) {
newUsePlace += cityList[1] + "/";
newUsePlaceCode += cityList[0] + "#";
}
}
if (!ObjectUtils.isEmpty(county)) {
String[] countyList = county.split("_");
if (countyList.length > 1) {
newUsePlace += countyList[1] + "/";
newUsePlaceCode += countyList[0] + "#";
}
}
if (!ObjectUtils.isEmpty(street)) {
String[] countyList = street.split("_");
if (countyList.length > 1) {
newUsePlace += countyList[1];
newUsePlaceCode += countyList[0];
}
}
......@@ -1197,6 +1202,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
Map<String, Object> map1 = new HashMap<>();
map1.put("USE_PLACE", newUsePlace);
map1.put("ADDRESS", newAddress);
map1.put("USE_SITE_CODE", newUsePlaceCode);
map1.put("LONGITUDE_LATITUDE", newLongitudeLatitude);
if (isUpdateRegistrationCode.get()) {
map1.put("USE_ORG_CODE", useRegistrationCode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment