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
628216c8
Commit
628216c8
authored
Oct 22, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ys):综合统计分析接口
parent
85b9c1ff
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
8 deletions
+98
-8
SafetyProblemTracing.java
.../amos/boot/module/jg/api/entity/SafetyProblemTracing.java
+2
-2
logback-dev.xml
...mos-boot-module-jg-biz/src/main/resources/logback-dev.xml
+3
-3
pom.xml
...m-tzs/amos-boot-module-ys/amos-boot-module-ys-biz/pom.xml
+5
-0
CommonController.java
.../amos/boot/module/ys/biz/controller/CommonController.java
+8
-0
CommonService.java
...eejoin/amos/boot/module/ys/biz/service/CommonService.java
+2
-0
CommonServiceImpl.java
...os/boot/module/ys/biz/service/impl/CommonServiceImpl.java
+75
-0
logback-dev.xml
...mos-boot-module-ys-biz/src/main/resources/logback-dev.xml
+3
-3
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/SafetyProblemTracing.java
View file @
628216c8
...
...
@@ -36,7 +36,7 @@ public class SafetyProblemTracing extends BaseEntity {
private
String
problemType
;
/**
* 问题来源类型(1个人、2
设备、3企业
)
* 问题来源类型(1个人、2
企业、3设备
)
*/
@TableField
(
"source_type"
)
private
String
sourceType
;
...
...
@@ -204,7 +204,7 @@ public class SafetyProblemTracing extends BaseEntity {
private
String
problemTypeCode
;
/**
* 问题来源类型code(1个人、2
设备、3企业
)
* 问题来源类型code(1个人、2
企业、3设备
)
*/
@TableField
(
"source_type_code"
)
private
String
sourceTypeCode
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/logback-dev.xml
View file @
628216c8
...
...
@@ -20,9 +20,9 @@
</appender>
<!-- 控制台输出 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<
encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder
"
>
<pattern>
${LOG_PATTERN}
</pattern>
</
encoder
>
<
layout
class=
"ch.qos.logback.classic.PatternLayout
"
>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight(%-5level) --- %magenta([%thread]) %cyan([%-40.40logger{39},%method,%line]) : %msg%n
</pattern>
</
layout
>
</appender>
<!-- <!– ELK管理 –>-->
<!-- <appender name="ELK" class="net.logstash.logback.appender.LogstashTcpSocketAppender">-->
...
...
amos-boot-system-tzs/amos-boot-module-ys/amos-boot-module-ys-biz/pom.xml
View file @
628216c8
...
...
@@ -18,6 +18,11 @@
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-jg-api
</artifactId>
<version>
${amos-boot-biz.version}
</version>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-common-biz
</artifactId>
<version>
${amos-boot-biz.version}
</version>
</dependency>
...
...
amos-boot-system-tzs/amos-boot-module-ys/amos-boot-module-ys-biz/src/main/java/com/yeejoin/amos/boot/module/ys/biz/controller/CommonController.java
View file @
628216c8
...
...
@@ -37,4 +37,12 @@ public class CommonController extends BaseController {
@PathVariable
(
value
=
"componentType"
)
String
componentType
)
{
return
ResponseHelper
.
buildResponse
(
commonService
.
emergencySupportStatistics
(
businessType
,
componentType
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安全追溯-综合分析统计"
,
notes
=
"安全追溯-综合分析统计"
)
@RequestMapping
(
value
=
"/safetyTraceabilitySynthesis/{statisticalType}"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
<
Object
>
safetyTraceability
(
@PathVariable
(
value
=
"statisticalType"
)
String
statisticalType
)
{
return
ResponseHelper
.
buildResponse
(
commonService
.
safetyTraceabilitySynthesis
(
statisticalType
));
}
}
amos-boot-system-tzs/amos-boot-module-ys/amos-boot-module-ys-biz/src/main/java/com/yeejoin/amos/boot/module/ys/biz/service/CommonService.java
View file @
628216c8
...
...
@@ -4,4 +4,6 @@ public interface CommonService {
Object
emergencySupportStatistics
(
String
businessType
,
String
componentType
);
Object
safetyTraceabilitySynthesis
(
String
statisticalType
);
}
amos-boot-system-tzs/amos-boot-module-ys/amos-boot-module-ys-biz/src/main/java/com/yeejoin/amos/boot/module/ys/biz/service/impl/CommonServiceImpl.java
View file @
628216c8
...
...
@@ -5,12 +5,15 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormInstanceServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.api.entity.SafetyProblemTracing
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.SafetyProblemTracingMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ys.api.entity.YsEmergencyPlan
;
import
com.yeejoin.amos.boot.module.ys.api.entity.YsEmergencyRehearsal
;
import
com.yeejoin.amos.boot.module.ys.api.enums.MaintenanceExpiredEarlyWarningEnum
;
import
com.yeejoin.amos.boot.module.ys.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.ys.biz.service.CommonService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
...
...
@@ -66,6 +69,21 @@ public class CommonServiceImpl implements CommonService {
public
final
static
String
RICHTEXT_TEMPLATE
=
"{\"total\": %s,\"%s\": %s}"
;
/**
* 安全追溯-综合统计-严重违法 模板
*/
public
final
static
String
SERIOUS_VIOLATION_OF_LAW
=
"{\"seriesData\": [%s, %s, %s],\"axisData\": [\"红码警示企业数\", \"红码警示设备数\", \"红码警示人员数\"]}"
;
/**
* 安全追溯-综合统计-异常名录 模板
*/
public
final
static
String
EXCEPTION_DIRECTORY
=
"[{\"name\": \"问题企业数量\",\"value\": %s},{\"name\": \"非问题企业数量\",\"value\": %s}]"
;
/**
* 安全追溯-综合统计-信用监管 模板
*/
public
final
static
String
CREDIT_SUPERVISION
=
"[{\"name\": \"绿码\",\"value\": %s},{\"name\": \"红码\",\"value\": %s},{\"name\": \"橙码\",\"value\": %s},{\"name\": \"灰码\",\"value\": %s}]"
;
/**
* 应急保障四项统计使用 - 业务类型
*/
public
final
static
JSONObject
businessTypeJSON
=
new
JSONObject
();
...
...
@@ -83,6 +101,9 @@ public class CommonServiceImpl implements CommonService {
@Autowired
private
YsEmergencyPlanServiceImpl
ysEmergencyPlanService
;
@Autowired
private
SafetyProblemTracingMapper
safetyProblemTracingMapper
;
static
{
businessTypeJSON
.
fluentPut
(
"education"
,
"教育培训数"
).
fluentPut
(
"construct"
,
"体系建设数"
)
...
...
@@ -262,4 +283,57 @@ public class CommonServiceImpl implements CommonService {
}
return
null
;
}
/**
* 安全追溯-综合分析统计
* @param statisticalType 统计类型 creditSupervision(信用监管) 、 exceptionDirectory(异常名录)、seriousViolationOfLaw(严重违法)
* @return result
*/
@Override
public
Object
safetyTraceabilitySynthesis
(
String
statisticalType
)
{
// 严重违法 统计红码的企业、设备、人员数量
if
(
"seriousViolationOfLaw"
.
equals
(
statisticalType
))
{
// 红码警示企业数
long
comp
=
safetyProblemTracingMapper
.
selectCount
(
new
LambdaQueryWrapper
<
SafetyProblemTracing
>()
.
eq
(
SafetyProblemTracing:
:
getProblemStatusCode
,
0
)
.
eq
(
SafetyProblemTracing:
:
getSourceTypeCode
,
2
));
// 红码警示设备数
long
equ
=
safetyProblemTracingMapper
.
selectCount
(
new
LambdaQueryWrapper
<
SafetyProblemTracing
>()
.
eq
(
SafetyProblemTracing:
:
getProblemStatusCode
,
0
)
.
eq
(
SafetyProblemTracing:
:
getSourceTypeCode
,
3
));
// 红码警示人员数
long
peo
=
safetyProblemTracingMapper
.
selectCount
(
new
LambdaQueryWrapper
<
SafetyProblemTracing
>()
.
eq
(
SafetyProblemTracing:
:
getProblemStatusCode
,
0
)
.
eq
(
SafetyProblemTracing:
:
getSourceTypeCode
,
1
));
return
JSONObject
.
parseObject
(
String
.
format
(
SERIOUS_VIOLATION_OF_LAW
,
comp
,
equ
,
peo
));
}
// 异常名录 统计企业主体问题数量
if
(
"exceptionDirectory"
.
equals
(
statisticalType
))
{
// 问题企业数量
long
comp
=
safetyProblemTracingMapper
.
selectList
(
new
LambdaQueryWrapper
<
SafetyProblemTracing
>()
.
eq
(
SafetyProblemTracing:
:
getProblemStatusCode
,
0
)
.
eq
(
SafetyProblemTracing:
:
getSourceTypeCode
,
2
)
.
groupBy
(
SafetyProblemTracing:
:
getPrincipalUnitCode
))
.
size
();
// 非问题企业数量 (企业总数-问题企业数量)
long
total
=
Privilege
.
companyClient
.
queryForCompanyList
(
null
,
null
).
getResult
().
size
();
long
other
=
(
long
)
NumberUtil
.
sub
(
total
,
comp
);
return
JSONArray
.
parseArray
(
String
.
format
(
EXCEPTION_DIRECTORY
,
comp
,
other
));
}
// 信用监管 统计绿、红、橙、灰码数量及占比
if
(
"creditSupervision"
.
equals
(
statisticalType
))
{
// 绿码
long
greenCode
=
safetyProblemTracingMapper
.
selectCount
(
new
LambdaQueryWrapper
<
SafetyProblemTracing
>()
.
eq
(
SafetyProblemTracing:
:
getProblemStatusCode
,
1
));
// 红码
long
redCode
=
safetyProblemTracingMapper
.
selectCount
(
new
LambdaQueryWrapper
<
SafetyProblemTracing
>()
.
eq
(
SafetyProblemTracing:
:
getProblemStatusCode
,
0
));
// 橙码
long
orangeCode
=
0L
;
// 灰码
long
grayCode
=
0L
;
return
JSONArray
.
parseArray
(
String
.
format
(
CREDIT_SUPERVISION
,
greenCode
,
redCode
,
orangeCode
,
grayCode
));
}
return
null
;
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-ys/amos-boot-module-ys-biz/src/main/resources/logback-dev.xml
View file @
628216c8
...
...
@@ -20,9 +20,9 @@
</appender>
<!-- 控制台输出 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<
encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder
"
>
<pattern>
${LOG_PATTERN}
</pattern>
</
encoder
>
<
layout
class=
"ch.qos.logback.classic.PatternLayout
"
>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight(%-5level) --- %magenta([%thread]) %cyan([%-40.40logger{39},%method,%line]) : %msg%n
</pattern>
</
layout
>
</appender>
<!-- <!– ELK管理 –>-->
<!-- <appender name="ELK" class="net.logstash.logback.appender.LogstashTcpSocketAppender">-->
...
...
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