|
|
@@ -134,7 +134,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
private ResponseEntity<String> savedParkingSpaceInfo(IPageData pd, List<ImportParkingSpace> parkingSpaces, ComponentValidateResult result) {
|
|
|
String apiUrl = "";
|
|
|
JSONObject paramIn = null;
|
|
|
- ResponseEntity<String> responseEntity = null;
|
|
|
+ ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK);
|
|
|
ImportOwner owner = null;
|
|
|
for (ImportParkingSpace parkingSpace : parkingSpaces) {
|
|
|
JSONObject savedParkingSpaceInfo = getExistsParkSpace(pd, result, parkingSpace);
|
|
|
@@ -213,7 +213,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
private ResponseEntity<String> savedRoomInfo(IPageData pd, List<ImportRoom> rooms, ComponentValidateResult result) {
|
|
|
String apiUrl = "";
|
|
|
JSONObject paramIn = null;
|
|
|
- ResponseEntity<String> responseEntity = null;
|
|
|
+ ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK);
|
|
|
ImportOwner owner = null;
|
|
|
for (ImportRoom room : rooms) {
|
|
|
JSONObject savedRoomInfo = getExistsRoom(pd, result, room);
|
|
|
@@ -232,9 +232,9 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
paramIn.put("unitId", room.getFloor().getUnitId());
|
|
|
paramIn.put("roomNum", room.getRoomNum());
|
|
|
paramIn.put("layer", room.getLayer());
|
|
|
- paramIn.put("section", room.getSection());
|
|
|
- paramIn.put("apartment", "1");
|
|
|
- paramIn.put("state", "1000");
|
|
|
+ paramIn.put("section", "1");
|
|
|
+ paramIn.put("apartment", room.getSection());
|
|
|
+ paramIn.put("state", "2002");
|
|
|
paramIn.put("builtUpArea", room.getBuiltUpArea());
|
|
|
paramIn.put("unitPrice", "1000.00");
|
|
|
|
|
|
@@ -256,7 +256,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
paramIn.put("communityId", result.getCommunityId());
|
|
|
paramIn.put("ownerId", room.getImportOwner().getOwnerId());
|
|
|
paramIn.put("roomId", savedRoomInfo.getString("roomId"));
|
|
|
- paramIn.put("state", "2002");
|
|
|
+ paramIn.put("state", "2001");
|
|
|
paramIn.put("storeId", result.getStoreId());
|
|
|
responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
|
|
|
|
|
|
@@ -311,7 +311,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
private JSONObject getExistsRoom(IPageData pd, ComponentValidateResult result, ImportRoom room) {
|
|
|
String apiUrl = "";
|
|
|
ResponseEntity<String> responseEntity = null;
|
|
|
- apiUrl = ServiceConstant.SERVICE_API_URL + "/api/room.queryRooms?communityId=" + result.getCommunityId()
|
|
|
+ apiUrl = ServiceConstant.SERVICE_API_URL + "/api/room.queryRooms?page=1&row=1&communityId=" + result.getCommunityId()
|
|
|
+ "&floorId=" + room.getFloor().getFloorId() + "&unitId=" + room.getFloor().getUnitId() + "&roomNum=" + room.getRoomNum();
|
|
|
responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET);
|
|
|
|
|
|
@@ -343,12 +343,13 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
private ResponseEntity<String> savedOwnerInfo(IPageData pd, List<ImportOwner> owners, ComponentValidateResult result) {
|
|
|
String apiUrl = "";
|
|
|
JSONObject paramIn = null;
|
|
|
- ResponseEntity<String> responseEntity = null;
|
|
|
+ ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK);
|
|
|
|
|
|
for (ImportOwner owner : owners) {
|
|
|
JSONObject savedOwnerInfo = getExistsOwner(pd, result, owner);
|
|
|
|
|
|
if (savedOwnerInfo != null) {
|
|
|
+ owner.setOwnerId(savedOwnerInfo.getString("ownerId"));
|
|
|
continue;
|
|
|
}
|
|
|
paramIn = new JSONObject();
|
|
|
@@ -363,7 +364,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
paramIn.put("sex", owner.getSex());
|
|
|
paramIn.put("ownerTypeCd", "1001");
|
|
|
responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
|
|
|
- if (responseEntity.getStatusCode() != HttpStatus.OK) {
|
|
|
+ if (responseEntity.getStatusCode() == HttpStatus.OK) {
|
|
|
savedOwnerInfo = getExistsOwner(pd, result, owner);
|
|
|
owner.setOwnerId(savedOwnerInfo.getString("ownerId"));
|
|
|
}
|
|
|
@@ -383,7 +384,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
private ResponseEntity<String> savedFloorAndUnitInfo(IPageData pd, List<ImportFloor> floors, ComponentValidateResult result) {
|
|
|
String apiUrl = "";
|
|
|
JSONObject paramIn = null;
|
|
|
- ResponseEntity<String> responseEntity = null;
|
|
|
+ ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK);
|
|
|
for (ImportFloor importFloor : floors) {
|
|
|
paramIn = new JSONObject();
|
|
|
//先保存 楼栋信息
|
|
|
@@ -397,7 +398,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
paramIn.put("name", importFloor.getFloorNum() + "号楼");
|
|
|
responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
|
|
|
}
|
|
|
- if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息
|
|
|
+ if (responseEntity != null && responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -409,7 +410,9 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
importFloor.setFloorId(savedFloorInfo.getString("floorId"));
|
|
|
paramIn.clear();
|
|
|
//判断单元信息是否已经存在,如果存在则不保存数据unit.queryUnits
|
|
|
- if (getExistsUnit(pd, result, importFloor) != null) {
|
|
|
+ JSONObject savedUnitInfo = getExistsUnit(pd, result, importFloor);
|
|
|
+ if ( savedUnitInfo != null) {
|
|
|
+ importFloor.setUnitId(savedUnitInfo.getString("unitId"));
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -423,7 +426,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
|
|
|
|
|
|
//将unitId 刷入ImportFloor对象
|
|
|
- JSONObject savedUnitInfo = getExistsUnit(pd, result, importFloor);
|
|
|
+ savedUnitInfo = getExistsUnit(pd, result, importFloor);
|
|
|
importFloor.setUnitId(savedUnitInfo.getString("unitId"));
|
|
|
|
|
|
}
|
|
|
@@ -434,7 +437,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
String apiUrl = "";
|
|
|
ResponseEntity<String> responseEntity = null;
|
|
|
apiUrl = ServiceConstant.SERVICE_API_URL + "/api/unit.queryUnits?communityId=" + result.getCommunityId()
|
|
|
- + "&floorId=" + importFloor.getFloorId() + "&unitNum=" + importFloor.getFloorNum();
|
|
|
+ + "&floorId=" + importFloor.getFloorId() + "&unitNum=" + importFloor.getUnitNum();
|
|
|
responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET);
|
|
|
|
|
|
if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息
|
|
|
@@ -677,7 +680,7 @@ public class AssetImportSMOImpl extends BaseComponentSMO implements IAssetImport
|
|
|
importFloor.setFloorNum(os[0].toString());
|
|
|
importFloor.setUnitNum(os[1].toString());
|
|
|
importFloor.setLayerCount(os[2].toString());
|
|
|
- importFloor.setLift("有".equals(os[3].toString()) ? "Y" : "N");
|
|
|
+ importFloor.setLift("有".equals(os[3].toString()) ? "1010" : "2020");
|
|
|
floors.add(importFloor);
|
|
|
}
|
|
|
}
|