| | |
| | | package com.java110.web.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.exception.SMOException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.utils.constant.PrivilegeCodeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.BaseComponentSMO; |
| | | import com.java110.web.smo.IParkingSpaceServiceSMO; |
| | |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 小区楼实现类 |
| | |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return responseEntity; |
| | | } |
| | | |
| | | JSONObject psInfo = JSONObject.parseObject(responseEntity.getBody().toString()); |
| | | JSONArray pss = psInfo.getJSONArray("parkingSpaces"); |
| | | |
| | | Map feeMap = null; |
| | | JSONObject resultFeeInfo = null; |
| | | JSONObject psObj = null; |
| | | for (int roomIndex = 0; roomIndex < pss.size(); roomIndex++) { |
| | | psObj = pss.getJSONObject(roomIndex); |
| | | feeMap = new HashMap(); |
| | | feeMap.put("communityId", communityId); |
| | | feeMap.put("psId", psObj.getString("psId")); |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/fee.queryFeeByParkingSpace" + mapToUrlParam(feeMap); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | //throw new SMOException(ResponseConstant.RESULT_CODE_ERROR, "当前房屋[" + roomObj.getString("roomNum") + "]没有物业费信息,数据错误"); |
| | | |
| | | continue; |
| | | } |
| | | |
| | | resultFeeInfo = JSONObject.parseObject(responseEntity.getBody().toString()); |
| | | psObj.putAll(resultFeeInfo); |
| | | |
| | | } |
| | | |
| | | responseEntity = new ResponseEntity(psInfo.toJSONString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |