From cbc1f9db3d796683d88d6d30df3659984dfbeda3 Mon Sep 17 00:00:00 2001
From: webapp <webapp@home-server.attdns.com>
Date: 星期一, 30 九月 2019 22:56:12 +0800
Subject: [PATCH] 取消java110-common jar包,提升为CommonService服务,将之前的Java110-common内容变更为Java110-utils包
---
WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java | 82 +++++++++++++++++++++++++++++++++++++----
1 files changed, 74 insertions(+), 8 deletions(-)
diff --git a/WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java b/WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java
index 1b32c53..d716b17 100644
--- a/WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java
+++ b/WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java
@@ -1,9 +1,13 @@
package com.java110.web.smo.impl;
+import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.java110.common.constant.ServiceConstant;
+import com.java110.utils.constant.ServiceConstant;
+import com.java110.utils.constant.StateConstant;
+import com.java110.utils.util.CommonUtil;
import com.java110.core.context.IPageData;
import com.java110.web.core.BaseComponentSMO;
+import com.java110.web.smo.ICommunityServiceSMO;
import com.java110.web.smo.INavServiceSMO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -21,13 +25,18 @@
*/
@Service("navServiceSMOImpl")
public class NavServiceSMOImpl extends BaseComponentSMO implements INavServiceSMO {
- private final static Logger logger = LoggerFactory.getLogger(NavServiceSMOImpl.class);
+ private static Logger logger = LoggerFactory.getLogger(NavServiceSMOImpl.class);
@Autowired
private RestTemplate restTemplate;
+
+ @Autowired
+ private ICommunityServiceSMO communityServiceSMOImpl;
+
/**
* 鐢ㄦ埛閫�鍑�
+ *
* @param pd
* @return
*/
@@ -35,31 +44,88 @@
public ResponseEntity<String> doExit(IPageData pd) {
ResponseEntity<String> responseEntity = null;
JSONObject exitInfo = new JSONObject();
- exitInfo.put("token",pd.getToken());
- responseEntity = this.callCenterService(restTemplate,pd,exitInfo.toJSONString(), ServiceConstant.SERVICE_API_URL+"/api/user.service.logout", HttpMethod.POST);
+ exitInfo.put("token", pd.getToken());
+ responseEntity = this.callCenterService(restTemplate, pd, exitInfo.toJSONString(),
+ ServiceConstant.SERVICE_API_URL + "/api/user.service.logout", HttpMethod.POST);
return responseEntity;
}
/**
* 鑾峰彇鐢ㄦ埛淇℃伅
+ *
* @param pd
* @return
*/
@Override
public ResponseEntity<String> getUserInfo(IPageData pd) {
- Assert.hasLength(pd.getUserId(),"鐢ㄦ埛鏈櫥褰曡鍏堢櫥褰�");
- ResponseEntity<String> responseEntity = null;
- responseEntity = this.callCenterService(restTemplate,pd,"", ServiceConstant.SERVICE_API_URL+"/api/query.user.userInfo?userId="+pd.getUserId(), HttpMethod.GET);
+ Assert.hasLength(pd.getUserId(), "鐢ㄦ埛鏈櫥褰曡鍏堢櫥褰�");
+ /*ResponseEntity<String> responseEntity = null;
+ responseEntity = this.callCenterService(restTemplate,pd,"",
+ ServiceConstant.SERVICE_API_URL+"/api/query.user.userInfo?userId="+pd.getUserId(), HttpMethod.GET);
// 杩囨护杩斿洖鎶ユ枃涓殑瀛楁锛屽彧杩斿洖name瀛楁
- //{"address":"","orderTypeCd":"Q","serviceCode":"","responseTime":"20190401194712","sex":"","localtionCd":"","userId":"302019033054910001","levelCd":"00","transactionId":"-1","dataFlowId":"-1","response":{"code":"0000","message":"鎴愬姛"},"name":"996icu","tel":"18909780341","bId":"-1","businessType":"","email":""}
+ //{"address":"","orderTypeCd":"Q","serviceCode":"","responseTime":"20190401194712","sex":"",
+ "localtionCd":"","userId":"302019033054910001","levelCd":"00","transactionId":"-1","dataFlowId":"-1",
+ "response":{"code":"0000","message":"鎴愬姛"},"name":"996icu","tel":"18909780341","bId":"-1","businessType":"","email":""}
if(responseEntity.getStatusCode() == HttpStatus.OK){
JSONObject tmpUserInfo = JSONObject.parseObject(responseEntity.getBody().toString());
JSONObject resultUserInfo = new JSONObject();
resultUserInfo.put("name",tmpUserInfo.getString("name"));
responseEntity = new ResponseEntity<String>(resultUserInfo.toJSONString(),HttpStatus.OK);
+ }*/
+ ResponseEntity<String> responseEntity = null;
+ responseEntity = super.getUserInfo(pd, restTemplate);
+ if (responseEntity.getStatusCode() == HttpStatus.OK) {
+ JSONObject tmpUserInfo = JSONObject.parseObject(responseEntity.getBody().toString());
+ JSONObject resultUserInfo = new JSONObject();
+ resultUserInfo.put("name", tmpUserInfo.getString("name"));
+ resultUserInfo.put("address", tmpUserInfo.getString("address"));
+ resultUserInfo.put("sex", tmpUserInfo.getString("sex"));
+ resultUserInfo.put("localtionCd", tmpUserInfo.getString("localtionCd"));
+ resultUserInfo.put("levelCd", tmpUserInfo.getString("levelCd"));
+ resultUserInfo.put("tel", CommonUtil.mobileEncrypt(tmpUserInfo.getString("tel")));
+ resultUserInfo.put("email", tmpUserInfo.getString("email"));
+ responseEntity = new ResponseEntity<String>(resultUserInfo.toJSONString(), HttpStatus.OK);
}
return responseEntity;
}
+
+
+ @Override
+ public ResponseEntity<String> listMyCommunity(IPageData pd) {
+ ResponseEntity<String> responseEntity = communityServiceSMOImpl.listMyCommunity(pd);
+ if (responseEntity.getStatusCode() != HttpStatus.OK) {
+ return responseEntity;
+ }
+
+ JSONArray communitys = JSONArray.parseArray(responseEntity.getBody());
+
+ JSONArray newCommunitys = new JSONArray();
+
+ //鍙繑鍥炲皬鍖篒D鍜屽皬鍖哄悕绉� 骞朵笖鏄湪鐢ㄧ殑
+ JSONObject tempCommunity = null;
+ JSONObject newCommunity = null;
+ for (int communityIndex = 0; communityIndex < communitys.size(); communityIndex++) {
+ tempCommunity = communitys.getJSONObject(communityIndex);
+
+ if (!StateConstant.AGREE_AUDIT.equals(tempCommunity.getString("auditStatusCd"))) {
+ continue;
+ }
+ newCommunity = new JSONObject();
+ newCommunity.put("communityId", tempCommunity.getString("communityId"));
+ newCommunity.put("name", tempCommunity.getString("name"));
+ newCommunitys.add(newCommunity);
+ }
+ responseEntity = new ResponseEntity<String>(newCommunitys.toJSONString(), HttpStatus.OK);
+ return responseEntity;
+ }
+
+ public ICommunityServiceSMO getCommunityServiceSMOImpl() {
+ return communityServiceSMOImpl;
+ }
+
+ public void setCommunityServiceSMOImpl(ICommunityServiceSMO communityServiceSMOImpl) {
+ this.communityServiceSMOImpl = communityServiceSMOImpl;
+ }
}
--
Gitblit v1.8.0