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
c87f5901
Commit
c87f5901
authored
Aug 25, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
赋码等业务开发
parent
7bae3e9d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
392 additions
and
2 deletions
+392
-2
StationBasicMapper.java
...amos/boot/module/jxiop/api/mapper/StationBasicMapper.java
+5
-0
StationBasicMapper.xml
...xiop-api/src/main/resources/mapper/StationBasicMapper.xml
+8
-0
pom.xml
...system-jxiop/amos-boot-module-jxiop-bigscreen-biz/pom.xml
+6
-0
PersonQrCodeController.java
...t/module/jxiop/biz/controller/PersonQrCodeController.java
+132
-0
SjglZsjZsbtzMapper.java
...mos/boot/module/jxiop/biz/mapper2/SjglZsjZsbtzMapper.java
+11
-0
PersonYardTimeTask.java
...oot/module/jxiop/biz/service/impl/PersonYardTimeTask.java
+199
-0
PersonYardTimeTask.java
...oot/module/jxiop/biz/service/impl/PersonYardTimeTask.java
+4
-2
SjglZsjZsbtzMapper.xml
.../src/main/resources/mapper/cluster/SjglZsjZsbtzMapper.xml
+27
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/StationBasicMapper.java
View file @
c87f5901
...
...
@@ -64,4 +64,9 @@ public interface StationBasicMapper extends BaseMapper<StationBasic> {
*/
int
updateYardByProjectOrgCode
(
@Param
(
"list"
)
List
<
Map
<
String
,
String
>>
analysisResult
);
/**
* 查询所有场站信息
*/
List
<
StationBasicDto
>
getStationBasicListAll
();
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/StationBasicMapper.xml
View file @
c87f5901
...
...
@@ -179,4 +179,12 @@
project_org_code = #{item.code}
</foreach>
</update>
<select
id=
"getStationBasicListAll"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto"
>
SELECT
station_number stationNumber,
project_org_code AS projectOrgCode
FROM
station_basic
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/pom.xml
View file @
c87f5901
...
...
@@ -32,6 +32,12 @@
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-jxiop-biz
</artifactId>
<version>
1.0.0
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.influxdb
</groupId>
<artifactId>
influxdb-java
</artifactId>
</dependency>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PersonQrCodeController.java
0 → 100644
View file @
c87f5901
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.McbWarningFeign
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationQrCodeStatisticsMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.PersonBasicServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
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.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@Api
(
tags
=
"人员人员赋码基本信息 评估大屏Api"
)
@RequestMapping
(
value
=
"/person-qrcode"
)
public
class
PersonQrCodeController
extends
BaseController
{
@Autowired
PersonBasicServiceImpl
personBasicServiceImpl
;
@Autowired
McbWarningFeign
mcbWarningFeign
;
@Autowired
PersonBasicMapper
personBasicMapper
;
@Autowired
private
StationQrCodeStatisticsMapper
stationQrCodeStatisticsMapper
;
/**
* 评估大屏 - 人员赋码环形图查询
*
* @param parentCode 父级code
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getPersonYardStatistics"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"评估大屏 - 人员赋码环形图查询"
,
notes
=
"评估大屏 - 人员赋码环形图查询"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getPersonYardStatistics
(
@RequestParam
(
required
=
false
,
value
=
"parentCode"
)
String
parentCode
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
personBasicServiceImpl
.
getPersonYardStatistics
(
parentCode
);
return
ResponseHelper
.
buildResponse
(
resultList
);
}
/**
* 评估大屏 - 人员赋码列表查询
*
* @param parentCode 父级code
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getPersonYardByPage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"评估大屏 - 人员赋码列表查询"
,
notes
=
"评估大屏 - 人员赋码列表查询"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getPersonYardByPage
(
@RequestParam
(
required
=
false
,
value
=
"parentCode"
)
String
parentCode
,
@RequestParam
(
value
=
"current"
)
Integer
current
,
@RequestParam
(
value
=
"size"
)
Integer
size
)
{
Page
<
Map
<
String
,
Object
>>
resultList
=
personBasicServiceImpl
.
getPersonYardByPage
(
parentCode
,
current
,
size
);
return
ResponseHelper
.
buildResponse
(
resultList
);
}
/**
* 评估大屏 - 人员赋码数量等统计
*
* @param parentCode 父级code
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getQrCodeCount"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"评估大屏 - 人员赋码数量等统计"
,
notes
=
"评估大屏 - 人员赋码数量等统计"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getQrCodeCount
(
@RequestParam
(
required
=
false
,
value
=
"parentCode"
)
String
parentCode
)
{
FeignClientResult
<
Map
<
String
,
Object
>>
sevenEntity
=
null
;
try
{
sevenEntity
=
mcbWarningFeign
.
getQrCodeCount
(
parentCode
,
"RYFM"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
sevenEntity
!=
null
&&
200
==
sevenEntity
.
getStatus
())
{
Map
<
String
,
Object
>
result
=
sevenEntity
.
getResult
();
String
red
=
result
.
get
(
"red"
).
toString
();
String
yellow
=
result
.
get
(
"yellow"
).
toString
();
String
redToGreen
=
result
.
get
(
"redToGreen"
).
toString
();
String
yellowToGreen
=
result
.
get
(
"yellowToGreen"
).
toString
();
Integer
countAll
=
personBasicMapper
.
getPersonYardByPageCount
(
parentCode
);
result
.
put
(
"redToGreenPercent"
,
getPercent
(
new
BigDecimal
(
red
),
new
BigDecimal
(
countAll
)));
result
.
put
(
"redPercent"
,
getPercent
(
new
BigDecimal
(
redToGreen
),
new
BigDecimal
(
countAll
)));
result
.
put
(
"yellowToGreenPercent"
,
getPercent
(
new
BigDecimal
(
yellow
),
new
BigDecimal
(
countAll
)));
result
.
put
(
"yellowPercent"
,
getPercent
(
new
BigDecimal
(
yellowToGreen
),
new
BigDecimal
(
countAll
)));
return
ResponseHelper
.
buildResponse
(
result
);
}
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
* 评估大屏 - 场站 人员赋码数量等统计 【折线图】
*
* @param parentCode 父级code
* @param dataType 类型 - 人员、任务、设备等
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getQrCodeCountByStation"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"评估大屏 - 场站 人员赋码数量等统计 【折线图】"
,
notes
=
"评估大屏 - 场站 人员赋码数量等统计 【折线图】"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getQrCodeCountByStation
(
@RequestParam
(
required
=
false
,
value
=
"parentCode"
)
String
parentCode
,
@RequestParam
(
required
=
false
,
value
=
"dataType"
)
String
dataType
)
{
List
<
Map
<
String
,
Object
>>
qrCodeCountByStation
=
stationQrCodeStatisticsMapper
.
getQrCodeCountByStation
(
parentCode
,
dataType
);
return
ResponseHelper
.
buildResponse
(
qrCodeCountByStation
);
}
/**
* 百分比
*
* @param numerator 分子
* @param denominator 分母
* @return 百分比
*/
private
double
getPercent
(
BigDecimal
numerator
,
BigDecimal
denominator
)
{
BigDecimal
multiply
=
numerator
.
divide
(
denominator
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
?
denominator
:
new
BigDecimal
(
1
),
4
,
BigDecimal
.
ROUND_DOWN
).
multiply
(
new
BigDecimal
(
100
));
return
Math
.
abs
(
multiply
.
doubleValue
());
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/SjglZsjZsbtzMapper.java
View file @
c87f5901
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz
;
import
java.util.List
;
...
...
@@ -26,4 +27,14 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationWerks
(
String
WERKS
,
String
DATAID
);
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationGFWerks
(
String
WERKS
,
String
DATAID
);
/**
* 设备赋码数据
*/
List
<
StationQrCodeStatistics
>
getEquipQrcodeInfo
();
/**
* 任务赋码数据
*/
List
<
StationQrCodeStatistics
>
getTaskQrcodeInfo
();
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonYardTimeTask.java
0 → 100644
View file @
c87f5901
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonYardTimeTask.java
View file @
c87f5901
...
...
@@ -67,7 +67,8 @@ public class PersonYardTimeTask {
@Scheduled
(
cron
=
"0 0 0 1/1 * ? "
)
// @Scheduled(cron = "0 0 0 1/1 * ? ")
// 已迁移至大屏服务
public
void
timeYardTimeTask
()
{
if
(!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_POST
)
||
!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_CERTIFICATES
))
{
personBasicService
.
addRedisPostAndCerInfo
();
...
...
@@ -169,7 +170,8 @@ public class PersonYardTimeTask {
// @Scheduled(cron = "0 55 23 1/1 * ? ")
@Scheduled
(
cron
=
"0 0/30 * * * ? "
)
// @Scheduled(cron = "0 0/30 * * * ? ")
// 已迁移至大屏服务
public
void
stationQrCodeStatisticsData
()
{
LambdaQueryWrapper
<
StationQrCodeStatistics
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
eq
(
StationQrCodeStatistics:
:
getRecordDate
,
DateUtils
.
getDateNowShortStr
());
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/resources/mapper/cluster/SjglZsjZsbtzMapper.xml
View file @
c87f5901
...
...
@@ -37,4 +37,31 @@
B.FSB
</select>
<select
id=
"getEquipQrcodeInfo"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics"
>
SELECT
WERKS AS `code`,
count( QRCODE_COLOR = 'red' OR NULL ) AS redNum,
count( QRCODE_COLOR = 'yellow' OR NULL ) AS yellowNum,
count( QRCODE_COLOR = 'green' OR NULL ) AS greenNum,
'equip' AS type,
CURRENT_DATE AS recordDate
FROM
sjgl_zsj_zsbtz
GROUP BY
WERKS
</select>
<select
id=
"getTaskQrcodeInfo"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics"
>
SELECT
WERKS AS `code`,
count( QRCODE_COLOR = 'red' OR NULL ) AS redNum,
count( QRCODE_COLOR = 'yellow' OR NULL ) AS yellowNum,
count( QRCODE_COLOR = 'green' OR NULL ) AS greenNum,
'job' AS type,
CURRENT_DATE AS recordDate
FROM
fdgl_job_main
GROUP BY
WERKS
</select>
</mapper>
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