| | |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.house.entity.HouseRentalEntity; |
| | | import org.springblade.modules.house.entity.HouseholdEntity; |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| | | import org.springblade.modules.house.excel.ExportHouseholdExcel; |
| | | import org.springblade.modules.house.excel.ImportHouseholdExcel; |
| | | import org.springblade.modules.house.mapper.HouseholdMapper; |
| | | import org.springblade.modules.house.service.IHouseRentalService; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.modules.house.service.IUserHouseLabelService; |
| | |
| | | |
| | | @Autowired |
| | | private IPlaceService placeService; |
| | | |
| | | @Autowired |
| | | private IHouseRentalService iHouseRentalService; |
| | | |
| | | |
| | | @Override |
| | | public IPage<HouseholdVO> selectHouseholdPage(IPage<HouseholdVO> page, HouseholdVO household) { |
| | |
| | | |
| | | /** |
| | | * 导入住户数据 |
| | | * |
| | | * @param data |
| | | * @param isCovered |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String importUserHouseHold(List<ImportHouseholdExcel> data, Boolean isCovered) { |
| | | public String importUserHouseHold(List<ImportHouseholdExcel> data, Boolean isCovered, String isTenant) { |
| | | IHouseService houseService = SpringUtils.getBean(IHouseService.class); |
| | | int totalNum = data.size(); |
| | | int importNum = 0; |
| | |
| | | if (Strings.isBlank(householdEntity.getName()) |
| | | || Strings.isBlank(householdEntity.getPhoneNumber()) |
| | | || Strings.isBlank(householdEntity.getHouseCode()) |
| | | ){ |
| | | errorNum ++; |
| | | ) { |
| | | errorNum++; |
| | | continue; |
| | | } |
| | | // 查询库中是否已存在 |
| | |
| | | houseService.saveOrUpdateUser(householdEntity); |
| | | } |
| | | } |
| | | // 判断是否租户导入 |
| | | if (StringUtils.isNotBlank(isTenant)) { |
| | | householdEntity.setRelationship(18); |
| | | HouseRentalEntity houseRentalEntity = iHouseRentalService.getOne(Wrappers.<HouseRentalEntity>lambdaQuery() |
| | | .eq(HouseRentalEntity::getHouseCode, householdEntity.getHouseCode())); |
| | | if (houseRentalEntity != null) { |
| | | householdEntity.setHousingRentalId(houseRentalEntity.getId()); |
| | | } else { |
| | | errorNum++; |
| | | continue; |
| | | } |
| | | } |
| | | /// 是否主要联系人 |
| | | if (!Strings.isBlank(houseHoldExcel.getIsPrimaryContact())) { |
| | | householdEntity.setIsPrimaryContact(Integer.parseInt(houseHoldExcel.getIsPrimaryContact())); |