| | |
| | | import org.springblade.modules.place.service.IPlaceExtService; |
| | | import org.springblade.modules.place.service.IPlacePoiLabelService; |
| | | import org.springblade.modules.place.service.IPlaceRelService; |
| | | import org.springblade.modules.place.vo.PlacePoiLabelVO; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.place.mapper.PlaceMapper; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | |
| | | if (null!=one) { |
| | | placeVO.setId(one.getId()); |
| | | } |
| | | // 设置来源( 1:地址总表 2:国控采集),扫码采集 |
| | | placeVO.setSource(1); |
| | | // 绑定用户信息 |
| | | bindUserHandle(placeVO); |
| | | // 设置完善状态 |
| | | setPlaceStatus(placeVO); |
| | | // 更新场所信息 |
| | | flag = updateById(placeVO); |
| | | // 保存场所详情及任务信息 |
| | |
| | | placeVO.setHouseCode(IdUtils.getIdBy36()); |
| | | // 绑定用户信息 |
| | | bindUserHandle(placeVO); |
| | | // 设置完善状态 |
| | | setPlaceStatus(placeVO); |
| | | // 新增场所信息 |
| | | flag = save(placeVO); |
| | | // 保存场所详情及任务信息 |
| | |
| | | // 位置绑定,通过定位去匹配所在网格 |
| | | // 返回结果 |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * 设置场所完善状态 |
| | | * @param placeVO |
| | | */ |
| | | private void setPlaceStatus(PlaceVO placeVO) { |
| | | if (!Strings.isBlank(placeVO.getPrincipal()) |
| | | && !Strings.isBlank(placeVO.getPrincipalPhone()) |
| | | && !Strings.isBlank(placeVO.getLocation()) |
| | | && !Strings.isBlank(placeVO.getPlaceName()) |
| | | && !Strings.isBlank(placeVO.getImageUrls()) |
| | | ){ |
| | | // 已完善 |
| | | placeVO.setStatus(2); |
| | | }else { |
| | | // 未完善 |
| | | placeVO.setStatus(1); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | big.setPlaceId(placeVO.getId()); |
| | | big.setPoiCode(Integer.parseInt(bigString)); |
| | | big.setType(1); |
| | | if (!Strings.isBlank(placeVO.getColor())){ |
| | | big.setColor(placeVO.getColor()); |
| | | } |
| | | placePoiLabelService.save(big); |
| | | // 中类 |
| | | PlacePoiLabel mid = new PlacePoiLabel(); |
| | | mid.setPlaceId(placeVO.getId()); |
| | | mid.setPoiCode(Integer.parseInt(midString)); |
| | | mid.setType(2); |
| | | if (!Strings.isBlank(placeVO.getColor())){ |
| | | mid.setColor(placeVO.getColor()); |
| | | } |
| | | placePoiLabelService.save(mid); |
| | | // 小类 |
| | | PlacePoiLabel min = new PlacePoiLabel(); |
| | | min.setPlaceId(placeVO.getId()); |
| | | min.setPoiCode(Integer.parseInt(labelId)); |
| | | min.setType(3); |
| | | if (!Strings.isBlank(placeVO.getColor())){ |
| | | min.setColor(placeVO.getColor()); |
| | | } |
| | | placePoiLabelService.save(min); |
| | | } |
| | | }); |
| | |
| | | big.setPlaceId(placeVO.getId()); |
| | | big.setPoiCode(Integer.parseInt(bigString)); |
| | | big.setType(1); |
| | | if (!Strings.isBlank(placeVO.getColor())){ |
| | | big.setColor(placeVO.getColor()); |
| | | } |
| | | placePoiLabelService.save(big); |
| | | // 中类 |
| | | PlacePoiLabel mid = new PlacePoiLabel(); |
| | | mid.setPlaceId(placeVO.getId()); |
| | | mid.setPoiCode(Integer.parseInt(midString)); |
| | | mid.setType(2); |
| | | if (!Strings.isBlank(placeVO.getColor())){ |
| | | mid.setColor(placeVO.getColor()); |
| | | } |
| | | placePoiLabelService.save(mid); |
| | | // 处理小类 |
| | | if (labelCode.length() > 4) { |
| | |
| | | min.setPlaceId(placeVO.getId()); |
| | | min.setPoiCode(Integer.parseInt(labelCode)); |
| | | min.setType(3); |
| | | if (!Strings.isBlank(placeVO.getColor())){ |
| | | min.setColor(placeVO.getColor()); |
| | | } |
| | | placePoiLabelService.save(min); |
| | | } |
| | | } |
| | |
| | | if (null != placeVO.getHouseCode() && !placeVO.getHouseCode().equals("")) { |
| | | place.setHouseCode(placeVO.getHouseCode()); |
| | | } |
| | | if (placeVO.getPlacePoiLabelVOList().size()>0){ |
| | | PlacePoiLabelVO placePoiLabelVO = placeVO.getPlacePoiLabelVOList().get(0); |
| | | if (!Strings.isBlank(placePoiLabelVO.getColor())){ |
| | | placeVO.setColor(placePoiLabelVO.getColor()); |
| | | } |
| | | } |
| | | // 查询门牌地址信息 |
| | | if (null != place.getHouseCode() && !place.getHouseCode().equals("")) { |
| | | QueryWrapper<DoorplateAddressEntity> wrapper = new QueryWrapper<>(); |