Преглед на файлове

Merge branch '2.0.0' of http://git.ycjcjy.com/fuxingfan/smartCommunity into 2.0.0

魏熙美 преди 6 години
родител
ревизия
0ee6e60bc7

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxLoginController.java Целия файл

@@ -36,7 +36,7 @@ public class WxLoginController {
36 36
 			return responseBean;
37 37
 		}
38 38
 		//根据wxcode获取openid
39
-		wxLoginService.getOpenidByWxcode(wxcode);
39
+		responseBean = wxLoginService.getOpenidByWxcode(wxcode);
40 40
 		return responseBean;
41 41
 	}
42 42
 }

+ 3
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/WxLoginServiceI.java Целия файл

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.service;
2 2
 
3
+import com.community.commom.mode.ResponseBean;
4
+
3 5
 public interface WxLoginServiceI {
4
-	void getOpenidByWxcode(String wxcode);
6
+	ResponseBean getOpenidByWxcode(String wxcode);
5 7
 }

+ 7
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxLoginServiceImpl.java Целия файл

@@ -1,5 +1,6 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.community.commom.mode.ResponseBean;
3 4
 import com.community.huiju.dao.TaUserMapper;
4 5
 import com.community.huiju.model.TaUser;
5 6
 import com.community.huiju.service.WxLoginServiceI;
@@ -26,7 +27,8 @@ public class WxLoginServiceImpl implements WxLoginServiceI {
26 27
 	private TaUserMapper taUserMapper;
27 28
 	
28 29
 	@Override
29
-	public void getOpenidByWxcode(String wxcode) {
30
+	public ResponseBean getOpenidByWxcode(String wxcode) {
31
+		ResponseBean responseBean = new ResponseBean();
30 32
 		ApiConfig apiConfig = new ApiConfig("wx6070fd3e8ef854e4","cb07709de2f05b824f1ebda220684d3b", true);
31 33
 		logger.info("获取微信相关信息");
32 34
 		OauthAPI oauthAPI = new OauthAPI(apiConfig);
@@ -35,10 +37,12 @@ public class WxLoginServiceImpl implements WxLoginServiceI {
35 37
 		logger.info("获取到wxcode:" + wxcode + " 获取到的openid: " + openId);
36 38
 		
37 39
 		//根据openId查询关联的手机号
38
-		TaUser taUser = taUserMapper.getByOpenId(openId);
39
-		
40
+		//TaUser taUser = taUserMapper.getByOpenId(openId);
41
+
40 42
 		UserAPI userAPI = new UserAPI(apiConfig);
41 43
         GetUserInfoResponse userInfo = userAPI.getUserInfo(openId);
42 44
 		logger.info(userInfo.getNickname());
45
+		responseBean.addSuccess(userInfo);
46
+		return responseBean;
43 47
 	}
44 48
 }

+ 18
- 6
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java Целия файл

@@ -5,8 +5,10 @@ import com.community.commom.constant.Constant;
5 5
 import com.community.commom.mode.ResponseBean;
6 6
 import com.community.commom.session.UserElement;
7 7
 import com.community.commom.utils.AccountValidatorUtil;
8
+import com.community.huiju.dao.TpPhaseMapper;
8 9
 import com.community.huiju.model.TaUser;
9 10
 import com.community.huiju.model.TpBuildingOwnerInfo;
11
+import com.community.huiju.model.TpPhase;
10 12
 import com.community.huiju.service.BuildingTreeServiceI;
11 13
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
12 14
 import org.apache.poi.ss.usermodel.Row;
@@ -15,6 +17,7 @@ import org.apache.poi.ss.usermodel.Workbook;
15 17
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
16 18
 import org.slf4j.Logger;
17 19
 import org.slf4j.LoggerFactory;
20
+import org.springframework.beans.factory.annotation.Autowired;
18 21
 import org.springframework.stereotype.Service;
19 22
 import org.springframework.web.multipart.MultipartFile;
20 23
 
@@ -33,6 +36,8 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
33 36
 	
34 37
 	public static final Logger logger = LoggerFactory.getLogger(BuildingOwnerInfoServiceImpl.class);
35 38
 	
39
+	@Autowired
40
+	private TpPhaseMapper tpPhaseMapper;
36 41
 	/**
37 42
 	 * 获取整个小区的基础数据
38 43
 	 *
@@ -148,13 +153,20 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
148 153
 		Map<String,Object> map = (Map<String, Object>) responseBean.getData();
149 154
 		List<TpBuildingOwnerInfo> list = (List<TpBuildingOwnerInfo>) map.get("list");
150 155
 		
151
-		for (int i = 0; i < list.size(); i++){
152
-			//拆分数据
153
-			if (i == 0){
154
-			
155
-			}
156
-		}
156
+		//入库
157
+		Integer communityId = userElement.getCommunityId();
158
+		
159
+		//保存数据到表中--拆分数据
160
+		String state = saveBuildingTreeData(communityId,list);
157 161
 		responseBean.addSuccess("success");
158 162
 		return responseBean;
159 163
 	}
164
+	
165
+	private String saveBuildingTreeData(Integer communityId, List<TpBuildingOwnerInfo> list) {
166
+		String lastPhaseName = "";
167
+		for (int i = 0; i < list.size(); i++){
168
+		
169
+		}
170
+		return "";
171
+	}
160 172
 }