加入 房屋 添加完成后跳转到指定页面然后完成数据查询
| | |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import com.java110.common.constant.CommonConstant; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | |
| | | |
| | | ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj); |
| | | |
| | | JSONObject paramOutObj = new JSONObject(); |
| | | paramOutObj.put("floorId", viewFloorInfo.getString("floorId")); |
| | | paramOutObj.put("unitId", viewUnitInfo.getString("unitId")); |
| | | paramOutObj.put("roomId", addRoomView.getString("floorId")); |
| | | |
| | | if (responseEntity.getStatusCode() == HttpStatus.OK) { |
| | | responseEntity = new ResponseEntity<String>(paramOutObj.toJSONString(), HttpStatus.OK); |
| | | } |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | private JSONObject getObj(JSONArray infos , String flowComponent){ |
| | | private JSONObject getObj(JSONArray infos, String flowComponent) { |
| | | |
| | | JSONObject serviceInfo = null; |
| | | |
| | | for(int infoIndex = 0 ; infoIndex < infos.size(); infoIndex ++){ |
| | | for (int infoIndex = 0; infoIndex < infos.size(); infoIndex++) { |
| | | |
| | | Assert.hasKeyAndValue(infos.getJSONObject(infoIndex), "flowComponent", "未包含服务流程组件名称"); |
| | | |
| | | if(flowComponent.equals(infos.getJSONObject(infoIndex).getString("flowComponent"))){ |
| | | if (flowComponent.equals(infos.getJSONObject(infoIndex).getString("flowComponent"))) { |
| | | serviceInfo = infos.getJSONObject(infoIndex); |
| | | Assert.notNull(serviceInfo, "未包含服务信息"); |
| | | return serviceInfo; |
| | |
| | | |
| | | throw new IllegalArgumentException("未找到组件编码为【" + flowComponent + "】数据"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.java110.web.components.room; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.IFloorServiceSMO; |
| | | import com.java110.web.smo.IRoomServiceSMO; |
| | | import com.java110.web.smo.IUnitServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private IRoomServiceSMO roomServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFloorServiceSMO floorServiceSMOImpl; |
| | | |
| | | /** |
| | | * 显示房屋信息 |
| | | * |
| | |
| | | */ |
| | | public ResponseEntity<String> listRoom(IPageData pd) { |
| | | return roomServiceSMOImpl.listRoom(pd); |
| | | } |
| | | |
| | | /** |
| | | * 根据 floorId 查询单元信息 |
| | | * |
| | | * @param pd 包含floorId 和小区ID 页面封装对象 |
| | | * @return 单元信息 |
| | | */ |
| | | public ResponseEntity<String> loadFloor(IPageData pd) { |
| | | return floorServiceSMOImpl.getFloor(pd); |
| | | } |
| | | |
| | | /** |
| | |
| | | public void setUnitServiceSMOImpl(IUnitServiceSMO unitServiceSMOImpl) { |
| | | this.unitServiceSMOImpl = unitServiceSMOImpl; |
| | | } |
| | | |
| | | public IFloorServiceSMO getFloorServiceSMOImpl() { |
| | | return floorServiceSMOImpl; |
| | | } |
| | | |
| | | public void setFloorServiceSMOImpl(IFloorServiceSMO floorServiceSMOImpl) { |
| | | this.floorServiceSMOImpl = floorServiceSMOImpl; |
| | | } |
| | | } |
| | |
| | | ResponseEntity<String> listFloor(IPageData pd); |
| | | |
| | | /** |
| | | * 查询 楼栋 |
| | | * @param pd 页面数据封装对象 |
| | | * @return 返回 ResponseEntity对象包含 http状态 信息 body信息 |
| | | */ |
| | | ResponseEntity<String> getFloor(IPageData pd); |
| | | |
| | | /** |
| | | * 添加小区楼信息 |
| | | * |
| | | * @param pd 页面数据封装对象 |
| | |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.StringUtil; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.web.core.BaseComponentSMO; |
| | | import com.java110.web.smo.IFloorServiceSMO; |
| | | import org.slf4j.Logger; |
| | |
| | | private RestTemplate restTemplate; |
| | | |
| | | /** |
| | | * 查询 楼栋 |
| | | * @param pd 页面数据封装对象 |
| | | * @return 返回 ResponseEntity对象包含 http状态 信息 body信息 |
| | | */ |
| | | public ResponseEntity<String> getFloor(IPageData pd){ |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | paramIn.put("page",1); |
| | | paramIn.put("row",1); |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_FLOOR); |
| | | |
| | | ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | ResponseEntity responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | ServiceConstant.SERVICE_API_URL + "/api/floor.queryFloors" + mapToUrlParam(paramIn), |
| | | HttpMethod.GET); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | /** |
| | | * 查询小区楼 |
| | | * |
| | | * @param pd 页面数据封装对象 |
| | |
| | | |
| | | vc.message('处理成功',true); |
| | | //关闭model |
| | | vc.jumpToPage("/?" + vc.objToGetParam(JSON.parse(json))); |
| | | vc.jumpToPage("/flow/roomFlow?" + vc.objToGetParam(JSON.parse(json))); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | //根据 参数查询相应数据 |
| | | vc.component._loadDataByParam(); |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('room','listRoom',function(_param){ |
| | | vc.component.listRoom(); |
| | | }); |
| | | vc.on('room','loadData',function(_param){ |
| | | vc.component.roomInfo.floorId = _param.floorId; |
| | | vc.component.roomInfo.unitId = ''; |
| | | vc.component.roomInfo.state = ''; |
| | | vc.component.roomInfo.roomNum = ''; |
| | | |
| | | vc.component.listRoom(DEFAULT_PAGE,DEFAULT_ROW); |
| | | vc.component.loadUnits(_param.floorId); |
| | | vc.component._loadData(_param); |
| | | }); |
| | | vc.on('pagination','page_event',function(_currentPage){ |
| | | vc.component.listRoom(_currentPage,DEFAULT_ROW); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | _loadData:function(_param){ |
| | | vc.component.roomInfo.floorId = _param.floorId; |
| | | vc.component.roomInfo.unitId = ''; |
| | | vc.component.roomInfo.state = ''; |
| | | vc.component.roomInfo.roomNum = ''; |
| | | |
| | | vc.component.listRoom(DEFAULT_PAGE,DEFAULT_ROW); |
| | | vc.component.loadUnits(_param.floorId); |
| | | }, |
| | | listRoom:function(_page,_row){ |
| | | var param = { |
| | | params:{ |
| | |
| | | return "未知"; |
| | | } |
| | | } |
| | | _loadDataByParam: function(){ |
| | | vc.component.roomInfo.floorId = vc.getParam("floorId"); |
| | | //如果 floodId 没有传 则,直接结束 |
| | | if(vc.component.roomInfo.floorId == null |
| | | || vc.component.roomInfo.floorId == undefined |
| | | || vc.component.roomInfo.floorId == ''){ |
| | | return ; |
| | | } |
| | | |
| | | var param = { |
| | | params:{ |
| | | communityId:vc.getCurrentCommunity().communityId, |
| | | floorId:vc.component.roomInfo.floorId |
| | | } |
| | | } |
| | | |
| | | vc.http.get( |
| | | 'room', |
| | | 'loadFloor', |
| | | param, |
| | | function(json,res){ |
| | | if(res.status == 200){ |
| | | var _floorInfo = JSON.parse(json); |
| | | var _tmpFloor = _floorInfo.apiFloorDataVoList[0]; |
| | | vc.emit('roomSelectFloor','chooseFloor', _tmpFloor); |
| | | vc.component._loadData({ |
| | | floorId: _tmpFloor.floorId |
| | | }); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | }); |
| | | |
| | | } |
| | | } |
| | | }); |
| | | })(window.vc); |
| | |
| | | <div class="row border-bottom"> |
| | | <vc:create name="nav"></vc:create> |
| | | </div> |
| | | <div class="wrapper wrapper-content" style="padding-bottom: 0px;"> |
| | | <vc:create name="breadcrumb"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="addRoomBinding"></vc:create> |
| | |
| | | <div class="row border-bottom"> |
| | | <vc:create name="nav"></vc:create> |
| | | </div> |
| | | <div class="wrapper wrapper-content" style="padding-bottom: 0px;"> |
| | | <vc:create name="breadcrumb"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="@@templateCode@@"></vc:create> |
| | |
| | | <div class="row border-bottom"> |
| | | <vc:create name="nav"></vc:create> |
| | | </div> |
| | | <div class="wrapper wrapper-content" style="padding-bottom: 0px;"> |
| | | <vc:create name="breadcrumb"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="@@templateCode@@Manage"></vc:create> |