Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9d9c8934
authored
Aug 18, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 调整新建区划接口,可以不传边界
1 parent
4a4201c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
project-order/src/main/java/com/dituhui/pea/order/feign/ISaaSRemoteService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/utils/RegionUtils.java
project-order/src/main/java/com/dituhui/pea/order/feign/ISaaSRemoteService.java
View file @
9d9c893
...
...
@@ -8,9 +8,9 @@ import org.springframework.web.bind.annotation.RequestParam;
@FeignClient
(
url
=
"${SaaS.url}"
,
name
=
"saasService"
)
public
interface
ISaaSRemoteService
{
@PostMapping
(
"/v1/area/add"
)
@PostMapping
(
"/v1/
bsh/
area/add"
)
public
String
addArea
(
@RequestParam
String
ak
,
@RequestParam
String
name
,
@RequestParam
String
layerId
,
@RequestParam
String
region
,
@RequestParam
String
coordType
);
@RequestParam
String
center
);
@PostMapping
(
"/v1/area/delById"
)
public
String
deleteArea
(
@RequestParam
String
ak
,
@RequestParam
String
id
);
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
View file @
9d9c893
...
...
@@ -144,10 +144,8 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Transactional
@Override
public
Result
<?>
businessServiceBlockAdd
(
String
layerId
,
String
teamId
)
throws
BusinessException
{
String
layerName
;
// 获取layerName
String
layerName
;
MapLayerEntity
layer1
=
mapLayerDao
.
getByLayerId
(
layerId
);
if
(
layer1
==
null
)
{
MapLayerCustomizeEntity
layer2
=
mapLayerCustomizeDao
.
getByLayerId
(
layerId
);
...
...
@@ -165,7 +163,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
throw
new
BusinessException
(
"关联小队不存在"
);
}
// 重复检查layerId+teamId
// 重复检查layerId+teamId
注意:1个小队可以对应多个图层
MapBlockInfoEntity
existBlock
=
mapBlockInfoDao
.
findByTeamIdAndLayerId
(
teamId
,
layerId
);
if
(
null
!=
existBlock
)
{
return
Result
.
failure
(
"区块已存在"
);
...
...
@@ -174,15 +172,15 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
// 同步到saas,返回blockId
// 获取小队出发点,初始化区块
OrgGroupEntity
group
=
orgGroupDao
.
getByGroupId
(
team
.
getGroupId
());
String
region
=
RegionUtils
.
constructRegion
(
group
.
getX
(),
group
.
getY
());
String
center
=
RegionUtils
.
constructCenter
(
group
.
getX
(),
group
.
getY
());
// 获取saas图层id
String
saasLayerId
=
getSaaSLayerId
(
team
.
getBranchId
(),
layerId
);
if
(
StringUtils
.
isEmpty
(
saasLayerId
))
{
return
Result
.
failure
(
"
图层未配置"
);
return
Result
.
failure
(
team
.
getTeamName
()
+
"
图层未配置"
);
}
String
result
=
saasRemoteService
.
addArea
(
ak
,
team
.
getTeamName
(),
saasLayerId
,
region
,
"gcj02mc"
);
log
.
info
(
"params:{} {} {} {} result:{}"
,
team
.
getTeamName
(),
saasLayerId
,
region
,
result
);
String
result
=
saasRemoteService
.
addArea
(
ak
,
team
.
getTeamName
(),
saasLayerId
,
center
);
log
.
info
(
"params:{} {} {} {} result:{}"
,
team
.
getTeamName
(),
saasLayerId
,
center
,
result
);
Result
<
String
>
saasResult
=
TypeUtils
.
convertResult
(
result
);
if
(!
ResultEnum
.
SUCCESS
.
getCode
().
equals
(
saasResult
.
getCode
()))
{
return
Result
.
failure
(
"区块已存在或者裁剪为空"
);
...
...
project-order/src/main/java/com/dituhui/pea/order/utils/RegionUtils.java
View file @
9d9c893
...
...
@@ -15,6 +15,13 @@ public class RegionUtils {
return
gson
.
toJson
(
region
);
}
public
static
String
constructCenter
(
String
x
,
String
y
)
{
// 经纬度转墨卡托坐标
double
xx
=
Double
.
parseDouble
(
x
);
double
yy
=
Double
.
parseDouble
(
y
);
return
gcj02LngToMercator
(
xx
)
+
","
+
gcj02LatToMercator
(
yy
);
}
public
static
RegionDTO
convertXyToRegion
(
double
x
,
double
y
)
{
// 经纬度转墨卡托坐标
double
xx
=
gcj02LngToMercator
(
x
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment