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 e15313e6
authored
Aug 01, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加saas图层id相关逻辑
1 parent
bbf4dbe9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
2 deletions
project-order/src/main/java/com/dituhui/pea/order/dao/MapLayerCustomizeDao.java
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerCustomizeEntity.java
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerEntity.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/dao/MapLayerCustomizeDao.java
View file @
e15313e
...
@@ -4,4 +4,7 @@ import com.dituhui.pea.order.entity.MapLayerCustomizeEntity;
...
@@ -4,4 +4,7 @@ import com.dituhui.pea.order.entity.MapLayerCustomizeEntity;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
MapLayerCustomizeDao
extends
JpaRepository
<
MapLayerCustomizeEntity
,
Long
>
{
public
interface
MapLayerCustomizeDao
extends
JpaRepository
<
MapLayerCustomizeEntity
,
Long
>
{
public
MapLayerCustomizeEntity
findByBranchIdAndLayerId
(
String
branchId
,
String
layerId
);
}
}
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerCustomizeEntity.java
View file @
e15313e
...
@@ -20,6 +20,9 @@ public class MapLayerCustomizeEntity {
...
@@ -20,6 +20,9 @@ public class MapLayerCustomizeEntity {
@Column
(
name
=
"layer_id"
,
length
=
32
)
@Column
(
name
=
"layer_id"
,
length
=
32
)
private
String
layerId
;
private
String
layerId
;
@Column
(
name
=
"saas_layer_id"
,
length
=
32
)
private
String
saasLayerId
;
@Column
(
name
=
"layer"
,
nullable
=
false
,
length
=
50
)
@Column
(
name
=
"layer"
,
nullable
=
false
,
length
=
50
)
private
String
layer
;
private
String
layer
;
...
...
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerEntity.java
View file @
e15313e
...
@@ -17,6 +17,9 @@ public class MapLayerEntity {
...
@@ -17,6 +17,9 @@ public class MapLayerEntity {
@Column
(
name
=
"layer_id"
,
nullable
=
false
,
length
=
32
)
@Column
(
name
=
"layer_id"
,
nullable
=
false
,
length
=
32
)
private
String
layerId
;
private
String
layerId
;
@Column
(
name
=
"saas_layer_id"
,
nullable
=
false
,
length
=
32
)
private
String
saasLayerId
;
@Column
(
name
=
"layer"
,
nullable
=
false
,
length
=
50
)
@Column
(
name
=
"layer"
,
nullable
=
false
,
length
=
50
)
private
String
layer
;
private
String
layer
;
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
View file @
e15313e
...
@@ -49,6 +49,12 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
...
@@ -49,6 +49,12 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Autowired
@Autowired
private
OrgGroupDao
orgGroupDao
;
private
OrgGroupDao
orgGroupDao
;
@Autowired
private
MapLayerDao
mapLayerDao
;
@Autowired
private
MapLayerCustomizeDao
mapLayerCustomizeDao
;
@Value
(
"${SaaS.ak}"
)
@Value
(
"${SaaS.ak}"
)
String
ak
;
String
ak
;
...
@@ -160,8 +166,25 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
...
@@ -160,8 +166,25 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
// 同步到saas,返回blockId
// 同步到saas,返回blockId
// 获取小队出发点,初始化区块
// 获取小队出发点,初始化区块
OrgGroupEntity
group
=
orgGroupDao
.
getByGroupId
(
team
.
getGroupId
());
OrgGroupEntity
group
=
orgGroupDao
.
getByGroupId
(
team
.
getGroupId
());
String
region
=
RegionUtils
.
constructRegion
(
group
.
getX
(),
group
.
getY
());
String
region
=
RegionUtils
.
constructRegion
(
group
.
getX
(),
group
.
getY
());
String
result
=
saasRemoteService
.
addArea
(
ak
,
team
.
getTeamName
(),
layerId
,
region
,
"gcj02mc"
);
// 获取saas图层id
MapLayerEntity
layer
=
mapLayerDao
.
getByLayerId
(
layerId
);
String
saasLayerId
=
null
;
if
(
null
==
layer
)
{
MapLayerCustomizeEntity
layerCustom
=
mapLayerCustomizeDao
.
findByBranchIdAndLayerId
(
team
.
getBranchId
(),
layerId
);
if
(
null
==
layerCustom
)
{
return
Result
.
failure
(
"图层数据错误"
);
}
saasLayerId
=
layerCustom
.
getSaasLayerId
();
}
else
{
saasLayerId
=
layer
.
getSaasLayerId
();
}
if
(
StringUtils
.
isEmpty
(
saasLayerId
))
{
return
Result
.
failure
(
"图层未配置"
);
}
String
result
=
saasRemoteService
.
addArea
(
ak
,
team
.
getTeamName
(),
saasLayerId
,
region
,
"gcj02mc"
);
log
.
info
(
"params:{} {} {} result:{}"
,
team
.
getTeamName
(),
layerId
,
region
,
result
);
log
.
info
(
"params:{} {} {} result:{}"
,
team
.
getTeamName
(),
layerId
,
region
,
result
);
Result
<
String
>
saasResult
=
TypeUtils
.<
String
>
convertResult
(
result
);
Result
<
String
>
saasResult
=
TypeUtils
.<
String
>
convertResult
(
result
);
if
(!
ResultEnum
.
SUCCESS
.
getCode
().
equals
(
saasResult
.
getCode
()))
{
if
(!
ResultEnum
.
SUCCESS
.
getCode
().
equals
(
saasResult
.
getCode
()))
{
...
...
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