init
commit
33b1186d4d
|
|
@ -0,0 +1,14 @@
|
|||
# 忽略编译输出文件夹
|
||||
target/
|
||||
|
||||
# 忽略 IDEA 配置文件
|
||||
.idea/
|
||||
*.iml
|
||||
*.iws
|
||||
*.ipr
|
||||
|
||||
# 忽略日志
|
||||
*.log
|
||||
|
||||
# 忽略系统文件
|
||||
.DS_Store
|
||||
|
|
@ -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"]
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
-- ============================================================
|
||||
-- 信义门禁系统 建表脚本
|
||||
-- ============================================================
|
||||
|
||||
-- 1. 来访申请主表(人员/车辆共用,apply_type区分)
|
||||
DROP TABLE IF EXISTS `gate_visitor_apply`;
|
||||
CREATE TABLE `gate_visitor_apply` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`visitor_apply_id` varchar(36) NOT NULL COMMENT '业务主键UUID',
|
||||
`apply_type` tinyint NOT NULL COMMENT '申请类型:1-外来人员 2-外来车辆',
|
||||
`source_unit` varchar(100) DEFAULT NULL COMMENT '来源单位',
|
||||
`visitor_count` int DEFAULT NULL COMMENT '入场人数',
|
||||
`license_plate` varchar(20) DEFAULT NULL COMMENT '车牌号(车辆申请时填写)',
|
||||
`vehicle_type` varchar(50) DEFAULT NULL COMMENT '车型(车辆申请时填写)',
|
||||
`purpose` varchar(500) DEFAULT NULL COMMENT '入场事由',
|
||||
`apply_start_time` datetime DEFAULT NULL COMMENT '申请开始时间',
|
||||
`apply_end_time` datetime DEFAULT NULL COMMENT '申请结束时间',
|
||||
`audit_dept_id` bigint DEFAULT NULL COMMENT '审批部门ID',
|
||||
`status` tinyint NOT NULL DEFAULT '0' COMMENT '申请状态:0未提交 1待审核 2待审批 3待确认 4已进场 5已出场 6审核被打回 7审批被打回 8待归档 9已归档 10已过期',
|
||||
`reject_reason` varchar(500) DEFAULT NULL COMMENT '拒绝原因',
|
||||
`apply_source` tinyint DEFAULT NULL COMMENT '申请来源 1PC端 2扫码申请',
|
||||
`apply_dept_id` bigint DEFAULT NULL COMMENT '申请人部门ID',
|
||||
`apply_user_id` bigint DEFAULT NULL COMMENT '申请人ID',
|
||||
`delete_enum` varchar(32) DEFAULT NULL COMMENT '删除标识true false',
|
||||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`create_name` varchar(50) DEFAULT NULL COMMENT '创建人姓名',
|
||||
`update_name` varchar(50) DEFAULT NULL COMMENT '更新人姓名',
|
||||
`tenant_id` bigint DEFAULT NULL COMMENT '租户id',
|
||||
`org_id` bigint DEFAULT NULL COMMENT '单位id',
|
||||
`version` int DEFAULT NULL COMMENT '版本',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`create_id` bigint DEFAULT NULL COMMENT '创建人id',
|
||||
`update_id` bigint DEFAULT NULL COMMENT '修改人id',
|
||||
`env` varchar(50) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_apply_id` (`visitor_apply_id`),
|
||||
KEY `idx_apply_type` (`apply_type`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_tenant_org` (`tenant_id`, `org_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='来访申请主表';
|
||||
|
||||
-- 2. 来访人员明细表(人员申请的来访人员 + 车辆申请的车内人员)
|
||||
DROP TABLE IF EXISTS `gate_visitor_person`;
|
||||
CREATE TABLE `gate_visitor_person` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`visitor_person_id` varchar(36) NOT NULL COMMENT '业务主键UUID',
|
||||
`visitor_apply_id` varchar(36) NOT NULL COMMENT '申请主表ID',
|
||||
`person_type` tinyint NOT NULL COMMENT '人员类型:1-来访人员 2-车内人员',
|
||||
`name` varchar(50) DEFAULT NULL COMMENT '姓名',
|
||||
`phone` varchar(20) DEFAULT NULL COMMENT '手机号',
|
||||
`delete_enum` varchar(32) DEFAULT NULL COMMENT '删除标识true false',
|
||||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`create_name` varchar(50) DEFAULT NULL COMMENT '创建人姓名',
|
||||
`update_name` varchar(50) DEFAULT NULL COMMENT '更新人姓名',
|
||||
`tenant_id` bigint DEFAULT NULL COMMENT '租户id',
|
||||
`org_id` bigint DEFAULT NULL COMMENT '单位id',
|
||||
`version` int DEFAULT NULL COMMENT '版本',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`create_id` bigint DEFAULT NULL COMMENT '创建人id',
|
||||
`update_id` bigint DEFAULT NULL COMMENT '修改人id',
|
||||
`env` varchar(50) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_visitor_person_id` (`visitor_person_id`),
|
||||
KEY `idx_visitor_apply_id` (`visitor_apply_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='来访人员明细表';
|
||||
|
||||
-- 3. 审核记录表(职能部门审核、安检部门审批、现场确认共用)
|
||||
DROP TABLE IF EXISTS `gate_visitor_audit`;
|
||||
CREATE TABLE `gate_visitor_audit` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`visitor_audit_id` varchar(36) NOT NULL COMMENT '业务主键UUID',
|
||||
`visitor_apply_id` varchar(36) NOT NULL COMMENT '申请主表ID',
|
||||
`audit_type` tinyint NOT NULL COMMENT '审核类型:1-职能部室审核 2-安监部门审批 3-现场确认',
|
||||
`audit_result` tinyint NOT NULL COMMENT '审核结果:1-通过 2-拒绝',
|
||||
`audit_opinion` varchar(500) DEFAULT NULL COMMENT '审核意见',
|
||||
`auditor_id` bigint DEFAULT NULL COMMENT '审核人ID',
|
||||
`auditor_name` varchar(50) DEFAULT NULL COMMENT '审核人姓名',
|
||||
`audit_time` datetime DEFAULT NULL COMMENT '审核时间',
|
||||
`delete_enum` varchar(32) DEFAULT NULL COMMENT '删除标识true false',
|
||||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`create_name` varchar(50) DEFAULT NULL COMMENT '创建人姓名',
|
||||
`update_name` varchar(50) DEFAULT NULL COMMENT '更新人姓名',
|
||||
`tenant_id` bigint DEFAULT NULL COMMENT '租户id',
|
||||
`org_id` bigint DEFAULT NULL COMMENT '单位id',
|
||||
`version` int DEFAULT NULL COMMENT '版本',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`create_id` bigint DEFAULT NULL COMMENT '创建人id',
|
||||
`update_id` bigint DEFAULT NULL COMMENT '修改人id',
|
||||
`env` varchar(50) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_visitor_audit_id` (`visitor_audit_id`),
|
||||
KEY `idx_visitor_apply_id` (`visitor_apply_id`),
|
||||
KEY `idx_audit_type` (`audit_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='审核记录表';
|
||||
|
||||
-- 4. 黑名单(人员/车辆共用,blacklist_type区分)
|
||||
DROP TABLE IF EXISTS `gate_blacklist`;
|
||||
CREATE TABLE `gate_blacklist` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`blacklist_id` varchar(36) NOT NULL COMMENT '业务主键UUID',
|
||||
`blacklist_type` tinyint NOT NULL COMMENT '黑名单类型:1-人员 2-车辆',
|
||||
`name` varchar(50) DEFAULT NULL COMMENT '姓名(人员黑名单)',
|
||||
`phone` varchar(20) DEFAULT NULL COMMENT '手机号(人员黑名单)',
|
||||
`license_plate` varchar(20) DEFAULT NULL COMMENT '车牌号(车辆黑名单)',
|
||||
`affiliated_unit` varchar(100) DEFAULT NULL COMMENT '所属单位',
|
||||
`join_time` datetime DEFAULT NULL COMMENT '加入时间',
|
||||
`added_by_id` bigint DEFAULT NULL COMMENT '添加人ID',
|
||||
`status` tinyint NOT NULL DEFAULT '1' COMMENT '状态:1-启用 0-禁用',
|
||||
`delete_enum` varchar(32) DEFAULT NULL COMMENT '删除标识true false',
|
||||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`create_name` varchar(50) DEFAULT NULL COMMENT '创建人姓名',
|
||||
`update_name` varchar(50) DEFAULT NULL COMMENT '更新人姓名',
|
||||
`tenant_id` bigint DEFAULT NULL COMMENT '租户id',
|
||||
`org_id` bigint DEFAULT NULL COMMENT '单位id',
|
||||
`version` int DEFAULT NULL COMMENT '版本',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`create_id` bigint DEFAULT NULL COMMENT '创建人id',
|
||||
`update_id` bigint DEFAULT NULL COMMENT '修改人id',
|
||||
`env` varchar(50) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_blacklist_id` (`blacklist_id`),
|
||||
KEY `idx_blacklist_type` (`blacklist_type`),
|
||||
KEY `idx_phone` (`phone`),
|
||||
KEY `idx_license_plate` (`license_plate`),
|
||||
KEY `idx_tenant_org` (`tenant_id`, `org_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='黑名单';
|
||||
|
||||
-- 5. 部门审核人/审批人/确认人配置
|
||||
DROP TABLE IF EXISTS `gate_dept_auditor_config`;
|
||||
CREATE TABLE `gate_dept_auditor_config` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`config_id` varchar(36) NOT NULL COMMENT '主键UUID',
|
||||
`dept_id` bigint NOT NULL COMMENT '部门ID',
|
||||
`config_type` tinyint NOT NULL COMMENT '配置类型:1-审核人 2-审批人 3-确认人',
|
||||
`user_id` bigint NOT NULL COMMENT '用户ID',
|
||||
`delete_enum` varchar(32) DEFAULT NULL COMMENT '删除标识true false',
|
||||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`create_name` varchar(50) DEFAULT NULL COMMENT '创建人姓名',
|
||||
`update_name` varchar(50) DEFAULT NULL COMMENT '更新人姓名',
|
||||
`tenant_id` bigint DEFAULT NULL COMMENT '租户id',
|
||||
`org_id` bigint DEFAULT NULL COMMENT '单位id',
|
||||
`version` int DEFAULT NULL COMMENT '版本',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`create_id` bigint DEFAULT NULL COMMENT '创建人id',
|
||||
`update_id` bigint DEFAULT NULL COMMENT '修改人id',
|
||||
`env` varchar(50) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_config_id` (`config_id`),
|
||||
KEY `idx_dept_type` (`dept_id`, `config_type`),
|
||||
KEY `idx_tenant_org` (`tenant_id`, `org_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='部门审核人/审批人/确认人配置';
|
||||
|
|
@ -0,0 +1,631 @@
|
|||
# 信义门禁开发指南
|
||||
|
||||
## 一、项目概览
|
||||
|
||||
| 项目 | 值 |
|
||||
|------|-----|
|
||||
| groupId | `com.zcloud.xinyigate` |
|
||||
| artifactId | `zcloud_gbs_xinyi_gate` |
|
||||
| 包名 | `com.zcloud.xinyigate` |
|
||||
| 应用名 | `jjb-saas-zcloud-xinyi-gate` |
|
||||
| 网关名 | `xinyiGate` |
|
||||
| 父POM | `com.jjb.saas:jjb-saas-parent:2.2.0-SNAPSHOT` |
|
||||
| 公共库 | `com.zcloud.gbscommon:zcloud_gbscommon:1.0.0-SNAPSHOT` |
|
||||
| 技术栈 | Spring Boot 2.6 + Spring Cloud + Nacos + MyBatis-Plus + XXL-Job |
|
||||
|
||||
## 二、模块结构
|
||||
|
||||
```
|
||||
zcloud_gbs_xinyi_gate/
|
||||
├── start/ # 启动模块
|
||||
│ └── src/main/
|
||||
│ ├── java/.../Application.java # Spring Boot 入口
|
||||
│ └── resources/
|
||||
│ ├── nacos.yml # Nacos配置(开发)
|
||||
│ ├── nacos-prod.yml # Nacos配置(生产)
|
||||
│ ├── bootstrap.yml # 引导配置
|
||||
│ └── templates/xinyiGate/ # 前端模板
|
||||
│
|
||||
├── web-adapter/ # 适配层 - 接收外部请求
|
||||
│ └── src/main/java/.../
|
||||
│ ├── web/{module}/ # REST Controller
|
||||
│ │ └── XxxController.java
|
||||
│ └── job/ # 定时任务
|
||||
│ └── XxxJob.java
|
||||
│
|
||||
├── web-app/ # 应用层 - 业务编排
|
||||
│ └── src/main/java/.../
|
||||
│ ├── command/{module}/ # 写操作执行器
|
||||
│ │ ├── XxxAddExe.java
|
||||
│ │ ├── XxxEditExe.java
|
||||
│ │ └── XxxRemoveExe.java
|
||||
│ ├── command/query/{module}/ # 读操作执行器
|
||||
│ │ └── XxxQueryExe.java
|
||||
│ ├── command/convertor/{module}/ # 对象转换器
|
||||
│ │ └── XxxCoConvertor.java
|
||||
│ └── service/{module}/ # Service实现
|
||||
│ └── XxxServiceImpl.java
|
||||
│
|
||||
├── web-client/ # 客户端层 - 接口定义 + DTO
|
||||
│ └── src/main/java/.../
|
||||
│ ├── api/{module}/ # 服务接口
|
||||
│ │ └── XxxServiceI.java
|
||||
│ ├── dto/{module}/ # 入参(Cmd/Qry)
|
||||
│ │ ├── XxxAddCmd.java
|
||||
│ │ ├── XxxEditCmd.java
|
||||
│ │ └── XxxPageQry.java
|
||||
│ ├── dto/clientobject/{module}/ # 出参(CO)
|
||||
│ │ └── XxxCO.java
|
||||
│ └── config/ # 配置类
|
||||
│
|
||||
├── web-domain/ # 领域层 - 核心业务模型
|
||||
│ └── src/main/java/.../
|
||||
│ └── domain/
|
||||
│ ├── model/{module}/ # 领域实体
|
||||
│ │ └── XxxE.java
|
||||
│ ├── gateway/{module}/ # 网关接口
|
||||
│ │ └── XxxGateway.java
|
||||
│ ├── enums/ # 枚举
|
||||
│ └── util/ # 领域工具
|
||||
│
|
||||
├── web-infrastructure/ # 基础设施层 - 数据库对接
|
||||
│ └── src/main/
|
||||
│ ├── java/.../
|
||||
│ │ ├── gatewayimpl/{module}/ # 网关实现
|
||||
│ │ │ └── XxxGatewayImpl.java
|
||||
│ │ ├── persistence/
|
||||
│ │ │ ├── dataobject/{module}/ # 数据对象
|
||||
│ │ │ │ └── XxxDO.java
|
||||
│ │ │ ├── mapper/{module}/ # Mapper接口
|
||||
│ │ │ │ └── XxxMapper.java
|
||||
│ │ │ ├── repository/{module}/ # Repository接口
|
||||
│ │ │ │ └── XxxRepository.java
|
||||
│ │ │ └── repository/impl/{module}/ # Repository实现
|
||||
│ │ │ └── XxxRepositoryImpl.java
|
||||
│ │ └── utils/ # 工具类
|
||||
│ └── resources/
|
||||
│ ├── mapper/{module}/ # MyBatis XML
|
||||
│ │ └── XxxMapper.xml
|
||||
│ └── mybatis/mybatis-config.xml
|
||||
│
|
||||
└── pom.xml # 父POM
|
||||
```
|
||||
|
||||
## 三、模块依赖关系
|
||||
|
||||
```
|
||||
start → adapter → app → client → domain
|
||||
↓
|
||||
infrastructure → domain
|
||||
```
|
||||
|
||||
| 模块 | 可依赖 |
|
||||
|------|--------|
|
||||
| web-domain | 无(纯核心,不依赖任何业务模块) |
|
||||
| web-client | web-domain |
|
||||
| web-infrastructure | web-domain |
|
||||
| web-app | web-client, web-infrastructure |
|
||||
| web-adapter | web-app, web-client |
|
||||
| start | web-adapter |
|
||||
|
||||
## 四、调用链路
|
||||
|
||||
```
|
||||
HTTP请求
|
||||
→ Controller (adapter层,参数校验、权限控制)
|
||||
→ ServiceI (client层,接口定义)
|
||||
→ ServiceImpl (app层,业务编排)
|
||||
→ XxxExe (app层,单一职责执行器)
|
||||
→ XxxGateway (domain层,网关接口)
|
||||
→ XxxGatewayImpl (infrastructure层,网关实现)
|
||||
→ XxxMapper (infrastructure层,MyBatis接口)
|
||||
→ XxxMapper.xml (SQL映射)
|
||||
→ 数据库
|
||||
```
|
||||
|
||||
## 五、各层代码模板
|
||||
|
||||
### 5.1 web-client — 服务接口 + DTO
|
||||
|
||||
#### 服务接口 `XxxServiceI.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.api.module;
|
||||
|
||||
import com.jjb.saas.framework.client.ResponseData;
|
||||
import com.zcloud.xinyigate.dto.module.XxxAddCmd;
|
||||
import com.zcloud.xinyigate.dto.module.XxxEditCmd;
|
||||
import com.zcloud.xinyigate.dto.module.XxxPageQry;
|
||||
import com.zcloud.xinyigate.dto.clientobject.module.XxxCO;
|
||||
|
||||
public interface XxxServiceI {
|
||||
|
||||
ResponseData addXxx(XxxAddCmd cmd);
|
||||
|
||||
ResponseData editXxx(XxxEditCmd cmd);
|
||||
|
||||
ResponseData removeXxx(Long id);
|
||||
|
||||
ResponseData<XxxCO> getXxx(Long id);
|
||||
|
||||
ResponseData queryXxxPage(XxxPageQry qry);
|
||||
}
|
||||
```
|
||||
|
||||
#### 新增命令 `XxxAddCmd.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.dto.module;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
@ApiModel("Xxx新增命令")
|
||||
public class XxxAddCmd {
|
||||
|
||||
@NotBlank(message = "名称不能为空")
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
```
|
||||
|
||||
#### 分页查询 `XxxPageQry.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.dto.module;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("Xxx分页查询")
|
||||
public class XxxPageQry {
|
||||
|
||||
@ApiModelProperty("页码")
|
||||
private Integer pageIndex = 1;
|
||||
|
||||
@ApiModelProperty("每页条数")
|
||||
private Integer pageSize = 10;
|
||||
|
||||
@ApiModelProperty("名称(模糊查询)")
|
||||
private String name;
|
||||
}
|
||||
```
|
||||
|
||||
#### 返回对象 `XxxCO.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.dto.clientobject.module;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("Xxx返回对象")
|
||||
public class XxxCO {
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
```
|
||||
|
||||
### 5.2 web-domain — 领域实体 + 网关接口
|
||||
|
||||
#### 领域实体 `XxxE.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.domain.model.module;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class XxxE {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String remark;
|
||||
}
|
||||
```
|
||||
|
||||
#### 网关接口 `XxxGateway.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.domain.gateway.module;
|
||||
|
||||
import com.zcloud.xinyigate.domain.model.module.XxxE;
|
||||
|
||||
public interface XxxGateway {
|
||||
|
||||
void add(XxxE xxxE);
|
||||
|
||||
void edit(XxxE xxxE);
|
||||
|
||||
void remove(Long id);
|
||||
|
||||
XxxE getById(Long id);
|
||||
}
|
||||
```
|
||||
|
||||
### 5.3 web-app — Service实现 + 执行器
|
||||
|
||||
#### Service实现 `XxxServiceImpl.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.service.module;
|
||||
|
||||
import com.jjb.saas.framework.client.ResponseData;
|
||||
import com.zcloud.xinyigate.api.module.XxxServiceI;
|
||||
import com.zcloud.xinyigate.command.module.XxxAddExe;
|
||||
import com.zcloud.xinyigate.command.module.XxxEditExe;
|
||||
import com.zcloud.xinyigate.command.query.module.XxxQueryExe;
|
||||
import com.zcloud.xinyigate.dto.module.XxxAddCmd;
|
||||
import com.zcloud.xinyigate.dto.module.XxxEditCmd;
|
||||
import com.zcloud.xinyigate.dto.module.XxxPageQry;
|
||||
import com.zcloud.xinyigate.dto.clientobject.module.XxxCO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class XxxServiceImpl implements XxxServiceI {
|
||||
|
||||
private final XxxAddExe xxxAddExe;
|
||||
private final XxxEditExe xxxEditExe;
|
||||
private final XxxQueryExe xxxQueryExe;
|
||||
|
||||
@Override
|
||||
public ResponseData addXxx(XxxAddCmd cmd) {
|
||||
xxxAddExe.execute(cmd);
|
||||
return ResponseData.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseData editXxx(XxxEditCmd cmd) {
|
||||
xxxEditExe.execute(cmd);
|
||||
return ResponseData.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseData removeXxx(Long id) {
|
||||
// 直接调用Gateway或写RemoveExe
|
||||
return ResponseData.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseData<XxxCO> getXxx(Long id) {
|
||||
return ResponseData.success(xxxQueryExe.getById(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseData queryXxxPage(XxxPageQry qry) {
|
||||
return ResponseData.success(xxxQueryExe.queryPage(qry));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 新增执行器 `XxxAddExe.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.command.module;
|
||||
|
||||
import com.zcloud.xinyigate.domain.gateway.module.XxxGateway;
|
||||
import com.zcloud.xinyigate.domain.model.module.XxxE;
|
||||
import com.zcloud.xinyigate.dto.module.XxxAddCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class XxxAddExe {
|
||||
|
||||
private final XxxGateway xxxGateway;
|
||||
|
||||
public void execute(XxxAddCmd cmd) {
|
||||
XxxE xxxE = new XxxE();
|
||||
xxxE.setName(cmd.getName());
|
||||
xxxE.setRemark(cmd.getRemark());
|
||||
xxxGateway.add(xxxE);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 查询执行器 `XxxQueryExe.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.command.query.module;
|
||||
|
||||
import com.zcloud.xinyigate.domain.gateway.module.XxxGateway;
|
||||
import com.zcloud.xinyigate.domain.model.module.XxxE;
|
||||
import com.zcloud.xinyigate.dto.clientobject.module.XxxCO;
|
||||
import com.zcloud.xinyigate.dto.module.XxxPageQry;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class XxxQueryExe {
|
||||
|
||||
private final XxxGateway xxxGateway;
|
||||
|
||||
public XxxCO getById(Long id) {
|
||||
XxxE xxxE = xxxGateway.getById(id);
|
||||
// E → CO 转换
|
||||
XxxCO co = new XxxCO();
|
||||
co.setId(xxxE.getId());
|
||||
co.setName(xxxE.getName());
|
||||
co.setRemark(xxxE.getRemark());
|
||||
return co;
|
||||
}
|
||||
|
||||
public Object queryPage(XxxPageQry qry) {
|
||||
// 调用Gateway分页查询,转换返回
|
||||
return null;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 5.4 web-infrastructure — 数据库对接
|
||||
|
||||
#### 数据对象 `XxxDO.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.persistence.dataobject.module;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("t_xxx")
|
||||
public class XxxDO {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String name;
|
||||
private String remark;
|
||||
}
|
||||
```
|
||||
|
||||
#### Mapper接口 `XxxMapper.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.persistence.mapper.module;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zcloud.xinyigate.persistence.dataobject.module.XxxDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface XxxMapper extends BaseMapper<XxxDO> {
|
||||
}
|
||||
```
|
||||
|
||||
#### Mapper XML `XxxMapper.xml`
|
||||
|
||||
```xml
|
||||
<?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.xinyigate.persistence.mapper.module.XxxMapper">
|
||||
|
||||
</mapper>
|
||||
```
|
||||
|
||||
#### 网关实现 `XxxGatewayImpl.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.gatewayimpl.module;
|
||||
|
||||
import com.zcloud.xinyigate.domain.gateway.module.XxxGateway;
|
||||
import com.zcloud.xinyigate.domain.model.module.XxxE;
|
||||
import com.zcloud.xinyigate.persistence.dataobject.module.XxxDO;
|
||||
import com.zcloud.xinyigate.persistence.mapper.module.XxxMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class XxxGatewayImpl implements XxxGateway {
|
||||
|
||||
private final XxxMapper xxxMapper;
|
||||
|
||||
@Override
|
||||
public void add(XxxE xxxE) {
|
||||
XxxDO xxxDO = new XxxDO();
|
||||
xxxDO.setName(xxxE.getName());
|
||||
xxxDO.setRemark(xxxE.getRemark());
|
||||
xxxMapper.insert(xxxDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(XxxE xxxE) {
|
||||
XxxDO xxxDO = new XxxDO();
|
||||
xxxDO.setId(xxxE.getId());
|
||||
xxxDO.setName(xxxE.getName());
|
||||
xxxDO.setRemark(xxxE.getRemark());
|
||||
xxxMapper.updateById(xxxDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
xxxMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XxxE getById(Long id) {
|
||||
XxxDO xxxDO = xxxMapper.selectById(id);
|
||||
if (xxxDO == null) return null;
|
||||
XxxE xxxE = new XxxE();
|
||||
xxxE.setId(xxxDO.getId());
|
||||
xxxE.setName(xxxDO.getName());
|
||||
xxxE.setRemark(xxxDO.getRemark());
|
||||
return xxxE;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 5.5 web-adapter — Controller
|
||||
|
||||
#### REST接口 `XxxController.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.web.module;
|
||||
|
||||
import com.jjb.saas.framework.client.ResponseData;
|
||||
import com.zcloud.xinyigate.api.module.XxxServiceI;
|
||||
import com.zcloud.xinyigate.dto.module.XxxAddCmd;
|
||||
import com.zcloud.xinyigate.dto.module.XxxEditCmd;
|
||||
import com.zcloud.xinyigate.dto.module.XxxPageQry;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/xxx")
|
||||
@Api(tags = "Xxx管理")
|
||||
@RequiredArgsConstructor
|
||||
public class XxxController {
|
||||
|
||||
private final XxxServiceI xxxService;
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增")
|
||||
public ResponseData add(@Valid @RequestBody XxxAddCmd cmd) {
|
||||
return xxxService.addXxx(cmd);
|
||||
}
|
||||
|
||||
@PostMapping("/edit")
|
||||
@ApiOperation("编辑")
|
||||
public ResponseData edit(@Valid @RequestBody XxxEditCmd cmd) {
|
||||
return xxxService.editXxx(cmd);
|
||||
}
|
||||
|
||||
@PostMapping("/remove/{id}")
|
||||
@ApiOperation("删除")
|
||||
public ResponseData remove(@PathVariable Long id) {
|
||||
return xxxService.removeXxx(id);
|
||||
}
|
||||
|
||||
@GetMapping("/get/{id}")
|
||||
@ApiOperation("详情")
|
||||
public ResponseData get(@PathVariable Long id) {
|
||||
return xxxService.getXxx(id);
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
@ApiOperation("分页查询")
|
||||
public ResponseData page(@RequestBody XxxPageQry qry) {
|
||||
return xxxService.queryXxxPage(qry);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 5.6 定时任务(web-adapter)
|
||||
|
||||
#### `XxxJob.java`
|
||||
|
||||
```java
|
||||
package com.zcloud.xinyigate.job;
|
||||
|
||||
import com.jjb.saas.framework.job.Job;
|
||||
import com.jjb.saas.framework.job.annotation.JobRegister;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class XxxJob implements Job {
|
||||
|
||||
private final XxxServiceI xxxService;
|
||||
|
||||
@Override
|
||||
@JobRegister(cron = "0 0 0 * * ?", jobDesc = "Xxx定时任务", triggerStatus = 1)
|
||||
@XxlJob("com.zcloud.xinyigate.job.XxxJob")
|
||||
public ReturnT<String> execute(String param) {
|
||||
log.info("【Xxx定时任务】开始执行");
|
||||
try {
|
||||
// xxxService.doSomething();
|
||||
log.info("【Xxx定时任务】执行完成");
|
||||
} catch (Exception e) {
|
||||
log.error("【Xxx定时任务】执行异常", e);
|
||||
return new ReturnT<>(ReturnT.FAIL_CODE, e.getMessage());
|
||||
}
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 六、开发步骤清单
|
||||
|
||||
实现一个新接口时,按以下顺序创建文件:
|
||||
|
||||
| 步骤 | 模块 | 文件 | 说明 |
|
||||
|------|------|------|------|
|
||||
| 1 | web-client | `dto/module/XxxAddCmd.java` | 定义入参 |
|
||||
| 2 | web-client | `dto/module/XxxPageQry.java` | 定义查询参数 |
|
||||
| 3 | web-client | `dto/clientobject/module/XxxCO.java` | 定义出参 |
|
||||
| 4 | web-client | `api/module/XxxServiceI.java` | 定义服务接口 |
|
||||
| 5 | web-domain | `domain/model/module/XxxE.java` | 定义领域实体 |
|
||||
| 6 | web-domain | `domain/gateway/module/XxxGateway.java` | 定义网关接口 |
|
||||
| 7 | web-infrastructure | `persistence/dataobject/module/XxxDO.java` | 定义数据对象 |
|
||||
| 8 | web-infrastructure | `persistence/mapper/module/XxxMapper.java` | 定义Mapper接口 |
|
||||
| 9 | web-infrastructure | `resources/mapper/module/XxxMapper.xml` | 编写SQL |
|
||||
| 10 | web-infrastructure | `gatewayimpl/module/XxxGatewayImpl.java` | 实现网关 |
|
||||
| 11 | web-app | `command/module/XxxAddExe.java` | 实现新增逻辑 |
|
||||
| 12 | web-app | `command/query/module/XxxQueryExe.java` | 实现查询逻辑 |
|
||||
| 13 | web-app | `service/module/XxxServiceImpl.java` | 实现Service |
|
||||
| 14 | web-adapter | `web/module/XxxController.java` | 暴露REST接口 |
|
||||
|
||||
## 七、命名规范
|
||||
|
||||
| 类型 | 命名 | 示例 |
|
||||
|------|------|------|
|
||||
| Controller | `{业务}Controller` | `GateRecordController` |
|
||||
| Service接口 | `{业务}ServiceI` | `GateRecordServiceI` |
|
||||
| Service实现 | `{业务}ServiceImpl` | `GateRecordServiceImpl` |
|
||||
| 新增执行器 | `{业务}AddExe` | `GateRecordAddExe` |
|
||||
| 编辑执行器 | `{业务}EditExe` | `GateRecordEditExe` |
|
||||
| 删除执行器 | `{业务}RemoveExe` | `GateRecordRemoveExe` |
|
||||
| 查询执行器 | `{业务}QueryExe` | `GateRecordQueryExe` |
|
||||
| 领域实体 | `{业务}E` | `GateRecordE` |
|
||||
| 网关接口 | `{业务}Gateway` | `GateRecordGateway` |
|
||||
| 网关实现 | `{业务}GatewayImpl` | `GateRecordGatewayImpl` |
|
||||
| 数据对象 | `{业务}DO` | `GateRecordDO` |
|
||||
| Mapper接口 | `{业务}Mapper` | `GateRecordMapper` |
|
||||
| 新增命令 | `{业务}AddCmd` | `GateRecordAddCmd` |
|
||||
| 编辑命令 | `{业务}EditCmd` | `GateRecordEditCmd` |
|
||||
| 分页查询 | `{业务}PageQry` | `GateRecordPageQry` |
|
||||
| 返回对象 | `{业务}CO` | `GateRecordCO` |
|
||||
| 定时任务 | `{业务}Job` | `GateRecordJob` |
|
||||
|
||||
## 八、注意事项
|
||||
|
||||
1. **包名统一为 `com.zcloud.xinyigate`**,Java目录对应 `com/zcloud/xinyigate/`
|
||||
2. **Application.java** 中的 `mapperPackages` 已配置为 `com.zcloud.xinyigate.persistence.mapper`,新Mapper会自动扫描
|
||||
3. **分页参数**统一使用 `pageIndex`(页码)和 `pageSize`(每页条数),参考 `Query.java` 工具类
|
||||
4. **定时任务**必须实现 `Job` 接口,同时加 `@JobRegister` 和 `@XxlJob` 注解
|
||||
5. **对象转换**:Cmd → E(在Exe中),DO → E(在GatewayImpl中),E → CO(在QueryExe中)
|
||||
6. **Flyway** 已集成,数据库变更脚本放在 `start/src/main/resources/db/migration/` 下
|
||||
|
|
@ -0,0 +1,394 @@
|
|||
# 新益门禁后端接口开发文档
|
||||
|
||||
## 接口总览
|
||||
|
||||
| 编号 | 接口 | 方法 | 路径 | 模块 |
|
||||
|------|------|------|------|------|
|
||||
| 1 | 获取部门审核人/审批人/确认人列表 | POST | `/deptAuditor/list` | DeptAuditor |
|
||||
| 2 | 设置审核人/审批人/确认人 | POST | `/deptAuditor/save` | DeptAuditor |
|
||||
| 3 | 获取来访申请列表 | POST | `/visitorApply/page` | VisitorApply |
|
||||
| 4 | 新增来访申请 | POST | `/visitorApply/add` | VisitorApply |
|
||||
| 5 | 删除来访申请 | POST | `/visitorApply/remove` | VisitorApply |
|
||||
| 6 | 进场/出场确认 | POST | `/visitorApply/confirm` | VisitorApply |
|
||||
| 7 | 新增黑名单 | POST | `/blacklist/add` | Blacklist |
|
||||
| 8 | 获取黑名单列表 | POST | `/blacklist/page` | Blacklist |
|
||||
| 9 | 删除黑名单 | POST | `/blacklist/remove` | Blacklist |
|
||||
|
||||
---
|
||||
|
||||
## 接口1:获取部门审核人/审批人/确认人列表
|
||||
|
||||
### 请求
|
||||
|
||||
```
|
||||
POST /deptAuditor/list
|
||||
```
|
||||
|
||||
### 入参 `DeptAuditorListQry`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|--------|------|------|------|
|
||||
| deptId | String | 否 | 部门名称(模糊筛选) |
|
||||
|
||||
### 出参 `List<DeptAuditorCO>`
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| deptId | Long | 部门ID |
|
||||
| deptName | String | 部门名称 |
|
||||
| deptLevel | String | 部门级别 |
|
||||
| leaderName | String | 主管领导 |
|
||||
| headName | String | 部门负责人 |
|
||||
| auditors | List<AuditorItemCO> | 审核人列表 |
|
||||
| approvers | List<AuditorItemCO> | 审批人列表 |
|
||||
| confirmers | List<AuditorItemCO> | 确认人列表 |
|
||||
|
||||
### `AuditorItemCO`
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|----------|--------|--------|
|
||||
| id | Long | 主键id |
|
||||
| configId | String | 配置UUID |
|
||||
| userId | Long | 用户ID |
|
||||
| userName | String | 用户姓名 |
|
||||
|
||||
### 逻辑说明
|
||||
|
||||
1. 查询部门列表(需调用外部部门服务获取部门名称、级别、主管领导、负责人信息)
|
||||
2. 按部门ID分组查询 `gate_dept_auditor_config`,按 `config_type` 拆分为审核人/审批人/确认人
|
||||
3. 组装返回,每个部门一行,三种人员作为子列表
|
||||
|
||||
---
|
||||
|
||||
## 接口2:设置审核人/审批人/确认人
|
||||
|
||||
### 请求
|
||||
|
||||
```
|
||||
POST /deptAuditor/save
|
||||
```
|
||||
|
||||
### 入参 `DeptAuditorSaveCmd`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|------|------------|------|------|
|
||||
| deptId | Long | 是 | 部门ID |
|
||||
| configType | Integer | 是 | 配置类型:1-审核人 2-审批人 3-确认人 |
|
||||
| userList | List<Long> | 是 | 相关人员数组(可多个) |
|
||||
|
||||
### 逻辑说明
|
||||
|
||||
1. 每次只更新一种类型(configType)
|
||||
2. 先删除该部门该类型的所有旧配置:`DELETE FROM gate_dept_auditor_config WHERE dept_id = ? AND config_type = ?`
|
||||
3. 批量插入新配置,每条记录生成 `config_id` UUID
|
||||
4. 事务保证原子性
|
||||
|
||||
---
|
||||
|
||||
## 接口3:获取外来人员/外来车辆管理列表
|
||||
|
||||
### 请求
|
||||
|
||||
```
|
||||
POST /visitorApply/page
|
||||
```
|
||||
|
||||
### 入参 `VisitorApplyPageQry`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| pageIndex | Integer | 否 | 页码,默认1 |
|
||||
| pageSize | Integer | 否 | 每页条数,默认10 |
|
||||
| sourceUnit | String | 否 | 来源单位(模糊筛选) |
|
||||
| statusList | List<Integer> | 否 | 状态列表(多选筛选) |
|
||||
| applyStartTime | String | 否 | 申请时间起(yyyy-MM-dd) |
|
||||
| applyEndTime | String | 否 | 申请时间止(yyyy-MM-dd) |
|
||||
|
||||
### 出参 `PageData<VisitorApplyCO>`
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| visitorApplyId | String | 业务主键UUID |
|
||||
| applyType | Integer | 申请类型:1-外来人员 2-外来车辆 |
|
||||
| sourceUnit | String | 来源单位 |
|
||||
| visitorCount | Integer | 入场人数 |
|
||||
| applyStartTime | String | 申请开始时间 |
|
||||
| applyEndTime | String | 申请结束时间 |
|
||||
| licensePlate | String | 车牌号 |
|
||||
| vehicleType | String | 车型 |
|
||||
| purpose | String | 入场事由 |
|
||||
| applySourceDesc | String | 申请来源(来源类型 + 部门名称 + 人员名称) |
|
||||
| status | Integer | 状态 |
|
||||
|
||||
### 逻辑说明
|
||||
|
||||
1. 分页查询 `gate_visitor_apply`,支持来源单位模糊、状态多选、申请时间范围筛选
|
||||
2. `applySourceDesc` 拼接逻辑:申请来源类型(PC端/扫码) + 申请部门名称 + 申请人姓名,需关联部门服务和用户服务
|
||||
3. 状态枚举:0未提交 1待审核 2待审批 3待确认 4已进场 5已出场 6已打回 7待归档 8已归档 9已过期
|
||||
|
||||
---
|
||||
|
||||
## 接口4:新增外来人员/外来车辆管理
|
||||
|
||||
### 请求
|
||||
|
||||
```
|
||||
POST /visitorApply/add
|
||||
```
|
||||
|
||||
### 入参 `VisitorApplyAddCmd`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|----------------|------------------------|------|---------------------|
|
||||
| applyType | Integer | 是 | 申请类型:1-外来人员 2-外来车辆 |
|
||||
| sourceUnit | String | 是 | 来源单位 |
|
||||
| visitorCount | Integer | 否 | 入场人数 |
|
||||
| licensePlate | String | 条件必填 | 车牌号(applyType=2时必填) |
|
||||
| vehicleType | String | 否 | 车型(applyType=2时填写) |
|
||||
| purpose | String | 是 | 入场事由 |
|
||||
| applyStartTime | String | 是 | 申请开始时间 |
|
||||
| applyEndTime | String | 是 | 申请结束时间 |
|
||||
| auditDeptId | Long | 是 | 审批部门ID |
|
||||
| personList | List<VisitorPersonCmd> | 是 | 人员列表(姓名+手机号,可多条) |
|
||||
| status | Intger | 是 | 状态 |
|
||||
|
||||
### `VisitorPersonCmd`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| name | String | 是 | 姓名 |
|
||||
| phone | String | 是 | 手机号 |
|
||||
|
||||
### 逻辑说明
|
||||
|
||||
1. 生成 `visitor_apply_id` UUID,插入 `gate_visitor_apply`
|
||||
2. `person_type` 自动设置:applyType=1时为1(来访人员),applyType=2时为2(车内人员)
|
||||
3. 批量插入 `gate_visitor_person`,每条生成 `visitor_person_id` UUID
|
||||
4. 校验黑名单:遍历personList中的姓名+手机号查 `gate_blacklist`(blacklist_type=1),以及车牌号查 `gate_blacklist`(blacklist_type=2),命中则提示
|
||||
5. 状态初始为 0(未提交)
|
||||
|
||||
---
|
||||
|
||||
## 接口5:删除外来人员/外来车辆管理
|
||||
|
||||
### 请求
|
||||
|
||||
```
|
||||
POST /visitorApply/remove
|
||||
```
|
||||
|
||||
### 入参 `VisitorApplyRemoveCmd`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| visitorApplyId | String | 是 | 业务主键UUID |
|
||||
|
||||
### 逻辑说明
|
||||
|
||||
1. 逻辑删除 `gate_visitor_apply`:设置 `delete_enum = 'true'`
|
||||
2. 同时逻辑删除关联的 `gate_visitor_person`:按 `visitor_apply_id` 设置 `delete_enum = 'true'`
|
||||
|
||||
---
|
||||
|
||||
## 接口6:进场/出场确认
|
||||
|
||||
### 请求
|
||||
|
||||
```
|
||||
POST /visitorApply/confirm
|
||||
```
|
||||
|
||||
### 入参 `VisitorApplyConfirmCmd`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| visitorApplyId | String | 是 | 业务主键UUID |
|
||||
| confirmType | Integer | 是 | 确认类型:1-进场 2-出场 |
|
||||
|
||||
### 逻辑说明
|
||||
|
||||
1. 根据 `visitorApplyId` 查询申请记录,校验存在且未删除
|
||||
2. 进场确认(confirmType=1):状态必须为3(待确认),确认后改为4(已进场)
|
||||
3. 出场确认(confirmType=2):状态必须为4(已进场),确认后改为5(已出场)
|
||||
4. 同时插入一条 `gate_visitor_audit` 审核记录,`audit_type=3`(现场确认),`audit_result=1`(通过)
|
||||
|
||||
---
|
||||
|
||||
## 接口7:新增黑名单
|
||||
|
||||
### 请求
|
||||
|
||||
```
|
||||
POST /blacklist/add
|
||||
```
|
||||
|
||||
### 入参 `BlacklistAddCmd`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| blacklistType | Integer | 是 | 黑名单类型:1-人员 2-车辆 |
|
||||
| name | String | 条件必填 | 姓名(blacklistType=1时必填) |
|
||||
| phone | String | 条件必填 | 手机号(blacklistType=1时必填) |
|
||||
| licensePlate | String | 条件必填 | 车牌号(blacklistType=2时必填) |
|
||||
| affiliatedUnit | String | 否 | 所属单位 |
|
||||
|
||||
### 逻辑说明
|
||||
|
||||
1. 生成 `blacklist_id` UUID
|
||||
2. `join_time` 自动设置为当前时间
|
||||
3. `added_by_id` 自动取当前登录用户ID
|
||||
4. 校验重复:人员黑名单按姓名+手机号查重,车辆黑名单按车牌号查重(同一租户下)
|
||||
|
||||
---
|
||||
|
||||
## 接口8:获取黑名单列表
|
||||
|
||||
### 请求
|
||||
|
||||
```
|
||||
POST /blacklist/page
|
||||
```
|
||||
|
||||
### 入参 `BlacklistPageQry`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| pageIndex | Integer | 否 | 页码,默认1 |
|
||||
| pageSize | Integer | 否 | 每页条数,默认10 |
|
||||
| blacklistType | Integer | 是 | 黑名单类型:1-人员 2-车辆 |
|
||||
| name | String | 否 | 姓名(模糊筛选) |
|
||||
| phone | String | 否 | 手机号(模糊筛选) |
|
||||
| status | Integer | 否 | 状态:1-启用 0-禁用 |
|
||||
| affiliatedUnit | String | 否 | 所属单位(模糊筛选) |
|
||||
| licensePlate | String | 否 | 车牌号(模糊筛选) |
|
||||
|
||||
### 出参 `PageData<BlacklistCO>`
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| blacklistId | String | 业务主键UUID |
|
||||
| blacklistType | Integer | 类型:1-人员 2-车辆 |
|
||||
| name | String | 姓名 |
|
||||
| phone | String | 手机号 |
|
||||
| licensePlate | String | 车牌号 |
|
||||
| affiliatedUnit | String | 所属单位 |
|
||||
| joinTime | String | 加入时间 |
|
||||
| addedByName | String | 添加人 |
|
||||
| status | Integer | 状态 |
|
||||
|
||||
### 逻辑说明
|
||||
|
||||
1. 按 `blacklist_type` 必选筛选
|
||||
2. 支持姓名、手机号、车牌号、所属单位模糊筛选,状态精确筛选
|
||||
3. `addedByName` 通过 `added_by_id` 关联用户服务获取
|
||||
|
||||
---
|
||||
|
||||
## 接口9:删除黑名单
|
||||
|
||||
### 请求
|
||||
|
||||
```
|
||||
POST /blacklist/remove
|
||||
```
|
||||
|
||||
### 入参 `BlacklistRemoveCmd`
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| blacklistId | String | 是 | 业务主键UUID |
|
||||
|
||||
### 逻辑说明
|
||||
|
||||
1. 逻辑删除:设置 `delete_enum = 'true'`
|
||||
|
||||
---
|
||||
|
||||
## 文件清单
|
||||
|
||||
按开发指南的分层架构,以下为需要创建的所有文件:
|
||||
|
||||
### 模块一:DeptAuditor(部门审核人配置)
|
||||
|
||||
| 层 | 文件路径 |
|
||||
|----|---------|
|
||||
| client | `dto/deptAuditor/DeptAuditorListQry.java` |
|
||||
| client | `dto/deptAuditor/DeptAuditorSaveCmd.java` |
|
||||
| client | `dto/deptAuditor/AuditorItemCmd.java` |
|
||||
| client | `dto/clientobject/deptAuditor/DeptAuditorCO.java` |
|
||||
| client | `dto/clientobject/deptAuditor/AuditorItemCO.java` |
|
||||
| client | `api/deptAuditor/DeptAuditorServiceI.java` |
|
||||
| domain | `domain/model/deptAuditor/DeptAuditorE.java` |
|
||||
| domain | `domain/gateway/deptAuditor/DeptAuditorGateway.java` |
|
||||
| infrastructure | `persistence/dataobject/deptAuditor/DeptAuditorConfigDO.java` |
|
||||
| infrastructure | `persistence/mapper/deptAuditor/DeptAuditorConfigMapper.java` |
|
||||
| infrastructure | `resources/mapper/deptAuditor/DeptAuditorConfigMapper.xml` |
|
||||
| infrastructure | `gatewayimpl/deptAuditor/DeptAuditorGatewayImpl.java` |
|
||||
| app | `command/deptAuditor/DeptAuditorSaveExe.java` |
|
||||
| app | `command/query/deptAuditor/DeptAuditorQueryExe.java` |
|
||||
| app | `service/deptAuditor/DeptAuditorServiceImpl.java` |
|
||||
| adapter | `web/deptAuditor/DeptAuditorController.java` |
|
||||
|
||||
### 模块二:VisitorApply(来访申请)
|
||||
|
||||
| 层 | 文件路径 |
|
||||
|----|---------|
|
||||
| client | `dto/visitorApply/VisitorApplyAddCmd.java` |
|
||||
| client | `dto/visitorApply/VisitorApplyRemoveCmd.java` |
|
||||
| client | `dto/visitorApply/VisitorApplyConfirmCmd.java` |
|
||||
| client | `dto/visitorApply/VisitorApplyPageQry.java` |
|
||||
| client | `dto/visitorApply/VisitorPersonCmd.java` |
|
||||
| client | `dto/clientobject/visitorApply/VisitorApplyCO.java` |
|
||||
| client | `api/visitorApply/VisitorApplyServiceI.java` |
|
||||
| domain | `domain/model/visitorApply/VisitorApplyE.java` |
|
||||
| domain | `domain/model/visitorApply/VisitorPersonE.java` |
|
||||
| domain | `domain/gateway/visitorApply/VisitorApplyGateway.java` |
|
||||
| domain | `domain/gateway/visitorApply/VisitorPersonGateway.java` |
|
||||
| infrastructure | `persistence/dataobject/visitorApply/VisitorApplyDO.java` |
|
||||
| infrastructure | `persistence/dataobject/visitorApply/VisitorPersonDO.java` |
|
||||
| infrastructure | `persistence/mapper/visitorApply/VisitorApplyMapper.java` |
|
||||
| infrastructure | `persistence/mapper/visitorApply/VisitorPersonMapper.java` |
|
||||
| infrastructure | `resources/mapper/visitorApply/VisitorApplyMapper.xml` |
|
||||
| infrastructure | `resources/mapper/visitorApply/VisitorPersonMapper.xml` |
|
||||
| infrastructure | `gatewayimpl/visitorApply/VisitorApplyGatewayImpl.java` |
|
||||
| infrastructure | `gatewayimpl/visitorApply/VisitorPersonGatewayImpl.java` |
|
||||
| app | `command/visitorApply/VisitorApplyAddExe.java` |
|
||||
| app | `command/visitorApply/VisitorApplyRemoveExe.java` |
|
||||
| app | `command/visitorApply/VisitorApplyConfirmExe.java` |
|
||||
| app | `command/query/visitorApply/VisitorApplyQueryExe.java` |
|
||||
| app | `service/visitorApply/VisitorApplyServiceImpl.java` |
|
||||
| adapter | `web/visitorApply/VisitorApplyController.java` |
|
||||
|
||||
### 模块三:Blacklist(黑名单)
|
||||
|
||||
| 层 | 文件路径 |
|
||||
|----|---------|
|
||||
| client | `dto/blacklist/BlacklistAddCmd.java` |
|
||||
| client | `dto/blacklist/BlacklistRemoveCmd.java` |
|
||||
| client | `dto/blacklist/BlacklistPageQry.java` |
|
||||
| client | `dto/clientobject/blacklist/BlacklistCO.java` |
|
||||
| client | `api/blacklist/BlacklistServiceI.java` |
|
||||
| domain | `domain/model/blacklist/BlacklistE.java` |
|
||||
| domain | `domain/gateway/blacklist/BlacklistGateway.java` |
|
||||
| infrastructure | `persistence/dataobject/blacklist/BlacklistDO.java` |
|
||||
| infrastructure | `persistence/mapper/blacklist/BlacklistMapper.java` |
|
||||
| infrastructure | `resources/mapper/blacklist/BlacklistMapper.xml` |
|
||||
| infrastructure | `gatewayimpl/blacklist/BlacklistGatewayImpl.java` |
|
||||
| app | `command/blacklist/BlacklistAddExe.java` |
|
||||
| app | `command/blacklist/BlacklistRemoveExe.java` |
|
||||
| app | `command/query/blacklist/BlacklistQueryExe.java` |
|
||||
| app | `service/blacklist/BlacklistServiceImpl.java` |
|
||||
| adapter | `web/blacklist/BlacklistController.java` |
|
||||
|
||||
---
|
||||
|
||||
## 状态流转图
|
||||
|
||||
```
|
||||
0未提交 → 1待审核 → 2待审批 → 3待确认 → 4已进场 → 5已出场
|
||||
↑ ↑ ↑
|
||||
└──── 6已打回(任一环节拒绝) ────┘
|
||||
|
||||
7待归档 → 8已归档
|
||||
9已过期(申请时间过期自动标记)
|
||||
```
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<?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.xinyiGate</groupId>
|
||||
<artifactId>zcloud_gbs_xinyi_gate</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>zcloud_gbs_xinyi_gate</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>
|
||||
<dependency>
|
||||
<groupId>com.jjb.saas</groupId>
|
||||
<artifactId>jjb-saas-system-client</artifactId>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!--Project modules-->
|
||||
<dependency>
|
||||
<groupId>com.zcloud.xinyiGate</groupId>
|
||||
<artifactId>web-adapter</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zcloud.xinyiGate</groupId>
|
||||
<artifactId>web-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zcloud.xinyiGate</groupId>
|
||||
<artifactId>web-app</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zcloud.xinyiGate</groupId>
|
||||
<artifactId>web-domain</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zcloud.xinyiGate</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>
|
||||
|
|
@ -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.xinyiGate</groupId>
|
||||
<artifactId>zcloud_gbs_xinyi_gate</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.xinyiGate</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.xinyiGate.Application</mainClass>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.zcloud.xinyiGate;
|
||||
|
||||
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.xinyiGate.persistence.mapper"}
|
||||
)
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
spring:
|
||||
config:
|
||||
import:
|
||||
- classpath:nacos.yml
|
||||
- classpath:sdk.yml
|
||||
# - classpath:nacos-prod.yml
|
||||
# - classpath:sdk-prod.yml
|
||||
- classpath:swagger.yml
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
nacos:
|
||||
url: prod-nacos:8848
|
||||
namespace: jjb-dragon
|
||||
application:
|
||||
name: jjb-saas-zcloud-xinyi-gate
|
||||
version:
|
||||
gateway: xinyiGate
|
||||
cn-name: 新益门禁
|
||||
spring:
|
||||
application:
|
||||
name: ${application.name}${application.version}
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: test
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
username: nacos
|
||||
password: u9Hc7tLFBY
|
||||
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}
|
||||
username: nacos
|
||||
password: u9Hc7tLFBY
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
nacos:
|
||||
url: 192.168.20.100:30290
|
||||
namespace: jjb-dragon
|
||||
application:
|
||||
name: jjb-saas-zcloud-xinyi-gate
|
||||
version:
|
||||
gateway: xinyiGate
|
||||
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}
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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}
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
server:
|
||||
port: 80
|
||||
debug: true
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
sdk:
|
||||
server:
|
||||
app-key: 09a491d02f9b4371968deb601898b467
|
||||
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: http://${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: http://jjb-saas-base
|
||||
path: /${application.gateway}/container/**
|
||||
order: -2
|
||||
archives:
|
||||
async:
|
||||
pool:
|
||||
maxPoolSize: 2
|
||||
corePoolSize: 1
|
||||
queueCapacity: 60
|
||||
namePrefix: async-task-
|
||||
keepAliveSeconds: 60
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
sdk:
|
||||
server:
|
||||
app-key: 09a491d02f9b4371968deb601898b467
|
||||
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
|
||||
archives:
|
||||
async:
|
||||
pool:
|
||||
maxPoolSize: 2
|
||||
corePoolSize: 1
|
||||
queueCapacity: 60
|
||||
namePrefix: async-task-
|
||||
keepAliveSeconds: 60
|
||||
|
|
@ -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
|
||||
|
|
@ -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.xinyiGate</groupId>
|
||||
<artifactId>zcloud_gbs_xinyi_gate</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.zcloud.xinyiGate</groupId>
|
||||
<artifactId>web-app</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zcloud.xinyiGate</groupId>
|
||||
<artifactId>web-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jjb.saas</groupId>
|
||||
<artifactId>jjb-saas-framework-job</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.zcloud.xinyiGate.job;
|
||||
|
||||
import com.jjb.saas.framework.job.Job;
|
||||
import com.jjb.saas.framework.job.annotation.JobRegister;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import com.zcloud.xinyiGate.api.visitorApply.VisitorApplyServiceI;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 来访申请 - 定时任务:更新过期申请状态
|
||||
* <p>
|
||||
* 执行周期:每10分钟(cron = "0 0/10 * * * ?")
|
||||
* <p>
|
||||
* 业务场景:
|
||||
* 当来访申请的申请结束时间已过(即当前时间 > apply_end_time),
|
||||
* 需要自动将其状态置为10(已过期),排除已打回(6)、已完结(9)、已过期(10)的记录。
|
||||
* <p>
|
||||
* 调用层级:Job → VisitorApplyServiceI → VisitorApplyServiceImpl → VisitorApplyExpiredUpdateExe → Gateway → Mapper
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
@Slf4j
|
||||
public class VisitorApplyExpiredJob implements Job {
|
||||
|
||||
private final VisitorApplyServiceI visitorApplyService;
|
||||
|
||||
@Override
|
||||
@JobRegister(cron = "0 0/30 * * * ?", jobDesc = "新益门禁-更新过期来访申请状态", triggerStatus = 1)
|
||||
@XxlJob("com.zcloud.xinyiGate.job.VisitorApplyExpiredJob")
|
||||
public ReturnT<String> execute(String param) {
|
||||
log.info("【定时任务-新益门禁】开始更新过期来访申请状态");
|
||||
try {
|
||||
visitorApplyService.updateExpiredStatus();
|
||||
log.info("【定时任务-新益门禁】过期来访申请状态更新完成");
|
||||
} catch (Exception e) {
|
||||
log.error("【定时任务-新益门禁】过期来访申请状态更新异常", e);
|
||||
return new ReturnT<>(ReturnT.FAIL_CODE, e.getMessage());
|
||||
}
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.zcloud.xinyiGate.web.blacklist;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.zcloud.xinyiGate.api.blacklist.BlacklistServiceI;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistAddCmd;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistPageQry;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistRemoveCmd;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.blacklist.BlacklistCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/blacklist")
|
||||
@Api(tags = "黑名单管理")
|
||||
@RequiredArgsConstructor
|
||||
public class BlacklistController {
|
||||
|
||||
private final BlacklistServiceI blacklistService;
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增黑名单")
|
||||
public Response add(@Valid @RequestBody BlacklistAddCmd cmd) {
|
||||
return blacklistService.add(cmd);
|
||||
}
|
||||
|
||||
@PostMapping("/remove")
|
||||
@ApiOperation("删除黑名单")
|
||||
public Response remove(@Valid @RequestBody BlacklistRemoveCmd cmd) {
|
||||
return blacklistService.remove(cmd);
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
@ApiOperation("获取黑名单列表")
|
||||
public PageResponse<BlacklistCO> page(@Valid @RequestBody BlacklistPageQry qry) {
|
||||
return blacklistService.queryPage(qry);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.xinyiGate.web.deptAuditor;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.zcloud.xinyiGate.api.deptAuditor.DeptAuditorServiceI;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.deptAuditor.DeptAuditorCO;
|
||||
import com.zcloud.xinyiGate.dto.deptAuditor.DeptAuditorListQry;
|
||||
import com.zcloud.xinyiGate.dto.deptAuditor.DeptAuditorSaveCmd;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/deptAuditor")
|
||||
@Api(tags = "部门审核人配置")
|
||||
@RequiredArgsConstructor
|
||||
public class DeptAuditorController {
|
||||
|
||||
private final DeptAuditorServiceI deptAuditorService;
|
||||
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("获取部门审核人/审批人/确认人列表")
|
||||
public MultiResponse<DeptAuditorCO> list(@RequestBody DeptAuditorListQry qry) {
|
||||
return deptAuditorService.list(qry);
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("设置审核人/审批人/确认人")
|
||||
public Response save(@Valid @RequestBody DeptAuditorSaveCmd cmd) {
|
||||
return deptAuditorService.save(cmd);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.xinyiGate.web.visitorApply;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.zcloud.xinyiGate.api.visitorApply.VisitorApplyServiceI;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.visitorApply.VisitorApplyCO;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyAddCmd;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyAuditCmd;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyConfirmCmd;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyPageQry;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyRemoveCmd;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/visitorApply")
|
||||
@Api(tags = "来访申请管理")
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorApplyController {
|
||||
|
||||
private final VisitorApplyServiceI visitorApplyService;
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增外来人员/外来车辆管理")
|
||||
public Response add(@Valid @RequestBody VisitorApplyAddCmd cmd) {
|
||||
return visitorApplyService.add(cmd);
|
||||
}
|
||||
|
||||
@PostMapping("/remove")
|
||||
@ApiOperation("删除外来人员/外来车辆管理")
|
||||
public Response remove(@Valid @RequestBody VisitorApplyRemoveCmd cmd) {
|
||||
return visitorApplyService.remove(cmd);
|
||||
}
|
||||
|
||||
@PostMapping("/audit")
|
||||
@ApiOperation("审核/审批通过驳回")
|
||||
public Response audit(@Valid @RequestBody VisitorApplyAuditCmd cmd) {
|
||||
return visitorApplyService.audit(cmd);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@ApiOperation("进场/出场")
|
||||
public Response confirm(@Valid @RequestBody VisitorApplyConfirmCmd cmd) {
|
||||
return visitorApplyService.confirm(cmd);
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
@ApiOperation("获取外来人员/外来车辆管理列表")
|
||||
public PageResponse<VisitorApplyCO> page(@RequestBody VisitorApplyPageQry qry) {
|
||||
return visitorApplyService.queryPage(qry);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?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.xinyiGate</groupId>
|
||||
<artifactId>zcloud_gbs_xinyi_gate</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.xinyiGate</groupId>
|
||||
<artifactId>web-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zcloud.xinyiGate</groupId>
|
||||
<artifactId>web-infrastructure</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-stream-rocketmq</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.zcloud.xinyiGate.command.blacklist;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.xinyiGate.domain.gateway.blacklist.BlacklistGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.blacklist.BlacklistE;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistAddCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class BlacklistAddExe {
|
||||
|
||||
private final BlacklistGateway blacklistGateway;
|
||||
|
||||
public void execute(BlacklistAddCmd cmd) {
|
||||
// 校验重复
|
||||
if (cmd.getBlacklistType() == 1) {
|
||||
if (blacklistGateway.existsByPerson(cmd.getName(), cmd.getPhone())) {
|
||||
throw new BizException("该人员已在黑名单中");
|
||||
}
|
||||
} else if (cmd.getBlacklistType() == 2) {
|
||||
if (blacklistGateway.existsByLicensePlate(cmd.getLicensePlate())) {
|
||||
throw new BizException("该车辆已在黑名单中");
|
||||
}
|
||||
}
|
||||
|
||||
BlacklistE e = new BlacklistE();
|
||||
e.setBlacklistId(UuidUtil.get32UUID());
|
||||
e.setBlacklistType(cmd.getBlacklistType());
|
||||
e.setName(cmd.getName());
|
||||
e.setPhone(cmd.getPhone());
|
||||
e.setLicensePlate(cmd.getLicensePlate());
|
||||
e.setAffiliatedUnit(cmd.getAffiliatedUnit());
|
||||
e.setJoinTime(LocalDateTime.now().toString());
|
||||
e.setStatus(1);
|
||||
blacklistGateway.add(e);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.zcloud.xinyiGate.command.blacklist;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.gateway.blacklist.BlacklistGateway;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistRemoveCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class BlacklistRemoveExe {
|
||||
|
||||
private final BlacklistGateway blacklistGateway;
|
||||
|
||||
public void execute(BlacklistRemoveCmd cmd) {
|
||||
blacklistGateway.logicDelete(cmd.getBlacklistId());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.zcloud.xinyiGate.command.deptAuditor;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.gateway.deptAuditor.DeptAuditorGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.deptAuditor.DeptAuditorE;
|
||||
import com.zcloud.xinyiGate.dto.deptAuditor.DeptAuditorSaveCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DeptAuditorSaveExe {
|
||||
|
||||
private final DeptAuditorGateway deptAuditorGateway;
|
||||
|
||||
public void execute(DeptAuditorSaveCmd cmd) {
|
||||
// 先逻辑删除该部门该类型的旧配置
|
||||
deptAuditorGateway.removeByDeptIdAndType(cmd.getDeptId(), cmd.getConfigType());
|
||||
|
||||
// 批量插入新配置
|
||||
if (cmd.getUserList() != null && !cmd.getUserList().isEmpty()) {
|
||||
List<DeptAuditorE> list = new ArrayList<>();
|
||||
for (Long userId : cmd.getUserList()) {
|
||||
DeptAuditorE e = new DeptAuditorE();
|
||||
e.setDeptId(cmd.getDeptId());
|
||||
e.setConfigType(cmd.getConfigType());
|
||||
e.setUserId(userId);
|
||||
list.add(e);
|
||||
}
|
||||
deptAuditorGateway.batchAdd(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.zcloud.xinyiGate.command.query.blacklist;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.blacklist.BlacklistCO;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistPageQry;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.blacklist.BlacklistDO;
|
||||
import com.zcloud.xinyiGate.persistence.mapper.blacklist.BlacklistMapper;
|
||||
import com.zcloud.xinyiGate.utils.Query;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class BlacklistQueryExe {
|
||||
|
||||
private final BlacklistMapper blacklistMapper;
|
||||
|
||||
public PageResponse<BlacklistCO> queryPage(BlacklistPageQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
|
||||
IPage<BlacklistDO> page = new Query<BlacklistDO>().getPage(params);
|
||||
IPage<BlacklistDO> result = blacklistMapper.pageWithJoin(page, params);
|
||||
|
||||
PageResponse<BlacklistDO> pageResponse = PageHelper.pageToResponse(result, result.getRecords());
|
||||
return PageResponse.of(
|
||||
result.convert(this::toCO).getRecords(),
|
||||
pageResponse.getTotalCount(),
|
||||
pageResponse.getPageSize(),
|
||||
pageResponse.getPageIndex()
|
||||
);
|
||||
}
|
||||
|
||||
private BlacklistCO toCO(BlacklistDO dos) {
|
||||
BlacklistCO co = new BlacklistCO();
|
||||
co.setBlacklistId(dos.getBlacklistId());
|
||||
co.setBlacklistType(dos.getBlacklistType());
|
||||
co.setName(dos.getName());
|
||||
co.setPhone(dos.getPhone());
|
||||
co.setLicensePlate(dos.getLicensePlate());
|
||||
co.setAffiliatedUnit(dos.getAffiliatedUnit());
|
||||
co.setJoinTime(dos.getJoinTime());
|
||||
co.setAddedByName(dos.getAddedByName());
|
||||
co.setStatus(dos.getStatus());
|
||||
return co;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.zcloud.xinyiGate.command.query.deptAuditor;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.gateway.deptAuditor.DeptAuditorGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.deptAuditor.DeptAuditorE;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.deptAuditor.AuditorItemCO;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.deptAuditor.DeptAuditorCO;
|
||||
import com.zcloud.xinyiGate.dto.deptAuditor.DeptAuditorListQry;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.deptAuditor.DeptAuditorConfigDO;
|
||||
import com.zcloud.xinyiGate.persistence.mapper.deptAuditor.DeptAuditorConfigMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DeptAuditorQueryExe {
|
||||
|
||||
private final DeptAuditorConfigMapper deptAuditorConfigMapper;
|
||||
|
||||
public List<DeptAuditorCO> execute(DeptAuditorListQry qry) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
if (qry.getDeptId() != null) {
|
||||
params.put("deptId", qry.getDeptId());
|
||||
}
|
||||
if (qry.getDeptName() != null) {
|
||||
params.put("deptName", qry.getDeptName());
|
||||
}
|
||||
|
||||
// 联表一次查出所有数据(含部门名称、用户姓名)
|
||||
List<DeptAuditorConfigDO> doList = deptAuditorConfigMapper.listWithDeptInfo(params);
|
||||
|
||||
// 按部门ID分组
|
||||
Map<Long, List<DeptAuditorConfigDO>> deptMap = doList.stream()
|
||||
.collect(Collectors.groupingBy(DeptAuditorConfigDO::getDeptId));
|
||||
|
||||
List<DeptAuditorCO> result = new ArrayList<>();
|
||||
for (Map.Entry<Long, List<DeptAuditorConfigDO>> entry : deptMap.entrySet()) {
|
||||
DeptAuditorCO co = new DeptAuditorCO();
|
||||
co.setDeptId(entry.getKey());
|
||||
|
||||
List<DeptAuditorConfigDO> items = entry.getValue();
|
||||
if (!items.isEmpty()) {
|
||||
co.setDeptName(items.get(0).getDeptName());
|
||||
}
|
||||
|
||||
// 按 config_type 拆分
|
||||
co.setAuditors(buildItemList(items, 1));
|
||||
co.setApprovers(buildItemList(items, 2));
|
||||
co.setConfirmers(buildItemList(items, 3));
|
||||
|
||||
result.add(co);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<AuditorItemCO> buildItemList(List<DeptAuditorConfigDO> items, int configType) {
|
||||
return items.stream()
|
||||
.filter(d -> d.getConfigType() != null && d.getConfigType() == configType)
|
||||
.map(d -> {
|
||||
AuditorItemCO item = new AuditorItemCO();
|
||||
item.setId(d.getId());
|
||||
item.setConfigId(d.getConfigId());
|
||||
item.setUserId(d.getUserId());
|
||||
item.setUserName(d.getUserName());
|
||||
return item;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.zcloud.xinyiGate.command.query.visitorApply;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.visitorApply.VisitorApplyCO;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyPageQry;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorApplyDO;
|
||||
import com.zcloud.xinyiGate.persistence.mapper.visitorApply.VisitorApplyMapper;
|
||||
import com.zcloud.xinyiGate.utils.Query;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorApplyQueryExe {
|
||||
|
||||
private final VisitorApplyMapper visitorApplyMapper;
|
||||
|
||||
public PageResponse<VisitorApplyCO> queryPage(VisitorApplyPageQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
|
||||
IPage<VisitorApplyDO> page = new Query<VisitorApplyDO>().getPage(params);
|
||||
IPage<VisitorApplyDO> result = visitorApplyMapper.pageWithJoin(page, params);
|
||||
|
||||
PageResponse<VisitorApplyDO> pageResponse = PageHelper.pageToResponse(result, result.getRecords());
|
||||
return PageResponse.of(
|
||||
result.convert(this::toCO).getRecords(),
|
||||
pageResponse.getTotalCount(),
|
||||
pageResponse.getPageSize(),
|
||||
pageResponse.getPageIndex()
|
||||
);
|
||||
}
|
||||
|
||||
private VisitorApplyCO toCO(VisitorApplyDO dos) {
|
||||
VisitorApplyCO co = new VisitorApplyCO();
|
||||
co.setVisitorApplyId(dos.getVisitorApplyId());
|
||||
co.setApplyType(dos.getApplyType());
|
||||
co.setSourceUnit(dos.getSourceUnit());
|
||||
co.setVisitorCount(dos.getVisitorCount());
|
||||
co.setApplyStartTime(dos.getApplyStartTime());
|
||||
co.setApplyEndTime(dos.getApplyEndTime());
|
||||
co.setLicensePlate(dos.getLicensePlate());
|
||||
co.setVehicleType(dos.getVehicleType());
|
||||
co.setPurpose(dos.getPurpose());
|
||||
co.setStatus(dos.getStatus());
|
||||
co.setAuditDeptId(dos.getAuditDeptId());
|
||||
co.setAuditDeptName(dos.getAuditDeptName());
|
||||
co.setApplySource(dos.getApplySource());
|
||||
co.setApplyDeptName(dos.getApplyDeptName());
|
||||
co.setApplyUserName(dos.getApplyUserName());
|
||||
|
||||
// 拼接申请来源描述
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (dos.getApplyDeptName() != null) {
|
||||
if (sb.length() > 0) sb.append(" ");
|
||||
sb.append(dos.getApplyDeptName());
|
||||
}
|
||||
if (dos.getApplyUserName() != null) {
|
||||
if (sb.length() > 0) sb.append(" ");
|
||||
sb.append(dos.getApplyUserName());
|
||||
}
|
||||
if (dos.getApplySource() != null) {
|
||||
sb.append(dos.getApplySource() == 1 ? "PC端" : "扫码申请");
|
||||
}
|
||||
co.setApplySourceDesc(sb.toString());
|
||||
|
||||
return co;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.zcloud.xinyiGate.command.visitorApply;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorApplyGateway;
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorPersonGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorApplyE;
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorPersonE;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyAddCmd;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorPersonCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorApplyAddExe {
|
||||
|
||||
private final VisitorApplyGateway visitorApplyGateway;
|
||||
private final VisitorPersonGateway visitorPersonGateway;
|
||||
|
||||
public void execute(VisitorApplyAddCmd cmd) {
|
||||
|
||||
// 生成UUID
|
||||
if (cmd.getVisitorApplyId() == null) {
|
||||
cmd.setVisitorApplyId(UuidUtil.get32UUID());
|
||||
}
|
||||
// 插入主表
|
||||
VisitorApplyE e = new VisitorApplyE();
|
||||
e.setVisitorApplyId(cmd.getVisitorApplyId());
|
||||
e.setApplyType(cmd.getApplyType());
|
||||
e.setSourceUnit(cmd.getSourceUnit());
|
||||
e.setVisitorCount(cmd.getVisitorCount());
|
||||
e.setLicensePlate(cmd.getLicensePlate());
|
||||
e.setVehicleType(cmd.getVehicleType());
|
||||
e.setPurpose(cmd.getPurpose());
|
||||
e.setApplyStartTime(cmd.getApplyStartTime());
|
||||
e.setApplyEndTime(cmd.getApplyEndTime());
|
||||
e.setAuditDeptId(cmd.getAuditDeptId());
|
||||
e.setStatus(cmd.getStatus());
|
||||
|
||||
if (cmd.getApplyAddSource() != null) {
|
||||
e.setApplySource(cmd.getApplyAddSource().getApplySource());
|
||||
e.setApplyDeptId(cmd.getApplyAddSource().getApplyDeptId());
|
||||
e.setApplyUserId(cmd.getApplyAddSource().getApplyUserId());
|
||||
}
|
||||
|
||||
e.setApplySource(1);
|
||||
e.setApplyDeptId(user.getOrgId());
|
||||
e.setApplyUserId(user.getUserId());
|
||||
visitorApplyGateway.add(e);
|
||||
|
||||
// 插入人员明细
|
||||
if (cmd.getPersonList() != null && !cmd.getPersonList().isEmpty()) {
|
||||
List<VisitorPersonE> personList = new ArrayList<>();
|
||||
for (VisitorPersonCmd personCmd : cmd.getPersonList()) {
|
||||
VisitorPersonE personE = new VisitorPersonE();
|
||||
personE.setVisitorApplyId(cmd.getVisitorApplyId());
|
||||
// applyType=1来访人员, applyType=2车内人员
|
||||
personE.setPersonType(cmd.getApplyType());
|
||||
personE.setName(personCmd.getName());
|
||||
personE.setPhone(personCmd.getPhone());
|
||||
personList.add(personE);
|
||||
}
|
||||
visitorPersonGateway.batchAdd(personList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.xinyiGate.command.visitorApply;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorApplyGateway;
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorAuditGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorApplyE;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyAuditCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorApplyAuditExe {
|
||||
|
||||
private final VisitorApplyGateway visitorApplyGateway;
|
||||
private final VisitorAuditGateway visitorAuditGateway;
|
||||
|
||||
public void execute(VisitorApplyAuditCmd cmd) {
|
||||
VisitorApplyE applyE = visitorApplyGateway.getByApplyId(cmd.getVisitorApplyId());
|
||||
if (applyE == null) {
|
||||
throw new BizException("申请记录不存在");
|
||||
}
|
||||
|
||||
if (cmd.getAuditResult() == 1) {
|
||||
// 通过
|
||||
if (cmd.getAuditType() == 1) {
|
||||
// 职能部室审核通过:状态1(待审核) -> 2(待审批)
|
||||
if (applyE.getStatus() != 1) {
|
||||
throw new BizException("当前状态不允许审核");
|
||||
}
|
||||
visitorApplyGateway.updateStatus(cmd.getVisitorApplyId(), 2);
|
||||
} else if (cmd.getAuditType() == 2) {
|
||||
// 安监部门审批通过:状态2(待审批) -> 3(待确认)
|
||||
if (applyE.getStatus() != 2) {
|
||||
throw new BizException("当前状态不允许审批");
|
||||
}
|
||||
visitorApplyGateway.updateStatus(cmd.getVisitorApplyId(), 3);
|
||||
}
|
||||
} else if (cmd.getAuditResult() == 2) {
|
||||
// 驳回
|
||||
if (cmd.getAuditType() == 1) {
|
||||
// 职能部室审核驳回:状态1(待审核) -> 6(审核被打回)
|
||||
if (applyE.getStatus() != 1) {
|
||||
throw new BizException("当前状态不允许审核");
|
||||
}
|
||||
visitorApplyGateway.updateStatus(cmd.getVisitorApplyId(), 6);
|
||||
} else if (cmd.getAuditType() == 2) {
|
||||
// 安监部门审批驳回:状态2(待审批) -> 7(审批被驳回)
|
||||
if (applyE.getStatus() != 2) {
|
||||
throw new BizException("当前状态不允许审批");
|
||||
}
|
||||
visitorApplyGateway.updateStatus(cmd.getVisitorApplyId(), 7);
|
||||
}
|
||||
}
|
||||
|
||||
// 插入审核记录
|
||||
visitorAuditGateway.add(applyE, cmd.getAuditType(), cmd.getAuditResult(), cmd.getAuditOpinion());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.zcloud.xinyiGate.command.visitorApply;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorApplyGateway;
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorAuditGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorApplyE;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyConfirmCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorApplyConfirmExe {
|
||||
|
||||
private final VisitorApplyGateway visitorApplyGateway;
|
||||
private final VisitorAuditGateway visitorAuditGateway;
|
||||
|
||||
public void execute(VisitorApplyConfirmCmd cmd) {
|
||||
VisitorApplyE applyE = visitorApplyGateway.getByApplyId(cmd.getVisitorApplyId());
|
||||
if (applyE == null) {
|
||||
throw new BizException("申请记录不存在");
|
||||
}
|
||||
|
||||
if (cmd.getConfirmType() == 1) {
|
||||
// 进场确认:状态必须为3(待确认)
|
||||
if (applyE.getStatus() != 3) {
|
||||
throw new BizException("当前状态不允许进场确认");
|
||||
}
|
||||
visitorApplyGateway.updateStatus(cmd.getVisitorApplyId(), 4);
|
||||
} else if (cmd.getConfirmType() == 2) {
|
||||
// 出场确认:状态必须为4(已进场)
|
||||
if (applyE.getStatus() != 4) {
|
||||
throw new BizException("当前状态不允许出场确认");
|
||||
}
|
||||
visitorApplyGateway.updateStatus(cmd.getVisitorApplyId(), 5);
|
||||
}
|
||||
|
||||
// 插入审核记录:audit_type=3(现场确认), audit_result=1(通过)
|
||||
visitorAuditGateway.add(applyE, 3, 1, null);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.zcloud.xinyiGate.command.visitorApply;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorApplyGateway;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class VisitorApplyExpiredUpdateExe {
|
||||
|
||||
private final VisitorApplyGateway visitorApplyGateway;
|
||||
|
||||
public void execute() {
|
||||
log.info("开始更新过期来访申请状态");
|
||||
visitorApplyGateway.updateExpiredStatus();
|
||||
log.info("过期来访申请状态更新完成");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.zcloud.xinyiGate.command.visitorApply;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorApplyGateway;
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorPersonGateway;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyRemoveCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorApplyRemoveExe {
|
||||
|
||||
private final VisitorApplyGateway visitorApplyGateway;
|
||||
private final VisitorPersonGateway visitorPersonGateway;
|
||||
|
||||
public void execute(VisitorApplyRemoveCmd cmd) {
|
||||
// 逻辑删除主表
|
||||
visitorApplyGateway.logicDeleteByApplyId(cmd.getVisitorApplyId());
|
||||
// 逻辑删除人员明细
|
||||
visitorPersonGateway.logicDeleteByApplyId(cmd.getVisitorApplyId());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.zcloud.xinyiGate.service.blacklist;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.zcloud.xinyiGate.api.blacklist.BlacklistServiceI;
|
||||
import com.zcloud.xinyiGate.command.blacklist.BlacklistAddExe;
|
||||
import com.zcloud.xinyiGate.command.blacklist.BlacklistRemoveExe;
|
||||
import com.zcloud.xinyiGate.command.query.blacklist.BlacklistQueryExe;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistAddCmd;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistPageQry;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistRemoveCmd;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.blacklist.BlacklistCO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BlacklistServiceImpl implements BlacklistServiceI {
|
||||
|
||||
private final BlacklistAddExe blacklistAddExe;
|
||||
private final BlacklistRemoveExe blacklistRemoveExe;
|
||||
private final BlacklistQueryExe blacklistQueryExe;
|
||||
|
||||
@Override
|
||||
public Response add(BlacklistAddCmd cmd) {
|
||||
blacklistAddExe.execute(cmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response remove(BlacklistRemoveCmd cmd) {
|
||||
blacklistRemoveExe.execute(cmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<BlacklistCO> queryPage(BlacklistPageQry qry) {
|
||||
return blacklistQueryExe.queryPage(qry);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.xinyiGate.service.deptAuditor;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.zcloud.xinyiGate.api.deptAuditor.DeptAuditorServiceI;
|
||||
import com.zcloud.xinyiGate.command.deptAuditor.DeptAuditorSaveExe;
|
||||
import com.zcloud.xinyiGate.command.query.deptAuditor.DeptAuditorQueryExe;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.deptAuditor.DeptAuditorCO;
|
||||
import com.zcloud.xinyiGate.dto.deptAuditor.DeptAuditorListQry;
|
||||
import com.zcloud.xinyiGate.dto.deptAuditor.DeptAuditorSaveCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeptAuditorServiceImpl implements DeptAuditorServiceI {
|
||||
|
||||
private final DeptAuditorSaveExe deptAuditorSaveExe;
|
||||
private final DeptAuditorQueryExe deptAuditorQueryExe;
|
||||
|
||||
@Override
|
||||
public MultiResponse<DeptAuditorCO> list(DeptAuditorListQry qry) {
|
||||
List<DeptAuditorCO> list = deptAuditorQueryExe.execute(qry);
|
||||
return MultiResponse.of(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response save(DeptAuditorSaveCmd cmd) {
|
||||
deptAuditorSaveExe.execute(cmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.zcloud.xinyiGate.service.visitorApply;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.xinyiGate.api.visitorApply.VisitorApplyServiceI;
|
||||
import com.zcloud.xinyiGate.command.query.visitorApply.VisitorApplyQueryExe;
|
||||
import com.zcloud.xinyiGate.command.visitorApply.VisitorApplyAddExe;
|
||||
import com.zcloud.xinyiGate.command.visitorApply.VisitorApplyAuditExe;
|
||||
import com.zcloud.xinyiGate.command.visitorApply.VisitorApplyConfirmExe;
|
||||
import com.zcloud.xinyiGate.command.visitorApply.VisitorApplyExpiredUpdateExe;
|
||||
import com.zcloud.xinyiGate.command.visitorApply.VisitorApplyRemoveExe;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.visitorApply.VisitorApplyCO;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorApplyServiceImpl implements VisitorApplyServiceI {
|
||||
|
||||
private final VisitorApplyAddExe visitorApplyAddExe;
|
||||
private final VisitorApplyRemoveExe visitorApplyRemoveExe;
|
||||
private final VisitorApplyAuditExe visitorApplyAuditExe;
|
||||
private final VisitorApplyConfirmExe visitorApplyConfirmExe;
|
||||
private final VisitorApplyExpiredUpdateExe visitorApplyExpiredUpdateExe;
|
||||
private final VisitorApplyQueryExe visitorApplyQueryExe;
|
||||
|
||||
@Override
|
||||
public Response add(VisitorApplyAddCmd cmd) {
|
||||
|
||||
SSOUser user = AuthContext.getCurrentUser();
|
||||
if (user == null) {
|
||||
throw new BizException("请先登录");
|
||||
}
|
||||
|
||||
// 申请来源相关信息
|
||||
VisitorApplyAddSourceCmd applyAddSource = new VisitorApplyAddSourceCmd();
|
||||
applyAddSource.setApplySource(1);
|
||||
applyAddSource.setApplyDeptId(user.getOrgId());
|
||||
applyAddSource.setApplyUserId(user.getUserId());
|
||||
cmd.setApplyAddSource(applyAddSource);
|
||||
|
||||
visitorApplyAddExe.execute(cmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response remove(VisitorApplyRemoveCmd cmd) {
|
||||
visitorApplyRemoveExe.execute(cmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response audit(VisitorApplyAuditCmd cmd) {
|
||||
visitorApplyAuditExe.execute(cmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response confirm(VisitorApplyConfirmCmd cmd) {
|
||||
visitorApplyConfirmExe.execute(cmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<VisitorApplyCO> queryPage(VisitorApplyPageQry qry) {
|
||||
return visitorApplyQueryExe.queryPage(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExpiredStatus() {
|
||||
visitorApplyExpiredUpdateExe.execute();
|
||||
}
|
||||
}
|
||||
|
|
@ -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.xinyiGate</groupId>
|
||||
<artifactId>zcloud_gbs_xinyi_gate</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.xinyiGate</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>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.zcloud.xinyiGate.api.blacklist;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistAddCmd;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistPageQry;
|
||||
import com.zcloud.xinyiGate.dto.blacklist.BlacklistRemoveCmd;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.blacklist.BlacklistCO;
|
||||
|
||||
public interface BlacklistServiceI {
|
||||
|
||||
Response add(BlacklistAddCmd cmd);
|
||||
|
||||
Response remove(BlacklistRemoveCmd cmd);
|
||||
|
||||
PageResponse<BlacklistCO> queryPage(BlacklistPageQry qry);
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.zcloud.xinyiGate.api.deptAuditor;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.deptAuditor.DeptAuditorCO;
|
||||
import com.zcloud.xinyiGate.dto.deptAuditor.DeptAuditorListQry;
|
||||
import com.zcloud.xinyiGate.dto.deptAuditor.DeptAuditorSaveCmd;
|
||||
|
||||
public interface DeptAuditorServiceI {
|
||||
|
||||
MultiResponse<DeptAuditorCO> list(DeptAuditorListQry qry);
|
||||
|
||||
Response save(DeptAuditorSaveCmd cmd);
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.zcloud.xinyiGate.api.visitorApply;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.zcloud.xinyiGate.dto.clientobject.visitorApply.VisitorApplyCO;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyAddCmd;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyAuditCmd;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyConfirmCmd;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyPageQry;
|
||||
import com.zcloud.xinyiGate.dto.visitorApply.VisitorApplyRemoveCmd;
|
||||
|
||||
public interface VisitorApplyServiceI {
|
||||
|
||||
Response add(VisitorApplyAddCmd cmd);
|
||||
|
||||
Response remove(VisitorApplyRemoveCmd cmd);
|
||||
|
||||
Response audit(VisitorApplyAuditCmd cmd);
|
||||
|
||||
Response confirm(VisitorApplyConfirmCmd cmd);
|
||||
|
||||
PageResponse<VisitorApplyCO> queryPage(VisitorApplyPageQry qry);
|
||||
|
||||
void updateExpiredStatus();
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.zcloud.xinyiGate.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* @author zhangyue
|
||||
* @date 2026/2/2 17:24
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
public class ThreadPoolAsyncConfig {
|
||||
|
||||
|
||||
public static Integer maxPoolSize;
|
||||
public static Integer corePoolSize;
|
||||
public static Integer queueCapacity;
|
||||
public static String namePrefix;
|
||||
public static Integer keepAliveSeconds;
|
||||
|
||||
@Value("${archives.async.pool.maxPoolSize}")
|
||||
public void setMaxPoolSize(Integer maxPoolSizeProperties) {
|
||||
maxPoolSize = maxPoolSizeProperties;
|
||||
}
|
||||
|
||||
@Value("${archives.async.pool.corePoolSize}")
|
||||
public void setCorePoolSize(Integer corePoolSizeProperties) {
|
||||
corePoolSize = corePoolSizeProperties;
|
||||
}
|
||||
|
||||
@Value("${archives.async.pool.queueCapacity}")
|
||||
public void setQueueCapacity(Integer queueCapacityProperties) {
|
||||
queueCapacity = queueCapacityProperties;
|
||||
}
|
||||
|
||||
@Value("${archives.async.pool.namePrefix}")
|
||||
public void setNamePrefix(String namePrefixProperties) {
|
||||
namePrefix = namePrefixProperties;
|
||||
}
|
||||
|
||||
@Value("${archives.async.pool.keepAliveSeconds}")
|
||||
public void setKeepAliveSeconds(Integer keepAliveSecondsProperties) {
|
||||
keepAliveSeconds = keepAliveSecondsProperties;
|
||||
}
|
||||
|
||||
@Bean()
|
||||
public Executor asyncExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
//最大线程数
|
||||
executor.setMaxPoolSize(maxPoolSize);
|
||||
//核心线程数
|
||||
executor.setCorePoolSize(corePoolSize);
|
||||
//任务队列的大小
|
||||
executor.setQueueCapacity(queueCapacity);
|
||||
//线程前缀名
|
||||
executor.setThreadNamePrefix(namePrefix);
|
||||
//线程存活时间
|
||||
executor.setKeepAliveSeconds(keepAliveSeconds);
|
||||
/**
|
||||
* 拒绝处理策略
|
||||
* CallerRunsPolicy():交由调用方线程运行,比如 main 线程。
|
||||
* AbortPolicy():直接抛出异常。
|
||||
* DiscardPolicy():直接丢弃。
|
||||
* DiscardOldestPolicy():丢弃队列中最老的任务。
|
||||
*/
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
|
||||
// 初始化
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.xinyiGate.dto.blacklist;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@ApiModel("黑名单新增命令")
|
||||
public class BlacklistAddCmd {
|
||||
|
||||
@NotNull(message = "黑名单类型不能为空")
|
||||
@ApiModelProperty("黑名单类型:1-人员 2-车辆")
|
||||
private Integer blacklistType;
|
||||
|
||||
@ApiModelProperty("姓名(blacklistType=1时必填)")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("手机号(blacklistType=1时必填)")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("车牌号(blacklistType=2时必填)")
|
||||
private String licensePlate;
|
||||
|
||||
@ApiModelProperty("所属单位")
|
||||
private String affiliatedUnit;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.zcloud.xinyiGate.dto.blacklist;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@ApiModel("黑名单分页查询")
|
||||
public class BlacklistPageQry extends PageQuery {
|
||||
|
||||
@NotNull(message = "黑名单类型不能为空")
|
||||
@ApiModelProperty("黑名单类型:1-人员 2-车辆")
|
||||
private Integer blacklistType;
|
||||
|
||||
@ApiModelProperty("姓名(模糊筛选)")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("手机号(模糊筛选)")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("状态:1-启用 0-禁用")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("所属单位(模糊筛选)")
|
||||
private String affiliatedUnit;
|
||||
|
||||
@ApiModelProperty("车牌号(模糊筛选)")
|
||||
private String licensePlate;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.zcloud.xinyiGate.dto.blacklist;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
@ApiModel("黑名单删除命令")
|
||||
public class BlacklistRemoveCmd {
|
||||
|
||||
@NotBlank(message = "业务主键不能为空")
|
||||
@ApiModelProperty("业务主键UUID")
|
||||
private String blacklistId;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.zcloud.xinyiGate.dto.clientobject.blacklist;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("黑名单返回对象")
|
||||
public class BlacklistCO {
|
||||
|
||||
@ApiModelProperty("业务主键UUID")
|
||||
private String blacklistId;
|
||||
|
||||
@ApiModelProperty("黑名单类型:1-人员 2-车辆")
|
||||
private Integer blacklistType;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("车牌号")
|
||||
private String licensePlate;
|
||||
|
||||
@ApiModelProperty("所属单位")
|
||||
private String affiliatedUnit;
|
||||
|
||||
@ApiModelProperty("加入时间")
|
||||
private String joinTime;
|
||||
|
||||
@ApiModelProperty("添加人")
|
||||
private String addedByName;
|
||||
|
||||
@ApiModelProperty("状态:1-启用 0-禁用")
|
||||
private Integer status;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.zcloud.xinyiGate.dto.clientobject.deptAuditor;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("审核人项")
|
||||
public class AuditorItemCO {
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("配置UUID")
|
||||
private String configId;
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("用户姓名")
|
||||
private String userName;
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.zcloud.xinyiGate.dto.clientobject.deptAuditor;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("部门审核人返回对象")
|
||||
public class DeptAuditorCO {
|
||||
|
||||
@ApiModelProperty("部门ID")
|
||||
private Long deptId;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("部门级别")
|
||||
private String deptLevel;
|
||||
|
||||
@ApiModelProperty("主管领导")
|
||||
private String leaderName;
|
||||
|
||||
@ApiModelProperty("部门负责人")
|
||||
private String headName;
|
||||
|
||||
@ApiModelProperty("审核人列表")
|
||||
private List<AuditorItemCO> auditors;
|
||||
|
||||
@ApiModelProperty("审批人列表")
|
||||
private List<AuditorItemCO> approvers;
|
||||
|
||||
@ApiModelProperty("确认人列表")
|
||||
private List<AuditorItemCO> confirmers;
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.zcloud.xinyiGate.dto.clientobject.visitorApply;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@ApiModel("来访申请返回对象")
|
||||
public class VisitorApplyCO {
|
||||
|
||||
@ApiModelProperty("业务主键UUID")
|
||||
private String visitorApplyId;
|
||||
|
||||
@ApiModelProperty("申请类型:1-外来人员 2-外来车辆")
|
||||
private Integer applyType;
|
||||
|
||||
@ApiModelProperty("来源单位")
|
||||
private String sourceUnit;
|
||||
|
||||
@ApiModelProperty("入场人数")
|
||||
private Integer visitorCount;
|
||||
|
||||
@ApiModelProperty("申请开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime applyStartTime;
|
||||
|
||||
@ApiModelProperty("申请结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime applyEndTime;
|
||||
|
||||
@ApiModelProperty("车牌号")
|
||||
private String licensePlate;
|
||||
|
||||
@ApiModelProperty("车型")
|
||||
private String vehicleType;
|
||||
|
||||
@ApiModelProperty("入场事由")
|
||||
private String purpose;
|
||||
|
||||
@ApiModelProperty("申请来源描述(来源类型+部门名称+人员名称)")
|
||||
private String applySourceDesc;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("审批部门ID")
|
||||
private Long auditDeptId;
|
||||
|
||||
@ApiModelProperty("审批部门名称")
|
||||
private String auditDeptName;
|
||||
|
||||
@ApiModelProperty("申请来源 1-PC端 2-扫码申请")
|
||||
private Integer applySource;
|
||||
|
||||
@ApiModelProperty("申请部门名称")
|
||||
private String applyDeptName;
|
||||
|
||||
@ApiModelProperty("申请人姓名")
|
||||
private String applyUserName;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.zcloud.xinyiGate.dto.deptAuditor;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("部门审核人列表查询")
|
||||
public class DeptAuditorListQry {
|
||||
|
||||
@ApiModelProperty("部门ID")
|
||||
private Long deptId;
|
||||
|
||||
@ApiModelProperty("部门名称(模糊筛选)")
|
||||
private String deptName;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.zcloud.xinyiGate.dto.deptAuditor;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("部门审核人保存命令")
|
||||
public class DeptAuditorSaveCmd {
|
||||
|
||||
@NotNull(message = "部门ID不能为空")
|
||||
@ApiModelProperty("部门ID")
|
||||
private Long deptId;
|
||||
|
||||
@NotNull(message = "配置类型不能为空")
|
||||
@ApiModelProperty("配置类型:1-审核人 2-审批人 3-确认人")
|
||||
private Integer configType;
|
||||
|
||||
@ApiModelProperty("相关人员用户ID数组")
|
||||
private List<Long> userList;
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.xinyiGate.dto.visitorApply;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("来访申请新增命令")
|
||||
public class VisitorApplyAddCmd {
|
||||
|
||||
@ApiModelProperty("业务主键id")
|
||||
private String visitorApplyId;
|
||||
|
||||
@NotNull(message = "申请类型不能为空")
|
||||
@ApiModelProperty("申请类型:1-外来人员 2-外来车辆")
|
||||
private Integer applyType;
|
||||
|
||||
@NotNull(message = "来源单位不能为空")
|
||||
@ApiModelProperty("来源单位")
|
||||
private String sourceUnit;
|
||||
|
||||
@ApiModelProperty("入场人数")
|
||||
private Integer visitorCount;
|
||||
|
||||
@ApiModelProperty("车牌号(applyType=2时必填)")
|
||||
private String licensePlate;
|
||||
|
||||
@ApiModelProperty("车型(applyType=2时填写)")
|
||||
private String vehicleType;
|
||||
|
||||
@NotNull(message = "入场事由不能为空")
|
||||
@ApiModelProperty("入场事由")
|
||||
private String purpose;
|
||||
|
||||
@NotNull(message = "申请开始时间不能为空")
|
||||
@ApiModelProperty("申请开始时间")
|
||||
private LocalDateTime applyStartTime;
|
||||
|
||||
@NotNull(message = "申请结束时间不能为空")
|
||||
@ApiModelProperty("申请结束时间")
|
||||
private LocalDateTime applyEndTime;
|
||||
|
||||
@NotNull(message = "审批部门ID不能为空")
|
||||
@ApiModelProperty("审批部门ID")
|
||||
private Long auditDeptId;
|
||||
|
||||
@ApiModelProperty("申请来源相关信息")
|
||||
private VisitorApplyAddSourceCmd applyAddSource;
|
||||
|
||||
@NotNull(message = "状态不能为空")
|
||||
@ApiModelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("人员列表")
|
||||
private List<VisitorPersonCmd> personList;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.zcloud.xinyiGate.dto.visitorApply;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("来访申请新增命令")
|
||||
public class VisitorApplyAddSourceCmd {
|
||||
|
||||
@ApiModelProperty("申请来源 1-PC端 2-扫码申请")
|
||||
private Integer applySource;
|
||||
|
||||
@ApiModelProperty("申请部门ID")
|
||||
private Long applyDeptId;
|
||||
|
||||
@ApiModelProperty("申请人ID")
|
||||
private Long applyUserId;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.xinyiGate.dto.visitorApply;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@ApiModel("审核/审批命令")
|
||||
public class VisitorApplyAuditCmd {
|
||||
|
||||
@NotBlank(message = "业务主键不能为空")
|
||||
@ApiModelProperty("业务主键UUID")
|
||||
private String visitorApplyId;
|
||||
|
||||
@NotNull(message = "审核类型不能为空")
|
||||
@ApiModelProperty("审核类型:1-职能部室审核 2-安监部门审批")
|
||||
private Integer auditType;
|
||||
|
||||
@NotNull(message = "审核结果不能为空")
|
||||
@ApiModelProperty("审核结果:1-通过 2-驳回")
|
||||
private Integer auditResult;
|
||||
|
||||
@ApiModelProperty("审核意见(驳回时必填)")
|
||||
private String auditOpinion;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.zcloud.xinyiGate.dto.visitorApply;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@ApiModel("进场/出场确认命令")
|
||||
public class VisitorApplyConfirmCmd {
|
||||
|
||||
@NotBlank(message = "业务主键不能为空")
|
||||
@ApiModelProperty("业务主键UUID")
|
||||
private String visitorApplyId;
|
||||
|
||||
@NotNull(message = "确认类型不能为空")
|
||||
@ApiModelProperty("确认类型:1-进场 2-出场")
|
||||
private Integer confirmType;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.xinyiGate.dto.visitorApply;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("来访申请分页查询")
|
||||
public class VisitorApplyPageQry extends PageQuery {
|
||||
|
||||
@ApiModelProperty("来源单位(模糊筛选)")
|
||||
private String sourceUnit;
|
||||
|
||||
@ApiModelProperty("状态列表(多选筛选)")
|
||||
private List<Integer> statusList;
|
||||
|
||||
@ApiModelProperty("申请时间起(yyyy-MM-dd)")
|
||||
private String applyStartTime;
|
||||
|
||||
@ApiModelProperty("申请时间止(yyyy-MM-dd)")
|
||||
private String applyEndTime;
|
||||
|
||||
@ApiModelProperty("申请类型:1-外来人员 2-外来车辆")
|
||||
private Integer applyType;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.zcloud.xinyiGate.dto.visitorApply;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
@ApiModel("来访申请删除命令")
|
||||
public class VisitorApplyRemoveCmd {
|
||||
|
||||
@NotBlank(message = "业务主键不能为空")
|
||||
@ApiModelProperty("业务主键UUID")
|
||||
private String visitorApplyId;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.zcloud.xinyiGate.dto.visitorApply;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
@ApiModel("来访人员命令")
|
||||
public class VisitorPersonCmd {
|
||||
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@ApiModelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@ApiModelProperty("手机号")
|
||||
private String phone;
|
||||
}
|
||||
|
|
@ -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.xinyiGate</groupId>
|
||||
<artifactId>zcloud_gbs_xinyi_gate</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>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.zcloud.xinyiGate.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 菜单枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum MenuEnum {
|
||||
// 重点作业情况统计
|
||||
jgdzdzyqktj("/KeyProject/container/supervision/keyStats/list", "jgd-zdzyqktj");
|
||||
|
||||
private final String path;
|
||||
private final String menuKey;
|
||||
|
||||
private static final Map<String, MenuEnum> PATH_MAP =
|
||||
Arrays.stream(values())
|
||||
.collect(Collectors.toMap(MenuEnum::getPath, Function.identity()));
|
||||
|
||||
MenuEnum(String path, String menuKey) {
|
||||
this.path = path;
|
||||
this.menuKey = menuKey;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public String getMenuKey() {
|
||||
return menuKey;
|
||||
}
|
||||
|
||||
// 通过name获取枚举
|
||||
public static MenuEnum getByPath(String path) {
|
||||
return PATH_MAP.get(path);
|
||||
}
|
||||
|
||||
// 通过path获取age
|
||||
public static String getMenuKeyByPath(String path) {
|
||||
MenuEnum entry = PATH_MAP.get(path);
|
||||
return entry != null ? entry.getMenuKey() : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.zcloud.xinyiGate.domain.gateway.blacklist;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.model.blacklist.BlacklistE;
|
||||
|
||||
public interface BlacklistGateway {
|
||||
|
||||
void add(BlacklistE e);
|
||||
|
||||
void logicDelete(String blacklistId);
|
||||
|
||||
boolean existsByPerson(String name, String phone);
|
||||
|
||||
boolean existsByLicensePlate(String licensePlate);
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.zcloud.xinyiGate.domain.gateway.deptAuditor;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.model.deptAuditor.DeptAuditorE;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeptAuditorGateway {
|
||||
|
||||
List<DeptAuditorE> listByDeptId(Long deptId);
|
||||
|
||||
List<DeptAuditorE> listByDeptIds(List<Long> deptIds);
|
||||
|
||||
void removeByDeptIdAndType(Long deptId, Integer configType);
|
||||
|
||||
void batchAdd(List<DeptAuditorE> list);
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.zcloud.xinyiGate.domain.gateway.visitorApply;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorApplyE;
|
||||
|
||||
public interface VisitorApplyGateway {
|
||||
|
||||
void add(VisitorApplyE e);
|
||||
|
||||
void logicDeleteByApplyId(String visitorApplyId);
|
||||
|
||||
VisitorApplyE getByApplyId(String visitorApplyId);
|
||||
|
||||
void updateStatus(String visitorApplyId, Integer status);
|
||||
|
||||
void updateExpiredStatus();
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.zcloud.xinyiGate.domain.gateway.visitorApply;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorApplyE;
|
||||
|
||||
public interface VisitorAuditGateway {
|
||||
|
||||
void add(VisitorApplyE applyE, Integer auditType, Integer auditResult, String auditOpinion);
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.zcloud.xinyiGate.domain.gateway.visitorApply;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorPersonE;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface VisitorPersonGateway {
|
||||
|
||||
void batchAdd(List<VisitorPersonE> list);
|
||||
|
||||
void logicDeleteByApplyId(String visitorApplyId);
|
||||
|
||||
List<VisitorPersonE> listByApplyId(String visitorApplyId);
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.zcloud.xinyiGate.domain.model.blacklist;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BlacklistE {
|
||||
|
||||
private Long id;
|
||||
private String blacklistId;
|
||||
private Integer blacklistType;
|
||||
private String name;
|
||||
private String phone;
|
||||
private String licensePlate;
|
||||
private String affiliatedUnit;
|
||||
private String joinTime;
|
||||
private Long addedById;
|
||||
private Integer status;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.zcloud.xinyiGate.domain.model.deptAuditor;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeptAuditorE {
|
||||
|
||||
private Long id;
|
||||
private String configId;
|
||||
private Long deptId;
|
||||
private Integer configType;
|
||||
private Long userId;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.zcloud.xinyiGate.domain.model.visitorApply;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class VisitorApplyE {
|
||||
|
||||
private Long id;
|
||||
private String visitorApplyId;
|
||||
private Integer applyType;
|
||||
private String sourceUnit;
|
||||
private Integer visitorCount;
|
||||
private String licensePlate;
|
||||
private String vehicleType;
|
||||
private String purpose;
|
||||
private LocalDateTime applyStartTime;
|
||||
private LocalDateTime applyEndTime;
|
||||
private Long auditDeptId;
|
||||
private Integer status;
|
||||
private String rejectReason;
|
||||
private Integer applySource;
|
||||
private Long applyDeptId;
|
||||
private Long applyUserId;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.zcloud.xinyiGate.domain.model.visitorApply;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VisitorPersonE {
|
||||
|
||||
private Long id;
|
||||
private String visitorPersonId;
|
||||
private String visitorApplyId;
|
||||
private Integer personType;
|
||||
private String name;
|
||||
private String phone;
|
||||
}
|
||||
|
|
@ -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.xinyiGate</groupId>
|
||||
<artifactId>zcloud_gbs_xinyi_gate</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.xinyiGate</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>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.zcloud.xinyiGate.gatewayimpl.blacklist;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.gateway.blacklist.BlacklistGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.blacklist.BlacklistE;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.blacklist.BlacklistDO;
|
||||
import com.zcloud.xinyiGate.persistence.mapper.blacklist.BlacklistMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class BlacklistGatewayImpl implements BlacklistGateway {
|
||||
|
||||
private final BlacklistMapper blacklistMapper;
|
||||
|
||||
@Override
|
||||
public void add(BlacklistE e) {
|
||||
BlacklistDO dos = new BlacklistDO();
|
||||
dos.setBlacklistId(e.getBlacklistId());
|
||||
dos.setBlacklistType(e.getBlacklistType());
|
||||
dos.setName(e.getName());
|
||||
dos.setPhone(e.getPhone());
|
||||
dos.setLicensePlate(e.getLicensePlate());
|
||||
dos.setAffiliatedUnit(e.getAffiliatedUnit());
|
||||
dos.setJoinTime(e.getJoinTime());
|
||||
dos.setAddedById(e.getAddedById());
|
||||
dos.setStatus(e.getStatus() != null ? e.getStatus() : 1);
|
||||
dos.setDeleteEnum("FALSE");
|
||||
blacklistMapper.insert(dos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logicDelete(String blacklistId) {
|
||||
blacklistMapper.logicDelete(blacklistId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsByPerson(String name, String phone) {
|
||||
return blacklistMapper.countByPerson(name, phone) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsByLicensePlate(String licensePlate) {
|
||||
return blacklistMapper.countByLicensePlate(licensePlate) > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.zcloud.xinyiGate.gatewayimpl.deptAuditor;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.gateway.deptAuditor.DeptAuditorGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.deptAuditor.DeptAuditorE;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.deptAuditor.DeptAuditorConfigDO;
|
||||
import com.zcloud.xinyiGate.persistence.mapper.deptAuditor.DeptAuditorConfigMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DeptAuditorGatewayImpl implements DeptAuditorGateway {
|
||||
|
||||
private final DeptAuditorConfigMapper deptAuditorConfigMapper;
|
||||
|
||||
@Override
|
||||
public List<DeptAuditorE> listByDeptId(Long deptId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("deptId", deptId);
|
||||
List<DeptAuditorConfigDO> doList = deptAuditorConfigMapper.listWithDeptInfo(params);
|
||||
return doList.stream().map(this::toE).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptAuditorE> listByDeptIds(List<Long> deptIds) {
|
||||
List<DeptAuditorConfigDO> doList = deptAuditorConfigMapper.listByDeptIds(deptIds);
|
||||
return doList.stream().map(this::toE).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeByDeptIdAndType(Long deptId, Integer configType) {
|
||||
deptAuditorConfigMapper.logicDeleteByDeptIdAndType(deptId, configType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchAdd(List<DeptAuditorE> list) {
|
||||
for (DeptAuditorE e : list) {
|
||||
DeptAuditorConfigDO dos = new DeptAuditorConfigDO();
|
||||
dos.setConfigId(UUID.randomUUID().toString());
|
||||
dos.setDeptId(e.getDeptId());
|
||||
dos.setConfigType(e.getConfigType());
|
||||
dos.setUserId(e.getUserId());
|
||||
dos.setDeleteEnum("FALSE");
|
||||
deptAuditorConfigMapper.insert(dos);
|
||||
}
|
||||
}
|
||||
|
||||
private DeptAuditorE toE(DeptAuditorConfigDO dos) {
|
||||
DeptAuditorE e = new DeptAuditorE();
|
||||
e.setId(dos.getId());
|
||||
e.setConfigId(dos.getConfigId());
|
||||
e.setDeptId(dos.getDeptId());
|
||||
e.setConfigType(dos.getConfigType());
|
||||
e.setUserId(dos.getUserId());
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.zcloud.xinyiGate.gatewayimpl.visitorApply;
|
||||
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorApplyGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorApplyE;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorApplyDO;
|
||||
import com.zcloud.xinyiGate.persistence.mapper.visitorApply.VisitorApplyMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorApplyGatewayImpl implements VisitorApplyGateway {
|
||||
|
||||
private final VisitorApplyMapper visitorApplyMapper;
|
||||
|
||||
@Override
|
||||
public void add(VisitorApplyE e) {
|
||||
VisitorApplyDO dos = new VisitorApplyDO();
|
||||
dos.setVisitorApplyId(e.getVisitorApplyId());
|
||||
dos.setApplyType(e.getApplyType());
|
||||
dos.setSourceUnit(e.getSourceUnit());
|
||||
dos.setVisitorCount(e.getVisitorCount());
|
||||
dos.setLicensePlate(e.getLicensePlate());
|
||||
dos.setVehicleType(e.getVehicleType());
|
||||
dos.setPurpose(e.getPurpose());
|
||||
dos.setApplyStartTime(e.getApplyStartTime());
|
||||
dos.setApplyEndTime(e.getApplyEndTime());
|
||||
dos.setAuditDeptId(e.getAuditDeptId());
|
||||
dos.setStatus(e.getStatus());
|
||||
dos.setApplySource(e.getApplySource());
|
||||
dos.setApplyDeptId(e.getApplyDeptId());
|
||||
dos.setApplyUserId(e.getApplyUserId());
|
||||
dos.setDeleteEnum("FALSE");
|
||||
visitorApplyMapper.insert(dos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logicDeleteByApplyId(String visitorApplyId) {
|
||||
visitorApplyMapper.logicDeleteByApplyId(visitorApplyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisitorApplyE getByApplyId(String visitorApplyId) {
|
||||
VisitorApplyDO dos = visitorApplyMapper.getByApplyId(visitorApplyId);
|
||||
if (dos == null) return null;
|
||||
return toE(dos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(String visitorApplyId, Integer status) {
|
||||
visitorApplyMapper.updateStatusByApplyId(visitorApplyId, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExpiredStatus() {
|
||||
visitorApplyMapper.updateExpiredStatus();
|
||||
}
|
||||
|
||||
private VisitorApplyE toE(VisitorApplyDO dos) {
|
||||
VisitorApplyE e = new VisitorApplyE();
|
||||
e.setId(dos.getId());
|
||||
e.setVisitorApplyId(dos.getVisitorApplyId());
|
||||
e.setApplyType(dos.getApplyType());
|
||||
e.setSourceUnit(dos.getSourceUnit());
|
||||
e.setVisitorCount(dos.getVisitorCount());
|
||||
e.setLicensePlate(dos.getLicensePlate());
|
||||
e.setVehicleType(dos.getVehicleType());
|
||||
e.setPurpose(dos.getPurpose());
|
||||
e.setApplyStartTime(dos.getApplyStartTime());
|
||||
e.setApplyEndTime(dos.getApplyEndTime());
|
||||
e.setAuditDeptId(dos.getAuditDeptId());
|
||||
e.setStatus(dos.getStatus());
|
||||
e.setApplySource(dos.getApplySource());
|
||||
e.setApplyDeptId(dos.getApplyDeptId());
|
||||
e.setApplyUserId(dos.getApplyUserId());
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.zcloud.xinyiGate.gatewayimpl.visitorApply;
|
||||
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorAuditGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorApplyE;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorAuditDO;
|
||||
import com.zcloud.xinyiGate.persistence.mapper.visitorApply.VisitorAuditMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorAuditGatewayImpl implements VisitorAuditGateway {
|
||||
|
||||
private final VisitorAuditMapper visitorAuditMapper;
|
||||
|
||||
@Override
|
||||
public void add(VisitorApplyE applyE, Integer auditType, Integer auditResult, String auditOpinion) {
|
||||
VisitorAuditDO dos = new VisitorAuditDO();
|
||||
dos.setVisitorAuditId(UuidUtil.get32UUID());
|
||||
dos.setVisitorApplyId(applyE.getVisitorApplyId());
|
||||
dos.setAuditType(auditType);
|
||||
dos.setAuditResult(auditResult);
|
||||
dos.setAuditOpinion(auditOpinion);
|
||||
dos.setAuditorId(applyE.getApplyUserId());
|
||||
dos.setAuditTime(LocalDateTime.now().toString());
|
||||
dos.setDeleteEnum("FALSE");
|
||||
visitorAuditMapper.insert(dos);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.zcloud.xinyiGate.gatewayimpl.visitorApply;
|
||||
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.xinyiGate.domain.gateway.visitorApply.VisitorPersonGateway;
|
||||
import com.zcloud.xinyiGate.domain.model.visitorApply.VisitorPersonE;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorPersonDO;
|
||||
import com.zcloud.xinyiGate.persistence.mapper.visitorApply.VisitorPersonMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class VisitorPersonGatewayImpl implements VisitorPersonGateway {
|
||||
|
||||
private final VisitorPersonMapper visitorPersonMapper;
|
||||
|
||||
@Override
|
||||
public void batchAdd(List<VisitorPersonE> list) {
|
||||
for (VisitorPersonE e : list) {
|
||||
VisitorPersonDO dos = new VisitorPersonDO();
|
||||
dos.setVisitorPersonId(UuidUtil.get32UUID());
|
||||
dos.setVisitorApplyId(e.getVisitorApplyId());
|
||||
dos.setPersonType(e.getPersonType());
|
||||
dos.setName(e.getName());
|
||||
dos.setPhone(e.getPhone());
|
||||
dos.setDeleteEnum("FALSE");
|
||||
visitorPersonMapper.insert(dos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logicDeleteByApplyId(String visitorApplyId) {
|
||||
visitorPersonMapper.logicDeleteByApplyId(visitorApplyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VisitorPersonE> listByApplyId(String visitorApplyId) {
|
||||
List<VisitorPersonDO> doList = visitorPersonMapper.listByApplyId(visitorApplyId);
|
||||
return doList.stream().map(this::toE).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private VisitorPersonE toE(VisitorPersonDO dos) {
|
||||
VisitorPersonE e = new VisitorPersonE();
|
||||
e.setId(dos.getId());
|
||||
e.setVisitorPersonId(dos.getVisitorPersonId());
|
||||
e.setVisitorApplyId(dos.getVisitorApplyId());
|
||||
e.setPersonType(dos.getPersonType());
|
||||
e.setName(dos.getName());
|
||||
e.setPhone(dos.getPhone());
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.xinyiGate.persistence.dataobject.blacklist;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("gate_blacklist")
|
||||
public class BlacklistDO {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String blacklistId;
|
||||
private Integer blacklistType;
|
||||
private String name;
|
||||
private String phone;
|
||||
private String licensePlate;
|
||||
private String affiliatedUnit;
|
||||
private String joinTime;
|
||||
private Long addedById;
|
||||
private Integer status;
|
||||
private String deleteEnum;
|
||||
private String remarks;
|
||||
private String createName;
|
||||
private String updateName;
|
||||
private Long tenantId;
|
||||
private Long orgId;
|
||||
private Integer version;
|
||||
private String createTime;
|
||||
private String updateTime;
|
||||
private Long createId;
|
||||
private Long updateId;
|
||||
private String env;
|
||||
|
||||
// 联表字段
|
||||
private String addedByName;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.xinyiGate.persistence.dataobject.deptAuditor;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("gate_dept_auditor_config")
|
||||
public class DeptAuditorConfigDO {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String configId;
|
||||
private Long deptId;
|
||||
private Integer configType;
|
||||
private Long userId;
|
||||
private String deleteEnum;
|
||||
private String remarks;
|
||||
private String createName;
|
||||
private String updateName;
|
||||
private Long tenantId;
|
||||
private Long orgId;
|
||||
private Integer version;
|
||||
private String createTime;
|
||||
private String updateTime;
|
||||
private Long createId;
|
||||
private Long updateId;
|
||||
private String env;
|
||||
|
||||
// 联表字段
|
||||
private String userName;
|
||||
private String deptName;
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.zcloud.xinyiGate.persistence.dataobject.visitorApply;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("gate_visitor_apply")
|
||||
public class VisitorApplyDO {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String visitorApplyId;
|
||||
private Integer applyType;
|
||||
private String sourceUnit;
|
||||
private Integer visitorCount;
|
||||
private String licensePlate;
|
||||
private String vehicleType;
|
||||
private String purpose;
|
||||
private LocalDateTime applyStartTime;
|
||||
private LocalDateTime applyEndTime;
|
||||
private Long auditDeptId;
|
||||
private Integer status;
|
||||
private String rejectReason;
|
||||
private Integer applySource;
|
||||
private Long applyDeptId;
|
||||
private Long applyUserId;
|
||||
private String deleteEnum;
|
||||
private String remarks;
|
||||
private String createName;
|
||||
private String updateName;
|
||||
private Long tenantId;
|
||||
private Long orgId;
|
||||
private Integer version;
|
||||
private String createTime;
|
||||
private String updateTime;
|
||||
private Long createId;
|
||||
private Long updateId;
|
||||
private String env;
|
||||
|
||||
// 联表字段
|
||||
private String auditDeptName;
|
||||
private String applyDeptName;
|
||||
private String applyUserName;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.xinyiGate.persistence.dataobject.visitorApply;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("gate_visitor_audit")
|
||||
public class VisitorAuditDO {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String visitorAuditId;
|
||||
private String visitorApplyId;
|
||||
private Integer auditType;
|
||||
private Integer auditResult;
|
||||
private String auditOpinion;
|
||||
private Long auditorId;
|
||||
private String auditorName;
|
||||
private String auditTime;
|
||||
private String deleteEnum;
|
||||
private String remarks;
|
||||
private String createName;
|
||||
private String updateName;
|
||||
private Long tenantId;
|
||||
private Long orgId;
|
||||
private Integer version;
|
||||
private String createTime;
|
||||
private String updateTime;
|
||||
private Long createId;
|
||||
private Long updateId;
|
||||
private String env;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.zcloud.xinyiGate.persistence.dataobject.visitorApply;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("gate_visitor_person")
|
||||
public class VisitorPersonDO {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String visitorPersonId;
|
||||
private String visitorApplyId;
|
||||
private Integer personType;
|
||||
private String name;
|
||||
private String phone;
|
||||
private String deleteEnum;
|
||||
private String remarks;
|
||||
private String createName;
|
||||
private String updateName;
|
||||
private Long tenantId;
|
||||
private Long orgId;
|
||||
private Integer version;
|
||||
private String createTime;
|
||||
private String updateTime;
|
||||
private Long createId;
|
||||
private Long updateId;
|
||||
private String env;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.zcloud.xinyiGate.persistence.mapper.blacklist;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.blacklist.BlacklistDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface BlacklistMapper extends BaseMapper<BlacklistDO> {
|
||||
|
||||
IPage<BlacklistDO> pageWithJoin(IPage<?> page, @Param("params") Map<String, Object> params);
|
||||
|
||||
void logicDelete(@Param("blacklistId") String blacklistId);
|
||||
|
||||
int countByPerson(@Param("name") String name, @Param("phone") String phone);
|
||||
|
||||
int countByLicensePlate(@Param("licensePlate") String licensePlate);
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.zcloud.xinyiGate.persistence.mapper.deptAuditor;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.deptAuditor.DeptAuditorConfigDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface DeptAuditorConfigMapper extends BaseMapper<DeptAuditorConfigDO> {
|
||||
|
||||
List<DeptAuditorConfigDO> listWithDeptInfo(@Param("params") Map<String, Object> params);
|
||||
|
||||
List<DeptAuditorConfigDO> listByDeptIds(@Param("deptIds") List<Long> deptIds);
|
||||
|
||||
void logicDeleteByDeptIdAndType(@Param("deptId") Long deptId, @Param("configType") Integer configType);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.zcloud.xinyiGate.persistence.mapper.visitorApply;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorApplyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface VisitorApplyMapper extends BaseMapper<VisitorApplyDO> {
|
||||
|
||||
IPage<VisitorApplyDO> pageWithJoin(IPage<?> page, @Param("params") Map<String, Object> params);
|
||||
|
||||
VisitorApplyDO getByApplyId(@Param("visitorApplyId") String visitorApplyId);
|
||||
|
||||
void logicDeleteByApplyId(@Param("visitorApplyId") String visitorApplyId);
|
||||
|
||||
void updateStatusByApplyId(@Param("visitorApplyId") String visitorApplyId, @Param("status") Integer status);
|
||||
|
||||
void updateExpiredStatus();
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.zcloud.xinyiGate.persistence.mapper.visitorApply;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorAuditDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface VisitorAuditMapper extends BaseMapper<VisitorAuditDO> {
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.zcloud.xinyiGate.persistence.mapper.visitorApply;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorPersonDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface VisitorPersonMapper extends BaseMapper<VisitorPersonDO> {
|
||||
|
||||
void logicDeleteByApplyId(@Param("visitorApplyId") String visitorApplyId);
|
||||
|
||||
List<VisitorPersonDO> listByApplyId(@Param("visitorApplyId") String visitorApplyId);
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.zcloud.xinyiGate.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class Query<T> {
|
||||
|
||||
public IPage<T> getPage(Map<String, Object> params) {
|
||||
return this.getPage(params, null, false);
|
||||
}
|
||||
|
||||
public IPage<T> getPage(Map<String, Object> params, String defaultOrderField, boolean isAsc) {
|
||||
//分页参数
|
||||
long curPage = 1;
|
||||
long limit = 10;
|
||||
|
||||
if(params.get("pageIndex") != null){
|
||||
curPage = Long.parseLong(params.get("pageIndex").toString());
|
||||
}
|
||||
if(params.get("pageSize") != null){
|
||||
limit = Long.parseLong(params.get("pageSize").toString());
|
||||
}
|
||||
|
||||
//分页对象
|
||||
Page<T> page = new Page<>(curPage, limit);
|
||||
|
||||
//没有排序字段,则不排序
|
||||
if(StringUtils.isBlank(defaultOrderField)){
|
||||
return page;
|
||||
}
|
||||
|
||||
//默认排序
|
||||
if(isAsc) {
|
||||
page.addOrder(OrderItem.asc(defaultOrderField));
|
||||
}else {
|
||||
page.addOrder(OrderItem.desc(defaultOrderField));
|
||||
}
|
||||
|
||||
return page;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?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.xinyiGate.persistence.mapper.blacklist.BlacklistMapper">
|
||||
|
||||
<select id="pageWithJoin" resultType="com.zcloud.xinyiGate.persistence.dataobject.blacklist.BlacklistDO">
|
||||
SELECT bl.*,
|
||||
u.name AS addedByName
|
||||
FROM gate_blacklist bl
|
||||
LEFT JOIN user u ON bl.added_by_id = u.id
|
||||
<where>
|
||||
bl.delete_enum = 'FALSE'
|
||||
<if test="params.blacklistType != null">
|
||||
AND bl.blacklist_type = #{params.blacklistType}
|
||||
</if>
|
||||
<if test="params.name != null and params.name != ''">
|
||||
AND bl.name LIKE CONCAT('%', #{params.name}, '%')
|
||||
</if>
|
||||
<if test="params.phone != null and params.phone != ''">
|
||||
AND bl.phone LIKE CONCAT('%', #{params.phone}, '%')
|
||||
</if>
|
||||
<if test="params.status != null">
|
||||
AND bl.status = #{params.status}
|
||||
</if>
|
||||
<if test="params.affiliatedUnit != null and params.affiliatedUnit != ''">
|
||||
AND bl.affiliated_unit LIKE CONCAT('%', #{params.affiliatedUnit}, '%')
|
||||
</if>
|
||||
<if test="params.licensePlate != null and params.licensePlate != ''">
|
||||
AND bl.license_plate LIKE CONCAT('%', #{params.licensePlate}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY bl.create_time DESC
|
||||
</select>
|
||||
|
||||
<update id="logicDelete">
|
||||
UPDATE gate_blacklist
|
||||
SET delete_enum = 'TRUE'
|
||||
WHERE blacklist_id = #{blacklistId} AND delete_enum = 'FALSE'
|
||||
</update>
|
||||
|
||||
<select id="countByPerson" resultType="int">
|
||||
SELECT COUNT(*) FROM gate_blacklist
|
||||
WHERE delete_enum = 'FALSE' AND blacklist_type = 1
|
||||
AND name = #{name} AND phone = #{phone}
|
||||
</select>
|
||||
|
||||
<select id="countByLicensePlate" resultType="int">
|
||||
SELECT COUNT(*) FROM gate_blacklist
|
||||
WHERE delete_enum = 'FALSE' AND blacklist_type = 2
|
||||
AND license_plate = #{licensePlate}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<?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.xinyiGate.persistence.mapper.deptAuditor.DeptAuditorConfigMapper">
|
||||
|
||||
<select id="listWithDeptInfo" resultType="com.zcloud.xinyiGate.persistence.dataobject.deptAuditor.DeptAuditorConfigDO">
|
||||
SELECT dac.*,
|
||||
dept.name AS deptName,
|
||||
u.name AS userName
|
||||
FROM gate_dept_auditor_config dac
|
||||
LEFT JOIN department dept ON dac.dept_id = dept.id
|
||||
LEFT JOIN user u ON dac.user_id = u.id
|
||||
<where>
|
||||
dac.delete_enum = 'FALSE'
|
||||
<if test="params.deptId != null">
|
||||
AND dac.dept_id = #{params.deptId}
|
||||
</if>
|
||||
<if test="params.deptName != null and params.deptName != ''">
|
||||
AND dept.name LIKE CONCAT('%', #{params.deptName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY dac.dept_id, dac.config_type
|
||||
</select>
|
||||
|
||||
<select id="listByDeptIds" resultType="com.zcloud.xinyiGate.persistence.dataobject.deptAuditor.DeptAuditorConfigDO">
|
||||
SELECT dac.*,
|
||||
dept.name AS deptName,
|
||||
u.name AS userName
|
||||
FROM gate_dept_auditor_config dac
|
||||
LEFT JOIN department dept ON dac.dept_id = dept.id
|
||||
LEFT JOIN user u ON dac.user_id = u.id
|
||||
WHERE dac.delete_enum = 'FALSE'
|
||||
AND dac.dept_id IN
|
||||
<foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
ORDER BY dac.dept_id, dac.config_type
|
||||
</select>
|
||||
|
||||
<update id="logicDeleteByDeptIdAndType">
|
||||
UPDATE gate_dept_auditor_config
|
||||
SET delete_enum = 'TRUE'
|
||||
WHERE dept_id = #{deptId} AND config_type = #{configType} AND delete_enum = 'FALSE'
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?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.xinyiGate.persistence.mapper.visitorApply.VisitorApplyMapper">
|
||||
|
||||
<select id="pageWithJoin" resultType="com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorApplyDO">
|
||||
SELECT va.*,
|
||||
audit_dept.name AS auditDeptName,
|
||||
apply_dept.name AS applyDeptName,
|
||||
apply_user.name AS applyUserName
|
||||
FROM gate_visitor_apply va
|
||||
LEFT JOIN department audit_dept ON va.audit_dept_id = audit_dept.id
|
||||
LEFT JOIN department apply_dept ON va.apply_dept_id = apply_dept.id
|
||||
LEFT JOIN user apply_user ON va.apply_user_id = apply_user.id
|
||||
<where>
|
||||
va.delete_enum = 'FALSE'
|
||||
<if test="params.applyType != null">
|
||||
AND va.apply_type = #{params.applyType}
|
||||
</if>
|
||||
<if test="params.sourceUnit != null and params.sourceUnit != ''">
|
||||
AND va.source_unit LIKE CONCAT('%', #{params.sourceUnit}, '%')
|
||||
</if>
|
||||
<if test="params.statusList != null and params.statusList.size() > 0">
|
||||
AND va.status IN
|
||||
<foreach collection="params.statusList" item="s" open="(" separator="," close=")">
|
||||
#{s}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="params.applyStartTime != null and params.applyStartTime != ''">
|
||||
AND va.apply_start_time >= #{params.applyStartTime}
|
||||
</if>
|
||||
<if test="params.applyEndTime != null and params.applyEndTime != ''">
|
||||
AND va.apply_end_time <= #{params.applyEndTime}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY va.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getByApplyId" resultType="com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorApplyDO">
|
||||
SELECT va.*,
|
||||
audit_dept.name AS auditDeptName,
|
||||
apply_dept.name AS applyDeptName,
|
||||
apply_user.name AS applyUserName
|
||||
FROM gate_visitor_apply va
|
||||
LEFT JOIN department audit_dept ON va.audit_dept_id = audit_dept.id
|
||||
LEFT JOIN department apply_dept ON va.apply_dept_id = apply_dept.id
|
||||
LEFT JOIN user apply_user ON va.apply_user_id = apply_user.id
|
||||
WHERE va.visitor_apply_id = #{visitorApplyId} AND va.delete_enum = 'FALSE'
|
||||
</select>
|
||||
|
||||
<update id="logicDeleteByApplyId">
|
||||
UPDATE gate_visitor_apply
|
||||
SET delete_enum = 'TRUE'
|
||||
WHERE visitor_apply_id = #{visitorApplyId} AND delete_enum = 'FALSE'
|
||||
</update>
|
||||
|
||||
<update id="updateStatusByApplyId">
|
||||
UPDATE gate_visitor_apply
|
||||
SET status = #{status}
|
||||
WHERE visitor_apply_id = #{visitorApplyId} AND delete_enum = 'FALSE'
|
||||
</update>
|
||||
|
||||
<update id="updateExpiredStatus">
|
||||
UPDATE gate_visitor_apply
|
||||
SET status = 10
|
||||
WHERE apply_end_time < NOW()
|
||||
AND status NOT IN (6, 9, 10)
|
||||
AND delete_enum = 'FALSE'
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?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.xinyiGate.persistence.mapper.visitorApply.VisitorPersonMapper">
|
||||
|
||||
<update id="logicDeleteByApplyId">
|
||||
UPDATE gate_visitor_person
|
||||
SET delete_enum = 'TRUE'
|
||||
WHERE visitor_apply_id = #{visitorApplyId} AND delete_enum = 'FALSE'
|
||||
</update>
|
||||
|
||||
<select id="listByApplyId" resultType="com.zcloud.xinyiGate.persistence.dataobject.visitorApply.VisitorPersonDO">
|
||||
SELECT * FROM gate_visitor_person
|
||||
WHERE visitor_apply_id = #{visitorApplyId} AND delete_enum = 'FALSE'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?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="mybatis/customer-mapper.xml"/>
|
||||
</mappers>
|
||||
</configuration>
|
||||
Loading…
Reference in New Issue