springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java
@@ -80,6 +80,8 @@ unionid = "无"; } userService.addOrUpdate(openid, sessionKey, unionid); //根据openid维护社区团队里是否注册 userService.judgeCommunityTeam(openid); return tokenService.loginApplets(openid); } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -988,4 +988,11 @@ */ @GetMapping("getUserListByCommunityId") R getUserListByCommunityId(@RequestParam("communityId") Long communityId); /** * 根据openid维护社区团队里是否注册 * @param openid 用户微信唯一标识 */ @GetMapping("judgeCommunityTeam") void judgeCommunityTeam(@RequestParam("openid") String openid); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
@@ -1112,4 +1112,12 @@ return userService.getUserListByCommunityId(communityId); } /** * 根据openid维护社区团队里是否注册 * @param openid 用户微信唯一标识 */ @PostMapping("judgeCommunityTeam") public void judgeCommunityTeam(@RequestParam("openid") String openid) { userService.judgeCommunityTeam(openid); } } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
@@ -166,4 +166,16 @@ int putUserTag(@Param("sysUserDO") SysUserDO sysUserDO); /** * 根据手机号维护社区团队表是否注册 * @param phone 手机号 */ void judgeCommunityTeam(@Param("phone") String phone); /** * 根据手机号查询社区团队表中用户数量 * @param phone 手机号 * @return 用户数量 */ Integer getCommunityTeamCount(@Param("phone") String phone); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java
@@ -678,4 +678,10 @@ */ R getUserListByCommunityId(Long communityId); /** * 根据openid维护社区团队里是否注册 * @param openid 用户微信唯一标识 */ void judgeCommunityTeam(String openid); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -2422,4 +2422,19 @@ public R getUserListByCommunityId(Long communityId) { return R.ok(this.userDao.getUserListByCommunityId(communityId)); } /** * 根据openid维护社区团队里是否注册 * @param openid 用户微信唯一标识 */ @Override public void judgeCommunityTeam(String openid){ //查询用户信息 SysUserDO userDO = this.userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getOpenid,openid)); if(userDO != null && StringUtils.isNotEmpty(userDO.getPhone())){ if(this.userDao.getCommunityTeamCount(userDO.getPhone()) > 0){ this.userDao.judgeCommunityTeam(userDO.getPhone()); } } } } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml
@@ -421,5 +421,12 @@ select count(id) from event_grid_member_relation where grid_member_id = #{userId} </select> <update id="judgeCommunityTeam"> update com_pb_service_team set is_reg = 1 where phone = #{phone} </update> <select id="getCommunityTeamCount" resultType="integer"> select count(id) from com_pb_service_team where is_reg = 2 and phone = #{phone} </select> </mapper>