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
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> {
...
@@ -64,4 +64,9 @@ public interface StationBasicMapper extends BaseMapper<StationBasic> {
*/
*/
int
updateYardByProjectOrgCode
(
@Param
(
"list"
)
List
<
Map
<
String
,
String
>>
analysisResult
);
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 @@
...
@@ -179,4 +179,12 @@
project_org_code = #{item.code}
project_org_code = #{item.code}
</foreach>
</foreach>
</update>
</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>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/pom.xml
View file @
c87f5901
...
@@ -32,6 +32,12 @@
...
@@ -32,6 +32,12 @@
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<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>
<groupId>
org.influxdb
</groupId>
<artifactId>
influxdb-java
</artifactId>
<artifactId>
influxdb-java
</artifactId>
</dependency>
</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;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
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
com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz
;
import
java.util.List
;
import
java.util.List
;
...
@@ -26,4 +27,14 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
...
@@ -26,4 +27,14 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationWerks
(
String
WERKS
,
String
DATAID
);
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationWerks
(
String
WERKS
,
String
DATAID
);
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationGFWerks
(
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
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.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.Enum.QrcodeColorEnum
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.BizMessage
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.RiskBizInfoVo
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.PersonAccount
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.PersonBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.PersonCertificate
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.Constants
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
java.nio.charset.StandardCharsets
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Slf4j
@Component
public
class
PersonYardTimeTask
{
@Autowired
PersonBasicMapper
personBasicMapper
;
@Autowired
PersonBasicServiceImpl
personBasicService
;
//人员资质信息service
@Autowired
PersonCertificateMapper
personCertificateMapper
;
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
private
PersonAccountMapper
personAccountMapper
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Autowired
private
StationQrCodeStatisticsMapper
stationQrCodeStatisticsMapper
;
@Autowired
private
StationQrCodeStatisticsServiceImpl
stationQrCodeStatisticsService
;
@Autowired
private
SjglZsjZsbtzMapper
sjglZsjZsbtzMapper
;
@Autowired
private
StationBasicMapper
stationBasicMapper
;
@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
();
}
// 岗位所需证书信息
Map
<
String
,
String
>
postNameMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_POST
);
// 证书临期信息
Map
<
String
,
String
>
certificatesMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_CERTIFICATES
);
List
<
PersonBasic
>
personBasicList
=
personBasicMapper
.
selectList
(
null
);
List
<
PersonCertificate
>
personCertificates
=
personCertificateMapper
.
selectList
(
null
);
List
<
PersonAccount
>
personAccounts
=
personAccountMapper
.
selectList
(
null
);
Map
<
Long
,
PersonAccount
>
personAccountMap
=
personAccounts
.
stream
().
collect
(
Collectors
.
toMap
(
PersonAccount:
:
getPersonId
,
t
->
t
));
Map
<
Long
,
List
<
PersonCertificate
>>
perCertificateMap
=
personCertificates
.
stream
().
filter
(
item
->
ObjectUtils
.
isNotEmpty
(
item
.
getPersonId
())).
collect
(
Collectors
.
groupingBy
(
PersonCertificate:
:
getPersonId
));
List
<
PersonBasic
>
personBasics
=
new
ArrayList
<>();
personBasicList
.
forEach
(
personBasic
->
{
PersonAccount
personAccount
=
personAccountMap
.
get
(
personBasic
.
getSequenceNbr
());
List
<
PersonCertificate
>
personCertificateList
=
perCertificateMap
.
get
(
personBasic
.
getSequenceNbr
());
//默认红码
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
RED
.
getCode
());
// 该岗位应获得的证书
List
<
String
>
list2
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
personBasic
.
getPostName
()))
{
String
certificates
=
String
.
valueOf
(
postNameMap
.
get
(
personBasic
.
getPostName
()));
if
(!
StringUtils
.
isEmpty
(
certificates
))
{
list2
=
Arrays
.
asList
(
certificates
.
split
(
","
));
}
}
List
<
String
>
list
=
new
ArrayList
(
list2
);
//人员资质信息
Integer
isInMonth
=
0
;
Integer
isOver
=
0
;
if
(
CollectionUtils
.
isNotEmpty
(
personCertificateList
))
{
for
(
PersonCertificate
item
:
personCertificateList
)
{
int
validPeriod
=
StringUtils
.
isEmpty
(
item
.
getValidPeriod
())
?
3
:
Integer
.
parseInt
(
item
.
getValidPeriod
());
Date
date
=
DateUtils
.
dateAddYears
(
item
.
getCertificateTime
(),
validPeriod
);
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
-
1
)
{
isOver
=
1
;
}
try
{
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateBetweenIncludeToday
(
new
Date
(),
date
)
<
Integer
.
valueOf
(
certificatesMap
.
get
(
item
.
getCertificateName
()))
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
1
)
{
isInMonth
=
1
;
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
list
.
remove
(
item
.
getCertificateName
());
}
}
String
qrcodeDescOld
=
personBasic
.
getQrcodeDesc
();
String
qrcodeColorOld
=
personBasic
.
getQrcodeColor
();
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isInMonth
==
0
&&
isOver
==
0
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
GREEN
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书齐全"
);
}
else
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
1
)
{
personBasic
.
setQrcodeDesc
(
"证书不全"
);
}
else
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
0
&&
isInMonth
==
1
)
{
personBasic
.
setQrcodeDesc
(
"证书临期"
);
}
if
(!
qrcodeDescOld
.
equals
(
personBasic
.
getQrcodeDesc
()))
{
personBasic
.
setRecDate
(
new
Date
());
personBasicService
.
updateById
(
personBasic
);
if
((
"证书不全"
.
equals
(
personBasic
.
getQrcodeDesc
())
||
"证书临期"
.
equals
(
personBasic
.
getQrcodeDesc
())))
{
BizMessage
bizMessage
=
new
BizMessage
();
bizMessage
.
setIndexKey
(
"RYFM"
);
bizMessage
.
setIndexValue
(
personBasic
.
getPostName
()
+
personBasic
.
getQrcodeDesc
());
RiskBizInfoVo
riskBizInfoVo
=
personBasicService
.
fetchData
(
personBasic
,
personAccount
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
PersonBasicServiceImpl
.
RYFM_DATA_MQTT_TOPIC
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
}
else
if
(
"证书齐全"
.
equals
(
personBasic
.
getQrcodeDesc
()))
{
HashMap
<
String
,
String
>
personMap
=
new
HashMap
<>();
personMap
.
put
(
"objectId"
,
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
personMap
.
put
(
"qrCodeColor"
,
qrcodeColorOld
);
personMap
.
put
(
"warningObjectType"
,
"RYFM"
);
personMap
.
put
(
"sourceAttribution"
,
personBasic
.
getProjectOrgCode
());
personMap
.
put
(
"sourceAttributionDesc"
,
personAccount
.
getProjectName
());
try
{
emqKeeper
.
getMqttClient
().
publish
(
PersonBasicServiceImpl
.
RYFM_GREEN
,
JSON
.
toJSONString
(
personMap
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
});
}
// @Scheduled(cron = "0 55 23 1/1 * ? ")
@Scheduled
(
cron
=
"0 0/30 * * * ? "
)
public
void
stationQrCodeStatisticsData
()
{
LambdaQueryWrapper
<
StationQrCodeStatistics
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
eq
(
StationQrCodeStatistics:
:
getRecordDate
,
DateUtils
.
getDateNowShortStr
());
Integer
integer
=
stationQrCodeStatisticsMapper
.
selectCount
(
qw
);
if
(
integer
<=
0
)
{
// 人员赋码数据
List
<
StationQrCodeStatistics
>
personStatistics
=
personBasicMapper
.
getPersonStatistics
();
// 设备赋码数据
List
<
StationQrCodeStatistics
>
equipQrcodeInfo
=
sjglZsjZsbtzMapper
.
getEquipQrcodeInfo
();
List
<
StationBasicDto
>
stationBasicListAll
=
stationBasicMapper
.
getStationBasicListAll
();
Map
<
String
,
String
>
collect
=
stationBasicListAll
.
stream
().
filter
(
t
->
StringUtils
.
isNotEmpty
(
t
.
getStationNumber
())).
filter
(
t
->
StringUtils
.
isNotEmpty
(
t
.
getProjectOrgCode
())).
collect
(
Collectors
.
toMap
(
StationBasicDto:
:
getStationNumber
,
StationBasicDto:
:
getProjectOrgCode
));
equipQrcodeInfo
.
stream
().
filter
(
t
->
collect
.
containsKey
(
t
.
getCode
())).
forEach
(
item
->
item
.
setCode
(
collect
.
get
(
item
.
getCode
())));
// 任务赋码数据
List
<
StationQrCodeStatistics
>
taskQrcodeInfo
=
sjglZsjZsbtzMapper
.
getTaskQrcodeInfo
();
taskQrcodeInfo
.
stream
().
filter
(
t
->
collect
.
containsKey
(
t
.
getCode
())).
forEach
(
item
->
item
.
setCode
(
collect
.
get
(
item
.
getCode
())));
// 人员、任务、设备整合插入数据库
personStatistics
.
addAll
(
equipQrcodeInfo
);
personStatistics
.
addAll
(
taskQrcodeInfo
);
stationQrCodeStatisticsService
.
saveBatch
(
personStatistics
);
}
}
}
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 {
...
@@ -67,7 +67,8 @@ public class PersonYardTimeTask {
@Scheduled
(
cron
=
"0 0 0 1/1 * ? "
)
// @Scheduled(cron = "0 0 0 1/1 * ? ")
// 已迁移至大屏服务
public
void
timeYardTimeTask
()
{
public
void
timeYardTimeTask
()
{
if
(!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_POST
)
||
!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_CERTIFICATES
))
{
if
(!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_POST
)
||
!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_CERTIFICATES
))
{
personBasicService
.
addRedisPostAndCerInfo
();
personBasicService
.
addRedisPostAndCerInfo
();
...
@@ -169,7 +170,8 @@ public class PersonYardTimeTask {
...
@@ -169,7 +170,8 @@ public class PersonYardTimeTask {
// @Scheduled(cron = "0 55 23 1/1 * ? ")
// @Scheduled(cron = "0 55 23 1/1 * ? ")
@Scheduled
(
cron
=
"0 0/30 * * * ? "
)
// @Scheduled(cron = "0 0/30 * * * ? ")
// 已迁移至大屏服务
public
void
stationQrCodeStatisticsData
()
{
public
void
stationQrCodeStatisticsData
()
{
LambdaQueryWrapper
<
StationQrCodeStatistics
>
qw
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
StationQrCodeStatistics
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
eq
(
StationQrCodeStatistics:
:
getRecordDate
,
DateUtils
.
getDateNowShortStr
());
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 @@
...
@@ -37,4 +37,31 @@
B.FSB
B.FSB
</select>
</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>
</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