| New file |
| | |
| | | package com.java110.web.components.community; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.ICommunityServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 商户申请入驻小区 |
| | | */ |
| | | @Component("storeEnterCommunity") |
| | | public class StoreEnterCommunityComponent { |
| | | |
| | | @Autowired |
| | | private ICommunityServiceSMO communityServiceSMOImpl; |
| | | |
| | | |
| | | /** |
| | | * 显示还没有入驻的小区 |
| | | * @param pd |
| | | * @return |
| | | */ |
| | | public ResponseEntity<String> listNoEnterCommunity(IPageData pd){ |
| | | ResponseEntity<String> responseEntity = null; |
| | | try{ |
| | | responseEntity = communityServiceSMOImpl.listNoEnterCommunity(pd); |
| | | }catch (Exception e){ |
| | | responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); |
| | | }finally { |
| | | return responseEntity; |
| | | } |
| | | } |
| | | |
| | | public ICommunityServiceSMO getCommunityServiceSMOImpl() { |
| | | return communityServiceSMOImpl; |
| | | } |
| | | |
| | | public void setCommunityServiceSMOImpl(ICommunityServiceSMO communityServiceSMOImpl) { |
| | | this.communityServiceSMOImpl = communityServiceSMOImpl; |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public ResponseEntity<String> listMyCommunity(IPageData pd); |
| | | |
| | | |
| | | /** |
| | | * 查询未入驻的小区 |
| | | * @param pd |
| | | * @return |
| | | */ |
| | | public ResponseEntity<String> listNoEnterCommunity(IPageData pd); |
| | | } |
| | |
| | | package com.java110.web.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.cache.MappingCache; |
| | | import com.java110.common.constant.AttrCdConstant; |
| | | import com.java110.common.constant.MappingConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | |
| | | if(responseEntity.getStatusCode() != HttpStatus.OK){ |
| | | return responseEntity; |
| | | } |
| | | responseEntity = new ResponseEntity<String>(JSONObject.parseObject(responseEntity.getBody().toString()).getJSONArray("communitys").toJSONString(), |
| | | JSONArray tmpCommunitys = JSONObject.parseObject(responseEntity.getBody().toString()).getJSONArray("communitys"); |
| | | freshCommunityAttr(tmpCommunitys); |
| | | responseEntity = new ResponseEntity<String>(tmpCommunitys.toJSONString(), |
| | | HttpStatus.OK); |
| | | return responseEntity; |
| | | } |
| | | |
| | | /** |
| | | * 查询未入驻的小区 |
| | | * @param pd |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResponseEntity<String> listNoEnterCommunity(IPageData pd) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | JSONObject _paramObj = JSONObject.parseObject(pd.getReqData()); |
| | | responseEntity = super.getStoreInfo(pd,restTemplate); |
| | | if(responseEntity.getStatusCode() != HttpStatus.OK){ |
| | | return responseEntity; |
| | | } |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(),"storeId","根据用户ID查询商户ID失败,未包含storeId节点"); |
| | | |
| | | String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId"); |
| | | String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd"); |
| | | |
| | | //修改用户信息 |
| | | responseEntity = this.callCenterService(restTemplate,pd,"", |
| | | ServiceConstant.SERVICE_API_URL+"/api/query.noEnterCommunity.byMember?memberId="+storeId+ |
| | | "&memberTypeCd="+MappingCache.getValue(MappingConstant.DOMAIN_STORE_TYPE_2_COMMUNITY_MEMBER_TYPE,storeTypeCd), |
| | | HttpMethod.GET); |
| | | |
| | | if(responseEntity.getStatusCode() != HttpStatus.OK){ |
| | | return responseEntity; |
| | | } |
| | | |
| | | JSONArray tmpCommunitys = JSONObject.parseObject(responseEntity.getBody().toString()).getJSONArray("communitys"); |
| | | freshCommunityAttr(tmpCommunitys); |
| | | responseEntity = new ResponseEntity<String>(tmpCommunitys.toJSONString(), |
| | | HttpStatus.OK); |
| | | return responseEntity; |
| | | } |
| | | |
| | | |
| | | private void freshCommunityAttr(JSONArray community){ |
| | | for(int _communityIndex = 0 ;_communityIndex < community.size();_communityIndex++){ |
| | | JSONObject _community = community.getJSONObject(_communityIndex); |
| | | if(!_community.containsKey("attrs")){ |
| | | continue; |
| | | } |
| | | JSONArray _attrs = _community.getJSONArray("attrs"); |
| | | for(int _cAttrIndex = 0;_cAttrIndex < _attrs.size();_cAttrIndex++){ |
| | | if(AttrCdConstant.SPEC_CD_COMMUNITY_TEL.equals(_attrs.getJSONObject(_cAttrIndex).getString("specCd"))){ |
| | | _community.put("tel",_attrs.getJSONObject(_cAttrIndex).getString("value")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="ibox-title"> |
| | | <h5>已入驻小区</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#addStaffModel"> |
| | | <button type="button" class="btn btn-primary btn-sm" v-on:click="_openEnterCommunityModal()"> |
| | | <i class="glyphicon glyphicon-plus"></i> |
| | | 入驻小区 |
| | | </button> |
| | |
| | | <tr> |
| | | <th>小区ID</th> |
| | | <th data-hide="phone">名称</th> |
| | | <th data-hide="phone">联系方式</th> |
| | | <th data-hide="phone">地址</th> |
| | | <th data-hide="phone">地标</th> |
| | | <th data-hide="phone,tablet" >城市编码</th> |
| | |
| | | </td> |
| | | <td> |
| | | {{community.name}} |
| | | </td> |
| | | <td> |
| | | {{community.tel}} |
| | | </td> |
| | | <td> |
| | | {{community.address}} |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <vc:create name="storeEnterCommunity"></vc:create> |
| | | </div> |
| | |
| | | vc.component.listMyCommunity(); |
| | | }, |
| | | _initEvent:function(){ |
| | | |
| | | vc.on('enterCommunity','listMyCommunity',function(_param){ |
| | | vc.component.listMyCommunity(); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | listMyCommunity:function(){ |
| | |
| | | } |
| | | ); |
| | | }, |
| | | openEnterCommunity:function(){ |
| | | |
| | | _openEnterCommunityModal:function(){ |
| | | vc.emit('storeEnterCommunity','openStoreEnterCommunity',{}); |
| | | }, |
| | | _openDeleteStaffPrivilegeModel:function(_community){ |
| | | |
| New file |
| | |
| | | <div id = "storeEnterCommunityModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-header"> |
| | | <h3 class="modal-title" id="addPrivilegeModalLabel">申请入驻</h3> |
| | | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| | | <span aria-hidden="true">×</span> |
| | | </button> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <div class=" row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox "> |
| | | <div class="row"> |
| | | |
| | | <div class="col-sm-7 m-b-xs"> |
| | | |
| | | </div> |
| | | <div class="col-sm-5"> |
| | | <div class="input-group"> |
| | | <input placeholder="输入小区名称" type="text" class="form-control form-control-sm"> |
| | | <span class="input-group-append"> |
| | | <button type="button" class="btn btn-sm btn-primary">查询</button> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="table-responsive" style="margin-top:15px"> |
| | | <table class="table table-striped"> |
| | | <thead> |
| | | <tr> |
| | | <th>小区ID</th> |
| | | <th data-hide="phone">名称</th> |
| | | <th data-hide="phone">地址</th> |
| | | <th data-hide="phone">联系方式</th> |
| | | <th data-hide="phone">地标</th> |
| | | <th data-hide="phone,tablet" >城市编码</th> |
| | | <th class="text-right">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="community in storeEnterCommunityInfo.communityInfo"> |
| | | <td> |
| | | {{community.communityId}} |
| | | </td> |
| | | <td> |
| | | {{community.name}} |
| | | </td> |
| | | <td> |
| | | {{community.tel}} |
| | | </td> |
| | | <td> |
| | | {{community.address}} |
| | | </td> |
| | | <td> |
| | | {{community.nearbyLandmarks}} |
| | | </td> |
| | | <td> |
| | | {{community.cityCode}} |
| | | </td> |
| | | <td class="text-right"> |
| | | <div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_saveEnterCommunity(community)">申请入驻</button> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | storeEnterCommunityInfo:{ |
| | | communityInfo:[], |
| | | errorInfo:'' |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('storeEnterCommunity','openStoreEnterCommunity',function(_params){ |
| | | $('#storeEnterCommunityModel').modal('show'); |
| | | vc.component.listNoEnterCommunity(); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | |
| | | _saveEnterCommunity:function(){ |
| | | var param = {}; |
| | | vc.component.storeEnterCommunityInfo.errorInfo = ""; |
| | | vc.http.post( |
| | | 'storeEnterCommunity', |
| | | 'enterCommunity', |
| | | JSON.stringify(param), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#storeEnterCommunityModel').modal('hide'); |
| | | vc.emit('enterCommunity','listMyCommunity',{}); |
| | | return ; |
| | | } |
| | | vc.component.storeEnterCommunityInfo.errorInfo = json; |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.component.storeEnterCommunityInfo.errorInfo = errInfo; |
| | | }); |
| | | }, |
| | | listNoEnterCommunity:function(){ |
| | | var param = { |
| | | params:{ |
| | | msg:'123' |
| | | } |
| | | |
| | | } |
| | | //发送get请求 |
| | | vc.http.get('storeEnterCommunity', |
| | | 'listNoEnterCommunity', |
| | | param, |
| | | function(json,res){ |
| | | vc.component.storeEnterCommunityInfo.communityInfo=JSON.parse(json); |
| | | },function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| | |
| | | * [用户退出登录](api/user/logout.md) |
| | | * [保存商户](api/store/saveStore.md) |
| | | * [删除用户权限](api/privilege/deleteStaffPrivilege.md) |
| | | * [查询已入驻的小区](api/community/queryMyCommunity.md) |
| | | * [查询未入驻的小区](api/community/queryNoEnterCommunity.md) |
| | | |
| | | * 服务端接口协议 |
| | | |
| New file |
| | |
| | | |
| | | |
| | | **1\. 查询商户未入驻小区信息** |
| | | ###### 接口功能 |
| | | > 用户通过web端或APP查询商户入驻小区信息接口 |
| | | |
| | | ###### URL |
| | | > [http://api.java110.com:8008/api/query.noEnterCommunity.byMember](http://api.java110.com:8008/api/query.noEnterCommunity.byMember) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | | |
| | | ###### HTTP请求方式 |
| | | > GET |
| | | |
| | | ###### 请求参数(header部分) |
| | | |参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-:| |
| | | |app_id|1|String|30|应用ID|Api服务分配 | |
| | | |transaction_id|1|String|30|请求流水号|不能重复 1000000000+YYYYMMDDhhmmss+6位序列 | |
| | | |sign|1|String|-|签名|请参考签名说明| |
| | | |req_time|1|String|-|请求时间|YYYYMMDDhhmmss| |
| | | |
| | | ###### 请求参数(url部分) |
| | | |参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |memberId|1|String|30|小区成员ID|-| |
| | | |memberTypeCd|1|String|12|小区成员角色|-| |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |父参数名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|communitys|1|Array|30|小区节点|-| |
| | | |communitys|communityId|1|String|30|小区ID|-| |
| | | |communitys|name|1|String|50|小区名称|-| |
| | | |communitys|address|1|String|200|小区地址|-| |
| | | |communitys|nearbyLandmarks|1|String|200|小区地标|-| |
| | | |communitys|cityCode|1|String|12|城市编码|-| |
| | | |communitys|mapX|1|String|12|精度|-| |
| | | |communitys|mapY|1|String|12|维度|-| |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://api.java110.com:8008/api/query.noEnterCommunity.byMember?memberId=345678&memberTypeCd=390001200001](http://api.java110.com:8008/api/query.noEnterCommunity.byMember?memberId=345678&memberTypeCd=390001200001) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | | Content-Type:application/json |
| | | USER_ID:1234 |
| | | APP_ID:8000418002 |
| | | TRANSACTION_ID:10029082726 |
| | | REQ_TIME:20181113225612 |
| | | SIGN:aabdncdhdbd878sbdudn898 |
| | | 请求报文: |
| | | |
| | | 无 |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "Q", |
| | | "serviceCode": "", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190415115326", |
| | | "communitys": [{ |
| | | "address": "青海省西宁市城中区129号", |
| | | "nearbyLandmarks": "王府井旁30米", |
| | | "cityCode": "100010", |
| | | "name": "万博家博园(城西区)", |
| | | "communityId": "7020181217000001", |
| | | "mapY": "36.597263", |
| | | "mapX": "101.801909" |
| | | }], |
| | | "bId": "-1", |
| | | "businessType": "", |
| | | "transactionId": "-1", |
| | | "dataFlowId": "-1" |
| | | } |
| | | |
| | | ``` |
| | |
| | | public final static String SPEC_CD_STORE_SCOPE = "100201903005";// 经营范围 |
| | | |
| | | |
| | | public final static String SPEC_CD_COMMUNITY_TEL = "100201904006";// 小区联系电话 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |