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
b21f7a28
Commit
b21f7a28
authored
Aug 24, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员赋码等业务开发
parent
6b54a551
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
179 additions
and
0 deletions
+179
-0
StationQrCodeStatistics.java
...boot/module/jxiop/api/entity/StationQrCodeStatistics.java
+53
-0
PersonBasicMapper.java
.../amos/boot/module/jxiop/api/mapper/PersonBasicMapper.java
+3
-0
StationQrCodeStatisticsMapper.java
...odule/jxiop/api/mapper/StationQrCodeStatisticsMapper.java
+14
-0
StationQrCodeStatisticsService.java
...ule/jxiop/api/service/StationQrCodeStatisticsService.java
+4
-0
PersonBasicMapper.xml
...jxiop-api/src/main/resources/mapper/PersonBasicMapper.xml
+14
-0
StationQrCodeStatisticsMapper.xml
...c/main/resources/mapper/StationQrCodeStatisticsMapper.xml
+35
-0
PersonBasicController.java
...ot/module/jxiop/biz/controller/PersonBasicController.java
+21
-0
PersonYardTimeTask.java
...oot/module/jxiop/biz/service/impl/PersonYardTimeTask.java
+24
-0
StationQrCodeStatisticsServiceImpl.java
.../biz/service/impl/StationQrCodeStatisticsServiceImpl.java
+11
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/entity/StationQrCodeStatistics.java
0 → 100644
View file @
b21f7a28
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"station_qr_code_statistics"
,
autoResultMap
=
true
)
public
class
StationQrCodeStatistics
extends
BaseEntity
{
/**
* 人员、任务、设备
*/
@TableField
(
"type"
)
private
String
type
;
/**
* 记录日期
*/
@TableField
(
"record_date"
)
private
Date
recordDate
;
/**
* 场站编码
*/
@TableField
(
"code"
)
private
String
code
;
/**
* 黄码数量
*/
@TableField
(
"yellow_num"
)
private
Integer
yellowNum
;
/**
* 红码数量
*/
@TableField
(
"red_num"
)
private
Integer
redNum
;
/**
* 绿码数量
*/
@TableField
(
"green_num"
)
private
Integer
greenNum
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/PersonBasicMapper.java
View file @
b21f7a28
...
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.UserMapperDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.PersonBasic
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -55,4 +56,6 @@ public interface PersonBasicMapper extends BaseMapper<PersonBasic> {
@Param
(
"parentCode"
)
String
parentCode
);
Integer
getPersonYardByPageCount
(
@Param
(
"parentCode"
)
String
parentCode
);
List
<
StationQrCodeStatistics
>
getPersonStatistics
();
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/StationQrCodeStatisticsMapper.java
0 → 100644
View file @
b21f7a28
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
StationQrCodeStatisticsMapper
extends
BaseMapper
<
StationQrCodeStatistics
>
{
List
<
Map
<
String
,
Object
>>
getQrCodeCountByStation
(
@Param
(
"parentCode"
)
String
parentCode
,
@Param
(
"dataType"
)
String
dataType
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/service/StationQrCodeStatisticsService.java
0 → 100644
View file @
b21f7a28
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
service
;
public
interface
StationQrCodeStatisticsService
{
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/PersonBasicMapper.xml
View file @
b21f7a28
...
...
@@ -239,4 +239,18 @@
</if>
</where>
</select>
<select
id=
"getPersonStatistics"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics"
>
SELECT
project_org_code 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,
'person' AS type,
CURRENT_DATE AS recordDate
FROM
person_basic
GROUP BY
project_org_code
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/StationQrCodeStatisticsMapper.xml
0 → 100644
View file @
b21f7a28
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.api.mapper.StationQrCodeStatisticsMapper"
>
<select
id=
"getQrCodeCountByStation"
resultType=
"java.util.Map"
>
SELECT
a.date,
IFNULL( sum( b.red_num ), 0 ) AS redNum,
IFNULL( sum( b.yellow_num ), 0 ) AS yellowNum,
IFNULL( sum( b.green_num ), 0 ) AS greenNum
FROM
(
SELECT
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( now(), INTERVAL - 7 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
DATEDIFF( now(), DATE( DATE_ADD( now(), INTERVAL - 7 DAY )) ) >= @s ) a
LEFT JOIN
( SELECT * FROM station_qr_code_statistics
<where>
<if
test=
"parentCode != null and parentCode != ''"
>
AND code LIKE concat(#{parentCode}, '%')
</if>
<if
test=
"dataType != null and dataType != ''"
>
AND `type` = #{dataType}
</if>
</where>
) b ON a.date = b.record_date
GROUP BY
a.date
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PersonBasicController.java
View file @
b21f7a28
...
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.UserMapperDto
;
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.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.apache.poi.ss.formula.functions.T
;
...
...
@@ -55,6 +56,9 @@ public class PersonBasicController extends BaseController {
@Autowired
PersonBasicMapper
personBasicMapper
;
@Autowired
private
StationQrCodeStatisticsMapper
stationQrCodeStatisticsMapper
;
/**
* 新增人员基本信息
*
...
...
@@ -251,6 +255,23 @@ public class PersonBasicController extends BaseController {
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
);
}
/**
* 百分比
*
...
...
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 @
b21f7a28
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.feign.AmosFeignService
;
...
...
@@ -12,9 +13,11 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.RiskBizInfoVo;
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.PersonAccountMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonCertificateMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationQrCodeStatisticsMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.Constants
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -56,6 +59,12 @@ public class PersonYardTimeTask {
@Autowired
protected
EmqKeeper
emqKeeper
;
@Autowired
private
StationQrCodeStatisticsMapper
stationQrCodeStatisticsMapper
;
@Autowired
private
StationQrCodeStatisticsServiceImpl
stationQrCodeStatisticsService
;
@Scheduled
(
cron
=
"0 0 0 1/1 * ? "
)
...
...
@@ -157,4 +166,19 @@ public class PersonYardTimeTask {
}
});
}
// @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
();
stationQrCodeStatisticsService
.
saveBatch
(
personStatistics
);
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/StationQrCodeStatisticsServiceImpl.java
0 → 100644
View file @
b21f7a28
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationQrCodeStatisticsMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.StationQrCodeStatisticsService
;
import
org.springframework.stereotype.Service
;
@Service
public
class
StationQrCodeStatisticsServiceImpl
extends
ServiceImpl
<
StationQrCodeStatisticsMapper
,
StationQrCodeStatistics
>
implements
StationQrCodeStatisticsService
{
}
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