| | |
| | | package com.java110.user.smo.impl; |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.CommunityMemberDto; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.owner.OwnerAttrDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.dto.owner.OwnerAppUserDto; |
| | | import com.java110.intf.user.IInitializeOwnerInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerAttrInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.po.owner.OwnerPo; |
| | | import com.java110.intf.user.IOwnerAppUserV1InnerServiceSMO; |
| | | import com.java110.user.dao.IInitializeOwneServiceDao; |
| | | import com.java110.user.dao.IOwnerServiceDao; |
| | | import com.java110.utils.constant.OwnerTypeConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | @RestController |
| | | public class InitializeOwnerInnerServiceSMOImpl extends BaseServiceSMO implements IInitializeOwnerInnerServiceSMO { |
| | | |
| | | |
| | | public static final int DEFAULT_ROW = 200; |
| | | |
| | | @Autowired |
| | | private IInitializeOwneServiceDao initializeOwnerServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerAppUserV1InnerServiceSMO ownerAppUserV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public int deleteBuildingOwner(@RequestBody Map communityId) { |
| | | int deleteFast = initializeOwnerServiceDaoImpl.deleteBuildingOwner(communityId); |
| | | |
| | | //todo 删除 业主绑定数据 |
| | | |
| | | OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto(); |
| | | ownerAppUserDto.setCommunityId(communityId.get("communityId").toString()); |
| | | int count = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsersCount(ownerAppUserDto); |
| | | int page = (int) Math.floor(count / DEFAULT_ROW); |
| | | List<String> userIds = null; |
| | | for (int pageIndex = 1; pageIndex < page + 1; pageIndex++) { |
| | | ownerAppUserDto = new OwnerAppUserDto(); |
| | | ownerAppUserDto.setPage(pageIndex); |
| | | ownerAppUserDto.setRow(DEFAULT_ROW); |
| | | ownerAppUserDto.setCommunityId(communityId.get("communityId").toString()); |
| | | List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto); |
| | | if (ListUtil.isNull(ownerAppUserDtos)) { |
| | | continue; |
| | | } |
| | | userIds = new ArrayList<>(); |
| | | for (OwnerAppUserDto tmpOwnerAppUserDto : ownerAppUserDtos) { |
| | | userIds.add(tmpOwnerAppUserDto.getUserId()); |
| | | } |
| | | communityId.put("userIds", userIds.toArray(new String[userIds.size()])); |
| | | initializeOwnerServiceDaoImpl.deleteUser(communityId); |
| | | } |
| | | initializeOwnerServiceDaoImpl.deleteOwnerAppUser(communityId); |
| | | // 删除业主账户 |
| | | initializeOwnerServiceDaoImpl.deleteOwnerAccount(communityId); |
| | | return deleteFast; |
| | | } |
| | | |