| | |
| | | import org.springblade.modules.house.vo.HouseRentalTenantVO; |
| | | import org.springblade.modules.house.vo.HouseRentalVO; |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * @param page |
| | |
| | | */ |
| | | @Override |
| | | public IPage<HouseRentalTenantVO> selectHouseRentalPage(IPage<HouseRentalTenantVO> page, HouseRentalTenantVO houseRental) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | houseRental.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | List<String> list = new ArrayList<>(); |
| | | if (null!=houseRental.getRoleName() && !houseRental.getRoleName().equals("")){ |
| | | if (houseRental.getRoleName().equals("网格员")){ |
| | |
| | | List<HouseRentalTenantVO> houseRentalTenantVOS = baseMapper.selectHouseRentalPage(page, houseRental, list); |
| | | for (HouseRentalTenantVO houseRentalTenantVO : houseRentalTenantVOS) { |
| | | if(houseRentalTenantVO.getStatus().equals(1)){ |
| | | houseRentalTenantVO.setAuditStatus(30); |
| | | houseRentalTenantVO.setStatus(30); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(0)){ |
| | | houseRentalTenantVO.setAuditStatus(0); |
| | | houseRentalTenantVO.setStatus(0); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(1)){ |
| | | houseRentalTenantVO.setAuditStatus(1); |
| | | houseRentalTenantVO.setStatus(1); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(3)){ |
| | | houseRentalTenantVO.setAuditStatus(20); |
| | | houseRentalTenantVO.setStatus(20); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(2)){ |
| | | houseRentalTenantVO.setAuditStatus(10); |
| | | houseRentalTenantVO.setStatus(10); |
| | | } |
| | | } |
| | | return page.setRecords(houseRentalTenantVOS); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean add(HouseRentalVO houseRentalVO) { |
| | | // // 判断添加人是否房屋业主 |
| | | // Long count = iHouseholdService.count(Wrappers.<HouseholdEntity>lambdaQuery() |
| | | // .eq(HouseholdEntity::getHouseCode, houseRentalVO.getHouseCode()) |
| | | // .eq(HouseholdEntity::getAssociatedUserId, AuthUtil.getUserId()) |
| | | // .eq(HouseholdEntity::getRelationship, 1)); |
| | | // if (count == 0) { |
| | | // return false; |
| | | // } |
| | | houseRentalVO.setCreateUser(AuthUtil.getUserId()); |
| | | houseRentalVO.setCreateTime(new Date()); |
| | | houseRentalVO.setUpdateUser(AuthUtil.getUserId()); |
| | | houseRentalVO.setUpdateTime(new Date()); |
| | | // 网格员新增默认是审核通过 |
| | | houseRentalVO.setAuditStatus(1); |
| | | //保存自身 |
| | | boolean save = save(houseRentalVO); |
| | | List<String> phoneList = new ArrayList<>(); |
| | |
| | | boolean update = iHouseholdService.update(Wrappers.<HouseholdEntity>lambdaUpdate() |
| | | .set(HouseholdEntity::getIsDeleted, 1) |
| | | .eq(HouseholdEntity::getHousingRentalId, id)); |
| | | if (update) { |
| | | return true && b; |
| | | } |
| | | return false; |
| | | // 返回 |
| | | return b; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public Integer getStatisticsCount(HouseRentalTenantVO houseRental) { |
| | | return baseMapper.getStatisticsCount(AuthUtil.getUserId()); |
| | | return baseMapper.getStatisticsCount(houseRental.getUserId(), houseRental.getNeiCode()); |
| | | } |
| | | } |