Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
zlmy-cloud
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
zlmy
zlmy-cloud
Commits
f2b6120b
Commit
f2b6120b
authored
Jan 09, 2026
by
鲁鸿波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
事故详情统计开发
parent
547c69c6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
388 additions
and
0 deletions
+388
-0
上线说明.md
zlmy-modules/zlmy-boot/doc/国产化/上线说明.md
+0
-0
AccidentReportController.java
.../module/accident/controller/AccidentReportController.java
+21
-0
AccidentReportDao.java
...ava/com/testor/module/accident/dao/AccidentReportDao.java
+12
-0
AccidentReport.java
...m/testor/module/accident/model/domain/AccidentReport.java
+42
-0
AccidentReportDetail.java
...estor/module/accident/model/dto/AccidentReportDetail.java
+123
-0
AccidentReportService.java
...testor/module/accident/service/AccidentReportService.java
+18
-0
AccidentReportServiceImpl.java
...dule/accident/service/impl/AccidentReportServiceImpl.java
+30
-0
ReportDetailParam.java
...com/testor/module/hazard/model/dto/ReportDetailParam.java
+31
-0
AccidentReport.xml
...oot/src/main/resources/mapper/accident/AccidentReport.xml
+111
-0
No files found.
zlmy-modules/zlmy-boot/doc/国产化/上线说明.md
View file @
f2b6120b
This diff is collapsed.
Click to expand it.
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/accident/controller/AccidentReportController.java
View file @
f2b6120b
...
...
@@ -14,10 +14,16 @@ import com.testor.common.model.UpdateProcessStatusReq;
import
com.testor.common.util.EnumUtil
;
import
com.testor.module.accident.model.domain.AccidentReport
;
import
com.testor.module.accident.model.dto.AccidentReportDelParam
;
import
com.testor.module.accident.model.dto.AccidentReportDetail
;
import
com.testor.module.accident.model.req.*
;
import
com.testor.module.accident.model.resp.*
;
import
com.testor.module.accident.model.vo.AccidentReportVO
;
import
com.testor.module.accident.service.AccidentReportService
;
import
com.testor.module.hazard.model.dto.ReportDetailParam
;
import
com.testor.module.hazard.model.dto.THazardWorkPlanCheckParam
;
import
com.testor.module.hazard.model.dto.THazardWorkPlanDTO
;
import
com.testor.module.hazard.model.dto.THazardWorkPlanParam
;
import
com.testor.module.hazard.model.vo.HazardWorkPlanCheckProblemCountStatisticsVO
;
import
com.tongtech.tfw.backend.common.biz.constants.BizConstants
;
import
com.tongtech.tfw.backend.common.biz.models.BaseResponse
;
import
com.tongtech.tfw.backend.common.biz.models.BaseResponseList
;
...
...
@@ -291,4 +297,19 @@ public class AccidentReportController extends SuperController {
baseResponse
.
setData
(
pieByTypeList
);
return
baseResponse
;
}
@ApiOperation
(
value
=
"查询事故信息详情"
)
@GetMapping
(
value
=
"/selectAccidentReportDetail"
)
public
BaseResponse
<
BaseResponseList
<
AccidentReportDetail
>>
AccidentReportDetail
(
ReportDetailParam
reportDetailParam
){
BaseResponse
<
BaseResponseList
<
AccidentReportDetail
>>
baseResponse
=
new
BaseResponse
<>();
reportDetailParam
.
setUserId
(
getUserId
());
Page
<
AccidentReportDetail
>
resultList
=
accidentReportService
.
selectAccidentReportDetail
(
reportDetailParam
);
BaseResponseList
<
AccidentReportDetail
>
baseResponseList
=
new
BaseResponseList
<>();
baseResponseList
.
setData
(
resultList
.
getRecords
());
baseResponseList
.
setTotal
(
resultList
.
getTotal
());
baseResponse
.
setData
(
baseResponseList
);
return
baseResponse
;
}
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/accident/dao/AccidentReportDao.java
View file @
f2b6120b
package
com
.
testor
.
module
.
accident
.
dao
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.testor.module.accident.model.domain.AccidentReport
;
import
com.testor.module.accident.model.dto.AccidentReportDetail
;
import
com.testor.module.accident.model.req.AccidentReportExportReq
;
import
com.testor.module.hazard.model.dto.ReportDetailParam
;
import
com.tongtech.tfw.backend.common.models.supers.SuperDao
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -27,4 +31,12 @@ public interface AccidentReportDao extends SuperDao<AccidentReport> {
* @date 4/11/23 5:02 PM
*/
List
<
AccidentReport
>
findExportlist
(
@Param
(
"qwe"
)
AccidentReportExportReq
accidentReportQueryReq
);
/**
* 查询事故信息详情
* @param page
* @param param
* @return
*/
Page
<
AccidentReportDetail
>
selectAccidentReportDetail
(
@Param
(
"page"
)
IPage
page
,
@Param
(
"param"
)
ReportDetailParam
param
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/accident/model/domain/AccidentReport.java
View file @
f2b6120b
...
...
@@ -189,6 +189,48 @@ public class AccidentReport extends SuperModel {
@TableField
(
"reject_opinion"
)
private
String
rejectOpinion
;
/**
* 事故等级(国家)(字典:accident_level_country)
*/
@ApiModelProperty
(
value
=
"事故等级(国家)(字典:accident_level_country)"
)
@TableField
(
"t_accident_report"
)
private
String
tAccidentReport
;
/**
* 事人员追责问责情况
*/
@ApiModelProperty
(
value
=
"人员追责问责情况"
)
@TableField
(
"personnel_accountability_status"
)
private
String
personnelAccountabilityStatus
;
/**
* 损失工作日
*/
@ApiModelProperty
(
value
=
"损失工作日"
)
@TableField
(
"lost_working_days"
)
private
String
lostWorkingDays
;
/**
* 涉及集团八大类风险(字典:group_risk)
*/
@ApiModelProperty
(
value
=
"涉及集团八大类风险(字典:group_risk)"
)
@TableField
(
"group_risk"
)
private
String
groupRisk
;
/**
* 涉及危险作业类型(字典:dangerous_homework_category)
*/
@ApiModelProperty
(
value
=
"涉及危险作业类型(字典:dangerous_homework_category)"
)
@TableField
(
"dangerous_homework_category"
)
private
String
dangerousHomeworkCategory
;
/**
* 受伤部位(字典:injured_area)
*/
@ApiModelProperty
(
value
=
"受伤部位(字典:injured_area)"
)
@TableField
(
"injured_area"
)
private
String
injuredArea
;
/**
* 创建人部门id
*/
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/accident/model/dto/AccidentReportDetail.java
0 → 100644
View file @
f2b6120b
package
com
.
testor
.
module
.
accident
.
model
.
dto
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.testor.module.accident.model.domain.AccidentPersonnel
;
import
com.testor.module.accident.model.domain.AccidentReport
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
* 事故统计详情表
*/
@Data
public
class
AccidentReportDetail
{
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"当前机构名称"
)
private
String
currentOrgName
;
@ApiModelProperty
(
value
=
"经营部名称"
)
private
String
businessDeptName
;
@ApiModelProperty
(
value
=
"大区名称"
)
private
String
regionName
;
/**
* 事故发生时间
*/
@ApiModelProperty
(
value
=
"事故发生时间"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
accidentTime
;
/**
* 事故等级(国家)(字典:accident_level_country)
*/
@ApiModelProperty
(
value
=
"事故等级(国家)(字典:accident_level_country)"
)
private
String
accidentLevelCountry
;
@ApiModelProperty
(
value
=
"事故等级(集团)"
)
private
String
accidentLevel
;
@ApiModelProperty
(
value
=
"受伤人数"
)
private
Integer
reportCount
;
/**
* 直接经济损失
*/
@ApiModelProperty
(
value
=
"直接经济损失"
)
private
BigDecimal
directEconomicLoss
;
/**
* 损失工作日
*/
@ApiModelProperty
(
value
=
"损失工作日"
)
@TableField
(
"lost_working_days"
)
private
String
lostWorkingDays
;
/**
* 人员信息
*/
@ApiModelProperty
(
value
=
"人员信息"
)
private
List
<
AccidentPersonnel
>
accidentPersonnelList
;
@ApiModelProperty
(
value
=
"事故类型"
)
private
String
accidentType
;
/**
* 涉及集团八大类风险(多选 字典:group_risk)
*/
@ApiModelProperty
(
value
=
"多选 涉及集团八大类风险(字典:group_risk)"
)
private
String
groupRiskDetail
;
/**
* 涉及危险作业类型(多选 字典:dangerous_homework_category)
*/
@ApiModelProperty
(
value
=
"多选 涉及危险作业类型(字典:dangerous_homework_category)"
)
private
String
dangerousHomeworkCategoryDetail
;
/**
* 受伤部位(多选 字典:injured_area)
*/
@ApiModelProperty
(
value
=
"多选 受伤部位(字典:injured_area)"
)
private
String
injuredAreaDetail
;
/**
* 事故详细经过
*/
@ApiModelProperty
(
value
=
"事故详细经过"
)
private
String
accidentPassed
;
/**
* 事故直接原因和间接原因
*/
@ApiModelProperty
(
value
=
"事故直接原因和间接原因"
)
private
String
accidentCause
;
/**
* 改善措施
*/
@ApiModelProperty
(
value
=
"改善措施"
)
private
String
improvements
;
/**
* 事故人员追责问责情况
*/
@ApiModelProperty
(
value
=
"人员追责问责情况"
)
private
String
personnelAccountabilityStatus
;
/**
* 备注
*/
@ApiModelProperty
(
value
=
"备注"
)
private
String
remarks
;
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/accident/service/AccidentReportService.java
View file @
f2b6120b
...
...
@@ -2,8 +2,11 @@ package com.testor.module.accident.service;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.testor.common.model.UpdateProcessStatusReq
;
import
com.testor.module.accident.model.domain.AccidentReport
;
import
com.testor.module.accident.model.dto.AccidentReportDetail
;
import
com.testor.module.accident.model.excel.AccidentExport
;
import
com.testor.module.accident.model.req.*
;
import
com.testor.module.accident.model.resp.AccidentReportEditResp
;
...
...
@@ -11,7 +14,9 @@ import com.testor.module.accident.model.resp.AccidentReportInsResp;
import
com.testor.module.accident.model.resp.AccidentStatisticsResp
;
import
com.testor.module.accident.model.resp.ReportUnitResp
;
import
com.testor.module.accident.model.vo.AccidentReportVO
;
import
com.testor.module.hazard.model.dto.ReportDetailParam
;
import
com.tongtech.tfw.backend.common.models.supers.SuperService
;
import
org.apache.ibatis.annotations.Param
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -126,4 +131,17 @@ public interface AccidentReportService extends SuperService<AccidentReport> {
* @date 4/11/23 9:48 AM
*/
void
exports
(
HttpServletResponse
response
,
HttpServletRequest
request
,
AccidentReportExportReq
accidentReportExportReq
);
@Override
default
<
E
extends
IPage
<
AccidentReport
>>
E
page
(
E
page
)
{
return
SuperService
.
super
.
page
(
page
);
}
/**
* 查询事故信息详情
* @param param
* @return
*/
Page
<
AccidentReportDetail
>
selectAccidentReportDetail
(
ReportDetailParam
param
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/accident/service/impl/AccidentReportServiceImpl.java
View file @
f2b6120b
...
...
@@ -6,6 +6,8 @@ import com.alibaba.excel.ExcelWriter;
import
com.alibaba.excel.write.metadata.WriteSheet
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.testor.biz.rule.service.SysRuleService
;
import
com.testor.biz.sys.dict.data.model.domain.SysDictData
;
import
com.testor.biz.sys.dict.data.service.SysDictDataService
;
...
...
@@ -25,6 +27,7 @@ import com.testor.module.accident.dao.AccidentReportDao;
import
com.testor.module.accident.manager.AccidentPersonnelManager
;
import
com.testor.module.accident.model.domain.AccidentPersonnel
;
import
com.testor.module.accident.model.domain.AccidentReport
;
import
com.testor.module.accident.model.dto.AccidentReportDetail
;
import
com.testor.module.accident.model.excel.AccidentExport
;
import
com.testor.module.accident.model.excel.AccidentExportVO
;
import
com.testor.module.accident.model.req.*
;
...
...
@@ -32,6 +35,8 @@ import com.testor.module.accident.model.resp.*;
import
com.testor.module.accident.model.vo.AccidentPersonnelVO
;
import
com.testor.module.accident.model.vo.AccidentReportVO
;
import
com.testor.module.accident.service.AccidentReportService
;
import
com.testor.module.hazard.model.domain.THazardWorkPlan
;
import
com.testor.module.hazard.model.dto.ReportDetailParam
;
import
com.testor.module.video.util.AutoHeadColumnWidthStyleStrategy
;
import
com.testor.module.video.util.Beans
;
import
com.tongtech.tfw.backend.common.biz.constants.BizConstants
;
...
...
@@ -887,6 +892,31 @@ public class AccidentReportServiceImpl extends SuperServiceImpl<AccidentReportDa
}
@Override
public
Page
<
AccidentReportDetail
>
selectAccidentReportDetail
(
ReportDetailParam
param
)
{
Long
page
=
StringHelper
.
isEmpty
(
param
.
getPage
())
?
BizConstants
.
PAGE
:
Long
.
valueOf
(
param
.
getPage
());
Long
limit
=
StringHelper
.
isEmpty
(
param
.
getLimit
())
?
BizConstants
.
LIMIT
:
Long
.
valueOf
(
param
.
getLimit
());
Page
<
THazardWorkPlan
>
resultPage
=
new
Page
<>(
page
,
limit
);
if
(
StringUtils
.
isEmpty
(
param
.
getOrgId
())){
SysUser
user
=
sysUserService
.
getById
(
param
.
getUserId
());
if
(
user
!=
null
){
param
.
setOrgId
(
user
.
getOrgId
());
}
}
Page
<
AccidentReportDetail
>
accidentReportDetailPage
=
accidentReportDao
.
selectAccidentReportDetail
(
resultPage
,
param
);
accidentReportDetailPage
.
getRecords
().
forEach
(
c
->{
if
(
c
.
getReportCount
()>
0
){
c
.
setAccidentPersonnelList
(
accidentPersonnelManager
.
list
(
new
QueryWrapper
<
AccidentPersonnel
>().
eq
(
AccidentPersonnel
.
REF_ID
,
c
.
getId
())));
}
});
return
accidentReportDetailPage
;
}
/**
* 列表查询条件及查询参数
*/
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/model/dto/ReportDetailParam.java
0 → 100644
View file @
f2b6120b
package
com
.
testor
.
module
.
hazard
.
model
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.apache.ibatis.annotations.Param
;
@Data
@ApiModel
(
value
=
"ReportDetailParam 事故详情参数"
)
public
class
ReportDetailParam
{
@ApiModelProperty
(
value
=
"每页数量"
)
private
String
limit
;
@ApiModelProperty
(
value
=
"当前页数"
)
private
String
page
;
@ApiModelProperty
(
value
=
"组织id"
)
private
String
orgId
;
@ApiModelProperty
(
value
=
"开始时间"
)
private
String
startTime
;
@ApiModelProperty
(
value
=
"结束时间"
)
private
String
endTime
;
@ApiModelProperty
(
value
=
"用户id"
)
private
String
userId
;
}
zlmy-modules/zlmy-boot/src/main/resources/mapper/accident/AccidentReport.xml
View file @
f2b6120b
...
...
@@ -21,6 +21,12 @@
<id
column=
"accident_cause"
property=
"accidentCause"
/>
<id
column=
"improvements"
property=
"improvements"
/>
<id
column=
"attachment"
property=
"attachment"
/>
<id
column=
"t_accident_report"
property=
"tAccidentReport"
/>
<id
column=
"personnel_accountability_status"
property=
"personnelAccountabilityStatus"
/>
<id
column=
"lost_working_days"
property=
"lostWorkingDays"
/>
<id
column=
"group_risk"
property=
"groupRisk"
/>
<id
column=
"dangerous_homework_category"
property=
"dangerousHomeworkCategory"
/>
<id
column=
"injured_area"
property=
"injuredArea"
/>
</resultMap>
<!--<select id="getCountByAccidentTime" parameterType="com.testor.module.accident.model.domain.AccidentReport" resultType="string">-->
...
...
@@ -147,7 +153,112 @@
</if>
and status='0'
</where>
</select>
<select
id=
"selectAccidentReportDetail"
resultType=
"com.testor.module.accident.model.dto.AccidentReportDetail"
>
SELECT
CASE
WHEN tar.accident_type IS NULL OR tar.accident_type = '' THEN NULL
ELSE (
SELECT STRING_AGG(type_dict.dict_value, ',')
FROM (
SELECT DISTINCT UNNEST(STRING_TO_ARRAY(tar.accident_type, ',')) as type_key
) AS types
LEFT JOIN t_sys_dict_data type_dict
ON type_dict.dict_key = types.type_key
AND type_dict.dict_id = '45f23cfa2ff1415ea45d857aa249f66c'
)
END as accidentType,
sdd2.dict_value as accidentLevel,
CASE
WHEN tar.accident_cause IS NULL OR tar.accident_cause = '' THEN NULL
ELSE (
SELECT STRING_AGG(cause_dict.dict_value, ',')
FROM (
SELECT DISTINCT UNNEST(STRING_TO_ARRAY(tar.accident_cause, ',')) as cause_key
) AS causes
LEFT JOIN t_sys_dict_data cause_dict
ON cause_dict.dict_key = causes.cause_key
AND cause_dict.dict_id = '5ed4476803994013b0ee319f479f199f'
)
END as accidentCauseDetail,
CASE
WHEN tar.dangerous_homework_category IS NULL OR tar.dangerous_homework_category = '' THEN NULL
ELSE (
SELECT STRING_AGG(dangerous_dict.dict_value, ',')
FROM (
SELECT DISTINCT UNNEST(STRING_TO_ARRAY(tar.dangerous_homework_category, ',')) as dangerous_key
) AS dangerous_categories
LEFT JOIN t_sys_dict_data dangerous_dict
ON dangerous_dict.dict_key = dangerous_categories.dangerous_key
AND dangerous_dict.dict_id = '4'
)
END as dangerousHomeworkCategoryDetail,
CASE
WHEN tar.group_risk IS NULL OR tar.group_risk = '' THEN NULL
ELSE (
SELECT STRING_AGG(risk_dict.dict_value, ',')
FROM (
SELECT DISTINCT UNNEST(STRING_TO_ARRAY(tar.group_risk, ',')) as risk_key
) AS risks
LEFT JOIN t_sys_dict_data risk_dict
ON risk_dict.dict_key = risks.risk_key
AND risk_dict.dict_id = '3'
)
END as groupRiskDetail,
CASE
WHEN tar.injured_area IS NULL OR tar.injured_area = '' THEN NULL
ELSE (
SELECT STRING_AGG(area_dict.dict_value, ',')
FROM (
SELECT DISTINCT UNNEST(STRING_TO_ARRAY(tar.injured_area, ',')) as area_key
) AS areas
LEFT JOIN t_sys_dict_data area_dict
ON area_dict.dict_key = areas.area_key
AND area_dict.dict_id = '5'
)
END as injuredArea,
sdd_country.dict_value as accidentLevelCountryDetail,
so.org_name as currentOrgName,
bd.org_name as businessDeptName,
rg.org_name as regionName,
regionalCompany.org_name as regionalCompanyName,
COALESCE(
(SELECT COUNT(1) FROM t_accident_personnel WHERE ref_id = tar.id AND status = '0'),
0
) as reportCount,
tar.*
FROM t_accident_report tar
LEFT JOIN t_sys_dict_data sdd2 ON tar.accident_level = sdd2.dict_key
AND sdd2.dict_id = 'cd94e04e8ddd4a078dfaf2b5d784c798'
LEFT JOIN t_sys_dict_data sdd_country ON tar.accident_level_country = sdd_country.dict_key
AND sdd_country.dict_id = '2'
LEFT JOIN t_sys_org so ON tar.basic_unit_id = so.org_id
LEFT JOIN t_sys_org bd ON so.parent_id = bd.org_id
LEFT JOIN t_sys_org bd2 ON so.parent_id = bd2.org_id
LEFT JOIN t_sys_org rg ON bd2.parent_id = rg.org_id
LEFT JOIN t_sys_org regionalCompany ON regionalCompany.org_id = tar.regional_company_id
WHERE tar.status = '0'
<if
test=
"param.startTime != null and param.startTime != '' and param.endTime != null and param.endTime != ''"
>
AND tar.accident_time BETWEEN #{param.startTime} AND #{param.endTime}
</if>
<if
test=
"param.orgId != null and param.orgId != ''"
>
AND (
tar.org_id = #{param.orgId}
OR so.parent_ids LIKE concat('%', #{param.orgId}, '%')
)
</if>
ORDER BY bd2.org_id, bd.org_id, so.org_id
</select>
...
...
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