| | |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> sellRoom(IPageData pd) { |
| | | |
| | | validateSellRoom(pd); |
| | | |
| | | //校验员工是否有权限操作 |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_SELL_ROOM); |
| | | |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | String communityId = paramIn.getString("communityId"); |
| | | ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return responseEntity; |
| | | } |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点"); |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeTypeCd", "根据用户ID查询商户类型失败,未包含storeTypeCd节点"); |
| | | |
| | | String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId"); |
| | | String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd"); |
| | | //数据校验是否 商户是否入驻该小区 |
| | | super.checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate); |
| | | paramIn.put("userId", pd.getUserId()); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/room.sellRoom", |
| | | HttpMethod.POST); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | /** |
| | | * 小区房屋查询数据校验 |
| | | * |
| | | * @param pd 页面数据封装对象 |
| | | */ |
| | | private void validateSellRoom(IPageData pd) { |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "communityId", "请求报文中未包含communityId节点"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "ownerId", "请求报文中未包含ownerId节点"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "roomId", "请求报文中未包含roomId节点"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "state", "请求报文中未包含state节点"); |
| | | |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | Assert.hasLength(paramIn.getString("communityId"), "小区ID不能为空"); |
| | | Assert.hasLength(paramIn.getString("ownerId"), "ownerId不能为空"); |
| | | Assert.hasLength(paramIn.getString("roomId"), "roomId不能为空"); |
| | | Assert.hasLength(paramIn.getString("state"), "state不能为空"); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 小区房屋查询数据校验 |