Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
map-parent
Commits
cd67ab98
Commit
cd67ab98
authored
Jul 12, 2021
by
Jbb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图层代码 完结
parent
9eda25cd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
90 additions
and
22 deletions
+90
-22
common/common_utils/src/main/java/com/founder/commonutils/viewEntity/TbStLayerData.java
+8
-7
service/view/src/main/java/com/founder/view/config/EduConfig.java
+14
-1
service/view/src/main/java/com/founder/view/controller/TbStLayerController.java
+10
-0
service/view/src/main/java/com/founder/view/mapper/TbStLayerDataMapper.java
+2
-0
service/view/src/main/java/com/founder/view/service/TbStLayerDataService.java
+4
-0
service/view/src/main/java/com/founder/view/service/impl/TbStLayerDataServiceImpl.java
+27
-0
service/view/src/main/java/com/founder/view/service/impl/TbStLayerServiceImpl.java
+24
-13
service/view/src/main/resources/bootstrap.properties
+1
-1
No files found.
common/common_utils/src/main/java/com/founder/commonutils/viewEntity/TbStLayerData.java
View file @
cd67ab98
package
com
.
founder
.
commonutils
.
viewEntity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
...
...
@@ -13,10 +13,11 @@ import java.util.Date;
@Accessors
(
chain
=
true
)
@TableName
(
"tb_st_layer_data"
)
@ApiModel
(
value
=
"图层数据对象"
,
description
=
"图层数据"
)
public
class
TbStLayerData
implements
Serializable
{
public
class
TbStLayerData
extends
PageInfo
implements
Serializable
{
@TableId
(
value
=
"xxzjbh"
)
private
String
xxzjbh
;
private
String
gl_xxzjbh
;
//@TableField(value = "gl_xxzjbh")
private
String
glXxzjbh
;
private
double
x
;
//经度
private
double
y
;
//纬度
private
String
xStr
;
//保存错误的经度
...
...
@@ -32,12 +33,12 @@ public class TbStLayerData implements Serializable {
this
.
xxzjbh
=
xxzjbh
;
}
public
String
getGl
_x
xzjbh
()
{
return
gl
_x
xzjbh
;
public
String
getGl
X
xzjbh
()
{
return
gl
X
xzjbh
;
}
public
void
setGl
_xxzjbh
(
String
gl_x
xzjbh
)
{
this
.
gl
_xxzjbh
=
gl_x
xzjbh
;
public
void
setGl
Xxzjbh
(
String
glX
xzjbh
)
{
this
.
gl
Xxzjbh
=
glX
xzjbh
;
}
public
double
getX
()
{
...
...
service/view/src/main/java/com/founder/view/config/EduConfig.java
View file @
cd67ab98
...
...
@@ -3,10 +3,13 @@ package com.founder.view.config;
import
com.baomidou.mybatisplus.core.injector.ISqlInjector
;
import
com.baomidou.mybatisplus.extension.injector.LogicSqlInjector
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.github.pagehelper.PageHelper
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
java.util.Properties
;
@Configuration
@MapperScan
(
"com.founder.view.mapper"
)
public
class
EduConfig
{
...
...
@@ -27,5 +30,15 @@ public class EduConfig {
return
new
PaginationInterceptor
();
}
@Bean
public
PageHelper
getPageHelper
(){
PageHelper
pageHelper
=
new
PageHelper
();
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
"helperDialect"
,
"mysql"
);
properties
.
setProperty
(
"reasonable"
,
"true"
);
properties
.
setProperty
(
"supportMethodsArguments"
,
"true"
);
properties
.
setProperty
(
"params"
,
"count=countSql"
);
pageHelper
.
setProperties
(
properties
);
return
pageHelper
;
}
}
service/view/src/main/java/com/founder/view/controller/TbStLayerController.java
View file @
cd67ab98
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
com.founder.commonutils.viewEntity.TbStLayer
;
import
com.founder.view.service.TbStLayerDataService
;
import
com.founder.view.service.TbStLayerService
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -19,10 +20,19 @@ import javax.annotation.Resource;
public
class
TbStLayerController
{
@Resource
TbStLayerService
tbStLayerService
;
@Resource
TbStLayerDataService
tbStLayerDataService
;
@RequestMapping
(
"/getLayers"
)
public
MapRestResult
getLayers
(
@RequestBody
TbStLayer
tbStLayer
)
{
return
tbStLayerService
.
getLayers
(
tbStLayer
,
tbStLayer
.
getPageNo
(),
tbStLayer
.
getSize
());
}
@RequestMapping
(
"/getLayerData"
)
public
MapRestResult
getLayerData
(
@RequestBody
TbStLayer
tbStLayer
)
{
return
tbStLayerDataService
.
selectByGlId
(
tbStLayer
.
getXxzjbh
(),
tbStLayer
.
getPageNo
(),
tbStLayer
.
getSize
());
}
}
service/view/src/main/java/com/founder/view/mapper/TbStLayerDataMapper.java
View file @
cd67ab98
...
...
@@ -2,6 +2,7 @@ package com.founder.view.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
com.founder.commonutils.viewEntity.TbStLayerData
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -22,4 +23,5 @@ public interface TbStLayerDataMapper extends BaseMapper<TbStLayerData> {
void
deleteByGlId
(
String
layerId
);
List
<
TbStLayerData
>
selectByGlId
(
String
layerId
);
}
service/view/src/main/java/com/founder/view/service/TbStLayerDataService.java
View file @
cd67ab98
package
com
.
founder
.
view
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
com.founder.commonutils.viewEntity.TbStLayerData
;
public
interface
TbStLayerDataService
extends
IService
<
TbStLayerData
>
{
void
deleteByGlId
(
String
layerId
);
MapRestResult
selectByGlId
(
String
layerId
,
Integer
pageNo
,
Integer
size
);
}
service/view/src/main/java/com/founder/view/service/impl/TbStLayerDataServiceImpl.java
View file @
cd67ab98
package
com
.
founder
.
view
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
com.founder.commonutils.viewEntity.TbStLayer
;
import
com.founder.commonutils.viewEntity.TbStLayerData
;
import
com.founder.view.mapper.TbStLayerDataMapper
;
import
com.founder.view.service.TbStLayerDataService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
public
class
TbStLayerDataServiceImpl
extends
ServiceImpl
<
TbStLayerDataMapper
,
TbStLayerData
>
implements
TbStLayerDataService
{
...
...
@@ -17,4 +23,25 @@ public class TbStLayerDataServiceImpl extends ServiceImpl<TbStLayerDataMapper, T
public
void
deleteByGlId
(
String
layerId
)
{
tbStLayerDataMapper
.
deleteByGlId
(
layerId
);
}
@Override
public
MapRestResult
selectByGlId
(
String
layerId
,
Integer
pageNo
,
Integer
size
)
{
try
{
if
(
pageNo
!=
null
&&
pageNo
!=
0
&&
size
!=
null
&&
size
!=
0
)
{
PageHelper
.
startPage
(
pageNo
,
size
);
List
<
TbStLayerData
>
tbStLayerDatas
=
tbStLayerDataMapper
.
selectByGlId
(
layerId
);
PageInfo
<
TbStLayerData
>
pageInfo
=
new
PageInfo
<>(
tbStLayerDatas
);
return
MapRestResult
.
build
(
200
,
"图层数据查询成功!"
,
pageInfo
.
getTotal
(),
pageInfo
);
}
else
{
List
<
TbStLayerData
>
tbStLayerDatas
=
tbStLayerDataMapper
.
selectByGlId
(
layerId
);
return
MapRestResult
.
build
(
200
,
"图层数据查询成功!"
,
null
,
tbStLayerDatas
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
MapRestResult
.
build
(
500
,
"图层数据查询失败!"
,
null
,
null
);
}
}
}
service/view/src/main/java/com/founder/view/service/impl/TbStLayerServiceImpl.java
View file @
cd67ab98
...
...
@@ -26,21 +26,32 @@ public class TbStLayerServiceImpl extends ServiceImpl<TbStLayerMapper, TbStLayer
@Override
public
MapRestResult
<
TbStLayer
>
getLayers
(
TbStLayer
tbStLayer
,
Integer
pageNo
,
Integer
size
)
{
try
{
pageNo
=
1
;
size
=
10
;
PageHelper
.
startPage
(
pageNo
,
size
);
List
<
TbStLayer
>
tbStLayerList
=
new
ArrayList
<>(
);
List
<
TbStLayer
>
tbStLayers
=
tbStLayerMapper
.
selectLayers
(
tbStLayer
);
if
(
tbStLayers
!=
null
&&
tbStLayers
.
size
()
>
0
)
{
for
(
TbStLayer
stLayer
:
tbStLayers
)
{
List
<
TbStLayerData
>
tbStLayerDataList
=
tbStLayerDataMapper
.
selectByGlId
(
stLayer
.
getXxzjbh
());
stLayer
.
setCount
(
tbStLayerDataList
.
size
()
);
tbStLayerList
.
add
(
stLayer
);
if
(
pageNo
!=
null
&&
pageNo
!=
0
&&
size
!=
null
&&
size
!=
0
)
{
PageHelper
.
startPage
(
pageNo
,
size
)
;
List
<
TbStLayer
>
tbStLayerList
=
new
ArrayList
<>(
);
List
<
TbStLayer
>
tbStLayers
=
tbStLayerMapper
.
selectLayers
(
tbStLayer
);
if
(
tbStLayers
!=
null
&&
tbStLayers
.
size
()
>
0
)
{
for
(
TbStLayer
stLayer
:
tbStLayers
)
{
List
<
TbStLayerData
>
tbStLayerDataList
=
tbStLayerDataMapper
.
selectByGlId
(
stLayer
.
getXxzjbh
());
stLayer
.
setCount
(
tbStLayerDataList
.
size
());
tbStLayerList
.
add
(
stLayer
);
}
}
}
PageInfo
<
TbStLayer
>
pageInfo
=
new
PageInfo
<>(
tbStLayerList
);
return
MapRestResult
.
build
(
200
,
"图层信息查询成功!"
,
pageInfo
.
getTotal
(),
pageInfo
);
PageInfo
<
TbStLayer
>
pageInfo
=
new
PageInfo
<>(
tbStLayerList
);
return
MapRestResult
.
build
(
200
,
"图层信息查询成功!"
,
pageInfo
.
getTotal
(),
pageInfo
);
}
else
{
List
<
TbStLayer
>
tbStLayerList
=
new
ArrayList
<>();
List
<
TbStLayer
>
tbStLayers
=
tbStLayerMapper
.
selectLayers
(
tbStLayer
);
if
(
tbStLayers
!=
null
&&
tbStLayers
.
size
()
>
0
)
{
for
(
TbStLayer
stLayer
:
tbStLayers
)
{
List
<
TbStLayerData
>
tbStLayerDataList
=
tbStLayerDataMapper
.
selectByGlId
(
stLayer
.
getXxzjbh
());
stLayer
.
setCount
(
tbStLayerDataList
.
size
());
tbStLayerList
.
add
(
stLayer
);
}
}
return
MapRestResult
.
build
(
200
,
"图层信息查询成功!"
,
null
,
tbStLayerList
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
MapRestResult
.
build
(
500
,
"图层信息查询失败!"
,
null
,
null
);
...
...
service/view/src/main/resources/bootstrap.properties
View file @
cd67ab98
...
...
@@ -5,7 +5,7 @@ spring.cloud.nacos.discovery.server-addr=47.92.48.137:9949
#spring.cloud.nacos.config.server-addr=26.3.13.184:8848
#spring.cloud.nacos.discovery.server-addr=26.3.13.184:8848
spring.profiles.active
=
dev
#
spring.profiles.active=dev
# 该配置影响统一配置中心中的dataId
spring.application.name
=
view
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment