| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComPropertyVO; |
| | |
| | | import com.panzhihua.service_community.service.ComPropertyService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private ComPropertyDao comPropertyDao; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return R.ok(comPropertyDao.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage)); |
| | |
| | | if (isNotBlank(comPropertyVO.getAccount())) { |
| | | AdministratorsUserVO administratorsUserVO=new AdministratorsUserVO(); |
| | | administratorsUserVO.setType(3); |
| | | if (comPropertyVO.getCommunityId().equals(10172)){ |
| | | administratorsUserVO.setType(20); |
| | | } |
| | | administratorsUserVO.setAccount(comPropertyVO.getAccount()); |
| | | administratorsUserVO.setPassword(comPropertyVO.getPassword()); |
| | | administratorsUserVO.setRoleId(comPropertyVO.getRoleId()); |
| | |
| | | administratorsUserVO.setAreaId(comPropertyVO.getAreaId()); |
| | | administratorsUserVO.setName(comPropertyVO.getContactName()); |
| | | administratorsUserVO.setPhone(comPropertyVO.getPhone()); |
| | | administratorsUserVO.setAppid(userService.detailUser(comPropertyVO.getCreateUserId()).getData().getAppId()); |
| | | R r=userService.addUserBackstageProperty(administratorsUserVO); |
| | | if(R.isOk(r)){ |
| | | comProperty.setUserId(Long.parseLong(r.getData().toString())); |
| | |
| | | administratorsUserVO.setLastLoginTime(DateUtil.date()); |
| | | administratorsUserVO.setAreaId(comPropertyVO.getAreaId()); |
| | | this.userService.putUserBackstage(administratorsUserVO); |
| | | // 删除用户信息缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + comPropertyBase.getUserId(); |
| | | stringRedisTemplate.delete(userKey); |
| | | } |
| | | this.comPropertyDao.updateById(comProperty); |
| | | |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | comPropertyVO.setPassword(null); |
| | | return R.ok(comPropertyVO); |
| | | } |
| | | |
| | | @Override |
| | | public R noticeList(Integer page, Integer size, Long propertyId) { |
| | | return R.ok(comPropertyDao.noticeList(new Page(page,size),propertyId)); |
| | | } |
| | | } |