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 8346a224
authored
Oct 28, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
2 parents
b0ff6148
75c713f7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
29 deletions
project-order/src/main/java/com/dituhui/pea/order/dto/BusinessServerBlocksRespDTO.java
project-order/src/main/java/com/dituhui/pea/order/entity/MapBlockInfoEntity.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
project-order/src/main/resources/application.yaml
project-order/src/main/java/com/dituhui/pea/order/dto/BusinessServerBlocksRespDTO.java
View file @
8346a22
...
...
@@ -22,7 +22,8 @@ public class BusinessServerBlocksRespDTO {
private
String
layerName
;
private
String
teamId
;
private
String
teamName
;
private
String
area
;
private
Integer
areaCount
;
private
String
saasUrl
;
private
String
updateTime
;
}
}
project-order/src/main/java/com/dituhui/pea/order/entity/MapBlockInfoEntity.java
View file @
8346a22
...
...
@@ -14,7 +14,7 @@ public class MapBlockInfoEntity {
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
@Column
(
name
=
"area_ids"
,
length
=
1024
,
nullable
=
false
)
@Column
(
name
=
"area_ids"
,
length
=
1024
)
private
String
areaIds
;
@Column
(
name
=
"area_name"
,
length
=
50
,
nullable
=
false
)
...
...
@@ -32,7 +32,7 @@ public class MapBlockInfoEntity {
@Column
(
name
=
"city_code"
,
nullable
=
true
)
private
String
cityCode
;
@Column
(
name
=
"area
C
ount"
)
@Column
(
name
=
"area
_c
ount"
)
private
Long
areaCount
;
@Column
(
name
=
"area_data"
,
nullable
=
true
,
columnDefinition
=
"json"
)
...
...
@@ -47,11 +47,14 @@ public class MapBlockInfoEntity {
@Column
(
name
=
"layer_name"
,
length
=
50
,
nullable
=
false
)
private
String
layerName
;
@Column
(
name
=
"saas_layercode"
,
length
=
50
,
nullable
=
false
)
@Column
(
name
=
"saas_layercode"
,
length
=
50
)
private
String
saasLayercode
;
@Column
(
name
=
"saas_layer_id"
,
length
=
50
,
nullable
=
false
)
@Column
(
name
=
"saas_layer_id"
,
length
=
50
)
private
String
saasLayerName
;
@Column
(
name
=
"saas_url"
,
length
=
512
)
private
String
saasUrl
;
@Column
(
nullable
=
false
)
private
Boolean
status
;
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
View file @
8346a22
...
...
@@ -38,6 +38,10 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String
ak
;
@Value
(
"${SaaS.url}"
)
String
url
;
@Value
(
"${SaaS.userAccount}"
)
String
userAccount
;
@Value
(
"${SaaS.userPassword}"
)
String
password
;
@Autowired
private
OrgTeamDao
orgTeamDao
;
@Autowired
...
...
@@ -127,7 +131,12 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
block
.
setLayerName
(
b
.
getLayerName
());
block
.
setTeamId
(
b
.
getTeamId
());
block
.
setTeamName
(
team
.
getTeamName
());
// block.setArea(b.getArea().toString());
block
.
setSaasUrl
(
b
.
getSaasUrl
());
if
(
StringUtils
.
isNotBlank
(
b
.
getAreaIds
()))
{
block
.
setAreaCount
(
b
.
getAreaIds
().
split
(
","
).
length
);
}
else
{
block
.
setAreaCount
(
0
);
}
if
(
null
!=
b
.
getUpdateTime
())
{
block
.
setUpdateTime
(
TimeUtils
.
IsoLocalDateTime2String
(
b
.
getUpdateTime
()));
}
...
...
@@ -170,31 +179,31 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
// 重复检查layerId+teamId 注意:1个小队可以对应多个图层
MapBlockInfoEntity
existBlock
=
mapBlockInfoDao
.
findByTeamIdAndLayerId
(
teamId
,
layerId
);
if
(
null
!=
existBlock
)
{
return
Result
.
failure
(
"区块已存在"
);
}
// 同步到saas,返回blockId
// 获取小队出发点,初始化区块
OrgGroupEntity
group
=
orgGroupDao
.
getByGroupId
(
team
.
getGroupId
());
String
center
=
RegionUtils
.
constructCenter
(
group
.
getX
(),
group
.
getY
());
// 获取saas图层id
String
saasLayerId
=
getSaaSLayerId
(
team
.
getBranchId
(),
layerId
);
if
(
StringUtils
.
isEmpty
(
saasLayerId
))
{
return
Result
.
failure
(
team
.
getTeamName
()
+
" 图层未配置"
);
return
Result
.
failure
(
"该工作队图层服务范围已存在"
);
}
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
(
"区块已存在或者裁剪为空"
);
}
String
blockId
=
saasResult
.
getResult
();
// // 同步到saas,返回blockId
// // 获取小队出发点,初始化区块
// OrgGroupEntity group = orgGroupDao.getByGroupId(team.getGroupId());
// String center = RegionUtils.constructCenter(group.getX(), group.getY());
// // 获取saas图层id
// String saasLayerId = getSaaSLayerId(team.getBranchId(), layerId);
// if (StringUtils.isEmpty(saasLayerId)) {
// return Result.failure(team.getTeamName() + " 图层未配置");
// }
//
// 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("区块已存在或者裁剪为空");
// }
// String blockId = saasResult.getResult();
String
blockName
=
String
.
format
(
"%s_%s"
,
layerName
,
team
.
getTeamName
());
//区块名称
MapBlockInfoEntity
block
=
new
MapBlockInfoEntity
();
block
.
setAreaIds
(
blockId
);
//
block.setAreaIds(blockId);
block
.
setAreaName
(
blockName
);
block
.
setBranchId
(
team
.
getBranchId
());
block
.
setGroupId
(
team
.
getGroupId
());
...
...
@@ -262,10 +271,6 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
throw
new
BusinessException
(
"区块不存在"
);
}
// TODO 根据当前block转换成分部,再转换成对应账号信息
String
userAccount
=
"sMvf3yZWA69lKcvlgKcOHQ=="
;
String
password
=
"qjOHxpQPXLnJP+Jq1CZGBQ=="
;
// 跳转SaaS url
// 获取saas图层id
String
saasLayerId
=
getSaaSLayerId
(
block
.
getBranchId
(),
block
.
getLayerId
());
...
...
project-order/src/main/resources/application.yaml
View file @
8346a22
...
...
@@ -63,6 +63,8 @@ sentry:
SaaS
:
url
:
https://pea-test.bshg.com.cn
ak
:
64e1cde3f9144bfb850b7d37c51af559
userAccount
:
sMvf3yZWA69lKcvlgKcOHQ==
userPassword
:
qjOHxpQPXLnJP+Jq1CZGBQ==
bean
:
server
:
https://bean-test.bshg.com.cn
app-key
:
eDZEhTCxAcM9paRfwPjAM7RGkfmbf15S_PEA
...
...
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