|
@@ -204,9 +204,9 @@ public class TaUserServiceImpl implements ITaUserService {
|
204
|
204
|
// 更新
|
205
|
205
|
taUserMapper.updateByPrimaryKeySelective(user);
|
206
|
206
|
|
207
|
|
- // TODO 这里先默认 type=1 (业主), 后期需要和 资料库对接
|
208
|
|
- // TODO 资料库已经对接, 新注册的默认为 业主, 后期需要改为只有匹配了资料库后才是业主
|
209
|
|
- addOrUpdateUserRole(1,response,user,true);
|
|
207
|
+ // TODO 这里先默认 type=4 (未认证), 后期需要和 资料库对接
|
|
208
|
+ // TODO 资料库已经对接, 新注册的默认为 未认证, 后期需要改为只有匹配了资料库后才是业主
|
|
209
|
+ addOrUpdateUserRole(4,response,user,true);
|
210
|
210
|
|
211
|
211
|
|
212
|
212
|
// 推送海康
|
|
@@ -688,20 +688,23 @@ public class TaUserServiceImpl implements ITaUserService {
|
688
|
688
|
/**
|
689
|
689
|
* 公共方法,添加或者修改 角色.
|
690
|
690
|
* 用于注册 和 业主添加家属和租客
|
691
|
|
- * @param type 1是业主 2 是租客 3 是家属
|
|
691
|
+ *
|
|
692
|
+ * 用户登录注册的时候,没有匹配到 资料库, 就定为 未认证角色!
|
|
693
|
+ *
|
|
694
|
+ * @param type 1是业主 2 是租客 3 是家属 4 未认证
|
692
|
695
|
* @param response
|
693
|
696
|
* @param user
|
694
|
697
|
* @param bool true 添加 false 修改
|
695
|
698
|
*/
|
696
|
699
|
private void addOrUpdateUserRole(Integer type,ResponseBean response,TaUser user, boolean bool){
|
697
|
700
|
// 先查询角色 在角色关联记录
|
698
|
|
- // 这里的 2 或者 3 是对应角色编号
|
|
701
|
+ // 这里的 2 或者 3 或者 4 是对应角色编号
|
699
|
702
|
int typeId = type.intValue();
|
700
|
|
- int roleType = typeId == 1 ? 1 : typeId == 2 ? 2 : 3;
|
|
703
|
+ int roleType = typeId == 1 ? 1 : typeId == 2 ? 2 : typeId == 3 ? 3 : 4;
|
701
|
704
|
TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(roleType);
|
702
|
705
|
if (null == taSysRole) {
|
703
|
706
|
response.addError("该权限不存在!");
|
704
|
|
- log.error("这个角色没有找到!角色名称:{} 角色编号:{}",type.equals("0") ? "租客" : "家属",roleType);
|
|
707
|
+ log.error("这个角色没有找到! 角色编号:{}" ,roleType);
|
705
|
708
|
return;
|
706
|
709
|
}
|
707
|
710
|
|
|
@@ -711,7 +714,7 @@ public class TaUserServiceImpl implements ITaUserService {
|
711
|
714
|
taSysUserRole.setUserId(user.getId());
|
712
|
715
|
|
713
|
716
|
String resultSuccess = bool == true?"添加成功!":"修改成功!";
|
714
|
|
- String errorSuccess = bool == true?"业主或者租客或者家属角色权限添加失败":"业主或者租客或者家属角色权限修改失败";
|
|
717
|
+ String errorSuccess = bool == true?"业主或者租客或者家属或者未认证角色权限添加失败":"业主或者租客或者家属或者未认证角色权限修改失败";
|
715
|
718
|
try {
|
716
|
719
|
int resultRole = 0;
|
717
|
720
|
if (bool) {
|
|
@@ -819,4 +822,26 @@ public class TaUserServiceImpl implements ITaUserService {
|
819
|
822
|
|
820
|
823
|
return response;
|
821
|
824
|
}
|
|
825
|
+
|
|
826
|
+ @Override
|
|
827
|
+ public ResponseBean temporaryLogin(Integer communityId) {
|
|
828
|
+ ResponseBean responseBean = new ResponseBean();
|
|
829
|
+ ToCommunities communities = toCommunitiesMapper.selectByPrimaryKey(communityId);
|
|
830
|
+ if (null == communities) {
|
|
831
|
+ responseBean.addError("小区不存在!");
|
|
832
|
+ return responseBean;
|
|
833
|
+ }
|
|
834
|
+
|
|
835
|
+ // 游客用户
|
|
836
|
+ TaUser user = taUserMapper.selectByPrimaryKey(-1);
|
|
837
|
+
|
|
838
|
+ TaUserVO taUserVO = new TaUserVO();
|
|
839
|
+ BeanUtils.copyProperties(user, taUserVO);
|
|
840
|
+ taUserVO.setCommunityId(communityId);
|
|
841
|
+ taUserVO.setRole("游客");
|
|
842
|
+
|
|
843
|
+ responseBean.addSuccess(taUserVO);
|
|
844
|
+
|
|
845
|
+ return responseBean;
|
|
846
|
+ }
|
822
|
847
|
}
|