Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
9941397c
Commit
9941397c
authored
Jul 04, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
树API和公用API
parent
8ed79c9a
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
234 additions
and
4 deletions
+234
-4
TreeDto.java
...a/com/yeejoin/amos/boot/module/jxiop/api/dto/TreeDto.java
+40
-0
MonitorFanIndicatorMapper.java
...ot/module/jxiop/api/mapper/MonitorFanIndicatorMapper.java
+11
-0
StationBasicMapper.java
...amos/boot/module/jxiop/api/mapper/StationBasicMapper.java
+8
-0
IMonitorFanIndicator.java
...s/boot/module/jxiop/api/service/IMonitorFanIndicator.java
+2
-0
IMonitorFanIndicatorService.java
...module/jxiop/api/service/IMonitorFanIndicatorService.java
+11
-0
MonitorFanIndicatorMapper.xml
...i/src/main/resources/mapper/MonitorFanIndicatorMapper.xml
+29
-0
StationBasicMapper.xml
...xiop-api/src/main/resources/mapper/StationBasicMapper.xml
+15
-0
AmosJxiopMonitorApplication.java
...in/java/com/yeejoin/amos/AmosJxiopMonitorApplication.java
+1
-1
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+52
-0
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+65
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/TreeDto.java
0 → 100644
View file @
9941397c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
dto
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
TreeDto
{
/**
* 树节点名称
*/
private
String
name
;
/**
* 树节点CODE
*/
private
String
code
;
/**
* 树父节点CODE
*/
private
String
parentCode
;
/**
* 树节点ID
*/
private
String
id
;
/**
* 是否可点击 0-否 1-是
*/
private
Integer
isOnClick
;
/**
* 子节点
*/
private
List
<
TreeDto
>
children
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/MonitorFanIndicatorMapper.java
View file @
9941397c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.mysql.cj.x.protobuf.MysqlxCrud
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator
;
...
...
@@ -17,4 +18,14 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
//批量修改
void
UpdateMonitorFanIndicator
(
@Param
(
value
=
"list"
)
List
<
IndexDto
>
list
);
Integer
queryByPageTotal
(
@Param
(
"fanCode"
)
String
fanCode
,
@Param
(
"gateway"
)
String
gateway
,
@Param
(
"frontModule"
)
String
frontModule
);
Page
<
MonitorFanIndicator
>
queryByPage
(
@Param
(
"size"
)
long
size
,
@Param
(
"fanCode"
)
String
fanCode
,
@Param
(
"gateway"
)
String
gateway
,
@Param
(
"frontModule"
)
String
frontModule
,
@Param
(
"offset"
)
int
offset
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/StationBasicMapper.java
View file @
9941397c
...
...
@@ -49,4 +49,12 @@ public interface StationBasicMapper extends BaseMapper<StationBasic> {
*/
List
<
StationTaksDto
>
getStationBasicDtoList
();
/**
* 根据所属地区code获取场站列表信息
* @param regionCode 所属地区code
*/
List
<
TreeDto
>
getStationListByRegionCode
(
@Param
(
"regionCode"
)
String
regionCode
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/service/IMonitorFanIndicator.java
View file @
9941397c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.mysql.cj.x.protobuf.MysqlxCrud
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator
;
import
java.util.List
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/service/IMonitorFanIndicatorService.java
0 → 100644
View file @
9941397c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
@Service
@Component
public
interface
IMonitorFanIndicatorService
extends
IService
<
MonitorFanIndicator
>
{
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/MonitorFanIndicatorMapper.xml
View file @
9941397c
...
...
@@ -10,5 +10,34 @@
</foreach>
</update>
<select
id=
"queryByPage"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator"
>
select * from monitor_fan_indicator
<where>
<if
test=
"fanCode != null and fanCode !=''"
>
fan_code like concat('%', #{fanCode},'%')
</if>
<if
test=
"gateway != null and gateway !=''"
>
AND gateway = #{gateway}
</if>
<if
test=
"frontModule != null and frontModule !=''"
>
AND front_module = #{frontModule}
</if>
</where>
limit #{offset}, #{size}
</select>
<select
id=
"queryByPageTotal"
resultType=
"java.lang.Integer"
>
select count(1) from monitor_fan_indicator
<where>
<if
test=
"fanCode != null and fanCode !=''"
>
fan_code like concat('%', #{fanCode},'%')
</if>
<if
test=
"gateway != null and gateway !=''"
>
AND gateway = #{gateway}
</if>
<if
test=
"frontModule != null and frontModule !=''"
>
AND front_module = #{frontModule}
</if>
</where>
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/StationBasicMapper.xml
View file @
9941397c
...
...
@@ -150,4 +150,19 @@
FROM
station_basic
</select>
<select
id=
"getStationListByRegionCode"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto"
>
select
station_name as name,
station_code as code,
station_type as parentCode,
sequence_nbr as id,
'1' as isOnclick
from station_basic
<where>
<if
test=
"regionCode != null and regionCode != ''"
>
belong_area like concat('%', #{regionCode}, '%')
</if>
</where>
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/AmosJxiopMonitorApplication.java
View file @
9941397c
...
...
@@ -45,7 +45,7 @@ import java.net.InetAddress;
@EnableScheduling
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"com.yeejoin.amos.boot.module.common.biz.*"
})
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"com.yeejoin.amos.boot.module.common.biz.*"
,
"com.yeejoin.amos.boot.module.jxiop.api.mapper"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
})
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
,
DruidDataSourceAutoConfigure
.
class
})
//@SpringBootApplication
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
0 → 100644
View file @
9941397c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
@RestController
@Api
(
tags
=
"大屏相关API"
)
@RequestMapping
(
value
=
"/monitorFanIdx"
)
public
class
MonitorFanIdxController
extends
BaseController
{
@Autowired
MonitorFanIndicatorImpl
monitorFanIndicatorImpl
;
@Autowired
MonitorFanIndicatorImpl
monitorFanIndicator
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据风机编码、网关ID、前段展示模块查询表数据"
)
@GetMapping
(
"/getFanIdxInfoByPage"
)
public
ResponseModel
<
IPage
<
MonitorFanIndicator
>>
getFanIdxInfoByPage
(
@RequestParam
(
value
=
"fanCode"
,
required
=
false
)
String
fanCode
,
@RequestParam
(
value
=
"gateway"
,
required
=
false
)
String
gateway
,
@RequestParam
(
value
=
"frontModule"
,
required
=
false
)
String
frontModule
,
@RequestParam
(
value
=
"current"
,
required
=
false
)
int
current
,
@RequestParam
(
value
=
"size"
,
required
=
false
)
int
size
)
{
return
ResponseHelper
.
buildResponse
(
monitorFanIndicator
.
getFanIdxInfoByPage
(
fanCode
,
gateway
,
frontModule
,
current
,
size
));
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"左侧树API"
)
@GetMapping
(
"/getTreeInfo"
)
public
ResponseModel
<
TreeDto
>
getTreeInfo
(
@RequestParam
(
value
=
"sequenceNbr"
,
required
=
true
)
String
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
monitorFanIndicator
.
getTreeInfo
(
sequenceNbr
));
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
9941397c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.Region
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IMonitorFanIndicator
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.stereotype.Service
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @description:
...
...
@@ -20,7 +31,13 @@ import java.util.List;
public
class
MonitorFanIndicatorImpl
implements
IMonitorFanIndicator
{
@Autowired
MonitorFanIndicatorMapper
monitorFanIndicatorregionMapper
;
private
MonitorFanIndicatorMapper
monitorFanIndicatorregionMapper
;
@Autowired
private
StationBasicMapper
stationBasicMapper
;
@Autowired
private
RegionMapper
regionMapper
;
@Override
public
void
UpdateMonitorFanIndicator
(
List
<
IndexDto
>
list
)
{
...
...
@@ -29,4 +46,49 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public
IPage
<
MonitorFanIndicator
>
getFanIdxInfoByPage
(
String
fanCode
,
String
gateway
,
String
frontModule
,
int
current
,
int
size
)
{
Page
<
MonitorFanIndicator
>
page
=
new
Page
<>(
current
,
size
);
Integer
integer
=
monitorFanIndicatorregionMapper
.
queryByPageTotal
(
fanCode
,
gateway
,
frontModule
);
Page
<
MonitorFanIndicator
>
monitorFanIndicators
=
monitorFanIndicatorregionMapper
.
queryByPage
(
page
.
getSize
(),
fanCode
,
gateway
,
frontModule
,
(
current
-
1
)
*
size
);
monitorFanIndicators
.
setTotal
(
integer
);
return
monitorFanIndicators
;
}
public
TreeDto
getTreeInfo
(
String
sequenceNbr
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
sequenceNbr
);
List
<
Integer
>
integers
=
JSON
.
parseArray
(
stationBasic
.
getBelongArea
(),
Integer
.
class
);
if
(
CollectionUtils
.
isEmpty
(
integers
))
{
throw
new
BadRequest
(
"所属地区不能为空"
);
}
LambdaQueryWrapper
<
Region
>
regionLambda
=
new
LambdaQueryWrapper
<>();
regionLambda
.
eq
(
Region:
:
getRegionCode
,
integers
.
get
(
0
));
Region
region
=
regionMapper
.
selectOne
(
regionLambda
);
TreeDto
treeDto
=
new
TreeDto
();
treeDto
.
setCode
(
String
.
valueOf
(
region
.
getRegionCode
()));
treeDto
.
setName
(
region
.
getRegionName
());
treeDto
.
setId
(
String
.
valueOf
(
region
.
getSequenceNbr
()));
treeDto
.
setParentCode
(
"0"
);
treeDto
.
setIsOnClick
(
0
);
List
<
TreeDto
>
stationListByRegionCode
=
stationBasicMapper
.
getStationListByRegionCode
(
String
.
valueOf
(
region
.
getRegionCode
()));
TreeDto
fdzTreeDto
=
new
TreeDto
();
fdzTreeDto
.
setName
(
"风电站"
);
fdzTreeDto
.
setCode
(
"FDZ"
);
fdzTreeDto
.
setParentCode
(
String
.
valueOf
(
region
.
getRegionCode
()));
fdzTreeDto
.
setIsOnClick
(
0
);
List
<
TreeDto
>
fdz
=
stationListByRegionCode
.
stream
().
filter
(
t
->
t
.
getParentCode
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
());
fdzTreeDto
.
setChildren
(
fdz
);
TreeDto
gfzTreeDto
=
new
TreeDto
();
gfzTreeDto
.
setName
(
"光伏站"
);
gfzTreeDto
.
setCode
(
"GFZ"
);
gfzTreeDto
.
setParentCode
(
String
.
valueOf
(
region
.
getRegionCode
()));
gfzTreeDto
.
setIsOnClick
(
0
);
List
<
TreeDto
>
gfz
=
stationListByRegionCode
.
stream
().
filter
(
t
->
t
.
getParentCode
().
equals
(
"GFZ"
)).
collect
(
Collectors
.
toList
());
gfzTreeDto
.
setChildren
(
gfz
);
List
<
TreeDto
>
treeDtos
=
Arrays
.
asList
(
fdzTreeDto
,
gfzTreeDto
);
treeDto
.
setChildren
(
treeDtos
);
return
treeDto
;
}
}
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