|
|
|
@ -3,6 +3,7 @@ package com.air.land.controller;
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.air.land.entity.LandListedLonLat; |
|
|
|
|
import com.air.land.entity.LandToListLonLat; |
|
|
|
|
import com.air.land.service.LandToListLonLatService; |
|
|
|
|
import com.air.land.vo.LandToListLonLatVo; |
|
|
|
@ -12,6 +13,7 @@ import com.cinderella.framework.common.core.util.R;
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
@ -25,6 +27,7 @@ import java.util.List;
|
|
|
|
|
* @author peihao |
|
|
|
|
* @date 2021-05-18 09:40:15 |
|
|
|
|
*/ |
|
|
|
|
@Slf4j |
|
|
|
|
@RestController |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
@RequestMapping("/landtolistlonlat") |
|
|
|
@ -122,4 +125,28 @@ public class LandToListLonLatController {
|
|
|
|
|
return R.ok(landToListLonLatService.importLandToListedLonLatExcel(file)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 经纬度转换(wgs84_To_Gcj02) |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "经纬度转换(wgs84_To_Gcj02)", notes = "经纬度转换(wgs84_To_Gcj02)") |
|
|
|
|
@GetMapping("/landToListLonLatConversion") |
|
|
|
|
public R<Boolean> landToListLonLatConversion() { |
|
|
|
|
List<LandToListLonLat> list = landToListLonLatService.list(Wrappers.<LandToListLonLat>query() |
|
|
|
|
.lambda().isNull(LandToListLonLat::getGeom)); |
|
|
|
|
if (CollectionUtil.isNotEmpty(list)){ |
|
|
|
|
list.forEach(landToListLonLat -> { |
|
|
|
|
if(StrUtil.isNotEmpty(landToListLonLat.getLandLonLat())){ |
|
|
|
|
try{ |
|
|
|
|
String[] split = landToListLonLat.getLandLonLat().split(";"); |
|
|
|
|
landToListLonLat.setLandLonLat(new StringBuffer(landToListLonLat.getLandLonLat()).append(";").append(split[0]).toString()); |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.error(landToListLonLat.getProposedseriaId()+"拟挂牌经纬度转换出错!",e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
return R.ok(landToListLonLatService.saveBatch(list)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|