傅行帆 6 years ago
parent
commit
4c9782c4c0

+ 14
- 28
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java View File

62
 		if (size < 1){
62
 		if (size < 1){
63
 			return 0;
63
 			return 0;
64
 		}
64
 		}
65
-		//查询这个用户是否包含多个小区
66
-		TpUser tpUserAlread = tpUserMapper.selectByLoginName(toCommunities.getLoginName());
67
-		if (null == tpUserAlread){
68
-			//构建用户信息
69
-			TpUser tpUser = new TpUser();
70
-			tpUser.setUserName(toCommunities.getUserName());
71
-			tpUser.setLoginName(toCommunities.getLoginName());
72
-			tpUser.setCreateDate(new Date());
73
-			tpUser.setCreateUser(1);
74
-			tpUser.setStatus(Constant.EFFECTIVE);
75
-			//插入用户信息
76
-			tpUserMapper.insertSelective(tpUser);
77
-			//维护此用户的角色
78
-			addUserAndRole(tpUser.getId(), 1);
79
-			//维护住户端用户与社区关系表
80
-			addUserAndCommunity(tpUser.getId(), toCommunities.getId());
81
-		}else {
82
-			//维护此用户的角色
83
-			addUserAndRole(tpUserAlread.getId(), 1);
84
-			//维护住户端用户与社区关系表
85
-			addUserAndCommunity(tpUserAlread.getId(), toCommunities.getId());
86
-		}
87
-		
65
+	 
66
+		//构建用户信息
67
+		TpUser tpUser = new TpUser();
68
+		tpUser.setUserName(toCommunities.getUserName());
69
+		tpUser.setLoginName(toCommunities.getLoginName());
70
+		tpUser.setCreateDate(new Date());
71
+		tpUser.setCreateUser(1);
72
+		tpUser.setCommunityId(toCommunities.getId());
73
+		tpUser.setStatus(Constant.EFFECTIVE);
74
+		//插入用户信息
75
+		tpUserMapper.insertSelective(tpUser);
76
+		//维护此用户的角色
77
+		addUserAndRole(tpUser.getId(), 1);
88
 		return size;
78
 		return size;
89
 	}
79
 	}
90
 
80
 
135
 		ToCommunities oldCommunities = toCommunitiesMapper.selectByPrimaryKey(toCommunities.getId());
125
 		ToCommunities oldCommunities = toCommunitiesMapper.selectByPrimaryKey(toCommunities.getId());
136
 		//未修改前的电话号码
126
 		//未修改前的电话号码
137
 		String oldTel = oldCommunities.getLoginName();
127
 		String oldTel = oldCommunities.getLoginName();
138
-		//判断电话号码是否重复
139
-		TpUser tpUser = tpUserMapper.selectByTel(toCommunities.getId(),toCommunities.getLoginName());
140
-		if (null != tpUser && !tpUser.getLoginName().equals(oldTel)){
141
-			return Constant.ADMIN_IS_EXIST;
142
-		}
128
+		//修改手机号码
143
 		tpUserMapper.updateByTel(toCommunities.getId(),toCommunities.getLoginName(),toCommunities.getUserName(),oldTel);
129
 		tpUserMapper.updateByTel(toCommunities.getId(),toCommunities.getLoginName(),toCommunities.getUserName(),oldTel);
144
 		toCommunitiesMapper.updateByPrimaryKeySelective(toCommunities);
130
 		toCommunitiesMapper.updateByPrimaryKeySelective(toCommunities);
145
 		return Constant.SUCCESS;
131
 		return Constant.SUCCESS;

+ 1
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/TpUserMapper.xml View File

203
       </if>
203
       </if>
204
     </set>
204
     </set>
205
     where login_name = #{oldTel,jdbcType=VARCHAR}
205
     where login_name = #{oldTel,jdbcType=VARCHAR}
206
+    and community_id = #{id}
206
     and status = 1
207
     and status = 1
207
   </update>
208
   </update>
208
 
209
 

+ 727
- 601
文档/MYSQL/smartCommunity.pdb
File diff suppressed because it is too large
View File


+ 727
- 601
文档/MYSQL/smartCommunity.pdm
File diff suppressed because it is too large
View File