| | |
| | | import org.springblade.modules.house.vo.HouseRentalVO; |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | | import org.springblade.modules.place.entity.PlaceExtEntity; |
| | | import org.springblade.modules.place.service.IPlaceExtService; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private IPlaceService placeService; |
| | | |
| | | @Autowired |
| | | private IPlaceExtService placeExtService; |
| | | |
| | | @Autowired |
| | | private IHouseService houseService; |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object placeDataHandle() { |
| | | public Object placeDataHandle(String townName) { |
| | | // 查询所有的地址表和场所表差集集合 |
| | | List<DoorplateAddressEntity> list = baseMapper.getNotInPlaceList(); |
| | | List<DoorplateAddressEntity> list = baseMapper.getNotInPlaceList(townName); |
| | | // 创建场所集合对象 |
| | | List<PlaceEntity> placeList = new ArrayList<>(); |
| | | if (list.size() > 0) { |
| | | // 将场所数据保存到场所表中 |
| | | for (DoorplateAddressEntity addressEntity : list) { |
| | | // pio 名称不为空的进行插入操作 |
| | | if (!Strings.isBlank(addressEntity.getPoi())) { |
| | | // if (!Strings.isBlank(addressEntity.getPoi())) { |
| | | PlaceEntity placeEntity = new PlaceEntity(); |
| | | placeEntity.setHouseCode(addressEntity.getAddressCode()); |
| | | placeEntity.setPlaceName(addressEntity.getPoi()); |
| | | placeEntity.setLng(addressEntity.getX()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | placeEntity.setLocation(addressEntity.getAddressName()); |
| | | // 设置来源( 1:地址总表 2:国控采集) |
| | | // 设置来源( 1:地址总表 2:国控采集 3:商超) |
| | | placeEntity.setSource(1); |
| | | // 待完善 |
| | | placeEntity.setStatus(1); |
| | | // 加入集合 |
| | | placeList.add(placeEntity); |
| | | } |
| | | // placeList.add(placeEntity); |
| | | // 保存 |
| | | placeService.save(placeEntity); |
| | | // 新增场所详情 |
| | | savePlaceExtAndTaskInfo(placeEntity); |
| | | // } |
| | | } |
| | | // 批量插入 |
| | | placeService.saveBatch(placeList); |
| | | // savePlaceExtAndTaskInfo(placeList); |
| | | } |
| | | // 返回 |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 新增场所详情 |
| | | * @param placeEntity |
| | | */ |
| | | public void savePlaceExtAndTaskInfo(PlaceEntity placeEntity) { |
| | | PlaceExtEntity placeExtEntity = new PlaceExtEntity(); |
| | | placeExtEntity.setPlaceId(placeEntity.getId()); |
| | | // 判断是否已存在,已存在则不新增 |
| | | QueryWrapper<PlaceExtEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("is_deleted",0) |
| | | .eq("place_id",placeEntity.getId()); |
| | | PlaceExtEntity one = placeExtService.getOne(wrapper); |
| | | if (null == one) { |
| | | placeExtEntity.setPlaceId(placeEntity.getId()); |
| | | // 默认给待完善状态 |
| | | placeExtEntity.setConfirmFlag(4); |
| | | placeExtEntity.setCreateTime(new Date()); |
| | | placeExtEntity.setUpdateTime(new Date()); |
| | | placeExtEntity.setCreateUser(AuthUtil.getUserId()); |
| | | placeExtEntity.setUpdateUser(AuthUtil.getUserId()); |
| | | // 新增场所详情 |
| | | placeExtService.save(placeExtEntity); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 门牌地址表(总台账数据) 自定义详情 |
| | | */ |
| | | @Override |