| | |
| | | package org.springblade.modules.house.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import org.springblade.modules.label.entity.LabelEntity; |
| | | import org.springblade.modules.label.service.ILabelService; |
| | | import org.springblade.modules.label.vo.LabelVO; |
| | | import org.springblade.modules.place.excel.PlaceExcel; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.entity.Region; |
| | |
| | | houseEntity.setHouseCode(IdUtils.getIdBy36()); |
| | | houseEntity.setSource(2); |
| | | } |
| | | // 网格处理 |
| | | importGridHandle(houseAndHoldExcel,houseEntity); |
| | | // 新增 |
| | | save(houseEntity); |
| | | }else { |
| | |
| | | one.setBuilding(houseAndHoldExcel.getBuilding()); |
| | | one.setArea(houseAndHoldExcel.getArea()); |
| | | one.setPropertyPrice(houseAndHoldExcel.getPropertyPrice()); |
| | | // 网格处理 |
| | | importGridHandle(houseAndHoldExcel,one); |
| | | // 更新 |
| | | updateById(one); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导入是网格数据绑定处理 |
| | | * @param houseAndHoldExcel |
| | | * @param houseEntity |
| | | */ |
| | | public void importGridHandle(HouseAndHoldExcel houseAndHoldExcel, HouseEntity houseEntity) { |
| | | if (!Strings.isBlank(houseAndHoldExcel.getCommunityName()) && |
| | | !Strings.isBlank(houseAndHoldExcel.getGridName())){ |
| | | // 查询对应的网格信息 |
| | | GridEntity gridEntity = gridService.getGridInfoByParam(houseAndHoldExcel.getCommunityName(),houseAndHoldExcel.getGridName()); |
| | | if (null!=gridEntity){ |
| | | // 设置场所范围 |
| | | houseEntity.setGridId(gridEntity.getId()); |
| | | houseEntity.setGridCode(gridEntity.getGridCode()); |
| | | // 更新网格范围绑定 |
| | | GridRangeEntity gridRangeEntity = new GridRangeEntity(); |
| | | gridRangeEntity.setGridId(gridEntity.getId()); |
| | | gridRangeEntity.setGridCode(gridEntity.getGridCode()); |
| | | gridRangeEntity.setHouseCode(houseEntity.getHouseCode()); |
| | | UpdateWrapper<GridRangeEntity> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("house_code",houseEntity.getHouseCode()); |
| | | gridRangeService.update(gridRangeEntity,updateWrapper); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 住户标签处理 |
| | | * @param houseAndHoldExcel |