From 0894b9328ae1c11146175b492ae348bbd4b13404 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期一, 29 四月 2019 16:42:32 +0800
Subject: [PATCH] 加入统一消息提示功能 请用 vc.messege('错误内容')
---
WebService/src/main/java/com/java110/web/core/BaseComponentSMO.java | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/WebService/src/main/java/com/java110/web/core/BaseComponentSMO.java b/WebService/src/main/java/com/java110/web/core/BaseComponentSMO.java
index 6977c2d..a89f29f 100644
--- a/WebService/src/main/java/com/java110/web/core/BaseComponentSMO.java
+++ b/WebService/src/main/java/com/java110/web/core/BaseComponentSMO.java
@@ -5,6 +5,7 @@
import com.java110.common.cache.MappingCache;
import com.java110.common.constant.CommonConstant;
import com.java110.common.constant.MappingConstant;
+import com.java110.common.constant.ResponseConstant;
import com.java110.common.constant.ServiceConstant;
import com.java110.common.exception.SMOException;
import com.java110.common.factory.ApplicationContextFactory;
@@ -105,9 +106,9 @@
ResponseEntity<String> responseEntity = null;
responseEntity = this.callCenterService(restTemplate, pd, "",
ServiceConstant.SERVICE_API_URL + "/api/query.myCommunity.byMember?memberId=" + storeId + "&memberTypeCd="
- + MappingCache.getValue(MappingConstant.DOMAIN_STORE_TYPE_2_COMMUNITY_MEMBER_TYPE,storeTypeCd), HttpMethod.GET);
+ + MappingCache.getValue(MappingConstant.DOMAIN_STORE_TYPE_2_COMMUNITY_MEMBER_TYPE, storeTypeCd), HttpMethod.GET);
if (responseEntity.getStatusCode() != HttpStatus.OK) {
- throw new SMOException(1999, "杩樻湭鍏ラ┗灏忓尯锛岃鍏堝叆椹诲皬鍖�");
+ throw new SMOException(ResponseConstant.RESULT_CODE_ERROR, "杩樻湭鍏ラ┗灏忓尯锛岃鍏堝叆椹诲皬鍖�");
}
Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "communitys", "杩樻湭鍏ラ┗灏忓尯锛岃鍏堝叆椹诲皬鍖�");
@@ -117,20 +118,20 @@
JSONArray communitys = community.getJSONArray("communitys");
if (communitys == null || communitys.size() == 0) {
- throw new SMOException(1999, "杩樻湭鍏ラ┗灏忓尯锛岃鍏堝叆椹诲皬鍖�");
+ throw new SMOException(ResponseConstant.RESULT_CODE_ERROR, "杩樻湭鍏ラ┗灏忓尯锛岃鍏堝叆椹诲皬鍖�");
}
- JSONObject currentCommunity = getCurrentCommunity(communitys,communityId);
+ JSONObject currentCommunity = getCurrentCommunity(communitys, communityId);
- if(currentCommunity == null){
- throw new SMOException(1999, "浼犲叆灏忓尯ID闈炴硶锛岃姝e父鎿嶄綔");
+ if (currentCommunity == null) {
+ throw new SMOException(ResponseConstant.RESULT_CODE_ERROR, "浼犲叆灏忓尯ID闈炴硶锛岃姝e父鎿嶄綔");
}
}
- private JSONObject getCurrentCommunity(JSONArray communitys,String communityId){
+ private JSONObject getCurrentCommunity(JSONArray communitys, String communityId) {
for (int communityIndex = 0; communityIndex < communitys.size(); communityIndex++) {
- if(communityId.equals(communitys.getJSONObject(communityIndex).getString("communityId"))){
+ if (communityId.equals(communitys.getJSONObject(communityIndex).getString("communityId"))) {
return communitys.getJSONObject(communityIndex);
}
}
--
Gitblit v1.8.0