初始提交

master
fangjiakai 2025-11-07 15:30:34 +08:00
commit 21a7364a36
64 changed files with 2617 additions and 0 deletions

38
.gitignore vendored Normal file
View File

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM jjb-registry-registry.cn-hangzhou.cr.aliyuncs.com/pub/jdk:1.8.0_202
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY ./start/target/start.jar /opt/app.jar
ENTRYPOINT ["java", "-jar", "/opt/app.jar"]

81
pom.xml Normal file
View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-parent</artifactId>
<version>2.2.0-SNAPSHOT</version>
</parent>
<groupId>com.zcloud.accident</groupId>
<artifactId>zcloud-gbs-accident</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>zcloud-gbs-accident</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.zcloud.gbscommon</groupId>
<artifactId>zcloud_gbscommon</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<!--Project modules-->
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-adapter</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-app</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-domain</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-infrastructure</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<!-- 统一管理插件版本 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.6</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>3.4.1</version>
</plugin>
</plugins>
</build>
<modules>
<module>web-client</module>
<module>web-adapter</module>
<module>web-app</module>
<module>web-domain</module>
<module>web-infrastructure</module>
<module>start</module>
</modules>
</project>

54
start/pom.xml Normal file
View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zcloud.accident</groupId>
<artifactId>zcloud-gbs-accident</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>start</artifactId>
<packaging>jar</packaging>
<name>start</name>
<dependencies>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-adapter</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-gateway-starter</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-framework-web</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.zcloud.accident.Application</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,18 @@
package com.zcloud.accident;
import com.jjb.saas.base.starter.bootstart.JJBSpringbootApplication;
import org.springframework.boot.SpringApplication;
/**
* Spring Boot Starter
*/
@JJBSpringbootApplication(
scanBasePackages = {"com.zcloud", "com.jjb"},
mapperPackages = {"com.zcloud.accident.persistence.mapper"}
)
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

View File

@ -0,0 +1,6 @@
spring:
config:
import:
- classpath:nacos.yml
- classpath:sdk.yml
- classpath:swagger.yml

View File

@ -0,0 +1,38 @@
nacos:
url: 192.168.20.100:30290
namespace: jjb-dragon
application:
name: zcloud-gbs-accident
version:
gateway: accident
cn-name: 事故事件中心
spring:
application:
name: ${application.name}${application.version}
profiles:
# 环境配置
active: test
cloud:
nacos:
config:
namespace: ${nacos.namespace}
server-addr: ${nacos.url}
file-extension: yml
shared-configs:
- config-common.yml
- config-port.yml
- config-mq.yml
- config-log.yml
- config-sdk-server.yml
- config-actuator.yml
- config-job.yml
- config-mysql.yml
- config-redis.yml
- config-cache.yml
- config-spring.yml
- config-mybatis.yml
- config-sdk.yml
- config-flyway.yml
discovery:
server-addr: ${spring.cloud.nacos.config.server-addr}
namespace: ${spring.cloud.nacos.config.namespace}

View File

@ -0,0 +1,36 @@
management:
endpoints:
web:
base-path: /${application.gateway}${application.version}/actuator
enabled-by-default: true
endpoint:
health:
enabled: true
info:
enabled: false
auditevents:
enabled: false
metrics:
enabled: false
loggers:
enabled: false
logfile:
enabled: false
httptrace:
enabled: false
env:
enabled: false
flyway:
enabled: false
liquidbase:
enabled: false
shutdown:
enabled: false
mappings:
enabled: false
scheduledtasks:
enabled: false
threaddump:
enabled: false
heapdump:
enabled: false

View File

@ -0,0 +1,39 @@
spring:
cache:
redis:
time-to-live: 1800s
# 二级缓存配置
# 注caffeine 不适用于数据量大,并且缓存命中率极低的业务场景,如用户维度的缓存。请慎重选择。
l2cache:
config:
# 是否存储空值默认true防止缓存穿透
allowNullValues: true
# 组合缓存配置
composite:
# 是否全部启用一级缓存默认false
l1AllOpen: false
# 一级缓存
caffeine:
# 是否自动刷新过期缓存 true 是 false 否
autoRefreshExpireCache: false
# 缓存刷新调度线程池的大小
refreshPoolSize: 2
# 缓存刷新的频率(秒)
refreshPeriod: 10
# 写入后过期时间(秒)
expireAfterWrite: 180
# 访问后过期时间(秒)
expireAfterAccess: 180
# 初始化大小
initialCapacity: 1
# 最大缓存对象个数,超过此数量时之前放入的缓存将失效
maximumSize: 3
# 二级缓存
redis:
# 全局过期时间,单位毫秒,默认不过期
defaultExpiration: 1800000
# 缓存更新时通知其他节点的topic名称 默认 cache:redis:caffeine:topic
topic: cache:redis:caffeine:topic

View File

@ -0,0 +1,44 @@
common:
mysql:
host: 192.168.2.166
port: 3306
username: root
password: root
redis:
host: 10.43.253.4
password: jjb123456
port: 6379
mq:
host: 10.43.163.23:9876
xxl-job:
address: http://10.43.98.135:8080/xxl-job-admin/
username: admin
password: jjb123456
gateway:
network:
http:
#网关的外网访问地址 必须配置为HTTPS协议
external: https://testdragon.cqjjb.cn
#网关的内网访问地址 固定配置为http://jjb-saas-gateway
intranet: http://10.43.250.65
wx:
#webSocket外网地址
external: wx://testdragon.cqjjb.cn
swagger:
#是否打开swagger 测试及UAT配置为true,生产环境配置为false
enabled: true
base:
# base应用访问外网访问地址
host-url: http://10.43.12.158
desk:
# desk工程的外网地址
host-url: http://10.43.12.158
login:
# login工程的外网访问地址
host-url: http://10.43.12.158
#所有的前端域名配置 避免iframe跨域
x-frame-options: ${common.desk.host-url}/ ${common.login.host-url}/ ${common.base.host-url}/ ${common.gateway.network.http.external}/ http://10.43.250.65/
k8s:
namespace: test-dragon

View File

@ -0,0 +1,8 @@
# JOB 配置
xxl-job:
admin:
address: ${common.xxl-job.address}
username: ${common.xxl-job.username}
password: ${common.xxl-job.password}
executor:
app-name: ${spring.application.name}

View File

@ -0,0 +1,11 @@
common:
log:
jjb-saas-system:
- com.jjb:info
jjb-saas-auth1:
- com.jjb:info
jjb-saas-user:
- com.jjb:info
gray:
log:
host: 192.168.1.1

View File

@ -0,0 +1,21 @@
mq:
topic: springcloudStream-jjb-dragon-test
server: ${common.mq.host}
spring:
cloud:
stream:
bindings:
input:
destination: springcloudStream-jjb-dragon-test
group: ${spring.application.name}-${spring.profiles.active}
output:
destination: springcloudStream-jjb-dragon-test
group: ${spring.application.name}-${spring.profiles.active}
rocketmq:
binder:
name-server: ${common.mq.host}
group: ${spring.application.name}-${spring.profiles.active}
bindings:
input:
consumer:
tags: a

View File

@ -0,0 +1,11 @@
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml,classpath*:mapper/**/*Mapper.xml
type-handlers-package: com.jjb.saas.framework.datascope.handler
global-config:
banner: false
db-config:
id-type: assign_id
logic-delete-value: 1
logic-not-delete-value: 0
configuration:
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl

View File

@ -0,0 +1,79 @@
mysql:
db: ${spring.application.name}
spring:
shardingsphere:
druid:
username: admin
password: jjb123456
allows:
denys:
props:
sql:
show: true
enabled: true
masterslave:
name: ms # 名字,任意,需要保证唯一
master-data-source-name: master # 主库数据源
slave-data-source-names: slave-1 # 从库数据源
datasource:
names: master,slave-1
master:
#url: jdbc:mysql://10.43.123.226:3306/${spring.application.name}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://${common.mysql.host}:${common.mysql.port}/${mysql.db}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: ${common.mysql.username}
password: ${common.mysql.password}
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
initial-size: 6
min-idle: 4
maxActive: 40
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
#Oracle需要打开注释
#validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters去掉后监控界面sql无法统计'wall'用于防火墙
filters: slf4j
# 通过connectProperties属性来打开mergeSql功能慢SQL记录
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
wall:
multi-statement-allow: true
slave-1:
# url: jdbc:mysql://10.43.123.226:3306/${spring.application.name}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://${common.mysql.host}:${common.mysql.port}/${mysql.db}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: ${common.mysql.username}
password: ${common.mysql.password}
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
initial-size: 6
min-idle: 4
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
#Oracle需要打开注释
#validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters去掉后监控界面sql无法统计'wall'用于防火墙,stat已去掉
filters: slf4j
# 通过connectProperties属性来打开mergeSql功能慢SQL记录
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
wall:
multi-statement-allow: true

View File

@ -0,0 +1,3 @@
server:
port: 80
debug: true

View File

@ -0,0 +1,14 @@
spring:
redis:
host: ${common.redis.host}
password: ${common.redis.password}
port: ${common.redis.port}
timeout: 15000
database: 0
prefix: dragon
jedis:
pool:
max-active: 600
max-idle: 300
max-wait: 15000
min-idle: 10

View File

@ -0,0 +1,19 @@
sdk:
server:
symmetry-url: jjb-saas-application/application/applications/server/secure/
app-key: jjb-saas-dragon
client:
security:
gateway: ${gateway.network.http.external}
appKey: ${sdk.client.app-key}
desensitization:
symmetric-key: 1234567887654321
logging:
gateway: ${sdk.client.security.gateway}
appKey: ${sdk.client.security.app-key}
clientLoggingEnable: true
level: debug
username: user
password: 123456
showConsoleLog: true
formatConsoleLogJson: true

View File

@ -0,0 +1,89 @@
spring:
zipkin:
#zipkin服务所在地址
base-url: http://jjb-saas-zipkin/
sender:
type: web #使用http的方式传输数据
#配置采样百分比
sleuth:
sampler:
probability: 1 # 将采样比例设置为 1.0也就是全部都需要。默认是0.1也就是10%一般情况下10%就够用了
web:
resources:
cache:
cachecontrol:
no-store: false
max-age: 10000
no-cache: false
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
main:
allow-bean-definition-overriding: true
mvc:
pathmatch:
matching-strategy: ant_path_matcher
messages:
basename: i18n.message
encoding: UTF-8
flyway:
# 是否启用flyway
enabled: true
# 编码格式默认UTF-8
encoding: UTF-8
# 迁移sql脚本文件存放路径默认db/migration
locations: classpath:db/migration
# 迁移sql脚本文件名称的前缀默认V
sql-migration-prefix: V
# 迁移sql脚本文件名称的分隔符默认2个下划线__
sql-migration-separator: __
# 迁移sql脚本文件名称的后缀
sql-migration-suffixes: .sql
# 迁移时是否进行校验默认true
validate-on-migrate: true
# 当迁移发现数据库非空且存在没有元数据的表时自动执行基准迁移新建schema_version表
baseline-on-migrate: true
server:
tomcat:
max-http-post-size: 200MB
connection-timeout: 180000
fastjson:
parser:
safeMode: true
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
thymeleaf:
prefix: classpath:/templates/
cache: false
dubbo:
application:
name: ${spring.application.name}
registry:
timeout: 20000
address: nacos://${spring.cloud.nacos.config.server-addr}?namespace=${spring.cloud.nacos.config.namespace}-facade
check: false
filter: providerContextFilter
protocol:
port: -1
name: dubbo
consumer:
timeout: 20000
check: false
filter: consumerContextFilter
logging:
config: classpath:jjb-saas-logback-spring.xml
level:
com.alibaba.nacos.client.naming: OFF
com.alibaba.nacos.client.config.impl: OFF
com.alibaba.nacos.common.remote.client: OFF
datapermssion:
tenantcondition:
defaultversion: NEWERSION
easy-retry:
server:
host: http://jjb-saas-config
port: 1788

View File

@ -0,0 +1,18 @@
sdk:
client:
app-key: e6ab3c9abda747b39d7cc12b6dc0f5a0
gateway:
url: ${common.gateway.network.http.intranet}
swagger:
enabled: ${common.swagger.enabled}
title: 例子
description: 这是例子项目
version: ${application.version}
group-name: 例子
springfox:
documentation:
swagger-ui:
base-url: ${application.gateway}
swagger:
v2:
path: /${application.gateway}/v2/api-docs

View File

@ -0,0 +1,51 @@
sdk:
server:
app-key: 722091ff53dd4abba078c2a00efd4a42
client:
gateway:
url: ${common.gateway.network.http.external}
route:
- client:
system-code: ${application.name}
name: ${application.cn-name}-后端
group-code: public_api
service:
system-code: ${application.name}
name: ${application.cn-name}-后端
group-code: public_api
strip-prefix: 0
uri: lb://${application.name}
path: /${application.gateway}/**
- client:
system-code: ${application.name}-container
name: ${application.cn-name}-前端
group-code: public_api
service:
system-code: ${application.name}-container
name: ${application.cn-name}-前端
group-code: public_api
strip-prefix: 0
uri: lb://jjb-saas-base
path: /${application.gateway}/container/**
order: -2
openapi:
appId: 1871106785124999168
appKey: 7314ecfc11ff4d5fad1ac19284ed2ac3
appSecret: 7565ab15-a2ae-4830-9b4d-fb382cd5fb30
appPublicKey: 3059301306072a8648ce3d020106082a811ccf5501822d03420004f339671110a06681fcfd968ad9247bd3cd0d2ec6b2159d1d4b775e7ed5566b3297d82cf14b626ef11fdd6bc7ecb6bcfb3ea94ccd1f381f4116f43367be4b360f
appPrivateKey: 308193020100301306072a8648ce3d020106082a811ccf5501822d0479307702010104206b6abc8e717b7d042f1e8531190a7c18113e4a701417f2770d2150d33ba97779a00a06082a811ccf5501822da14403420004f339671110a06681fcfd968ad9247bd3cd0d2ec6b2159d1d4b775e7ed5566b3297d82cf14b626ef11fdd6bc7ecb6bcfb3ea94ccd1f381f4116f43367be4b360f
encryptType: SM2
platform:
- name: default
openPublicKey: 3059301306072a8648ce3d020106082a811ccf5501822d034200045b5d8fcad91e113910406db4caf0f5c6688048e0f46742d55f872a25855316803ddb177cc9bb5906ff0b2ad4d6b1f1378a49109104613e79b5b5512e3710e88f
url: ${common.gateway.network.http.intranet}
protocol: HTTP
defaultPlatform: true
##ciphertext plaintext
type: plaintext
apiPlatform:
- name: default
#多个可以逗号隔开
apiCode: test:01
#多个可以逗号隔开,可以为空
tenantIds: 1838408702262321152

View File

@ -0,0 +1,15 @@
swagger:
enabled: ${common.swagger.enabled}
title: ${application.cn-name}
description: ${application.cn-name},一切皆有可能
version: 1.0.0
group-name: ${application.cn-name}
springfox:
documentation:
swagger-ui:
base-url: ${application.gateway}
swagger:
v2:
path: /${application.gateway}/v2/api-docs
open-doc:
brief-introduction-url: https://ipaas-gateway.cqjjb.cn/document-foreground/container/document/detail?siteId=1729854594279215106&docTypeId=1744908406080786434&dirId=1745034145606258688

View File

@ -0,0 +1,23 @@
<!doctype html><html lang="zh"><head data-built-info="@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2025/10/17 11:07:53) App/risk"><meta charset="UTF-8"/><meta name="renderer" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><title>--</title><script>(function () {
const APP_ENV = {
antd: {
'ant-prefix': 'micro-temp',
fontFamily: 'PingFangSC-Regular',
colorPrimary: '#1677ff',
borderRadius: parseInt('2')
},
appKey: '',
basename: 'risk',
API_HOST: ''
};
APP_ENV.API_HOST = sessionStorage.API_HOST || APP_ENV.API_HOST || window.location.origin;
window.process = {
env: { app: APP_ENV },
NODE_ENV: 'production'
};
window.__JJB_ENVIRONMENT__ = {
API_HOST: APP_ENV.API_HOST,
redirect: '',
FRAMEWORK: APP_ENV.antd
};
})();</script><script defer="defer" src="/risk/static/js/295.21df88c875577274cecb.js"></script><script defer="defer" src="/risk/static/js/main.4c0885586ad9a06ab444.js"></script><link href="/risk/static/css/main.40fc518bb0818fe8b8ea.css" rel="stylesheet"></head><body style="overflow: hidden"><noscript>此网页需要开启JavaScript功能。</noscript><div id="root" style="width: 100%; height: 100%; position: relative"></div><script type="text/javascript">/* @cqsjjb/script 输出当前应用基本信息、构建时间 */console.log("%c@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2025/10/17 11:07:53) App/risk Version/master Java/<branch-name>", "color: #1890ff; border-radius: 2px; padding: 0 4px; border: 1px solid #1890ff; background: #f9fcff")</script></body></html>

View File

@ -0,0 +1 @@
body,html{height:100%;width:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{font-weight:500;margin-bottom:.5em;margin-top:0}p{margin-bottom:1em;margin-top:0}abbr[data-original-title],abbr[title]{border-bottom:0;cursor:help;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}address{font-style:normal;line-height:inherit;margin-bottom:1em}input[type=number],input[type=password],input[type=text],textarea{-webkit-appearance:none}dl,ol,ul{margin-bottom:1em;margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}code,kbd,pre,samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}pre{margin-bottom:1em;margin-top:0;overflow:auto}figure{margin:0 0 1em}img{border-style:none;vertical-align:middle}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{caption-side:bottom;padding-bottom:.3em;padding-top:.75em;text-align:left}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{border:0;margin:0;min-width:0;padding:0}legend{color:inherit;display:block;font-size:1.5em;line-height:inherit;margin-bottom:.5em;max-width:100%;padding:0;white-space:normal;width:100%}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:none;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{background-color:#feffe6;padding:.2em}

View File

@ -0,0 +1 @@
module.exports={compact:!1,plugins:[["@babel/plugin-proposal-decorators",{legacy:!0}]],presets:[["@babel/preset-env",{targets:{browsers:["ie >= 10"]}}],["@babel/preset-react",{runtime:"automatic"}]]};

View File

@ -0,0 +1 @@
module.exports={javaGit:"<git-url>",javaGitName:"<git-name>",environment:{development:{javaGitBranch:"<branch-name>",API_HOST:"http://192.168.20.100:30140/demo2"},production:{javaGitBranch:"<branch-name>",API_HOST:""}},appIdentifier:"risk",contextInject:{appKey:""},windowInject:{title:"微应用模板",links:[],element:{root:{id:"root"}},scripts:[]},server:{port:"8080",host:"127.0.0.1",open:!0},framework:{antd:{"ant-prefix":"micro-temp",fontFamily:"PingFangSC-Regular",colorPrimary:"#1677ff",borderRadius:2}},webpackConfig:{htmlWebpackPluginOption:{inject:!0}}};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,135 @@
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/
/** @preserve
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**![caret-down](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTg0MC40IDMwMEgxODMuNmMtMTkuNyAwLTMwLjcgMjAuOC0xOC41IDM1bDMyOC40IDM4MC44YzkuNCAxMC45IDI3LjUgMTAuOSAzNyAwTDg1OC45IDMzNWMxMi4yLTE0LjIgMS4yLTM1LTE4LjUtMzV6IiAvPjwvc3ZnPg==) */
/**![caret-up](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTg1OC45IDY4OUw1MzAuNSAzMDguMmMtOS40LTEwLjktMjcuNS0xMC45LTM3IDBMMTY1LjEgNjg5Yy0xMi4yIDE0LjItMS4yIDM1IDE4LjUgMzVoNjU2LjhjMTk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c3ZnPg==) */
/**![right](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTc2NS43IDQ4Ni44TDMxNC45IDEzNC43QTcuOTcgNy45NyAwIDAwMzAyIDE0MXY3Ny4zYzAgNC45IDIuMyA5LjYgNi4xIDEyLjZsMzYwIDI4MS4xLTM2MCAyODEuMWMtMy45IDMtNi4xIDcuNy02LjEgMTIuNlY4ODNjMCA2LjcgNy43IDEwLjQgMTIuOSA2LjNsNDUwLjgtMzUyLjFhMzEuOTYgMzEuOTYgMCAwMDAtNTAuNHoiIC8+PC9zdmc+) */

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */

View File

@ -0,0 +1,44 @@
{
"name": "micro-app",
"version": "2.0.0",
"description": "建教帮微应用模板",
"author": "JJB",
"license": "MIT",
"main": "index.js",
"scripts": {
"serve": "node node_modules/@cqsjjb/scripts/webpack.dev.server.js",
"build": "node node_modules/@cqsjjb/scripts/webpack.build.js",
"push": "jjb-cmd push java production",
"clean-cache": "rimraf node_modules/.cache/webpack",
"serve:development": "cross-env NODE_ENV=development npm run serve",
"serve:production": "cross-env NODE_ENV=production npm run serve",
"build:development": "cross-env NODE_ENV=development npm run build",
"build:production": "cross-env NODE_ENV=production npm run build",
"code-optimization": "node node_modules/@cqsjjb/scripts/code-optimization.js",
"lint": "eslint --ext .js,.jsx,.tsx --fix src"
},
"dependencies": {
"@ant-design/icons": "latest",
"@cqsjjb/jjb-common-decorator": "latest",
"@cqsjjb/jjb-common-lib": "latest",
"@cqsjjb/jjb-dva-runtime": "latest",
"@cqsjjb/jjb-react-admin-component": "latest",
"ahooks": "^3.9.5",
"antd": "latest",
"dayjs": "^1.11.7",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@antfu/eslint-config": "^5.4.1",
"@babel/plugin-proposal-decorators": "^7.19.3",
"@cqsjjb/scripts": "latest",
"@eslint-react/eslint-plugin": "^2.2.2",
"cross-env": "^7.0.3",
"eslint": "^9.37.0",
"eslint-plugin-format": "^1.0.2",
"eslint-plugin-react-hooks": "^7.0.0",
"eslint-plugin-react-refresh": "^0.4.23",
"typescript": "^5.9.3"
}
}

34
web-adapter/pom.xml Normal file
View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zcloud.accident</groupId>
<artifactId>zcloud-gbs-accident</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>web-adapter</artifactId>
<packaging>jar</packaging>
<name>web-adapter</name>
<dependencies>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-framework-adapter</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rocketmq</artifactId>
</dependency>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-app</artifactId>
</dependency>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-client</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,122 @@
package com.zcloud.accident.web;
import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.jjb.saas.framework.auth.model.SSOUser;
import com.jjb.saas.framework.auth.utils.AuthContext;
import com.jjb.saas.framework.event.producer.RemoteEventPublisher;
import com.zcloud.accident.api.AccidentServiceI;
import com.zcloud.accident.dto.AccidentAddCmd;
import com.zcloud.accident.dto.AccidentCountQry;
import com.zcloud.accident.dto.AccidentPageQry;
import com.zcloud.accident.dto.AccidentUpdateCmd;
import com.zcloud.accident.dto.clientobject.AccidentCO;
import com.zcloud.accident.dto.clientobject.AccidentCountStatCO;
import com.zcloud.accident.dto.clientobject.AccidentExportCO;
import com.zcloud.accident.command.convertor.AccidentExportConvertor;
import com.zcloud.accident.util.ExcelUtils;
import com.zcloud.gbscommon.event.user.ZcUserEvent;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.messaging.MessageChannel;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* web-adapter
*
* @Author fangjiakai
* @Date 2025-10-29 14:28:30
*/
@Api(tags = "事故记录表")
@RequestMapping("/${application.gateway}/accident")
@RestController
@AllArgsConstructor
public class AccidentController {
private final AccidentServiceI accidentService;
private final AccidentExportConvertor accidentExportConvertor;
private final RemoteEventPublisher remoteEventPublisher ;
@ApiOperation("新增")
@PostMapping("/save")
public SingleResponse<AccidentCO> add(@Validated @RequestBody AccidentAddCmd cmd) {
SSOUser ssoUser = AuthContext.getCurrentUser();
return accidentService.add(cmd);
}
@ApiOperation("分页")
@PostMapping("/list")
public PageResponse<AccidentCO> page(@RequestBody AccidentPageQry qry) {
return accidentService.listPage(qry);
}
@ApiOperation("所有数据")
@GetMapping("/listAll")
public MultiResponse<AccidentCO> listAll() {
return MultiResponse.of(new ArrayList<AccidentCO>());
}
@ApiOperation("详情")
@GetMapping("/{id}")
public SingleResponse<AccidentCO> getInfoById(@PathVariable("id") Long id) {
return SingleResponse.of(accidentService.queryById(id));
}
@ApiOperation("删除")
@DeleteMapping("/{id}")
public Response remove(@PathVariable("id") Long id) {
accidentService.remove(id);
return SingleResponse.buildSuccess();
}
@ApiOperation("删除多个")
@DeleteMapping("/ids")
public Response removeBatch(@RequestParam Long[] ids) {
accidentService.removeBatch(ids);
return SingleResponse.buildSuccess();
}
@ApiOperation("修改")
@PutMapping("/edit")
public SingleResponse edit(@Validated @RequestBody AccidentUpdateCmd accidentUpdateCmd) {
accidentService.edit(accidentUpdateCmd);
return SingleResponse.buildSuccess();
}
@ApiOperation("导出Excel")
@PostMapping("/export")
public void export(@RequestBody AccidentPageQry qry, HttpServletResponse response) throws IOException {
// 使用listAll方法获取所有符合条件的数据
List<AccidentCO> accidentCOList = accidentService.listAll(qry);
// 转换为导出CO
List<AccidentExportCO> exportCOList = accidentExportConvertor.convertToExportCOList(accidentCOList);
// 生成文件名
String fileName = "事故数据_" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
// 调用工具类导出Excel
ExcelUtils.exportExcel(response, AccidentExportCO.class, fileName, exportCOList);
}
@ApiOperation("按照公司和事故类型统计个数")
@PostMapping("/countByCorpinfoAndType")
public MultiResponse<AccidentCountStatCO> countByCorpinfoIdAndIncidentType(@RequestBody AccidentCountQry accidentCountQry) {
return accidentService.countByCorpinfoIdAndIncidentType(accidentCountQry);
}
@GetMapping("/test")
public void test() {
ZcUserEvent zcUserEvent = new ZcUserEvent();
zcUserEvent.setName("hello world");
remoteEventPublisher.sendMessage(zcUserEvent,"zcloud:user:ev2" );
}
}

31
web-app/pom.xml Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zcloud.accident</groupId>
<artifactId>zcloud-gbs-accident</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>web-app</artifactId>
<packaging>jar</packaging>
<name>web-app</name>
<dependencies>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-client</artifactId>
</dependency>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-infrastructure</artifactId>
</dependency>
<!-- easyexcel依赖 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,41 @@
package com.zcloud.accident.command;
import com.zcloud.accident.domain.gateway.AccidentGateway;
import com.zcloud.accident.domain.model.AccidentE;
import com.zcloud.accident.dto.AccidentAddCmd;
import com.alibaba.cola.exception.BizException;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* web-app
* @Author fangjiakai
* @Date 2025-10-29 14:28:26
*/
@Component
@AllArgsConstructor
public class AccidentAddExe {
private final AccidentGateway accidentGateway;
@Transactional(rollbackFor = Exception.class)
public boolean execute(AccidentAddCmd cmd) {
AccidentE accidentE = new AccidentE();
BeanUtils.copyProperties(cmd, accidentE);
boolean res = false;
try {
res = accidentGateway.add(accidentE);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (!res) {
throw new BizException("保存失败");
}
return true;
}
}

View File

@ -0,0 +1,39 @@
package com.zcloud.accident.command;
import com.alibaba.cola.exception.BizException;
import com.zcloud.accident.domain.gateway.AccidentGateway;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* web-app
*
* @Author fangjiakai
* @Date 2025-10-29 14:28:45
*/
@Component
@AllArgsConstructor
public class AccidentRemoveExe {
private final AccidentGateway accidentGateway;
@Transactional(rollbackFor = Exception.class)
public boolean execute(Long id) {
boolean res = accidentGateway.deletedAccidentById(id);
if (!res) {
throw new BizException("删除失败");
}
return true;
}
@Transactional(rollbackFor = Exception.class)
public boolean execute(Long[] ids) {
boolean res = accidentGateway.deletedAccidentByIds(ids);
if (!res) {
throw new BizException("删除失败");
}
return true;
}
}

View File

@ -0,0 +1,35 @@
package com.zcloud.accident.command;
import com.alibaba.cola.exception.BizException;
import com.zcloud.accident.domain.gateway.AccidentGateway;
import com.zcloud.accident.domain.model.AccidentE;
import com.zcloud.accident.dto.AccidentUpdateCmd;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* web-app
* @Author fangjiakai
* @Date 2025-10-29 14:28:52
*/
@Component
@AllArgsConstructor
public class AccidentUpdateExe {
private final AccidentGateway accidentGateway;
@Transactional(rollbackFor = Exception.class)
public void execute(AccidentUpdateCmd accidentUpdateCmd) {
AccidentE accidentE = new AccidentE();
BeanUtils.copyProperties(accidentUpdateCmd, accidentE);
boolean res = accidentGateway.update(accidentE);
if (!res) {
throw new BizException("修改失败");
}
}
}

View File

@ -0,0 +1,26 @@
package com.zcloud.accident.command.convertor;
import com.zcloud.accident.dto.clientobject.AccidentCO;
import com.zcloud.accident.persistence.dataobject.AccidentDO;
import org.mapstruct.Mapper;
import java.util.List;
/**
* web-app
* @Author fangjiakai
* @Date 2025-10-29 14:28:32
*/
@Mapper(componentModel = "spring")
public interface AccidentCoConvertor {
/**
* @param accidentDOs
* @return
*/
List<AccidentCO> converDOsToCOs(List<AccidentDO> accidentDOs);
AccidentCO converDOToCO(AccidentDO accidentDO);
}

View File

@ -0,0 +1,32 @@
package com.zcloud.accident.command.convertor;
import com.zcloud.accident.domain.model.AccidentCountStat;
import com.zcloud.accident.dto.clientobject.AccidentCountStatCO;
import org.mapstruct.Mapper;
import java.util.List;
/**
*
* DTO
*
* @Author
* @Date
*/
@Mapper(componentModel = "spring")
public interface AccidentCountStatConvertor {
/**
* DTO
* @param accidentCountStat
* @return DTO
*/
AccidentCountStatCO convertToCO(AccidentCountStat accidentCountStat);
/**
* DTO
* @param accidentCountStats
* @return DTO
*/
List<AccidentCountStatCO> convertToCOList(List<AccidentCountStat> accidentCountStats);
}

View File

@ -0,0 +1,30 @@
package com.zcloud.accident.command.convertor;
import com.zcloud.accident.dto.clientobject.AccidentCO;
import com.zcloud.accident.dto.clientobject.AccidentExportCO;
import org.mapstruct.Mapper;
import org.springframework.beans.BeanUtils;
import java.util.List;
import java.util.stream.Collectors;
/**
*
*/
@Mapper(componentModel = "spring")
public interface AccidentExportConvertor {
/**
* AccidentCOAccidentExportCO
* @param accidentCO AccidentCO
* @return AccidentExportCO
*/
AccidentExportCO convertToExportCO(AccidentCO accidentCO);
/**
* AccidentCOAccidentExportCO
* @param accidentCOList AccidentCO
* @return AccidentExportCO
*/
List<AccidentExportCO> convertToExportCOList(List<AccidentCO> accidentCOList);
}

View File

@ -0,0 +1,81 @@
package com.zcloud.accident.command.query;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.MultiResponse;
import com.zcloud.accident.command.convertor.AccidentCoConvertor;
import com.zcloud.accident.command.convertor.AccidentCountStatConvertor;
import com.zcloud.accident.domain.gateway.AccidentGateway;
import com.zcloud.accident.dto.AccidentCountQry;
import com.zcloud.accident.dto.AccidentPageQry;
import com.zcloud.accident.dto.clientobject.AccidentCO;
import com.zcloud.accident.dto.clientobject.AccidentCountStatCO;
import com.zcloud.accident.persistence.dataobject.AccidentDO;
import com.zcloud.accident.persistence.repository.AccidentRepository;
import com.zcloud.gbscommon.utils.PageQueryHelper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* web-app
*
* @Author fangjiakai
* @Date 2025-10-29 14:28:45
*/
@Component
@AllArgsConstructor
public class AccidentQueryExe {
private final AccidentRepository accidentRepository;
private final AccidentCoConvertor accidentCoConvertor;
private final AccidentGateway accidentGateway;
private final AccidentCountStatConvertor accidentCountStatConvertor;
/**
* id
* @param id
* @return
*/
public AccidentCO queryById(Long id) {
return accidentCoConvertor.converDOToCO(accidentRepository.getById(id));
}
/**
*
*
* @param accidentPageQry
* @return
*/
public PageResponse<AccidentCO> execute(AccidentPageQry accidentPageQry) {
Map<String, Object> params = PageQueryHelper.toHashMap(accidentPageQry);
PageResponse<AccidentDO> pageResponse = accidentRepository.listPage(params);
List<AccidentCO> examCenterCOS = accidentCoConvertor.converDOsToCOs(pageResponse.getData());
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
}
/**
*
*
* @param accidentPageQry
* @return
*/
public List<AccidentCO> listAll(AccidentPageQry accidentPageQry) {
Map<String, Object> params = PageQueryHelper.toHashMap(accidentPageQry);
List<AccidentDO> accidentDOs = accidentRepository.listAll(params);
return accidentCoConvertor.converDOsToCOs(accidentDOs);
}
/**
* corpinfoIdincidentType
* @param accidentCountQry ID
* @return
*/
public MultiResponse<AccidentCountStatCO> countByCorpinfoIdAndIncidentType(AccidentCountQry accidentCountQry) {
List<com.zcloud.accident.domain.model.AccidentCountStat> resultList = accidentGateway.countByCorpinfoIdAndIncidentType(accidentCountQry.getCorpinfoIds());
List<AccidentCountStatCO> coList = accidentCountStatConvertor.convertToCOList(resultList);
return MultiResponse.of(coList);
}
}

View File

@ -0,0 +1,81 @@
package com.zcloud.accident.service;
import com.jjb.saas.framework.utils.DataEncryptDecryptUtil;
import com.zcloud.accident.api.AccidentServiceI;
import com.zcloud.accident.command.AccidentAddExe;
import com.zcloud.accident.command.AccidentRemoveExe;
import com.zcloud.accident.command.AccidentUpdateExe;
import com.zcloud.accident.command.query.AccidentQueryExe;
import com.zcloud.accident.dto.AccidentAddCmd;
import com.zcloud.accident.dto.AccidentCountQry;
import com.zcloud.accident.dto.AccidentPageQry;
import com.zcloud.accident.dto.AccidentUpdateCmd;
import com.zcloud.accident.dto.clientobject.AccidentCO;
import com.zcloud.accident.dto.clientobject.AccidentCountStatCO;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.alibaba.cola.dto.MultiResponse;
import com.zcloud.gbscommon.utils.Tools;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* web-app
* @Author fangjiakai
* @Date 2025-10-29 14:28:52
*/
@Service
@AllArgsConstructor
public class AccidentServiceImpl implements AccidentServiceI {
private final AccidentAddExe accidentAddExe;
private final AccidentUpdateExe accidentUpdateExe;
private final AccidentRemoveExe accidentRemoveExe;
private final AccidentQueryExe accidentQueryExe;
@Override
public AccidentCO queryById(Long id){
return accidentQueryExe.queryById(id);
}
@Override
public PageResponse<AccidentCO> listPage(AccidentPageQry qry){
return accidentQueryExe.execute(qry);
}
@Override
public List<AccidentCO> listAll(AccidentPageQry qry) {
return accidentQueryExe.listAll(qry);
}
@Override
public SingleResponse add(AccidentAddCmd cmd) {
accidentAddExe.execute(cmd);
return SingleResponse.buildSuccess();
}
@Override
public void edit(AccidentUpdateCmd accidentUpdateCmd) {
accidentUpdateExe.execute(accidentUpdateCmd);
}
@Override
public void remove(Long id) {
accidentRemoveExe.execute(id);
}
@Override
public void removeBatch(Long[] ids) {
accidentRemoveExe.execute(ids);
}
@Override
public MultiResponse<AccidentCountStatCO> countByCorpinfoIdAndIncidentType(AccidentCountQry accidentCountQry) {
return accidentQueryExe.countByCorpinfoIdAndIncidentType(accidentCountQry);
}
}

View File

@ -0,0 +1,48 @@
package com.zcloud.accident.util;
import com.alibaba.excel.EasyExcel;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
/**
* Excel
*/
public class ExcelUtils {
/**
* Excel
* @param response HttpServletResponse
* @param clazz
* @param fileName
* @param arrayList
* @param <T>
* @throws IOException IOException
*/
public static <T> void exportExcel(HttpServletResponse response, Class<T> clazz, String fileName, List<T> arrayList) throws IOException {
setupExcelResponse(response, fileName);
EasyExcel.write(response.getOutputStream(), clazz).sheet(fileName).doWrite(() -> {
return arrayList;
});
}
/**
* Excel
* @param response HttpServletResponse
* @param fileName
* @throws IOException IOException
*/
private static void setupExcelResponse(HttpServletResponse response, String fileName) throws IOException {
// 设置响应头
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
// 文件名编码,防止中文乱码
String encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()).replaceAll("\\+", "%");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename*=UTF-8''" + encodedFileName + ".xlsx");
}
}

50
web-client/pom.xml Normal file
View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zcloud.accident</groupId>
<artifactId>zcloud-gbs-accident</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>web-client</artifactId>
<packaging>jar</packaging>
<name>web-client</name>
<dependencies>
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-domain</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-application-client</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-system-client</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-framework-enums</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-open-platform-sdk</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-framework-client</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,50 @@
package com.zcloud.accident.api;
import com.zcloud.accident.dto.AccidentAddCmd;
import com.zcloud.accident.dto.AccidentCountQry;
import com.zcloud.accident.dto.AccidentPageQry;
import com.zcloud.accident.dto.AccidentUpdateCmd;
import com.zcloud.accident.dto.clientobject.AccidentCO;
import com.zcloud.accident.dto.clientobject.AccidentCountStatCO;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.alibaba.cola.dto.MultiResponse;
import java.util.List;
/**
* web-client
* @Author fangjiakai
* @Date 2025-10-29 14:28:51
*/
public interface AccidentServiceI {
AccidentCO queryById(Long id);
PageResponse<AccidentCO> listPage(AccidentPageQry qry);
/**
*
* @param qry
* @return
*/
List<AccidentCO> listAll(AccidentPageQry qry);
SingleResponse<AccidentCO> add(AccidentAddCmd cmd);
void edit(AccidentUpdateCmd cmd);
void remove(Long id);
void removeBatch(Long[] ids);
/**
* corpinfoIdincidentType
* @param accidentCountQry ID
* @return
*/
MultiResponse<AccidentCountStatCO> countByCorpinfoIdAndIncidentType(AccidentCountQry accidentCountQry);
}

View File

@ -0,0 +1,89 @@
package com.zcloud.accident.dto;
import com.alibaba.cola.dto.Command;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.time.LocalDateTime;
/**
* web-client
*
* @Author fangjiakai
* @Date 2025-10-29 14:28:08
*/
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AccidentAddCmd extends Command {
@ApiModelProperty(value = "主键", name = "id", required = true)
@NotNull(message = "主键不能为空")
private Long id;
@ApiModelProperty(value = "事故案号", name = "incidentNumber", required = true)
@NotEmpty(message = "事故案号不能为空")
private String incidentNumber;
@ApiModelProperty(value = "事故名称", name = "incidentName", required = true)
@NotEmpty(message = "事故名称不能为空")
private String incidentName;
@ApiModelProperty(value = "事故类型", name = "incidentType", required = true)
@NotEmpty(message = "事故类型不能为空")
private String incidentType;
private String incidentTypeName;
@ApiModelProperty(value = "事故级别", name = "incidentLevel", required = true)
@NotEmpty(message = "事故级别不能为空")
private String incidentLevel;
private String incidentLevelName;
@ApiModelProperty(value = "事故性质", name = "incidentNature", required = true)
@NotEmpty(message = "事故性质不能为空")
private String incidentNature;
@ApiModelProperty(value = "事故发生地点", name = "location", required = true)
@NotEmpty(message = "事故发生地点不能为空")
private String location;
@ApiModelProperty(value = "事故发生时间", name = "incidentDate", required = true)
@NotNull(message = "事故发生时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime incidentDate;
@ApiModelProperty(value = "直接经济损失(万元)", name = "directLoss", required = true)
@NotNull(message = "直接经济损失(万元)不能为空")
private BigDecimal directLoss;
@ApiModelProperty(value = "受伤人数", name = "injured", required = true)
@NotNull(message = "受伤人数不能为空")
private Integer injured;
@ApiModelProperty(value = "死亡人数", name = "fatalities", required = true)
@NotNull(message = "死亡人数不能为空")
private Integer fatalities;
@ApiModelProperty(value = "重伤人数", name = "seriouslyInjured", required = true)
@NotNull(message = "重伤人数不能为空")
private Integer seriouslyInjured;
@ApiModelProperty(value = "事故起因", name = "cause", required = true)
@NotEmpty(message = "事故起因不能为空")
private String cause;
@ApiModelProperty(value = "事故概述", name = "summary", required = true)
@NotEmpty(message = "事故概述不能为空")
private String summary;
@ApiModelProperty(value = "原因分析及责任认定", name = "analysis", required = true)
@NotEmpty(message = "原因分析及责任认定不能为空")
private String analysis;
@ApiModelProperty(value = "考核建议", name = "suggestions", required = true)
@NotEmpty(message = "考核建议不能为空")
private String suggestions;
@ApiModelProperty(value = "整改措施", name = "measures", required = true)
@NotEmpty(message = "整改措施不能为空")
private String measures;
@ApiModelProperty(value = "报出日期", name = "reportDate", required = true)
@NotNull(message = "报出日期不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime reportDate;
@ApiModelProperty(value = "1事件/2事故", name = "type", required = true)
@NotNull(message = "1事件/2事故不能为空")
private Integer type;
}

View File

@ -0,0 +1,20 @@
package com.zcloud.accident.dto;
import com.alibaba.cola.dto.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
*
* ID
*
* @Author
* @Date
*/
@Data
public class AccidentCountQry extends Query {
@ApiModelProperty(value = "公司ID列表")
private List<String> corpinfoIds;
}

View File

@ -0,0 +1,47 @@
package com.zcloud.accident.dto;
import com.alibaba.cola.dto.PageQuery;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.sql.Date;
import java.time.LocalDateTime;
/**
* web-client
* @Author fangjiakai
* @Date 2025-10-29 14:28:45
*/
@Data
public class AccidentPageQry extends PageQuery {
/**
* ,
* - `like`: SQLLIKE
* - `eq`: SQL=
* - `gt`:
* - `lt`:
* - `ge`:
* - `le`:
* - `ne`: SQL!=
*/
@ApiModelProperty(value = "事故名称", name = "likeIncidentName")
private String likeIncidentName;
@ApiModelProperty(value = "事故地点", name = "likeLocation")
private String likeLocation;
@ApiModelProperty(value = "事故类型", name = "likeIncidentType")
private String eqIncidentType;
@ApiModelProperty(value = "事故级别", name = "likeIncidentLevel")
private String eqIncidentLevel;
@ApiModelProperty(value = "开始时间", name = "geIncidentDate")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime geIncidentDate;
@ApiModelProperty(value = "结束时间", name = "leIncidentDate")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime leIncidentDate;
@ApiModelProperty(value = "类型1事件2事故", name = "eqType")
private Integer eqType;
}

View File

@ -0,0 +1,94 @@
package com.zcloud.accident.dto;
import com.alibaba.cola.dto.Command;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.time.LocalDateTime;
/**
* web-client
* @Author fangjiakai
* @Date 2025-10-29 14:28:52
*/
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AccidentUpdateCmd extends Command {
@ApiModelProperty(value = "主键id", name = "id", required = true)
@NotNull(message = "主键id不能为空")
private Long id;
@ApiModelProperty(value = "事故案号", name = "incidentNumber", required = true)
@NotEmpty(message = "事故案号不能为空")
private String incidentNumber;
@ApiModelProperty(value = "事故名称", name = "incidentName", required = true)
@NotEmpty(message = "事故名称不能为空")
private String incidentName;
@ApiModelProperty(value = "事故类型", name = "incidentType", required = true)
@NotEmpty(message = "事故类型不能为空")
private String incidentType;
@ApiModelProperty(value = "事故类型", name = "incidentTypeName", required = true)
@NotEmpty(message = "事故类型不能为空")
private String incidentTypeName;
@ApiModelProperty(value = "公司id", name = "corpinfoId", required = true)
@NotNull(message = "公司id不能为空")
private Long corpinfoId;
@ApiModelProperty(value = "事故级别", name = "incidentLevel", required = true)
@NotEmpty(message = "事故级别不能为空")
private String incidentLevel;
@ApiModelProperty(value = "事故级别", name = "incidentLevelName", required = true)
@NotEmpty(message = "事故级别不能为空")
private String incidentLevelName;
@ApiModelProperty(value = "事故性质", name = "incidentNature", required = true)
@NotEmpty(message = "事故性质不能为空")
private String incidentNature;
@ApiModelProperty(value = "事故发生地点", name = "location", required = true)
@NotEmpty(message = "事故发生地点不能为空")
private String location;
@ApiModelProperty(value = "事故发生时间", name = "incidentDate", required = true)
@NotNull(message = "事故发生时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime incidentDate;
@ApiModelProperty(value = "直接经济损失(万元)", name = "directLoss", required = true)
@NotNull(message = "直接经济损失(万元)不能为空")
private BigDecimal directLoss;
@ApiModelProperty(value = "受伤人数", name = "injured", required = true)
@NotNull(message = "受伤人数不能为空")
private Integer injured;
@ApiModelProperty(value = "死亡人数", name = "fatalities", required = true)
@NotNull(message = "死亡人数不能为空")
private Integer fatalities;
@ApiModelProperty(value = "重伤人数", name = "seriouslyInjured", required = true)
@NotNull(message = "重伤人数不能为空")
private Integer seriouslyInjured;
@ApiModelProperty(value = "事故起因", name = "cause", required = true)
@NotEmpty(message = "事故起因不能为空")
private String cause;
@ApiModelProperty(value = "事故概述", name = "summary", required = true)
@NotEmpty(message = "事故概述不能为空")
private String summary;
@ApiModelProperty(value = "原因分析及责任认定", name = "analysis", required = true)
@NotEmpty(message = "原因分析及责任认定不能为空")
private String analysis;
@ApiModelProperty(value = "考核建议", name = "suggestions", required = true)
@NotEmpty(message = "考核建议不能为空")
private String suggestions;
@ApiModelProperty(value = "整改措施", name = "measures", required = true)
@NotEmpty(message = "整改措施不能为空")
private String measures;
@ApiModelProperty(value = "报出日期", name = "reportDate", required = true)
@NotNull(message = "报出日期不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime reportDate;
@ApiModelProperty(value = "1事件/2事故", name = "type", required = true)
@NotNull(message = "1事件/2事故不能为空")
private Integer type;
}

View File

@ -0,0 +1,128 @@
package com.zcloud.accident.dto.clientobject;
import com.alibaba.cola.dto.ClientObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jjb.saas.framework.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* web-client
*
* @Author fangjiakai
* @Date 2025-10-29 14:28:26
*/
@Data
public class AccidentCO extends ClientObject {
//主键id
@ApiModelProperty(value = "主键id")
private Long id;
//业务主键id
@ApiModelProperty(value = "业务主键id")
private String accidentId;
//事故案号
@ApiModelProperty(value = "事故案号")
private String incidentNumber;
//事故名称
@ApiModelProperty(value = "事故名称")
private String incidentName;
//事故类型
@ApiModelProperty(value = "事故类型")
private String incidentType;
//事故类型
@ApiModelProperty(value = "事故类型")
private String incidentTypeName;
//公司id
@ApiModelProperty(value = "公司id")
private Long corpinfoId;
//公司名称
@ApiModelProperty(value = "公司名称")
private String corpinfoName;
//事故级别
@ApiModelProperty(value = "事故级别")
private String incidentLevel;
//事故级别
@ApiModelProperty(value = "事故级别")
private String incidentLevelName;
//事故性质
@ApiModelProperty(value = "事故性质")
private String incidentNature;
//事故发生地点
@ApiModelProperty(value = "事故发生地点")
private String location;
//事故发生时间
@ApiModelProperty(value = "事故发生时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime incidentDate;
//直接经济损失(万元)
@ApiModelProperty(value = "直接经济损失(万元)")
private BigDecimal directLoss;
//受伤人数
@ApiModelProperty(value = "受伤人数")
private Integer injured;
//死亡人数
@ApiModelProperty(value = "死亡人数")
private Integer fatalities;
//重伤人数
@ApiModelProperty(value = "重伤人数")
private Integer seriouslyInjured;
//事故起因
@ApiModelProperty(value = "事故起因")
private String cause;
//事故概述
@ApiModelProperty(value = "事故概述")
private String summary;
//原因分析及责任认定
@ApiModelProperty(value = "原因分析及责任认定")
private String analysis;
//考核建议
@ApiModelProperty(value = "考核建议")
private String suggestions;
//整改措施
@ApiModelProperty(value = "整改措施")
private String measures;
//报出日期
@ApiModelProperty(value = "报出日期")
private LocalDateTime reportDate;
//1事件/2事故
@ApiModelProperty(value = "1事件/2事故")
private Integer type;
//删除标识true false
@ApiModelProperty(value = "删除标识true false")
private String deleteEnum;
//备注
@ApiModelProperty(value = "备注")
private String remarks;
//创建人姓名
@ApiModelProperty(value = "创建人姓名")
private String createName;
//更新人姓名
@ApiModelProperty(value = "更新人姓名")
private String updateName;
//租户id
@ApiModelProperty(value = "租户id")
private Long tenantId;
//单位id
@ApiModelProperty(value = "单位id")
private Long orgId;
//版本
@ApiModelProperty(value = "版本")
private String version;
//创建时间
@ApiModelProperty(value = "创建时间")
private String createTime;
//修改时间
@ApiModelProperty(value = "修改时间")
private String updateTime;
//创建人id
@ApiModelProperty(value = "创建人id")
private Long createId;
//修改人id
@ApiModelProperty(value = "修改人id")
private Long updateId;
}

View File

@ -0,0 +1,29 @@
package com.zcloud.accident.dto.clientobject;
import com.alibaba.cola.dto.ClientObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* API
*
* @Author
* @Date
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AccidentCountStatCO extends ClientObject {
@ApiModelProperty(value = "公司ID")
private Long corpinfoId;
@ApiModelProperty(value = "事故类型")
private String incidentType;
@ApiModelProperty(value = "统计数量")
private Long count;
}

View File

@ -0,0 +1,91 @@
package com.zcloud.accident.dto.clientobject;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
*
* Excel
*/
@Data
public class AccidentExportCO {
@ApiModelProperty(value = "事故案号")
@ExcelProperty(value = "事故案号", index = 0)
private String incidentNumber;
@ApiModelProperty(value = "事故名称")
@ExcelProperty(value = "事故名称", index = 1)
private String incidentName;
@ApiModelProperty(value = "事故类型")
@ExcelProperty(value = "事故类型", index = 2)
private String incidentTypeName;
@ApiModelProperty(value = "公司")
@ExcelProperty(value = "公司", index = 3)
private String corpinfoName;
@ApiModelProperty(value = "事故级别")
@ExcelProperty(value = "事故级别", index = 4)
private String incidentLevelName;
@ApiModelProperty(value = "事故性质")
@ExcelProperty(value = "事故性质", index = 5)
private String incidentNature;
@ApiModelProperty(value = "事故发生地点")
@ExcelProperty(value = "事故发生地点", index = 6)
private String location;
@ApiModelProperty(value = "事故发生时间")
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
@ExcelProperty(value = "事故发生时间", index = 7,format = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime incidentDate;
@ApiModelProperty(value = "直接经济损失(万元)")
@ExcelProperty(value = "直接经济损失(万元)", index = 8)
private BigDecimal directLoss;
@ApiModelProperty(value = "受伤人数")
@ExcelProperty(value = "受伤人数", index = 9)
private Integer injured;
@ApiModelProperty(value = "死亡人数")
@ExcelProperty(value = "死亡人数", index = 10)
private Integer fatalities;
@ApiModelProperty(value = "重伤人数")
@ExcelProperty(value = "重伤人数", index = 11)
private Integer seriouslyInjured;
@ApiModelProperty(value = "事故起因")
@ExcelProperty(value = "事故起因", index = 12)
private String cause;
@ApiModelProperty(value = "事故概述")
@ExcelProperty(value = "事故概述", index = 13)
private String summary;
@ApiModelProperty(value = "原因分析及责任认定")
@ExcelProperty(value = "原因分析及责任认定", index = 14)
private String analysis;
@ApiModelProperty(value = "考核建议")
@ExcelProperty(value = "考核建议", index = 15)
private String suggestions;
@ApiModelProperty(value = "整改措施")
@ExcelProperty(value = "整改措施", index = 16)
private String measures;
@ApiModelProperty(value = "报出日期")
@ExcelProperty(value = "报出日期", index = 17,format = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime reportDate;
}

26
web-domain/pom.xml Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zcloud.accident</groupId>
<artifactId>zcloud-gbs-accident</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>web-domain</artifactId>
<packaging>jar</packaging>
<name>web-domain</name>
<dependencies>
<!-- COLA Framework -->
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-framework-domain</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-base-starter</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,38 @@
package com.zcloud.accident.domain.gateway;
import com.zcloud.accident.domain.model.AccidentE;
import com.zcloud.accident.domain.model.AccidentCountStat;
import java.util.List;
/**
* web-domain
* @Author fangjiakai
* @Date 2025-10-29 14:28:40
*/
public interface AccidentGateway {
/**
*
*/
Boolean add(AccidentE accidentE) ;
/**
*
*/
Boolean update(AccidentE accidentE);
/**
*
*/
Boolean deletedAccidentById(Long id);
Boolean deletedAccidentByIds(Long[] id);
/**
* corpinfoIdincidentType
* @param corpinfoIds ID
* @return corpinfoIdincidentTypecount
*/
List<AccidentCountStat> countByCorpinfoIdAndIncidentType(List<String> corpinfoIds);
}

View File

@ -0,0 +1,32 @@
package com.zcloud.accident.domain.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
*
*
* @Author
* @Date
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AccidentCountStat {
/**
* ID
*/
private Long corpinfoId;
/**
*
*/
private String incidentType;
/**
*
*/
private Long count;
}

View File

@ -0,0 +1,62 @@
package com.zcloud.accident.domain.model;
import com.alibaba.cola.domain.Entity;
import com.jjb.saas.framework.domain.model.BaseE;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* web-domain
* @Author fangjiakai
* @Date 2025-10-29 14:28:32
*/
@Data
public class AccidentE extends BaseE {
//主键id
private Long id;
//事故案号
private String incidentNumber;
//事故名称
private String incidentName;
//事故类型
private String incidentType;
//事故类型
private String incidentTypeName;
//事故级别
private String incidentLevel;
//事故级别
private String incidentLevelName;
//事故性质
private String incidentNature;
//事故发生地点
private String location;
//事故发生时间
private LocalDateTime incidentDate;
//直接经济损失(万元)
private BigDecimal directLoss;
//受伤人数
private Integer injured;
//死亡人数
private Integer fatalities;
//重伤人数
private Integer seriouslyInjured;
//事故起因
private String cause;
//事故概述
private String summary;
//原因分析及责任认定
private String analysis;
//考核建议
private String suggestions;
//整改措施
private String measures;
//报出日期
private LocalDateTime reportDate;
//1事件/2事故
private Integer type;
}

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zcloud.accident</groupId>
<artifactId>zcloud-gbs-accident</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<properties>
<zcloudGbs.service.version>1.0.0-SNAPSHOT</zcloudGbs.service.version>
</properties>
<artifactId>web-infrastructure</artifactId>
<packaging>jar</packaging>
<name>web-infrastructure</name>
<dependencies>
<!--DIP here, Infrastructure depends on Domain-->
<dependency>
<groupId>com.zcloud.accident</groupId>
<artifactId>web-domain</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-application-client</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-system-client</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-auth-client</artifactId>
</dependency>
<dependency>
<groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-framework-facade</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,58 @@
package com.zcloud.accident.gatewayimpl;
import com.zcloud.accident.domain.gateway.AccidentGateway;
import com.zcloud.accident.domain.model.AccidentE;
import com.zcloud.accident.domain.model.AccidentCountStat;
import com.zcloud.accident.persistence.dataobject.AccidentDO;
import com.zcloud.accident.persistence.repository.AccidentRepository;
import com.zcloud.gbscommon.utils.Tools;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* web-infrastructure
* @Author fangjiakai
* @Date 2025-10-29 14:28:42
*/
@Service
@AllArgsConstructor
public class AccidentGatewayImpl implements AccidentGateway {
private final AccidentRepository accidentRepository;
@Override
public Boolean add(AccidentE accidentE) {
AccidentDO d = new AccidentDO(Tools.get32UUID());
BeanUtils.copyProperties(accidentE, d, "accidentId");
accidentRepository.save(d);
return true;
}
@Override
public Boolean update(AccidentE accidentE) {
AccidentDO d = new AccidentDO();
BeanUtils.copyProperties(accidentE, d);
accidentRepository.updateById(d);
return true;
}
@Override
public Boolean deletedAccidentById(Long id) {
return accidentRepository.removeById(id);
}
@Override
public Boolean deletedAccidentByIds(Long[] ids) {
return accidentRepository.removeByIds(Arrays.asList(ids));
}
@Override
public List<AccidentCountStat> countByCorpinfoIdAndIncidentType(List<String> corpinfoIds) {
return accidentRepository.countByCorpinfoIdAndIncidentType(corpinfoIds);
}
}

View File

@ -0,0 +1,101 @@
package com.zcloud.accident.persistence.dataobject;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jjb.saas.framework.repository.basedo.BaseDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.sql.Date;
import java.time.LocalDateTime;
/**
* web-infrastructure
*
* @Author fangjiakai
* @Date 2025-10-29 14:28:38
*/
@Data
@TableName("accident")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class AccidentDO extends BaseDO {
//业务主键id
@ApiModelProperty(value = "业务主键id")
private String accidentId;
//事故案号
@ApiModelProperty(value = "事故案号")
private String incidentNumber;
//事故名称
@ApiModelProperty(value = "事故名称")
private String incidentName;
//事故类型
@ApiModelProperty(value = "事故类型")
private String incidentType;
//事故类型
@ApiModelProperty(value = "事故类型")
private String incidentTypeName;
//公司
@ApiModelProperty(value = "公司id")
private Long corpinfoId;
@ApiModelProperty(value = "公司")
private String corpinfoName;
//事故级别
@ApiModelProperty(value = "事故级别")
private String incidentLevel;
//事故级别
@ApiModelProperty(value = "事故级别")
private String incidentLevelName;
//事故性质
@ApiModelProperty(value = "事故性质")
private String incidentNature;
//事故发生地点
@ApiModelProperty(value = "事故发生地点")
private String location;
//事故发生时间
@ApiModelProperty(value = "事故发生时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime incidentDate;
//直接经济损失(万元)
@ApiModelProperty(value = "直接经济损失(万元)")
private BigDecimal directLoss;
//受伤人数
@ApiModelProperty(value = "受伤人数")
private Integer injured;
//死亡人数
@ApiModelProperty(value = "死亡人数")
private Integer fatalities;
//重伤人数
@ApiModelProperty(value = "重伤人数")
private Integer seriouslyInjured;
//事故起因
@ApiModelProperty(value = "事故起因")
private String cause;
//事故概述
@ApiModelProperty(value = "事故概述")
private String summary;
//原因分析及责任认定
@ApiModelProperty(value = "原因分析及责任认定")
private String analysis;
//考核建议
@ApiModelProperty(value = "考核建议")
private String suggestions;
//整改措施
@ApiModelProperty(value = "整改措施")
private String measures;
//报出日期
@ApiModelProperty(value = "报出日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime reportDate;
//1事件/2事故
@ApiModelProperty(value = "1事件/2事故")
private Integer type;
public AccidentDO(String accidentId) {
this.accidentId = accidentId;
}
}

View File

@ -0,0 +1,26 @@
package com.zcloud.accident.persistence.mapper;
import com.zcloud.accident.persistence.dataobject.AccidentDO;
import com.zcloud.accident.domain.model.AccidentCountStat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* web-infrastructure
* @Author fangjiakai
* @Date 2025-10-29 14:28:43
*/
@Mapper
public interface AccidentMapper extends BaseMapper<AccidentDO> {
/**
* corpinfoIdincidentType
* @param corpinfoIds ID
* @return corpinfoIdincidentTypecount
*/
List<AccidentCountStat> countByCorpinfoIdAndIncidentType(@Param("corpinfoIds") List<String> corpinfoIds);
}

View File

@ -0,0 +1,34 @@
package com.zcloud.accident.persistence.repository;
import com.zcloud.accident.persistence.dataobject.AccidentDO;
import com.zcloud.accident.domain.model.AccidentCountStat;
import com.alibaba.cola.dto.PageResponse;
import com.jjb.saas.framework.repository.repo.BaseRepository;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* web-infrastructure
* @Author fangjiakai
* @Date 2025-10-29 14:28:45
*/
public interface AccidentRepository extends BaseRepository<AccidentDO> {
PageResponse<AccidentDO> listPage(Map<String,Object> params);
/**
*
* @param params
* @return
*/
List<AccidentDO> listAll(Map<String,Object> params);
/**
* corpinfoIdincidentType
* @param corpinfoIds ID
* @return corpinfoIdincidentTypecount
*/
List<AccidentCountStat> countByCorpinfoIdAndIncidentType(@Param("corpinfoIds") List<String> corpinfoIds);
}

View File

@ -0,0 +1,52 @@
package com.zcloud.accident.persistence.repository.impl;
import com.jjb.saas.framework.repository.common.PageHelper;
import com.zcloud.accident.persistence.dataobject.AccidentDO;
import com.zcloud.accident.domain.model.AccidentCountStat;
import com.zcloud.accident.persistence.mapper.AccidentMapper;
import com.zcloud.accident.persistence.repository.AccidentRepository;
import com.alibaba.cola.dto.PageResponse;
import com.zcloud.gbscommon.utils.PageQueryHelper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
import com.zcloud.gbscommon.utils.Query;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* web-infrastructure
* @Author fangjiakai
* @Date 2025-10-29 14:28:49
*/
@Service
@RequiredArgsConstructor
public class AccidentRepositoryImpl extends BaseRepositoryImpl<AccidentMapper, AccidentDO> implements AccidentRepository {
private final AccidentMapper accidentMapper;
@Override
public PageResponse<AccidentDO> listPage(Map<String,Object> params) {
IPage<AccidentDO> iPage = new Query<AccidentDO>().getPage(params);
QueryWrapper<AccidentDO> queryWrapper = new QueryWrapper<>();
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
queryWrapper.orderByDesc("create_time");
IPage<AccidentDO> result = accidentMapper.selectPage(iPage, queryWrapper);
return PageHelper.pageToResponse(result, result.getRecords());
}
@Override
public List<AccidentDO> listAll(Map<String,Object> params) {
QueryWrapper<AccidentDO> queryWrapper = new QueryWrapper<>();
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
queryWrapper.orderByDesc("create_time");
return accidentMapper.selectList(queryWrapper);
}
@Override
public List<AccidentCountStat> countByCorpinfoIdAndIncidentType(List<String> corpinfoIds) {
return accidentMapper.countByCorpinfoIdAndIncidentType(corpinfoIds);
}
}

View File

@ -0,0 +1,24 @@
<?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.zcloud.accident.persistence.mapper.AccidentMapper">
<select id="countByCorpinfoIdAndIncidentType" resultType="com.zcloud.accident.domain.model.AccidentCountStat">
SELECT
corpinfo_id,
incident_type,
COUNT(*) as count
from accident
<where>
<if test="corpinfoIds != null and !corpinfoIds.isEmpty() and corpinfoIds.size()>0">
AND corpinfo_id IN
<foreach collection="corpinfoIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
GROUP BY corpinfo_id, incident_type
</select>
</mapper>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- mybatis的配置文件 -->
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<mappers>
<mapper resource="../mapper/customer-mapper.xml"/>
<mapper resource="../mapper/AccidentMapper.xml"/>
</mappers>
</configuration>