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 c140a1dc
authored
Aug 02, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 图层同步saas
1 parent
4598058a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
14 deletions
project-order/src/main/java/com/dituhui/pea/order/dao/MapBlockInfoDao.java
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerCustomize.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessLayerServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/dao/MapBlockInfoDao.java
View file @
c140a1d
...
...
@@ -14,4 +14,6 @@ public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integ
MapBlockInfoEntity
findByBlockId
(
String
blockId
);
List
<
MapBlockInfoEntity
>
findByLayerId
(
String
layerId
);
}
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerCustomize.java
View file @
c140a1d
...
...
@@ -9,6 +9,7 @@ public class MapLayerCustomize {
private
Integer
id
;
private
String
branchId
;
private
String
layerId
;
private
String
saasLayerId
;
private
String
layer
;
private
String
layerDescribe
;
private
Integer
status
;
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessLayerServiceImpl.java
View file @
c140a1d
package
com
.
dituhui
.
pea
.
order
.
service
.
impl
;
import
com.alibaba.nacos.common.utils.CollectionUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -12,6 +13,7 @@ import com.dituhui.pea.order.dto.BusinessCustomLayerRespDTO;
import
com.dituhui.pea.order.dto.BusinessCustomLayersRespDTO
;
import
com.dituhui.pea.order.entity.*
;
import
com.dituhui.pea.order.feign.ISaaSRemoteService
;
import
com.dituhui.pea.order.feign.dto.LayerDTO
;
import
com.dituhui.pea.order.service.BusinessLayerService
;
import
com.dituhui.pea.order.utils.TypeUtils
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -42,6 +44,8 @@ public class BusinessLayerServiceImpl implements BusinessLayerService {
private
SkillInfoMPDao
skillInfoMPDao
;
@Autowired
private
ISaaSRemoteService
saasRemoteService
;
@Autowired
private
MapBlockInfoDao
mapBlockInfoDao
;
@Override
public
Result
<?>
businessLayerUniversal
()
{
...
...
@@ -145,7 +149,6 @@ public class BusinessLayerServiceImpl implements BusinessLayerService {
throw
new
BusinessException
(
"分部参数错误,请联系管理员/研发"
);
}
/* TODO
// 同步创建saas图层,返回layerId
String
result
=
saasRemoteService
.
addLayer
(
ak
,
layerName
,
1
,
1
);
...
...
@@ -154,15 +157,14 @@ public class BusinessLayerServiceImpl implements BusinessLayerService {
if
(!
ResultEnum
.
SUCCESS
.
getCode
().
equals
(
saasResult
.
getCode
()))
{
return
Result
.
failure
(
saasResult
.
getMessage
());
}
*/
String
saasLayerId
=
saasResult
.
getResult
().
getId
();
// 存入pea
// TODO 临时生成,正式使用^
//String layerId = saasResult.getResult().getId();// 存入pea
String
layerId
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
// 入库保存
MapLayerCustomize
m
=
new
MapLayerCustomize
();
m
.
setLayerId
(
layerId
);
m
.
setSaasLayerId
(
saasLayerId
);
m
.
setLayer
(
layerName
);
m
.
setLayerDescribe
(
layerDesc
);
m
.
setBranchId
(
branchId
);
...
...
@@ -202,21 +204,24 @@ public class BusinessLayerServiceImpl implements BusinessLayerService {
if
(
layer
==
null
)
{
throw
new
BusinessException
(
"图层不存在"
);
}
//
更新状态为删除状态
layer
.
setStatus
(
0
);
mapLayerCustomizeMPDao
.
updateById
(
layer
);
/* TODO
// 同步
创建saas图层,返回layerId
String result = saasRemoteService.deleteLayer(ak, layer
Id
);
//
检查下面是否还有区块
List
<
MapBlockInfoEntity
>
blocks
=
mapBlockInfoDao
.
findByLayerId
(
layerId
);
if
(
CollectionUtils
.
isNotEmpty
(
blocks
))
{
return
Result
.
failure
(
"该图层下面还有区块"
);
}
// 同步
删除saas图层
String
result
=
saasRemoteService
.
deleteLayer
(
ak
,
layer
.
getSaasLayerId
()
);
log
.
info
(
"deleteLayer params:{} result:{}"
,
layerId
,
result
);
Result
<
Boolean
>
saasResult
=
TypeUtils
.
convertResult
(
result
);
if
(!
ResultEnum
.
SUCCESS
.
getCode
().
equals
(
saasResult
.
getCode
()))
{
return
Result
.
failure
(
saasResult
.
getMessage
());
}
*/
// 更新状态为删除状态
layer
.
setStatus
(
0
);
mapLayerCustomizeMPDao
.
updateById
(
layer
);
return
Result
.
success
(
null
);
}
...
...
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