| | |
| | | package com.panzhihua.service_dangjian.service.impl; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.SecurityConstants; |
| | | import com.panzhihua.common.constants.TokenConstant; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | import com.panzhihua.service_dangjian.service.ComPbServiceTeamService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | ComPbServiceTeamDO comPbServiceTeamDO = new ComPbServiceTeamDO(); |
| | | BeanUtils.copyProperties(comPbServiceTeamDTO, comPbServiceTeamDO); |
| | | comPbServiceTeamDO.setIsReg(2); |
| | | Long userId = comPbMemberRoleDAO.getSysUserIdByPhone(comPbServiceTeamDTO.getPhone()); |
| | | Long userId = comPbMemberRoleDAO.getSysUserIdByPhone(comPbServiceTeamDTO.getPhone(), comPbServiceTeamDTO.getAppid()); |
| | | if (nonNull(userId)) { |
| | | comPbServiceTeamDO.setIsReg(1); |
| | | } |
| | |
| | | if (insert > 0) { |
| | | if (nonNull(userId)) { |
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | Boolean hasKeyLoginUserInfo = stringRedisTemplate.hasKey(userKey); |
| | | if (hasKeyLoginUserInfo) { |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | String userInfo = valueOperations.get(userKey); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); |
| | | loginUserInfoVO.setIsmemberrole(1); |
| | | loginUserInfoVO.setIsCommunityWorker(1); |
| | | userInfo = JSONObject.toJSONString(loginUserInfoVO); |
| | | valueOperations.set(userKey, userInfo, TokenConstant.EXPIRETIME_REFRESH * 60 * 60 * 1000); |
| | | } |
| | | stringRedisTemplate.delete(userKey); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | ComPbServiceTeamDO oldComPbServiceTeam = |
| | | comPbServiceTeamDAO.selectComPbServiceTeamById(comPbServiceTeamDTO.getId()); |
| | | String oldphone = oldComPbServiceTeam.getPhone(); |
| | | SysUserVO sysUserOld = comPbMemberRoleDAO.getSysUserByPhone(oldphone); |
| | | SysUserVO sysUserOld = comPbMemberRoleDAO.getSysUserByPhone(oldphone, comPbServiceTeamDTO.getAppid()); |
| | | String newphone = comPbServiceTeamDTO.getPhone(); |
| | | SysUserVO sysUserNew = comPbMemberRoleDAO.getSysUserByPhone(newphone); |
| | | SysUserVO sysUserNew = comPbMemberRoleDAO.getSysUserByPhone(newphone, comPbServiceTeamDTO.getAppid()); |
| | | if (!ObjectUtils.isEmpty(sysUserOld) || !ObjectUtils.isEmpty(sysUserNew)) { |
| | | comPbServiceTeamDO.setIsReg(1); |
| | | } |
| | |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComPbServiceTeamVO> iPage = comPbServiceTeamDAO.PageComPbServiceTeamDTO(page, pageComPbServiceTeamDTO); |
| | | if (nonNull(pageComPbServiceTeamDTO.getPropertyId())){ |
| | | iPage = comPbServiceTeamDAO.pageServiceTeamProperty(page, pageComPbServiceTeamDTO); |
| | | } |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | |
| | | int delete = comPbServiceTeamDAO.deleteById(comPbServiceTeamDTO.getId()); |
| | | if (delete > 0) { |
| | | |
| | | SysUserVO sysUserVO = comPbMemberRoleDAO.getSysUserByPhone(comPbServiceTeamDO.getPhone()); |
| | | SysUserVO sysUserVO = comPbMemberRoleDAO.getSysUserByPhone(comPbServiceTeamDO.getPhone(), comPbServiceTeamDTO.getAppid()); |
| | | // 删除用户信息缓存 |
| | | if (sysUserVO != null) { |
| | | Long userId = sysUserVO.getUserId(); |